예제 #1
0
LayoutActivate( long version, GlobalFunc* global, LWLayoutGeneric* local, void* serverData )
{
	unsigned long    prodinfo;
	LWMessageFuncs*  msgfunc;

	XCALL_INIT;

	if (version != LWLAYOUTGENERIC_VERSION)
		return AFUNC_BADVERSION;

	msgfunc  = (LWMessageFuncs *) global( LWMESSAGEFUNCS_GLOBAL, GFUSE_TRANSIENT );
	prodinfo = (unsigned long)    global( LWPRODUCTINFO_GLOBAL,  GFUSE_TRANSIENT );

	int ver = LWINF_GETMAJOR( prodinfo );
	int minor = LWINF_GETMINOR( prodinfo );
	int build = LWINF_GETBUILD( prodinfo );
	dbgprintf("ver %d.%d(%d)\n", ver, minor, build);
	if (LWINF_GETMAJOR( prodinfo ) <= 6 &&
		LWINF_GETBUILD( prodinfo ) < 508) {
		msgfunc->error("This plugin works on LW6.5B or later.", (const char *) NULL);
		return AFUNC_OK;
	}

	dxOptions  options = dxOptions( DX_STATUS_LAYOUT );
	dxUI       ui      = dxUI     ( &options, global, local );

	if (ui._obj_no >= 0) {
		//local->evaluate(local->data, "CalculateAllNormals 1"); // 意味なかった
		ui.Open();
		ui.Close();
		//local->evaluate(local->data, "CalculateAllNormals 0");
	}

	return AFUNC_OK;
}
예제 #2
0
int Mesh_Object( GlobalFunc *global )
{
	LWStateQueryFuncs      *query;
	LWObjectFuncs          *objfunc;
	const char             *objname, *name;
	int                    n, num_objs;
	unsigned long          prodinfo;
	unsigned long          systemid;

	query    = (LWStateQueryFuncs *)(*global)( LWSTATEQUERYFUNCS_GLOBAL, GFUSE_TRANSIENT );
	objfunc  = (LWObjectFuncs *)    (*global)( LWOBJECTFUNCS_GLOBAL    , GFUSE_TRANSIENT );
	prodinfo = (unsigned long)      (*global)( LWPRODUCTINFO_GLOBAL    , GFUSE_TRANSIENT );
	systemid = (unsigned long)      (*global)( LWSYSTEMID_GLOBAL       , GFUSE_TRANSIENT );

	num_objs = (*objfunc->numObjects)();

	objname = (*query->object)();
	if (objname == NULL) return (-1);

	for (n = 0; n < num_objs; n++)
	{
		name = (*objfunc->filename)( n );
		if (objname != NULL && name != NULL) {
			if (strcmp(name, objname) == 0) return n;
		}
	}

//
//  BUG FOR LW6.5X
//
	if ((systemid & LWSYS_MODELER) && LWINF_GETBUILD(prodinfo) < 471) return (-1);

	for (n = 0; n < num_objs; n++)
	{
		name = (*objfunc->refName)( n );
		if (objname != NULL && name != NULL) {
			if (strcmp(name, objname) == 0) return n;
		}
	}

	return (-1);
}
예제 #3
0
LWError LWPPlugin::getCallBacks()
{
	if (!globalFunc) return "LWPPlugin::getCallbacks() : globalFunc not initialized!";

	// transients

	if (!(localeInfo = (unsigned long)globalFunc(LWLOCALEINFO_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get Locale Info";

	if (!(productInfo = (unsigned long)globalFunc(LWPRODUCTINFO_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get Product Info";
	productID = productInfo & LWINF_PRODUCT;
	productMajor = LWINF_GETMAJOR(productInfo);
	productMinor = LWINF_GETMINOR(productInfo);
	productBuild = LWINF_GETBUILD(productInfo);

	if (!(systemID = (unsigned long)globalFunc(LWSYSTEMID_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get System ID";
	systemContext = systemID & LWSYS_TYPEBITS;
	systemSerial = systemID & LWSYS_SERIALBITS;
	systemIsModeler = systemID & LWSYS_MODELER;
	systemIsLayout = 1;
	systemIsScreamerNet = systemID & LWSYS_SCREAMERNET;

	// acquisitions

	if (callBackUsers ++) return 0;	// already got them

	if (!(channelInfo = (LWChannelInfo *)globalFunc(LWCHANNELINFO_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Channel Info";

	if (!(dirInfoFunc = (LWDirInfoFunc *)globalFunc(LWDIRINFOFUNC_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Directory Info";

	if (!(dynaConvertFunc = (DynaConvertFunc *)globalFunc(LWDYNACONVERTFUNC_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Dynamic Conversion Funcsions";

	if (!(dynaRequestFuncs = (DynaReqFuncs *)globalFunc(LWDYNAREQFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Dynamic Requestor Functions";

	if (!(envelopeFuncs = (LWEnvelopeFuncs *)globalFunc(LWENVELOPEFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Envelops Functions";

	if (!(fileIOFuncs = (LWFileIOFuncs *)globalFunc(LWFILEIOFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get File IO Functions";

	if (!(imageList = (LWImageList *)globalFunc(LWIMAGELIST_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Image List";

	if (!(imageUtil = (LWImageUtil *)globalFunc(LWIMAGEUTIL_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Image Utilities";

	if (!(instUpdate = (LWInstUpdate *)globalFunc(LWINSTUPDATE_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Instance Update Functions";

	if (!(messageFuncs = (LWMessageFuncs*)globalFunc(LWMESSAGEFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Info Messages Functions";

	if (!(mutexFuncs = (LWMTUtilFuncs *)globalFunc(LWMTUTILFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Mutex Functions";

	if (!(objectFuncs = (LWObjectFuncs *)globalFunc(LWOBJECTFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Object Functions";
   
	if (!(surfaceFuncs = (LWSurfaceFuncs *)globalFunc(LWSURFACEFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Surface Functions";

	if (!(textureFuncs = (LWTextureFuncs *)globalFunc(LWTEXTUREFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Texture Functions";

	if (!(vParmFuncs = (LWVParmFuncs *)globalFunc(LWVPARMFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Variable Parameter Functions";

	if (systemIsScreamerNet) return 0;

	// non-screamy acquisitions

	if (!(colorPickerFunc = (LWColorActivateFunc *)globalFunc(LWCOLORACTIVATEFUNC_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Color Activate Function";

	if (!(fileActivateFunc = (LWFileActivateFunc *)globalFunc(LWFILEACTIVATEFUNC_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get File Request Activation Function";

	if (!(fileReqFunc = (LWFileReqFunc *)globalFunc(LWFILEREQFUNC_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get File Request Function";

	if (!(fileTypeFunc = (LWFileTypeFunc *)globalFunc(LWFILETYPEFUNC_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get File Type Function";

	if (!(panelFuncs = (LWPanelFuncs *)globalFunc(LWPANELFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Panel Functions";

	if (!(previewFuncs = (LWPreviewFuncs *)globalFunc(LWPREVIEWFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Preview Functions";

	if (!(rasterFuncs = (LWRasterFuncs *)globalFunc(LWRASTERFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Raster Functions";

	if (!(shelfFuncs = (LWShelfFuncs *)globalFunc(LWSHELFFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Shelf Functions";

	if (!(surfaceEditFuncs = (LWSurfEdFuncs *)globalFunc(LWSURFEDFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Surface Edit Functions";

	if (!(textureEditFuncs = (LWTxtrEdFuncs *)globalFunc(LWTXTREDFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Texture Edit Functions";

	if (!(xPanelFuncs = (LWXPanelFuncs *)globalFunc(LWXPANELFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get XPanel Functions";

	return 0;
}