/* Initialize the details form */ static void DetailsFormInit( void ) { FormType* detailsForm; FieldType* urlField; UInt16 reference; detailsForm = FrmGetFormPtr( frmDetails ); urlField = GetObjectPtr( frmDetailsLink ); reference = GetHistoryCurrent(); if ( AddURLToField( urlField, reference ) ) FrmShowObject( detailsForm, FrmGetObjectIndex( detailsForm, frmDetailsCopy ) ); else FrmHideObject( detailsForm, FrmGetObjectIndex( detailsForm, frmDetailsCopy ) ); FrmDrawForm( detailsForm ); AddDocNameTitle( Prefs()->docName ); CtlSetValue( GetObjectPtr( frmDetailsStatusRead ), LinkVisited( reference ) ); CtlSetValue( GetObjectPtr( frmDetailsStatusUnread ), ! LinkVisited( reference ) ); CtlSetValue( GetObjectPtr( frmDetailsShowImages ), ShowImages( reference ) ); }
void Gui::display(Api *api) { pthread_mutex_lock(&this->api->controlGui); ShowImages(); while (gtkmain.events_pending()) gtkmain.iteration(); pthread_mutex_unlock(&this->api->controlGui); }
/* Event handler for the details form */ Boolean DetailsFormHandleEvent ( EventType* event /* pointer to an EventType structure */ ) { Boolean handled; Boolean update; handled = false; update = false; switch ( event->eType ) { case ctlSelectEvent: if ( event->data.ctlEnter.controlID == frmDetailsOK ) { UInt16 reference; Boolean oldStatus; Boolean newStatus; reference = GetHistoryCurrent(); oldStatus = ShowImages( reference ); newStatus = CtlGetValue( GetObjectPtr( frmDetailsShowImages ) ); update = oldStatus ^ newStatus; if ( newStatus ) ShowImagesOn( reference ); else ShowImagesOff( reference ); if ( CtlGetValue( GetObjectPtr( frmDetailsStatusRead ) ) ) SetVisitedLink( reference ); else UnsetVisitedLink( reference ); } else if ( event->data.ctlEnter.controlID == frmDetailsCopy ) { FieldType* field; field = GetObjectPtr( frmDetailsLink ); WriteTextFieldToMemo( field ); } else if ( event->data.ctlEnter.controlID != frmDetailsCancel ) { break; } FrmReturnToForm( PREVIOUS_FORM ); if ( update ) { ResetHeight(); FrmUpdateForm( GetMainFormId(), frmRedrawUpdateCode ); } handled = true; break; case winEnterEvent: handled = ResizeHandleWinEnterEvent(); break; case winDisplayChangedEvent: handled = ResizeHandleWinDisplayChangedEvent(); break; case winExitEvent: handled = ResizeHandleWinExitEvent(); break; case frmOpenEvent: #ifdef HAVE_SILKSCREEN ResizeHandleFrmOpenEvent(); #endif DetailsFormInit(); handled = true; break; case frmCloseEvent: #ifdef HAVE_SILKSCREEN ResizeHandleFrmCloseEvent(); #endif handled = false; break; default: handled = false; } return handled; }