Changeset 176


Ignore:
Timestamp:
Jan 6, 2007, 1:10:17 PM (19 years ago)
Author:
cinc
Message:

Created an include file mess...

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/desktop/class_c/wpdatafile.c

    r122 r176  
    4747#include "nomtk.h"
    4848
    49 #include "wpdatafile.ih"
     49#include <gtk/gtk.h>
     50#include "nomguitk.h"
    5051#include "helper.h"
    5152#include "desktop.h"
     53#include "nomwindow.h"
     54#include "desktoptypes.h"
     55
     56/* wpdatafile.ih includes some WPObject stuff and that needs these
     57   includes. */
     58#include "nomfolderwindow.h"
     59
     60#include "wpdatafile.ih"
    5261
    5362NOM_Scope CORBA_long NOMLINK impl_WPDataFile_wpQueryFileSize(WPDataFile* nomSelf, CORBA_Environment *ev)
  • trunk/desktop/class_c/wpnotebook.c

    r172 r176  
    4343#include <gtk/gtk.h>
    4444#include <nomguitk.h>
     45#include "nomwindow.h"
     46#include "desktoptypes.h"
    4547
     48#include "nomfolderwindow.h"
    4649#include "wpnotebook.ih"
    4750
     
    6164}
    6265
     66
     67NOM_Scope void NOMLINK impl_WPNoteBook_wpSetWPObject(WPNoteBook* nomSelf, const PWPObject wpObject,
     68                                                     CORBA_Environment *ev)
     69{
     70  WPNoteBookData* nomThis=WPNoteBookGetData(nomSelf);
     71  _wpObject=wpObject;
     72
     73}
     74
     75
     76NOM_Scope PWPObject NOMLINK impl_WPNoteBook_wpQueryWPObject(WPNoteBook* nomSelf, CORBA_Environment *ev)
     77{
     78  WPNoteBookData* nomThis=WPNoteBookGetData(nomSelf);
     79
     80  return _wpObject;
     81}
     82
     83
     84
     85
    6386NOM_Scope void NOMLINK impl_WPNoteBook_nomInit(WPNoteBook* nomSelf, CORBA_Environment *ev)
    6487{
     88  /* WPNoteBookData* nomThis=WPNoteBookGetData(nomSelf);  */
    6589  GtkWidget* gtkWindow;
    6690  NOMNoteBook* nomNoteBook;
    67 
    68   WPNoteBookData* nomThis=WPNoteBookGetData(nomSelf);
    6991
    7092  WPNoteBook_nomInit_parent((NOMObject*)nomSelf,  ev);
  • trunk/desktop/class_c/wpobject.c

    r175 r176  
    6161#endif
    6262
    63 #ifndef WPObject
    64 typedef struct WPObject_struct {
    65   struct nomMethodTabStruct  *mtab;
    66   gulong body[1];
    67 } WPObjectObj;
    68 #define WPObject WPObjectObj
    69 typedef WPObject *PWPObject;
    70 #endif
    71 
    7263#include "nomwindow.h"
    7364#include "desktoptypes.h"
     
    138129  WPObject_nomInit_parent((NOMObject*) nomSelf,  ev);
    139130
    140   nomPrintf("    Entering %s with nomSelf: 0x%x. nomSelf is: %s.\n",
    141             __FUNCTION__, nomSelf , nomSelf->mtab->nomClassName);
     131  //nomPrintf("    Entering %s with nomSelf: 0x%x. nomSelf is: %s.\n",
     132  //        __FUNCTION__, nomSelf , nomSelf->mtab->nomClassName);
    142133
    143134  /* Initialize important data before letting subclasses do their stuff */
     
    181172}
    182173
     174static
     175gboolean defaultWPWindowDeleteHandler(GtkWidget* gtkWidget, GdkEvent* gdkEvent, gpointer pData)
     176{
     177  WPObject* wpObject;
     178  WPNoteBook* wpNoteBook;
     179  PUSEITEM pUseItem=(PUSEITEM) pData;
     180
     181  wpNoteBook=(WPNoteBook*)g_object_get_data(G_OBJECT(gtkWidget), NOMOBJECT_KEY_STRING);
     182
     183  g_return_val_if_fail(NULLHANDLE!=wpNoteBook, FALSE);
     184
     185  wpObject=WPNoteBook_wpQueryWPObject(wpNoteBook, NULLHANDLE);
     186
     187  g_return_val_if_fail(NULLHANDLE!=wpObject, FALSE);
     188
     189  WPObject_wpDeleteFromObjUseList(wpObject, pUseItem, NULLHANDLE);
     190
     191  return FALSE; /* Let other handlers run */
     192}
    183193
    184194NOM_Scope gpointer NOMLINK impl_WPObject_wpOpen(WPObject* nomSelf, const PNOMFolderWindow nomFolder,
     
    196206        WPNoteBook* wpNoteBook;
    197207        wpNoteBook=WPNoteBookNew();
     208        WPNoteBook_wpSetWPObject(wpNoteBook, nomSelf, NULLHANDLE);
     209
    198210        _wpAddSettingsPages(nomSelf, wpNoteBook, ev);
    199211
     
    207219        ((VIEWITEM*)pui)->ulView=VIEW_SETTINGS;
    208220        ((VIEWITEM*)pui)->nomWindow=(NOMWindow*)wpNoteBook;
    209         g_message("   in %s viewItem: %x wpNoteBook 0x%04X", __FUNCTION__, pui, wpNoteBook);
    210221        pui--;
    211 
     222        //g_message("   in %s wpNoteBook: %lx pui %lx", __FUNCTION__, wpNoteBook, pui);
     223        g_signal_connect(G_OBJECT(NOMWindow_queryWindowHandle((NOMWindow*)wpNoteBook, NULLHANDLE)),"delete-event",
     224                         G_CALLBACK(defaultWPWindowDeleteHandler), (gpointer) pui);
    212225        WPObject_wpAddToObjUseList(nomSelf, pui, ev);
    213226        WPNoteBook_show(wpNoteBook, ev);
     
    228241
    229242
    230   if((nomRetval=WPObject_wpSwitchTo(nomSelf, ulView, ev))!=NULLHANDLE){
    231     /* Bring the window to the foreground */
    232     //  NOMWindow_show((NOMWindow*)nomRetval , ev);
     243  if((nomRetval=WPObject_wpSwitchTo(nomSelf, ulView, ev))!=NULLHANDLE)
    233244    return nomRetval;
    234   }
    235 
    236   g_message("   in %s with ulViev 0x%04X", __FUNCTION__, ulView);
     245
    237246  return WPObject_wpOpen(nomSelf, nomFolder, ulView, pParam, ev);
    238247}
     
    242251/* WPObjectData* nomThis=WPObjectGetData(nomSelf); */
    243252  PVIEWITEM pViewItem;
    244 
    245   g_message("   in %s with ulViev 0x%04X", __FUNCTION__, ulView);
    246253
    247254  switch(ulView)
     
    249256    case OPEN_SETTINGS:
    250257      {
    251         g_message("   in %s : OPEN_SETTINGS", __FUNCTION__);
    252258        pViewItem=WPObject_wpFindViewItem(nomSelf, VIEW_SETTINGS, NULLHANDLE, ev);
    253259        if(pViewItem){
    254           g_message("   in %s : OPEN_SETTINGS returning %x %x ...", __FUNCTION__, pViewItem, pViewItem->nomWindow);
    255           NOMWindow_show(pViewItem->nomWindow, ev);
    256         return (gpointer)pViewItem->nomWindow;
     260          //g_message("   in %s : OPEN_SETTINGS returning %x %x ...", __FUNCTION__, pViewItem, pViewItem->nomWindow);
     261          /* Bring the window to the foreground */
     262          NOMWindow_present(pViewItem->nomWindow, ev);
     263          return (gpointer)pViewItem->nomWindow;
    257264        }
    258265        break;
     
    282289    return FALSE;
    283290
    284   g_message("   in %s : %x", __FUNCTION__, pUseItem);
     291  //g_message("   in %s : %x", __FUNCTION__, pUseItem);
    285292
    286293  WPObject_wpRequestObjectMutexSem(nomSelf, 0,ev);
     
    302309
    303310  WPObject_wpRequestObjectMutexSem(nomSelf, 0,ev);
    304 
     311  //g_message("   in %s %lx", __FUNCTION__, pUseItem);
    305312  _glstObjectInUse=g_slist_remove( _glstObjectInUse, (gpointer)pUseItem);
    306313
     
    322329
    323330  WPObject_wpRequestObjectMutexSem(nomSelf, 0,ev);
    324   g_message("   in %s %d", __FUNCTION__, ulType);
     331
    325332  if(NULLHANDLE==pCurrentUseItem)
    326333    tmpList=_glstObjectInUse;
     
    334341      pUseItem=(PUSEITEM)tmpList->data;
    335342
    336       g_message("     a in %s  type: %d", __FUNCTION__, pUseItem->type);
    337 
     343      //g_message("     a in %s  type: %d", __FUNCTION__, pUseItem->type);
    338344      if(pUseItem && ulType==pUseItem->type)
    339345        break;
    340       g_message("     b in %s  type: %d", __FUNCTION__, pUseItem->type);
     346
    341347      tmpList=g_slist_next(tmpList);
    342348      pUseItem=NULLHANDLE;
     
    358364  if(!flViews)
    359365    return NULLHANDLE;
    360   g_message("   in %s %d", __FUNCTION__, flViews);
     366
    361367  if(NULLHANDLE==pCurrentItem)
    362368    pUseItem=WPObject_wpFindUseItem(nomSelf, USAGE_OPENVIEW,  NULLHANDLE, ev);
     
    371377      pViewItem=(PVIEWITEM)pUseItem;
    372378      pUseItem--;
    373       g_message("        a in %s %d", __FUNCTION__, flViews);
     379      //g_message("        a in %s %d", __FUNCTION__, flViews);
    374380      if(pViewItem->ulView & flViews)
    375381        break;
    376       g_message("        b in %s %d", __FUNCTION__, flViews);
     382
    377383      pUseItem=WPObject_wpFindUseItem(nomSelf, USAGE_OPENVIEW,  pUseItem, ev);
    378384      pViewItem=NULLHANDLE;
  • trunk/desktop/idl/wpnotebook.idl

    r167 r176  
    3636#define WPNOTEBOOK_IDL_INCLUDED
    3737
     38#if 0
     39#ifndef WPObject_defined
     40#define WPObject_defined
     41native PWPObject;
     42#endif
     43#endif
     44
     45#include <nomobj.idl>
     46
     47NOMCLASSNAME(WPNoteBook);
     48
     49#include "wpobject.idl"
    3850#include "nomnotebook.idl"
    3951
    40 NOMCLASSNAME(WPNoteBook);
    4152
    4253interface WPNoteBook : NOMWindow
     
    4657  PNOMNoteBook wpQueryNoteBookObject();
    4758  void wpSetNoteBookObject(in PNOMNoteBook nomNBook);
     59  void wpSetWPObject(in PWPObject wpObject);
     60  PWPObject wpQueryWPObject();
    4861
    4962  NOMOVERRIDE(nomInit);
    5063
    5164  NOMINSTANCEVAR(PNOMNoteBook nomNoteBook);
     65  NOMINSTANCEVAR(PWPObject wpObject);
     66
    5267};
    5368
  • trunk/desktop/idl/wpobject.idl

    r175 r176  
    4242#include "nommenu.idl"
    4343#include "nommenuitem.idl"
    44 #include "wpnotebook.idl"
    4544#include "nomwindow.idl"
    4645
     
    5150
    5251NOMCLASSNAME(WPObject);
     52
     53#include "wpnotebook.idl"
    5354
    5455interface WPObject : NOMObject
  • trunk/desktop/include/desktoptypes.h

    r175 r176  
    1212  gpointer ptrUserinfo; /* Pointer to more menu item info for the user */
    1313}wpMenuItemInfo;
     14
     15#ifndef WPObject
     16typedef struct WPObject_struct {
     17  struct nomMethodTabStruct  *mtab;
     18  gulong body[1];
     19} WPObjectObj;
     20#define WPObject WPObjectObj
     21typedef WPObject *PWPObject;
     22#endif
    1423
    1524/* Inuse lists */
     
    6877 
    6978#endif /* DESKTOPTYPES_H_INCLUDED */
     79
  • trunk/emx-wrapper/voyager-desktop.c

    r134 r176  
    4141#include <stdio.h>
    4242
     43void * pMemInExe;
     44
    4345int main( int   argc,
    4446          char *argv[] )
     
    5153  PFN proc;
    5254
     55
     56  fprintf(stderr, "%s: Memaddress for GC: %x\n", __FUNCTION__, (UINT)&pMemInExe);
    5357  /*
    5458    Initialize the garbage collector.
     
    6973    }
    7074  fprintf(stderr, "   Proc address for nomInitGarbageCollection() is: 0x%x\n", (int)proc);
    71   proc();
     75  proc(&pMemInExe);
    7276
    7377  /*
  • trunk/gui/class_c/nomwindow.c

    r163 r176  
    7373{
    7474  /* NOMWindowData* nomThis=NOMWindowGetData(nomSelf); */
    75   gtk_widget_hide(NOMWindow_queryWindowHandle(nomSelf, NULLHANDLE));
     75  gtk_widget_hide(NOMWindow_queryWindowHandle(nomSelf, ev));
    7676}
    7777
     78NOM_Scope void NOMLINK impl_NOMWindow_present(NOMWindow* nomSelf, CORBA_Environment *ev)
     79{
     80/* NOMWindowData* nomThis=NOMWindowGetData(nomSelf); */
     81
     82  gtk_window_present(GTK_WINDOW(NOMWindow_queryWindowHandle(nomSelf, ev)));
     83}
     84
  • trunk/gui/idl/nomwindow.idl

    r173 r176  
    5454  void show();
    5555  void hide();
     56  void present();
     57
    5658  NOMINSTANCEVAR(PGtkWidget _pgWindowHandle);
    5759};
Note: See TracChangeset for help on using the changeset viewer.