Beispiel #1
0
//HOST_IMPORT void main(IORecHandle ioRecHandle)
HOST_IMPORT int main(IORecHandle ioRecHandle) //OC030110, required for GCC 4.2 Mac OSX
{
	//#ifdef applec					// For MPW C for 68K only.
	//	void _DATAINIT(void);
	//	_DATAINIT();				// For MPW C only.
	//	UnloadSeg(_DATAINIT);
	//#endif
	
	//#ifdef XOP_GLOBALS_ARE_A4_BASED
	//	#ifdef __MWERKS__
	//		SetCurrentA4();							// Set up correct A4. This allows globals to work.
	//		SendXOPA4ToIgor(ioRecHandle, GetA4());	// And communicate it to Igor.
	//	#endif
	//#endif

	//LoadXOPSegs();
	XOPInit(ioRecHandle);							// Do standard XOP initialization.
	SetXOPEntry(XOPEntry);							// Set entry point for future calls.
	
	if(igorVersion < 200) SetXOPResult(OLD_IGOR);
	else SetXOPResult(0L);
	
	SetXOPType(RESIDENT | IDLES);
	SR.Initialize();
	srYield.Init(0.5);

	srUtiProgrIndFuncSet(&(srTIgorSend::ShowCompProgress));
	srUtiWfrExtModifFuncSet(&(srTIgorSend::WfrModify));
	srUtiOptElemGetInfByNameFuncSet(&(srTIgorSend::GetOptElemInfByName));

	return 0;
}
Beispiel #2
0
/*	XOPEntry()

	This is the entry point from the host application to the XOP when the message specified by the
	host is other than INIT.
*/
extern "C" void
XOPEntry(void)
{	
	XOPIORecResult result = 0;
	
	switch (GetXOPMessage()) {
		case MENUITEM:								// XOPs menu item selected.
			XOPMenuItem();
			break;

		case MENUENABLE:							// Enable/disable XOPs menu item.
			XOPMenuEnable();
			break;
			
		case EXECUTE_OPERATION:
			{
				void* params;
				params = (void*)GetXOPItem(1);
				result = ExecuteMenuXOP1((MenuXOP1RuntimeParams*)params);
			}
			break;
	}
	
	SetXOPResult(result);
}
Beispiel #3
0
/*	XOPMain(ioRecHandle)

	This is the initial entry point at which the host application calls XOP.
	The message sent by the host must be INIT.

	main does any necessary initialization and then sets the XOPEntry field of the
	ioRecHandle to the address to be called for future messages.
*/
HOST_IMPORT int
XOPMain(IORecHandle ioRecHandle)				// The use of XOPMain rather than main means this XOP requires Igor Pro 6.20 or later
{
	int err;
	
	XOPInit(ioRecHandle);						// Do standard XOP initialization.
	if (igorVersion < 620) {
		SetXOPResult(OLD_IGOR);
		return EXIT_FAILURE;
	}
	
	if (err = RegisterMenuXOP1()) {
		SetXOPResult(err);
		return EXIT_FAILURE;
	}
	
	SetXOPEntry(XOPEntry);						// Set entry point for future calls.
	SetXOPType(RESIDENT);						// Specify XOP to stick around and to Idle.
	
	mainMenuHandle = ResourceMenuIDToMenuHandle(MAINMENU_ID);
	
	SetXOPResult(0L);
	return EXIT_SUCCESS;
}
Beispiel #4
0
/*	XOPEntry()

	This is the entry point from the host application to the XOP for all messages after the
	INIT message.
*/
static void
XOPEntry(void)
{	
	long result = 0;

	switch (GetXOPMessage()) {
		case FUNCTION:						// Our external function being invoked ?
			result = DoFunction();
			break;

		case FUNCADDRS:
			result = RegisterFunction();
			break;

		case IDLE:
			srEnsureSrwInit();
			break;
	}
	SetXOPResult(result);
}