Пример #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
// Constructor():
ReplaceObjects_Interface::ReplaceObjects_Interface( GlobalFunc *_global, void *local )
  : global(*_global), panel(NULL), sel_type(-1), progress_current(0), progress_total(1),
  progress_panel(NULL), do_process(false) {

  generic     = (LWLayoutGeneric *)local;
  message     = (LWMessageFuncs  *)global( LWMESSAGEFUNCS_GLOBAL,  GFUSE_TRANSIENT );
  ui          = (LWInterfaceInfo *)global( LWINTERFACEINFO_GLOBAL, GFUSE_TRANSIENT );
  iteminfo    = (LWItemInfo      *)global( LWITEMINFO_GLOBAL,      GFUSE_TRANSIENT );
  objectinfo  = (LWObjectInfo    *)global( LWOBJECTINFO_GLOBAL,    GFUSE_TRANSIENT );
  panel_funcs = (LWPanelFuncs    *)global( LWPANELFUNCS_GLOBAL,    GFUSE_TRANSIENT );

  if( ui->selItems[0] != NULL )
    sel_type = (iteminfo->type)( ui->selItems[0] );

  unsigned long prodinfo = (unsigned long) global( LWPRODUCTINFO_GLOBAL, GFUSE_TRANSIENT );
  unsigned long major    = LWINF_GETMAJOR( prodinfo );
  unsigned long minor    = LWINF_GETMINOR( prodinfo );

  if( ((major >= 6) && (minor >= 1)) && (major < 7) )
    checkmark_string = "\03(i:MIMG_CHECKMARK)";
  else
    checkmark_string = "Yes";

  rint = this;
}
Пример #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;
}