Changeset 166 for trunk/desktop/class_c/wpobject.c
- Timestamp:
- Jan 3, 2007, 10:27:53 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/desktop/class_c/wpobject.c
r152 r166 63 63 64 64 #include "wpobject.ih" 65 66 65 #include "nomfolderwindow.h" 66 67 /*************** Local vars ************************************/ 68 69 static nomId WPObjectNomId; 70 71 /***************************************************************/ 67 72 68 73 NOM_Scope gpointer NOMLINK impl_WPObject_wpAllocMem(WPObject* nomSelf, const CORBA_unsigned_long cbBytes, … … 146 151 WPObjectData* nomThis=WPObjectGetData(nomSelf); 147 152 153 /* Get our unique class ID. We need it for example when inserting menu items to 154 specify the namespace. We query it here because getting a GQuark from a string 155 is rather time consuming. The result is saved in a var for later use. */ 156 WPObjectNomId=g_quark_from_string("WPObject"); 157 148 158 /* Make sure a title exists (even if it's an empty string */ 149 159 _pnomStringTitle=NOMStringNew(); … … 264 274 265 275 /* And finally show it */ 266 gtk_menu_popup(GTK_MENU(NOMMenu_ getMenuHandle(nomMenu,ev)), NULL, NULL, NULL, NULL, 0,276 gtk_menu_popup(GTK_MENU(NOMMenu_queryMenuHandle(nomMenu,ev)), NULL, NULL, NULL, NULL, 0, 267 277 gtk_get_current_event_time()); 278 268 279 return nomMenu; 269 280 } 270 281 271 NOM_Scope void NOMLINK impl_WPObject_wpModifyMenu(WPObject* nomSelf, const PNOMFolderWindow nomFolder, const PNOMMenu nomMenu, const CORBA_unsigned_long ulMenuType, CORBA_Environment *ev) 272 { 273 /* WPObjectData* nomThis=WPObjectGetData(nomSelf); */ 274 275 } 276 277 NOM_Scope void NOMLINK impl_WPObject_wpFilterMenu(WPObject* nomSelf, const PNOMFolderWindow nomFolder, const PNOMMenu nomMenu, const CORBA_unsigned_long ulMenuType, const CORBA_unsigned_long ulFlags, CORBA_Environment *ev) 282 NOM_Scope void NOMLINK impl_WPObject_wpModifyMenu(WPObject* nomSelf, const PNOMFolderWindow nomFolder, 283 const PNOMMenu nomMenu, const CORBA_unsigned_long ulMenuType, 284 CORBA_Environment *ev) 285 { 286 NOMMenuItem* mItem; 287 /* WPObjectData* nomThis=WPObjectGetData(nomSelf); */ 288 289 mItem=NOMMenuItemNew(); 290 291 NOMMenuItem_setup(mItem, __FUNCTION__, WPObjectNomId, 0, ev); 292 WPObject_wpInsertMenuItem(nomSelf, nomMenu, mItem, 0, ev); 293 294 mItem=NOMMenuItemNew(); 295 NOMMenuItem_setup(mItem, "Settings...", WPObjectNomId, WPMENUID_PROPERTIES, ev); 296 WPObject_wpInsertMenuItem(nomSelf, nomMenu, mItem, 0, ev); 297 } 298 299 NOM_Scope void NOMLINK impl_WPObject_wpFilterMenu(WPObject* nomSelf, const PNOMFolderWindow nomFolder, 300 const PNOMMenu nomMenu, const CORBA_unsigned_long ulMenuType, 301 const CORBA_unsigned_long ulFlags, CORBA_Environment *ev) 278 302 { 279 303 /* WPObjectData* nomThis=WPObjectGetData(nomSelf); */ … … 282 306 283 307 NOM_Scope CORBA_boolean NOMLINK impl_WPObject_wpMenuItemSelected(WPObject* nomSelf, const PNOMFolderWindow nomFolder, 284 const PNOMMenu nomMenu, 285 const CORBA_unsigned_long ulMenuType, 308 const PNOMMenuItem nomMenuItem, 286 309 CORBA_Environment *ev) 287 310 { 288 311 /* WPObjectData* nomThis=WPObjectGetData(nomSelf); */ 289 CORBA_boolean nomRetval; 290 312 CORBA_boolean nomRetval=FALSE; 313 314 /* We only handle items with in own name space */ 315 if(WPObjectNomId==NOMMenuItem_queryNameSpaceId(nomMenuItem, ev)) 316 { 317 switch(NOMMenuItem_queryId(nomMenuItem, ev)) 318 { 319 default: 320 break; 321 } 322 } 291 323 return nomRetval; 292 324 } 293 325 326 /* 327 Callback for desktop menu items. This callback takes the object pointer and call wpMenuItemSelected() 328 of the object. 329 */ 330 static void menuItemActivateCallBack(GtkMenuItem* gtkMenuItem, gpointer wpObject) 331 { 332 PNOMMenuItem pItem; 333 334 #if 0 335 if(!nomIsObj((WPObject*)wpObject)) 336 return; 337 #endif 338 339 pItem=(PNOMMenuItem) g_object_get_data(G_OBJECT(gtkMenuItem), NOMOBJECT_KEY_STRING); 340 341 WPObject_wpMenuItemSelected((WPObject*) wpObject, NULLHANDLE, 342 pItem, NULLHANDLE); 343 } 344 345 /* 346 This method adds the correct callback function to the menuitem and inserts it into the given menu. 347 348 FIXME: position information for the menu item isn't used yet. The Item is always appended. 349 350 */ 294 351 NOM_Scope void NOMLINK impl_WPObject_wpInsertMenuItem(WPObject* nomSelf, const PNOMMenu nomMenu, 295 const CORBA_unsigned_long ulId, CORBA_Environment *ev) 296 { 297 /* WPObjectData* nomThis=WPObjectGetData(nomSelf); */ 298 299 } 352 const PNOMMenuItem nomMenuItem, 353 const CORBA_unsigned_long ulPosition, CORBA_Environment *ev) 354 { 355 /* WPObjectData* nomThis=WPObjectGetData(nomSelf); */ 356 357 g_signal_connect(NOMMenuItem_queryMenuItemHandle(nomMenuItem, ev), "activate", 358 (GCallback) menuItemActivateCallBack, (gpointer) nomSelf); 359 360 gtk_menu_shell_append(GTK_MENU_SHELL(NOMMenu_queryMenuHandle(nomMenu,ev)), 361 NOMMenuItem_queryMenuItemHandle(nomMenuItem, ev)); 362 363 } 364 365 366 367
Note:
See TracChangeset
for help on using the changeset viewer.