static void make_scrnobj_ctx_for_panel(QSP_ARG_DECL Panel_Obj *po) { IOS_Item_Context *icp = create_scrnobj_context(PO_NAME(po)); //sprintf(ERROR_STRING,"new_panel %s (0x%lx, qvc = 0x%lx), size is %d x %d, setting context to 0x%lx", //PO_NAME(po),(long)po,(long)PO_QVC(po),PO_WIDTH(po),PO_HEIGHT(po),(long)icp); //advise(ERROR_STRING); SET_PO_CONTEXT(po, icp); }
static void del_po(QSP_ARG_DECL Panel_Obj *po) { /* should deallocate any window system stuff first */ free_wsys_stuff(po); del_panel_obj(po); givbuf((void *)PO_NAME(po)); }
void so_info(Screen_Obj *sop) { if( sop==NULL ) return; printf("%s\t\t%s\n",SOB_NAME(sop),WIDGET_TYPE_NAME(sop)); if( SOB_SELECTOR(sop) != NULL ) printf("\tselector:\t%s\n",SOB_SELECTOR(sop)); if( SOB_ACTION(sop) != NULL ) printf("\taction text:\t%s\n",SOB_ACTION(sop)); if( WIDGET_PANEL(sop) != NULL ) printf("\tpanel:\t%s\n",PO_NAME(WIDGET_PANEL(sop))); /* else printf("no frame object; this must be a frame itself\n"); */ }
void unshow_panel(QSP_ARG_DECL Panel_Obj *po) { #ifdef HAVE_MOTIF if( PANEL_UNMAPPED(po) ){ sprintf(ERROR_STRING,"unshow_panel: panel %s is not currently mapped!?",PO_NAME(po)); WARN(ERROR_STRING); return; } XtUnmapWidget(po->po_frame_obj); po->po_flags &= ~PANEL_SHOWN; #endif /* HAVE_MOTIF */ }
void show_panel(QSP_ARG_DECL Panel_Obj *po) { #ifdef HAVE_MOTIF if( PANEL_MAPPED(po) ){ sprintf(ERROR_STRING,"show_panel: panel %s is already mapped!?",PO_NAME(po)); WARN(ERROR_STRING); return; } // On the mac (and linux???), when we unshow, and re-show a panel, // it moves down by the thickness of the top of the window??? posn_panel(po); /* if widget has already been realized, then just map it; otherwise realize it and set the flag */ if (!(po->po_realized)) { XtRealizeWidget(po->po_frame_obj); po->po_realized = 1; #ifdef FOOBAR /* This must be the first time we see this thing - lets * reset the positions of all the screen objects... */ lp=po->po_children; np=lp->l_head; while(np!=NO_NODE){ sop=np->n_data; if( sop != NULL ){ reposition(sop); } np=np->n_next; } #endif /* FOOBAR */ } else { XtMapWidget(po->po_frame_obj); } /* Now wait until it really is mapped */ #ifdef CAUTIOUS if( ! XtIsRealized(po->po_frame_obj) ) NERROR1("CAUTIOUS: show_panel: object not realized!?"); #endif /* CAUTIOUS */ /* get the window id */ while( ! panel_mapped(po) ) ; po->po_flags |= PANEL_SHOWN; #endif /* HAVE_MOTIF */ } /* end show_panel */
static void _list_widgets(QSP_ARG_DECL Panel_Obj *po) { IOS_List *lp; IOS_Node *np; /* lp=item_list(QSP_ARG scrnobj_itp); */ lp = PO_CHILDREN(po); np=IOS_LIST_HEAD(lp); while(np!=NULL ){ Screen_Obj *sop; sop=(Screen_Obj *)IOS_NODE_DATA(np); if( WIDGET_PANEL(sop) == po ){ /* list_scrnobj(sop); */ // printf("\t%s\n",SOB_NAME(sop)); so_info(sop); } else { sprintf(ERROR_STRING,"widget %s does not belong to panel %s!?", SOB_NAME(sop),PO_NAME(po)); warn(ERROR_STRING); } np=IOS_NODE_NEXT(np); } }
void make_panel(QSP_ARG_DECL Panel_Obj *po,int width,int height) { #ifdef HAVE_MOTIF Arg al[64]; int ac = 0; SET_PO_DOP(po, curr_dop()); #ifdef CAUTIOUS if( PO_DOP(po) == NO_DISP_OBJ ) ERROR1("CAUTIOUS: no display object"); #endif set_curr_win(PO_ROOTW(po)); /* let the panel share a colormap? */ /* set parameters for the "panel" (shell) to be created */ XtSetArg(al[ac], XmNallowShellResize, FALSE); ac++; /* used to be true!? */ XtSetArg(al[ac], XmNx, po->po_x); ac++; XtSetArg(al[ac], XmNy, po->po_y); ac++; XtSetArg(al[ac], XmNwidth, width); ac++; XtSetArg(al[ac], XmNheight, height); ac++; po->po_frame_obj = (Widget) XtAppCreateShell(PO_NAME(po), "guimenu", applicationShellWidgetClass, display, al, ac); if( po->po_frame_obj == (Widget) NULL ) ERROR1("error creating frame"); ac = 0; XtSetArg(al[ac], XmNautoUnmanage, FALSE); ac++; po->po_panel_obj = XmCreateForm(po->po_frame_obj, (String) NULL, al, ac); if( (Widget) po->po_panel_obj == (Widget) NULL ) ERROR1("error creating panel"); po->po_dpy = XtDisplay(po->po_frame_obj); po->po_screen_no = DefaultScreen(po->po_dpy); po->po_gc = DefaultGC(po->po_dpy,DefaultScreen(po->po_dpy)); po->po_visual = DefaultVisual(po->po_dpy,po->po_screen_no); /* indicate that the panel has not yet been realized */ po->po_realized = 0; /* po->po_flags = 0; */ /* the caller did this already... */ XtManageChild(po->po_panel_obj); /* XXX unsupported until I figure this out */ /*po->po_xwin = xv_get(po->po_frame_obj,XV_XID);*/ /* this gives "incomplete type" compiler error */ /* po->po_xwin = po->po_panel_obj->core.window; */ po->po_xwin = XtWindow( po->po_panel_obj ); //fprintf(stderr,"XtWindow returned 0x%lx\n",(long)po->po_xwin); #endif /* HAVE_MOTIF */ /* For compatibility w/ iOS, we make a viewer with the same * name that points to the same window... */ } /* end make_panel */