예제 #1
0
/*	ActualToResourceMenuID(int menuID)

	Given the ID of a menu in memory, returns the resource ID of the 'MENU' resource
	in the XOP's resource fork.
	
	Returns 0 if XOP did not add this menu to Igor menu.
	
	Thread Safety: ActualToResourceMenuID is not thread-safe.
*/
int
ActualToResourceMenuID(int menuID)
{
	if (!CheckRunningInMainThread("ActualToResourceMenuID"))
		return 0;
	
	return (int)CallBack1(RESOURCEMENUID, (void *)menuID);	
}
예제 #2
0
/*	ReleaseDataFolder(dfRefPtr)

	Tells Igor that you are no longer holding a data folder.
	
	dfRefPtr contains the address of your DataFolderHandle variable that refers to
	a data folder. ReleaseDataFolder sets *dfRefPtr to NULL so your DataFolderHandle
	variable is not valid after you call ReleaseDataFolder.
	
	If *dfRefPtr is NULL on input then ReleaseDataFolder does nothing and returns 0.
	
	For background information and further detail, please see "Data Folder Reference
	Counting" in the Accessing Igor Data chapter of the XOP Toolkit manual.

	ReleaseDataFolder returns an error code as the function result, typically 0 for success or
	IGOR_OBSOLETE.
	
	ReleaseDataFolder was added in Igor Pro 6.20. If you call this with an earlier
	version of Igor, it will do nothing and return IGOR_OBSOLETE.

	Thread Safety: ReleaseDataFolder is Igor-thread-safe with XOP Toolkit 6 and Igor Pro 6.20 or later.
	You can call it from a thread created by Igor but not from a private thread that you created yourself.
*/
int
ReleaseDataFolder(DataFolderHandle* dfRefPtr)
{
	if (*dfRefPtr == NULL)
		return 0;				// Nothing to release.
	
	return (int)CallBack1(RELEASE_DATAFOLDER, dfRefPtr);
}
예제 #3
0
/*	ResourceMenuIDToMenuHandle(int resourceMenuID)

	Given the ID of a 'MENU' resource in the XOP's resource fork, returns the
	menu handle for that menu.
	
	Returns NULL if XOP did not add this menu.
	
	Thread Safety: ResourceMenuIDToMenuHandle is not thread-safe.
*/
MenuHandle
ResourceMenuIDToMenuHandle(int resourceMenuID)
{
	if (!CheckRunningInMainThread("ResourceMenuIDToMenuHandle"))
		return NULL;
	
	return (MenuHandle)CallBack1(XOPMENUHANDLE, (void *)resourceMenuID);	
}
예제 #4
0
/*	ResourceToActualMenuID(int resourceMenuID)

	Given the ID of a 'MENU' resource in the XOP's resource fork, returns the
	actual menu ID of that resource in memory.
	
	Returns 0 if XOP did not add this menu to Igor menu.
	
	Thread Safety: ResourceToActualMenuID is not thread-safe.
*/
int
ResourceToActualMenuID(int resourceMenuID)
{
	if (!CheckRunningInMainThread("ResourceToActualMenuID"))
		return 0;
	
	return (int)CallBack1(ACTUALMENUID, (void *)resourceMenuID);	
}
예제 #5
0
static void
ShowHideContextualHelp(int code)		// -1 means toggle, 0 means hide, 1 means show contextual help window.
{
	CallBack1(SHOW_HIDE_CONTEXTUAL_HELP, (void*)code);
}
예제 #6
0
/*	KillDataFolder(dataFolderH)

	Kills an existing data folder, removing it and its contents, including
	any child data folders, from memory.
	
	dataFolderH is a handle to an existing Igor data folder or NULL to use
	the current data folder.

	You will receive an error and the data folder will not be killed if it
	contains waves or variables that are in use (e.g. displayed in tables or graphs).
	
	If you kill the current data folder or a data folder that contains the current
	data folder, Igor will set the current data folder to the parent of the killed
	data folder.
	
	If you kill the root data folder, its contents will be killed but not
	the root data folder itself.
	
	Returns 0 or error code.
	
	NOTE: Once a data folder is successfully killed, dataFolderH is no longer
		  valid. You should not reference it for any purpose.

	Thread Safety: KillDataFolder is Igor-thread-safe with XOP Toolkit 6 and Igor Pro 6.20 or later.
	You can call it from a thread created by Igor but not from a private thread that you created yourself.
*/
int
KillDataFolder(DataFolderHandle dataFolderH)
{
	return (int)CallBack1(KILL_DATAFOLDER, dataFolderH);
}
예제 #7
0
/*	SetCurrentDataFolder(dataFolderH)

	Sets the current data folder to the data folder referenced by dataFolderH.

	Returns 0 or error code.

	Thread Safety: SetCurrentDataFolder is Igor-thread-safe with XOP Toolkit 6 and Igor Pro 6.20 or later.
	You can call it from a thread created by Igor but not from a private thread that you created yourself.
*/
int
SetCurrentDataFolder(DataFolderHandle dataFolderH)
{
	return (int)CallBack1(SETCURRENT_DATAFOLDER, dataFolderH);
}
예제 #8
0
/*	GetCurrentDataFolder(currentDataFolderHPtr)

	Returns a handle to the current data folder in *currentDataFolderHPtr.
	
	Data folder handles belong to Igor so you should not modify or dispose them.
	
	The only use for this handle is to pass it to other data-folder-related
	XOPSupport routines.
	
	Returns 0 or error code.

	Thread Safety: GetCurrentDataFolder is Igor-thread-safe with XOP Toolkit 6 and Igor Pro 6.20 or later.
	You can call it from a thread created by Igor but not from a private thread that you created yourself.
*/
int
GetCurrentDataFolder(DataFolderHandle* currentDataFolderHPtr)
{
	return (int)CallBack1(GETCURRENT_DATAFOLDER, currentDataFolderHPtr);
}