const AttachmentStrategy * AttachmentStrategy::create( const QString & type ) { QString lowerType = type.toLower(); if ( lowerType == "iconic" ) return iconic(); //if ( lowerType == "smart" ) return smart(); // not needed, see below if ( lowerType == "inlined" ) return inlined(); if ( lowerType == "hidden" ) return hidden(); // don't kFatal here, b/c the strings are user-provided // (KConfig), so fail gracefully to the default: return smart(); }
const AttachmentStrategy * AttachmentStrategy::create( Type type ) { switch ( type ) { case Iconic: return iconic(); case Smart: return smart(); case Inlined: return inlined(); case Hidden: return hidden(); } kFatal( 5006 ) << "Unknown attachment startegy ( type ==" << (int)type << ") requested!"; return 0; // make compiler happy }
void iupmotCBstructure (Widget w, XtPointer data, XEvent *ev, Boolean *cont) { Ihandle *n = (Ihandle*)data; Widget form = XtNameToWidget((Widget)handle(n),"*dialog_area"); Iwidgetdata *wd; int state = -1; if (!form) return; XtVaGetValues (form, XmNuserData, &wd, NULL); if (!wd) return; switch(ev->type) { case MapNotify: { if ( iconic( wd->data ) ) /* IUP_RESTORE */ { wd->data = (void*)(-((long)wd->data)); state = IUP_RESTORE; } else /* IUP_SHOW */ { Ihandle *startfocus = IupGetAttributeHandle(n, "STARTFOCUS"); if (startfocus) IupSetFocus(startfocus); state = IUP_SHOW; iupmot_nvisiblewin++; } break; } case UnmapNotify: { if ( shown(wd->data) || popuped(wd->data) ) /* IUP_MINIMIZE */ { wd->data = (void*)(-((long)wd->data)); state = IUP_MINIMIZE; } break; } } { IFni cb = (IFni)IupGetCallback(n, IUP_SHOW_CB); if (cb && state>=0) { iupmot_incallback = TRUE; if (cb(n, state) == IUP_CLOSE) iupmot_exitmainloop = 1; iupmot_incallback = FALSE; } } }
const AttachmentStrategy * prev() const { return iconic(); }
const AttachmentStrategy * next() const { return iconic(); }