Changeset 186 for trunk/desktop/class_c/wpobject.c
- Timestamp:
- Jan 13, 2007, 12:36:01 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/desktop/class_c/wpobject.c
r183 r186 185 185 { 186 186 WPObject* wpObject; 187 WPNoteBook* wpNoteBook; 187 WPWindow* wpWindow; 188 188 189 PUSEITEM pUseItem=(PUSEITEM) pData; 189 190 190 wpNoteBook=(WPNoteBook*)g_object_get_data(G_OBJECT(gtkWidget), NOMOBJECT_KEY_STRING); 191 192 g_return_val_if_fail(NULLHANDLE!=wpNoteBook, FALSE); 193 194 wpObject=WPNoteBook_wpQueryWPObject(wpNoteBook, NULLHANDLE); 191 wpWindow=(WPWindow*)g_object_get_data(G_OBJECT(gtkWidget), NOMOBJECT_KEY_STRING); 192 193 g_return_val_if_fail(NULLHANDLE!=wpWindow, FALSE); 194 195 /* This is also in the use item */ 196 wpObject=WPNoteBook_wpQueryWPObject(wpWindow, NULLHANDLE); 195 197 196 198 g_return_val_if_fail(NULLHANDLE!=wpObject, FALSE); … … 232 234 pui--; 233 235 //g_message(" in %s wpNoteBook: %lx pui %lx", __FUNCTION__, wpNoteBook, pui); 236 /* Make sure the view item is removed when the window is closed */ 234 237 g_signal_connect(G_OBJECT(NOMWindow_queryWindowHandle((NOMWindow*)wpNoteBook, NULLHANDLE)),"delete-event", 235 238 G_CALLBACK(defaultWPWindowDeleteHandler), (gpointer) pui); … … 268 271 { 269 272 pViewItem=WPObject_wpFindViewItem(nomSelf, VIEW_SETTINGS, NULLHANDLE, ev); 273 if(pViewItem){ 274 //g_message(" in %s : OPEN_SETTINGS returning %x %x ...", __FUNCTION__, pViewItem, pViewItem->nomWindow); 275 /* Bring the window to the foreground */ 276 NOMWindow_present(pViewItem->nomWindow, ev); 277 return (gpointer)pViewItem->nomWindow; 278 } 279 break; 280 } 281 case OPEN_CONTENTS: 282 { 283 #warning !!!!! This belongs into WPFolder !!!!! 284 pViewItem=WPObject_wpFindViewItem(nomSelf, VIEW_CONTENTS, NULLHANDLE, ev); 270 285 if(pViewItem){ 271 286 //g_message(" in %s : OPEN_SETTINGS returning %x %x ...", __FUNCTION__, pViewItem, pViewItem->nomWindow); … … 449 464 } 450 465 451 NOM_Scope PNOMString NOMLINK impl_WPObject_wpSetTitle(WPObject* nomSelf, const PNOMString pnomStrNewTitle, CORBA_Environment *ev) 452 { 453 WPObjectData* nomThis=WPObjectGetData(nomSelf); 454 PNOMString tmpString=NOMStringNew(); 466 NOM_Scope void NOMLINK impl_WPObject_wpSetTitle(WPObject* nomSelf, const PNOMString pnomStrNewTitle, 467 CORBA_Environment *ev) 468 { 469 WPObjectData* nomThis=WPObjectGetData(nomSelf); 470 PNOMString tmpString=(PNOMString)NOMString_new(pnomStrNewTitle, NULLHANDLE); 455 471 gpointer tmpPtr; 456 472 457 473 /* Create a new title */ 458 NOMString_assign(tmpString, pnomStrNewTitle, ev);474 NOMString_assign(tmpString, pnomStrNewTitle, NULLHANDLE); 459 475 460 476 /* It may happen that someone changed the title from another thread. We may either … … 468 484 tmpPtr=g_atomic_pointer_get(&_pnomStringTitle); 469 485 }while(!g_atomic_pointer_compare_and_exchange((gpointer*)&_pnomStringTitle, tmpPtr, (gpointer) tmpString)); 470 471 return pnomStrNewTitle; 486 } 487 488 NOM_Scope void NOMLINK impl_WPObject_wpSetTitleFromCString(WPObject* nomSelf, const CORBA_char * chrNewTitle, 489 CORBA_Environment *ev) 490 { 491 WPObjectData* nomThis=WPObjectGetData(nomSelf); 492 PNOMString orgTitle; 493 PNOMString tmpString; 494 495 orgTitle=(PNOMString)g_atomic_pointer_get(&_pnomStringTitle); 496 tmpString=(PNOMString)NOMString_new(orgTitle, NULLHANDLE); 497 498 NOMString_assignCString(tmpString, chrNewTitle, NULLHANDLE); 499 do{ 500 /* Get old NOMString containing old title */ 501 orgTitle=(PNOMString)g_atomic_pointer_get(&_pnomStringTitle); 502 }while(!g_atomic_pointer_compare_and_exchange((gpointer*)&_pnomStringTitle, 503 (gpointer)orgTitle, (gpointer) tmpString)); 472 504 } 473 505
Note:
See TracChangeset
for help on using the changeset viewer.