コード例 #1
0
ファイル: dpy.c プロジェクト: felipebetancur/QuIP
Disp_Obj *open_display(QSP_ARG_DECL  const char *name,int desired_depth)
{
	Disp_Obj *dop;
	static int siz_done=0;

	dop = new_disp_obj(QSP_ARG  name);
	if( dop == NO_DISP_OBJ ){
		sprintf(ERROR_STRING, "Couldn't create object for display %s",
					name);
		NWARN(ERROR_STRING);
		return(NO_DISP_OBJ);
	}

	if( dop_open(QSP_ARG  dop) < 0 ){
		return(NO_DISP_OBJ);
	}

	if( dop_setup(QSP_ARG  dop,desired_depth) < 0 ){
		/* Bug - XCloseDisplay?? */
		/* need to destroy object here */
		del_disp_obj(QSP_ARG  dop);
		rls_str((char *)dop->do_name);
		return(NO_DISP_OBJ);
	}
	set_display(dop);

	if( ! siz_done ){
		siz_done++;
		add_sizable(QSP_ARG  disp_obj_itp,&dpy_sf, NULL );
	}

	return(dop);
}
コード例 #2
0
ファイル: screen_objs.c プロジェクト: nasa/QuIP
void _so_init(QSP_ARG_DECL  int argc,const char **argv)
{
	static int so_inited=0;

	if( so_inited ) return;
	window_sys_init(SINGLE_QSP_ARG);

#ifdef HAVE_MOTIF
	motif_init(argv[0]);
#endif /* HAVE_MOTIF */

#ifndef BUILD_FOR_OBJC

	if(panel_obj_itp == NULL)
		init_panel_objs();

	/* support for genwin */
	add_genwin(panel_obj_itp, &gwfp, NULL);
	
	add_sizable(panel_obj_itp,&panel_sf, NULL );

	// scrnobj_itp is null at this point!?
	if( scrnobj_itp == NULL )
		init_scrnobjs();
	add_sizable(scrnobj_itp,&scrnobj_sf, NULL );
	
#else

	//if(panel_obj_itp == NULL)
	//	init_panel_objs(SINGLE_QSP_ARG);

#endif /* ! BUILD_FOR_OBJC */

// We need to have genwin's be sizable for ios too!?

	so_inited=1;
}
コード例 #3
0
ファイル: dobj_util.c プロジェクト: jbmulligan/quip
void _dataobj_init(SINGLE_QSP_ARG_DECL)		// initiliaze the module
{
	static int dobj_inited=0;

	if( dobj_inited ){
		/* We need to call this from other menus
		 * like fileio and rawvol, so no assertion here.
		 */
		return;
	}

#ifdef QUIP_DEBUG
	debug_data = add_debug_module("data");
#endif // QUIP_DEBUG

	// BUG?  this happens here on the main thread, but child threads
	// will need to be initialized elsewhere!
	INSURE_QS_DOBJ_ASCII_INFO(THIS_QSP)
	init_dobj_ascii_info(QS_DOBJ_ASCII_INFO(THIS_QSP) );
    
	init_dobjs();		/* initialize items */

	vl2_init_platform(SINGLE_QSP_ARG);	// this initializes ram_area_p

	init_tmp_dps();

	set_del_method(dobj_itp,(void (*)(QSP_ARG_DECL  Item *))_delvec);

	init_dfuncs(SINGLE_QSP_ARG);

	set_obj_funcs(
                  _get_obj,
                  _dobj_of,
                  _d_subscript,
                  _c_subscript);
    
	init_dobj_expr_funcs(SINGLE_QSP_ARG);

//	/* BUG need to make context items sizables too!? */
	add_sizable(dobj_itp,&dobj_sf,
		(Item * (*)(QSP_ARG_DECL  const char *))_hunt_obj);
	add_positionable(dobj_itp,&dobj_pf,
		(Item * (*)(QSP_ARG_DECL  const char *))_hunt_obj);
	add_interlaceable(dobj_itp,&dobj_if,
		(Item * (*)(QSP_ARG_DECL  const char *))_hunt_obj);
	add_subscriptable(dobj_itp,&dobj_ssf,
		(Item * (*)(QSP_ARG_DECL  const char *))_hunt_obj);

	// This was commented out - why?
	// Maybe because initial iOS implementation didn't include ports menu?

	/* set up additional port data type */

	define_port_data_type(P_DATA,"data","name of data object", _recv_obj,
		(const char *(*)(QSP_ARG_DECL  const char *))_pick_obj,
		(void (*)(QSP_ARG_DECL Port *,const void *,int)) _xmit_obj
		);

	/* Version control */
//	verdata(SINGLE_QSP_ARG);

	dobj_inited =1;
}