AlXevents
 
 
 

X event interface to the Alias API. ( This class is not available on NT.)

Synopsis

#include <AlXevents.h>
class AlXevents
static statusCode	installHandler( int (*)( XEvent* ) );
static statusCode 	uninstallHandler( int (*)( XEvent* ) );
static XtAppContext	getXtAppContext( void );
static Widget	getAppShell( void );
static statusCode	addXdevice( const char *, int (*)(Widget, XDeviceInfoPtr) );
static statusCode	getXdevID( const char *, int& );
static statusCode	getXdevType( const char *, const char *, int& );
static statusCode	getXdevice( const char *,  XDevice ** );
static statusCode	addXdevID( const char *, XDevice *, int );
static statusCode	addXdevType( char *, const char *, int, int );
static statusCode	applicationNotify();
static boolean	belowAliasWindow( Widget );

Description

This static class contains methods to handle custom X event handling in the Alias API.

statusCode AlXevents::applicationNotify()

Description

Called by an interrupt handler to notify Alias that the handler has serviced the interrupt.

statusCode AlXevents::installHandler( int (*func)( XEvent* ) )

Description

Adds a callback handler for X events. The handler function will be passed every X event before Alias handles it. If the callback handler returns 0, then Alias will ignore the event. If it returns 1, then Alias will handle the event normally.

Arguments

func - callback pointer

Return Codes

sInvalidArgument - ’func’ was NULL

sSuccess - the event handler was installed

sFailure - the event handler was not installed

statusCode AlXevents::uninstallHandler( int (*func)( XEvent* ) )

Description

Removes a callback handler for X events.

Arguments

func - callback pointer to an installed handler

Return Codes

sInvalidArgument - ’func’ was NULL

sSuccess - the event handler was uninstalled

sFailure - the event handler could not be found

XtAppContext AlXevents::getXtAppContext( void )

Description

Returns Alias’ XtAppContext.

Widget AlXevents::getAppShell( void )

Description

Returns the application shell widget used by Alias. This widget should be used as a top level shell when creating custom dialog widgets for user interface interaction. Alias is responsible for processing and dispatching all events.

statusCode AlXevents::addXdevice( const char * name,int (*devXopen)(Widget, XDeviceInfoPtr) )

Description

Adds the named X device to the list of Alias devices.

Arguments

< name - the name of the device

< devXopen - function to call on opening of device

Return Codes

sInvalidArgument - name was NULL

sSuccess - the value was returned

sFailure - the variable could not be found

statusCode AlXevents::getXdevID( const char * dev, int& value )

Description

Retrieves the value of the named device from the Alias device list.

Arguments

< name - the name of the device

> value - the returned value

Return Codes

sInvalidArgument - name was NULL

sSuccess - the value was returned

sFailure - the variable could not be found

statusCode AlXevents::getXdevType( const char * dev, const char * event, int& value )

Description

Retrieves the value of the named device event from the Alias device list.

Arguments

< name - the name of the device

< event - the name of the event ID wanted

> value - the returned value

Return Codes

sInvalidArgument - name was NULL

sSuccess - the value was returned

sFailure - the variable could not be found

statusCode AlXevents::getXdevice( const char * dev, XDevice **xdev )

Description

Retrieves the value of the named device from the Alias device list.

Arguments

< name - the name of the device

> xdev - pointer to the XDevice structure

Return Codes

sInvalidArgument - name was NULL

sSuccess - the value was returned

sFailure - the variable could not be found

statusCode AlXevents::addXdevID( const char *name, XDevice *xdev, int dev_id )

Description

Adds the named device to the Alias device list.

Arguments

< name - the name of the device

< xdev - pointer to the XDevice structure

< dev_id - X device ID

Return Codes

sInvalidArgument - name was NULL

sSuccess - the value was returned

sFailure - the variable could not be found

statusCode AlXevents::addXdevType( char *name, const char *type,int type_id, int class_id )

Description

Adds the named device event to the Alias device list.

Arguments

< name - the name of the device

< event - the name of the event ID wanted

< type id - the event type to add

< class id - the event class to add

Return Codes

sInvalidArgument - name was NULL

sSuccess - the value was returned

sFailure - the variable could not be found

boolean AlXevents::belowAliasWindow( Widget w )

Description

Returns TRUE if Widget w is lower than the Alias window. Otherwise FALSE is returned.