void motif_init(QSP_ARG_DECL const char *progname) { const char *argv[1]; int argc=1; argv[0]=progname; the_dname = check_display(SINGLE_QSP_ARG); /* * initialize the Xt toolkit and create an application context * and shell */ XtSetLanguageProc ( (XtAppContext) NULL, (XtLanguageProc) NULL, (XtPointer) NULL ); XtToolkitInitialize (); globalAppContext = XtCreateApplicationContext (); display = XtOpenDisplay (globalAppContext, the_dname, argv[0],"guimenu", NULL, 0, &argc, (char **)argv); if (!display) { fprintf(stderr, "can't open display\n"); return; } add_event_func(QSP_ARG motif_dispatch); // This is not really a motif-specific thing, // but we do this here because nav_panel_itp is // static to this file... if( nav_panel_itp == NO_ITEM_TYPE ){ init_nav_panels(SINGLE_QSP_ARG); add_genwin(QSP_ARG nav_panel_itp, &navp_genwin_funcs, NULL); } }
void call_event_funcs(SINGLE_QSP_ARG_DECL) { #ifdef BUILD_FOR_IOS static int relinquishing=0; if( ! relinquishing ){ add_event_func(QSP_ARG relinquish_to_ios); relinquishing=1; } #endif // BUILD_FOR_IOS if( QS_EVENT_LIST(THIS_QSP) == NO_LIST ) return; call_funcs_from_list(QSP_ARG QS_EVENT_LIST(THIS_QSP) ); }
void window_sys_init(SINGLE_QSP_ARG_DECL) { char s[8]; Variable *vp; if( window_sys_inited ) return; #ifdef QUIP_DEBUG xdebug = add_debug_module(QSP_ARG "xsupp"); #endif /* QUIP_DEBUG */ add_event_func(QSP_ARG i_loop); set_discard_func( discard_events ); window_sys_inited=1; if( current_dop == NO_DISP_OBJ ){ current_dop = default_x_display(SINGLE_QSP_ARG); if( current_dop == NO_DISP_OBJ ){ NWARN("Couldn't open default display!?"); return; } } // Make sure DISPLAY_WIDTH and DISPLAY_HEIGHT are set... // If these have been set in the environment, leave be. vp = var_of(QSP_ARG "DISPLAY_WIDTH"); if( vp == NULL ){ sprintf(s,"%d",current_dop->do_width); ASSIGN_RESERVED_VAR("DISPLAY_WIDTH",s); } vp = var_of(QSP_ARG "DISPLAY_HEIGHT"); if( vp == NULL ){ sprintf(s,"%d",current_dop->do_height); ASSIGN_RESERVED_VAR("DISPLAY_HEIGHT",s); } //window_sys_inited=1; }