Changeset 166 for trunk/desktop/src
- Timestamp:
- Jan 3, 2007, 10:27:53 AM (19 years ago)
- Location:
- trunk/desktop/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/desktop/src/debug_window.c
r98 r166 121 121 va_list arg_ptr; 122 122 123 return; 124 123 125 if(store==NULL) 124 126 { -
trunk/desktop/src/quitwindow.c
r98 r166 69 69 } 70 70 71 static GtkWidget *window; 71 72 /* 72 73 Main entry point. This function is called from the EMX wrapper. Be aware that gtk_init() … … 76 77 { 77 78 /* GtkWidget is the storage type for widgets */ 78 GtkWidget *window; 79 79 80 GtkWidget *button; 80 81 -
trunk/desktop/src/vdesktop.c
r141 r166 33 33 * ***** END LICENSE BLOCK ***** */ 34 34 35 #define INCL_DOSPROCESS 35 36 #define INCL_DOS 37 #define INCL_DOSPROFILE 38 #define INCL_DOSERRORS 36 39 #define INCL_PM 37 40 #include <os2.h> 38 41 #include <stdio.h> 39 42 #include <stdlib.h> 43 #include <string.h> 40 44 #include <gtk/gtk.h> 41 45 #include "debug_window.h" … … 44 48 #include "nom.h" 45 49 #include "nomtk.h" 50 #include "nomgc.h" 51 #include "nomguitk.h" 52 #include "nomfolderwindow.h" 46 53 #include "wpobject.h" 47 54 #include "wpfolder.h" … … 50 57 int createQuitWindow(void); 51 58 52 PNOM_ENV pEnv; 53 NOMClassMgr *NOMClassMgrObject; 59 static gboolean 60 handleEvent (GtkWidget *widget, GdkEventButton *event, gpointer user_data) 61 { 54 62 63 DosBeep(5000, 100); 64 //g_malloc(1250000); 65 //g_message("%s: allocated...", __FUNCTION__); 66 //WPObject_wpDisplayMenu(wpFolder, pWindow, NULL, 0, 0, NULL); 67 68 return FALSE; 69 } 55 70 56 /* Desktop folder */57 WPFolder *wpDesktop;58 71 /* 59 72 Main entry point. This function is called from the EMX wrapper. Be aware that gtk_init() … … 62 75 int _System main_loop() 63 76 { 64 char desktopDir[CCHMAXPATH]={0}; 77 char desktopDir[CCHMAXPATH]={0}; 78 PNOM_ENV pEnv; 79 NOMClassMgr *NOMClassMgrObject; 80 GtkWidget* window; 81 int a; 82 ULONG pMem; 83 HREGDLL hReg=NULLHANDLE; 84 85 /* Desktop folder */ 86 WPFolder *wpDesktop; 87 88 hReg=nomBeginRegisterDLLWithGC(); 89 if(NULLHANDLE==hReg) 90 return 1; 91 92 /* Register DLLs with the garbage collector */ 93 g_assert(nomRegisterDLLByName(hReg, "GLIB2.DLL" )); 94 g_assert(nomRegisterDLLByName(hReg, "GOBJECT2.DLL")); 95 g_assert(nomRegisterDLLByName(hReg, "GMODULE2.DLL")); 96 g_assert(nomRegisterDLLByName(hReg, "GDK2.DLL")); 97 g_assert(nomRegisterDLLByName(hReg, "GDKPIX2.DLL")); 98 g_assert(nomRegisterDLLByName(hReg, "GTK2.DLL" )); 99 g_assert(nomRegisterDLLByName(hReg, "ATK.DLL" )); 100 g_assert(nomRegisterDLLByName(hReg, "NOBJTK.DLL")); 101 g_assert(nomRegisterDLLByName(hReg, "VDESKTOP.DLL")); 102 /* Add Pango here? */ 65 103 66 g_message("We started...\n");104 nomEndRegisterDLLWithGC(hReg); 67 105 106 g_message("We started...\n"); 68 107 69 108 #if 0 70 /* Initialize thread subsystem */71 if(!g_thread_supported())72 g_thread_init(NULL);109 /* Initialize thread subsystem */ 110 if(!g_thread_supported()) 111 g_thread_init(NULL); 73 112 #endif 74 113 75 114 /* Create a window with a 'quit' button to terminate us */ 76 createQuitWindow(); 77 78 115 createQuitWindow(); 116 79 117 /* Query current dir */ 80 118 g_strlcpy(desktopDir, g_get_current_dir(), sizeof(desktopDir)); 81 119 dbgPrintf("Desktop: %s", desktopDir); 82 120 83 /* 84 Bootstrap our objects... 85 */ 86 pEnv=nomTkInit(); 87 //dbgPrintf( "nomTKinit returned: %x", pEnv); 121 /* 122 Bootstrap our objects... 123 */ 124 pEnv=nomTkInit(); 88 125 89 if(!pEnv) { 90 nomPrintf("Can't initialize NOM environment. Exit...\n"); 91 return(1); 92 } 93 94 /* Init SOM */ 95 NOMClassMgrObject=nomEnvironmentNew(); 96 //dbgPrintf( "NOMClassMgrObject: %x", NOMClassMgrObject); 126 if(!pEnv) { 127 nomPrintf("Can't initialize NOM environment. Exit...\n"); 128 return(1); 129 } 97 130 98 131 132 /* Init SOM */ 133 NOMClassMgrObject=nomEnvironmentNew(); 134 //dbgPrintf( "NOMClassMgrObject: %x", NOMClassMgrObject); 135 136 /* Create desktop folder */ 137 wpDesktop=WPFolderNew(); 99 138 100 WPObject* wpObject; 101 wpObject=WPObjectNew(); 102 //dbgPrintf( "wpObject: %x", wpObject); 139 dbgPrintf( "Created desktop object: %x", wpDesktop); 140 WPFolder_tstSetFullPath(wpDesktop, desktopDir, NULLHANDLE); 141 142 WPFolder_wpOpen(wpDesktop, NULL, OPEN_DEFAULT, NULL, NULL); 143 /* WPFolder_wpPopulate(wpObject, 0,"blabla 2", 0, NULL); */ 144 145 #if 0 146 /* Folder toplevel window. */ 147 window = gtk_window_new (GTK_WINDOW_TOPLEVEL); 103 148 104 /* Create desktop folder */ 105 wpDesktop=WPFolderNew(); 106 dbgPrintf( "Created desktop object: %x", wpDesktop); 107 WPFolder_tstSetFullPath(wpDesktop, desktopDir, NULLHANDLE); 149 /* FIXME: Set default size of folder frame. Will later use a stored value */ 150 gtk_window_set_default_size (GTK_WINDOW (window), 650, 400); 108 151 109 WPFolder_wpOpen(wpDesktop, NULL, OPEN_DEFAULT, NULL, NULL); 110 /* WPFolder_wpPopulate(wpObject, 0,"blabla 2", 0, NULL); */ 152 g_signal_connect (GTK_WIDGET(window), "size-request", 153 G_CALLBACK (handleEvent), NULL/*nomSelf*/); 154 155 gtk_widget_show(window); 156 g_message("Window handle: %x", window); 157 #endif 158 159 /* All GTK applications must have a gtk_main(). Control ends here 160 * and waits for an event to occur (like a key press or 161 * mouse event). */ 162 gtk_main (); 111 163 112 164 113 165 #if 0 114 /* Base classes */ 115 wpObject=WPDataFileNew(); 166 mem=g_malloc(1250000); 167 memset(mem, 0xaa, 10000); 168 // *pGlobalMemInExe=mem; 169 for(a=0;a<50;a++){ 170 g_malloc(1250000); 171 printf("%x %x %x %x %d\n", *mem, *(mem+1), *(mem+2), *(mem+3), 0); 172 //printf("%x\n", *((ULONG*)pGlobalMemInExe)); 173 } 174 #endif 116 175 117 somPrintf("\nNew wpObject: %x\n", wpObject); 118 somPrintf(" -> Classname is: %s\n", _somGetClassName(wpObject)); 176 printf("And now we quit...\n"); 119 177 120 121 /* Test only!!! */122 _tstSetFullPath(wpDesktop, desktopDir);123 124 _wpSetFolder(wpDesktop, NULLHANDLE); /* FIXME: Instance var is zero anyway but this way I don't forget it ;-) */125 _wpOpen(wpDesktop, NULLHANDLE, OPEN_DEFAULT, 0); /* remove parameter later!!! */126 /* _dbgPrintRegisteredClasses(SOMClassMgrObject);*/127 128 #endif129 /* All GTK applications must have a gtk_main(). Control ends here130 * and waits for an event to occur (like a key press or131 * mouse event). */132 gtk_main ();133 134 printf("And now we quit...\n");135 178 return 0; 136 179 }
Note:
See TracChangeset
for help on using the changeset viewer.