AlFunctionHandle
Class for creating the OpenAlias interface to Alias
Synopsis
#include <AlFunctionHandle.h>
class AlFunctionHandle
AlFunctionHandle();
~AlFunctionHandle();
statusCode create( const char*, const char* );
statusCode create( const char*, AlFunction *func );
AlFunctionHandle& operator =( const AlFunctionHandle& f );
int operator !() const;
statusCode setAttributeString( const char * );
statusCode setOptionBox( const char *, const char *, const char *dirname
= NULL );
statusCode setIconPath( const char* path );
statusCode setHelpFile( const char* file );
statusCode addToMenu( const char * );
statusCode appendToMenu( const char * );
statusCode removeFromMenu();
statusCode deleteObject();
Description
This class provides a means to interface the OpenAlias application to the Alias user interface. An AlFunction class or one of its derivatives ( AlMomentaryFunction, AlContinuousFunction ) is required by the create method. Note that the string name of an Al*Function could also be specified in the create() method.
Summary
AlFunctionHandle::~AlFunctionHandle()
Description
Destructor for the AlFunctionHandle class.
AlFunctionHandle::AlFunctionHandle()
Description
Constructor for the AlFunctionHandle class.
AlFunctionHandle& AlFunctionHandle::operator =( const AlFunctionHandle& f )
Description
Assignment operator for the AlFunctionHandle class.
int AlFunctionHandle::operator !() const
Description
This allows us to use statements to check the validity of the handle, such as
if( functionhandle ) ....
statusCode AlFunctionHandle::create( const char * popupLabel, const char * command )
Description
This initializes the function handle given a popupLabel and a momentary function name (command).
Arguments
< popupLabel - This is the string that will appear on the menu pop-up for this plug-in.
< command - This is a character string which is the name of the momentary command. It must be unique.
Return codes
sInvalidArgument - name or command was NULL
sAlreadyCreated - the handle has already been created
sSuccess - the handle was created
sFailure - the handle could not be created
sObjectInSet - a command with name 'command' already exists
statusCode AlFunctionHandle::create( const char * popupLabel, AlFunction *func )
Description
This initializes the function handle given a name and a momentary function name (command).
Arguments
< popupLabel - This is the string that will appear on the menu pop-up for this plug-in.
< func - This is the set of functions (momentary or continuous).
Return codes
sInvalidArgument - name or command was NULL
sAlreadyCreated - the handle has already been created
sSuccess - the handle was created
sFailure - the handle could not be created
statusCode AlFunctionHandle::setAttributeString( const char * str )
Description
This method sets the string that will appear on the attribute line below the prompt line when the plug-in is selected from the menu.
Arguments
< str - The string to appear in the attribute line.
Return codes
sInvalidArgument - str was NULL
sInvalidObject - The function handle has not been initialized.
sSuccess - The attribute string was successfully set.
statusCode AlFunctionHandle::setOptionBox( const char * schemeFileName, const char * editorName, const char * schemeFileNamePrefix )
Description
This method sets the option box for the plug-in. If the plug-in has no option box, then do not call this method. This method will fail if the scheme file described by the name and prefix does not exist. Normally, the 'schemeFileName' is the name of the file which defines the option box. If the 'schemeFileNamePrefix' parameter is NULL, then the 'schemeFileName' will be loaded relative to the path defined by the environment variable ALIAS_WORKENV. If the 'schemeFileNamePrefix' parameter is not NULL, then it will be added to the start of the 'schemeFileName'. The string formed by concatenating 'schemeFileName' to 'schemeFileNamePrefix' will be be used as the filename that will be loaded. i.e. the actual scheme file that is loaded will be equivalent to schemeFileNamePrefix/schemeFileName
Arguments
< schemeFileName - name of the Scheme file which defined the option box.
< editorName - The name given to the ui-editor function in the Scheme file.
< schemeFileNamePrefix - the name of the directory to prefix to schemeFileName
Return codes
sInvalidObject - function handle is invalid
sInvalidArgument - One of the arguments was NULL or the file does not exist.
sFailure - The function handle is already attached to a menu.
sSuccess - The option box was successfully set for the plug-in.
statusCode AlFunctionHandle::addToMenu( const char * menuname )
Description
This method adds a plug-in to the bottom of the menu.
Arguments
< menuname - the name of the menu the plug-ins will be added to.
Return codes
sInvalidArgument - menuname was NULL
sAlreadyCreated - The function handle is already attached to a menu.
sObjectNotAMember - The menu name was not valid.
sFailure - Failed to attach the plug-in to the menu.
statusCode AlFunctionHandle::appendToMenu( const char * menuname )
Description
This method adds a plug-in to the top of the menu.
Arguments
< menuname - the name of the menu the plug-ins will be added to.
Return codes
sInvalidArgument - menuname was NULL
sAlreadyCreated - The function handle is already attached to a menu.
sObjectNotAMember - The menu name was not valid.
sFailure - Failed to attach the plug-in to the menu.
statusCode AlFunctionHandle::removeFromMenu()
Description
This method removes the function handle from its previously attached menu.
Return codes
sFailure - the handle is not attached to a menu
sSuccess - the handle was removed from the menu
statusCode AlFunctionHandle::setIconPath( const char* path )
Description
Sets the pathname to load the icon files from. Normally icons are loaded from ALIAS_BITMAP_LOCATION. In the specified path, there should be two directories
small
medium
In the small/ directory, there should be an icon file ending in the function name followed by '.S' In the medium/ directory, there should be an icon file ending in the function name followed by '.M' For example, if the function name is 'MySphere' and the icon path is '/usr/myicons', then the following files should exist
/usr/myicons/small/MySphere.S
/usr/myicons/medium/MySphere.M
Return codes
sFailure - the path could not be set
sSuccess - the path was set for this function handle
statusCode AlFunctionHandle::setHelpFile( const char* file )
Description
Sets the filename to load the help file from.
Return codes
sFailure - the file could not be set
sSuccess - the file was set for this function handle
statusCode AlFunctionHandle::deleteObject()
Description
Removes the function handle from the menu and invalidates it.
Return codes
sFailure - the handle could not be removed from the menu.
sSuccess - the handle was successfully removed.
aliasdocs@aw.sgi.com
Copyright © 1996, Alias|Wavefront, a Silicon Graphics Company. All rights
reserved.