| AT-SPI C Bindings Reference Manual | ||||
|---|---|---|---|---|
enum AccessibleKeySynthType;int SPI_getDesktopCount (void); Accessible * SPI_getDesktop (int i);int SPI_getDesktopList (Accessible ***desktop_list);void SPI_freeDesktopList (Accessible **desktop_list);SPIBoolean (*AccessibleKeystrokeListenerCB) (const AccessibleKeystroke *stroke,void *user_data); typedef AccessibleKeyEventMask; typedef AccessibleModifierMaskType; typedef AccessibleKeyMaskType; typedef AccessibleKeyEventType; enum AccessibleKeyListenerSyncType; typedef AccessibleKeystroke;AccessibleKeySet * SPI_createAccessibleKeySet (int len, constchar *keysyms,short *keycodes, constchar **keystrings);void SPI_freeAccessibleKeySet (AccessibleKeySet *keyset);AccessibleKeystrokeListener * SPI_createAccessibleKeystrokeListener (AccessibleKeystrokeListenerCB callback,void *user_data);SPIBoolean SPI_registerGlobalEventListener (AccessibleEventListener *listener, constchar *eventType);SPIBoolean SPI_deregisterGlobalEventListener (AccessibleEventListener *listener, constchar *eventType);SPIBoolean SPI_deregisterGlobalEventListenerAll (AccessibleEventListener *listener);SPIBoolean SPI_registerAccessibleKeystrokeListener (AccessibleKeystrokeListener *listener,AccessibleKeySet *keys, AccessibleKeyMaskType modmask, AccessibleKeyEventMask eventmask, AccessibleKeyListenerSyncType sync_type);SPIBoolean SPI_deregisterAccessibleKeystrokeListener (AccessibleKeystrokeListener *listener, AccessibleKeyMaskType modmask);void AccessibleKeystrokeListener_unref (AccessibleKeystrokeListener *listener);SPIBoolean AccessibleKeystrokeListener_removeCallback (AccessibleKeystrokeListener *listener, AccessibleKeystrokeListenerCB callback);SPIBoolean AccessibleKeystrokeListener_addCallback (AccessibleKeystrokeListener *listener, AccessibleKeystrokeListenerCB callback,void *user_data);SPIBoolean SPI_generateKeyboardEvent (longint keyval,char *keystring, AccessibleKeySynthType synth_type);SPIBoolean SPI_generateMouseEvent (longint x, longint y,char *name); AccessibleDeviceEvent; typedef AccessibleDeviceEventMask; enum AccessibleDeviceEventType;SPIBoolean (*AccessibleDeviceListenerCB) (const AccessibleDeviceEvent *stroke,void *user_data);AccessibleDeviceListener * SPI_createAccessibleDeviceListener (AccessibleDeviceListenerCB callback,void *user_data);SPIBoolean SPI_registerDeviceEventListener (AccessibleDeviceListener *listener, AccessibleDeviceEventMask eventmask,void *filter);SPIBoolean SPI_deregisterDeviceEventListener (AccessibleDeviceListener *listener,void *filter);SPIBoolean AccessibleDeviceListener_addCallback (AccessibleDeviceListener *listener, AccessibleDeviceListenerCB callback,void *user_data);SPIBoolean AccessibleDeviceListener_removeCallback (AccessibleDeviceListener *listener, AccessibleDeviceListenerCB callback);void AccessibleDeviceListener_unref (AccessibleDeviceListener *listener);
typedef enum {
SPI_KEY_PRESS,
SPI_KEY_RELEASE,
SPI_KEY_PRESSRELEASE,
SPI_KEY_SYM,
SPI_KEY_STRING
} AccessibleKeySynthType;
Specifies the type of a generated event.
| Generates a keypress event (requires a subsequent SPI_KEY_RELEASE event) | |
| Generates a key-release event | |
| Generates a key press/release event pair. | |
| Injects a "keysym" event into the stream, as if a press/release pair occurred; allows the user to specify the key via its symbolic name, as opposed to simulating a hardware press of a specific key. | |
| Injects one or more keysym events into the keyboard buffer, or directly inserts a string value into the currently focussed text widget, if the widgets supports this. SPI_KEY_STRING synthesis provides a shortcut for text substring insertion, and also allows the insertion of text which is not currently available via the current keyboard's keymap. |
int SPI_getDesktopCount (void);
Get the number of virtual desktops. NOTE: currently multiple virtual desktops are not implemented, this function always returns '1'.
Returns : |
an integer indicating the number of active virtual desktops. |
Accessible * SPI_getDesktop (int i);
Get the virtual desktop indicated by index i.
NOTE: currently multiple virtual desktops are not implemented, this
function always returns '1'.
|
an integer indicating which of the accessible desktops is to be returned. |
Returns : |
a pointer to the 'i-th' virtual desktop's Accessible representation. |
int SPI_getDesktopList (Accessible ***desktop_list);
Get the list of virtual desktops. On return, list will point
to a newly-created, NULL terminated array of virtual desktop
pointers.
It is the responsibility of the caller to free this array when
it is no longer needed.
Not Yet Implemented : this implementation always returns a single Accessible desktop.
|
a pointer to an array of Accessible references. |
Returns : |
an integer indicating how many virtual desktops have been
placed in the list pointed to by parameter list.
|
void SPI_freeDesktopList (Accessible **desktop_list);
This routine frees the memory associated with the list.
|
a pointer to an array of Accessible objects
as returned from SPI_getDesktopList
|
SPIBoolean (*AccessibleKeystrokeListenerCB) (const AccessibleKeystroke *stroke,void *user_data);
A function prototype for a callback function called when a key event notification takes place.
This is a function which is specified when creating a KeystrokeListener. It is called when an event being listened for occurs. If it returns TRUE, this indicates that the event should be consumed rather than passed through; only callbacks whose listeners are registered with the SPI_KEYLISTENER_ALL_WINDOWS or SPI_KEYLISTENER_CANCONSUME flags can be consumed.
|
the AccessibleKeystroke event for which notification is taking place. |
|
data passed to the callback each time it is notified, according to the data which was passed in when the listener/callback was registered. |
Returns : |
TRUE |
typedef unsigned long AccessibleKeyEventMask;
AccessibleKeyEventMask is a set of types of key events. It is used in SPI_registerAccessibleKeystroketListener to specify the events to be listener for.
typedef unsigned long AccessibleModifierMaskType;
AccessibleModifierMaskType is a synonym for AccessibleKeymaskType. The defined values for AccessibleModifierMaskType can be found in libspi/keymasks.h.
typedef AccessibleModifierMaskType AccessibleKeyMaskType;
AccessibleKeyMaskType is a mask which is a set of key event modifiers which is specified in SPI_registerAccessibleKeystrokeListener.
typedef AccessibleDeviceEventType AccessibleKeyEventType;
This is a synonym for AccessibleDeviceEventType
typedef enum {
SPI_KEYLISTENER_NOSYNC = 0,
SPI_KEYLISTENER_SYNCHRONOUS = 1,
SPI_KEYLISTENER_CANCONSUME = 2,
SPI_KEYLISTENER_ALL_WINDOWS = 4
} AccessibleKeyListenerSyncType;
Specified the tyupe of a key listener event. Certain of the values above can and should be bitwise-'OR'ed together, observing the compatibility limitations specified in the description of each value. For instance, SPI_KEYLISTENER_ALL_WINDOWS | SPI_KEYLISTENER_CANCONSUME is a commonly used combination which gives the AT complete control over the delivery of matching events. However, such filters should be used sparingly as they may have a negative impact on system performance.
| Events may be delivered asynchronously, which means in some cases they may already have been delivered to the application before the AT client receives the notification. | |
| Events are delivered synchronously, before the currently focussed application sees them. | |
| Events may be consumed by the AT client. Presumes and requires SPI_KEYLISTENER_SYNCHRONOUS, incompatible with SPI_KEYLISTENER_NOSYNC. | |
| Events are received not from the application toolkit layer, but from the device driver or windowing system subsystem; such notifications are 'global' in the sense that they are not broken or defeated by applications that participate poorly in the accessibility APIs, or not at all; however because of the intrusive nature of such snooping, it can have side-effects on certain older platforms. If unconditional event notifications, even when inaccessible or "broken" applications have focus, are not required, it may be best to avoid this enum value/flag. |
typedef AccessibleDeviceEvent AccessibleKeystroke;
This is a synonym for AccessibleDeviceEvent.
AccessibleKeySet * SPI_createAccessibleKeySet (int len, constchar *keysyms,short *keycodes, constchar **keystrings);
Create a new
|
the number of key values in the key set. |
|
a UTF-8 string containing symbolic key values to be matched, or NULL if matching is performed against other key values instead. |
|
an array of unsigned short values which are the hardware keycodes to be matched, or NULL if the keyset is specified solely by keysyms and/or keystrings. |
|
an array of null-terminated character strings which specify key name values to match, or NULL if the keyset is specified solely by keycodes and/or keysyms. |
Returns : |
a pointer to a newly-created |
void SPI_freeAccessibleKeySet (AccessibleKeySet *keyset);
Release the memory used by an AccessibleKeySet.
|
An AccessibleKeyset to free. |
AccessibleKeystrokeListener * SPI_createAccessibleKeystrokeListener (AccessibleKeystrokeListenerCB callback,void *user_data);
Create a new
|
an AccessibleKeystrokeListenerCB callback function, or NULL. |
|
a pointer to data which will be passed to the callback when invoked. |
Returns : |
a pointer to a newly-created |
SPIBoolean SPI_registerGlobalEventListener (AccessibleEventListener *listener, constchar *eventType);
Legal object event types:
(property change events)
object:property-change object:property-change:accessible-name object:property-change:accessible-description object:property-change:accessible-parent object:property-change:accessible-value object:property-change:accessible-role object:property-change:accessible-table-caption object:property-change:accessible-table-column-description object:property-change:accessible-table-column-header object:property-change:accessible-table-row-description object:property-change:accessible-table-row-header object:property-change:accessible-table-summary
(other object events)
object:state-changed object:children-changed object:visible-data-changed object:selection-changed object:text-selection-changed object:text-changed object:text-caret-moved object:row-inserted object:row-reordered object:row-deleted object:column-inserted object:column-reordered object:column-deleted object:model-changed object:active-descendant-changed
(window events)
window:minimize window:maximize window:restore window:close window:create window:reparent window:desktop-create window:desktop-destroy window:activate window:deactivate window:raise window:lower window:move window:resize window:shade window:unshade window:restyle
(other events)
focus: mouse:abs mouse:rel mouse:b1p mouse:b1r mouse:b2p mouse:b2r mouse:b3p mouse:b3r
NOTE: this string may be UTF-8, but should not contain byte value 56 (ascii ':'), except as a delimiter, since non-UTF-8 string delimiting functions are used internally. In general, listening to toolkit-specific events is not recommended.
Add an in-process callback function to an existing AccessibleEventListener.
|
the |
|
a character string indicating the type of events for which notification is requested. Format is EventClass:major_type:minor_type:detail where all subfields other than EventClass are optional. EventClasses include "object", "window", "mouse", and toolkit events (e.g. "Gtk", "AWT"). Examples: "focus:", "Gtk:GtkWidget:button-press-event". |
Returns : |
|
SPIBoolean SPI_deregisterGlobalEventListener (AccessibleEventListener *listener, constchar *eventType);
deregisters an AccessibleEventListener from the registry, for a specific event type.
|
the |
|
a string specifying the event type for which this listener is to be deregistered. |
Returns : |
|
SPIBoolean SPI_deregisterGlobalEventListenerAll (AccessibleEventListener *listener);
deregisters an AccessibleEventListener from the registry, for all event types it may be listening to. Use AccessibleEventListener_unref to release the listener reference.
|
the |
Returns : |
|
SPIBoolean SPI_registerAccessibleKeystrokeListener (AccessibleKeystrokeListener *listener,AccessibleKeySet *keys, AccessibleKeyMaskType modmask, AccessibleKeyEventMask eventmask, AccessibleKeyListenerSyncType sync_type);
Register a listener for keystroke events, either pre-emptively for
all windows (SPI_KEYLISTENER_ALL_WINDOWS),
non-preemptively (SPI_KEYLISTENER_NOSYNC), or
pre-emptively at the toolkit level (SPI_KEYLISTENER_CANCONSUME).
If ALL_WINDOWS or CANCONSUME are used, the event is consumed
upon receipt if one of listener's callbacks returns
|
a pointer to the |
|
a pointer to the |
|
an AccessibleKeyMaskType mask indicating which
key event modifiers must be set in combination with keys,
events will only be reported for key events for which all
modifiers in modmask are set. If you wish to listen for
events with multiple modifier combinations you must call
registerAccessibleKeystrokeListener() |
|
an AccessibleKeyMaskType mask indicating which types of key events are requested (SPI_KEY_PRESSED, etc.). |
|
a AccessibleKeyListenerSyncType parameter indicating the behavior of the notification/listener transaction. |
Returns : |
|
SPIBoolean SPI_deregisterAccessibleKeystrokeListener (AccessibleKeystrokeListener *listener, AccessibleKeyMaskType modmask);
Removes a keystroke event listener from the registry's listener queue,
ceasing notification of events with modifiers matching modmask.
|
a pointer to the |
|
the key modifier mask for which this listener is to be
'deregistered' (of type |
Returns : |
|
void AccessibleKeystrokeListener_unref (AccessibleKeystrokeListener *listener);
Decrements an
|
a pointer to the |
SPIBoolean AccessibleKeystrokeListener_removeCallback (AccessibleKeystrokeListener *listener, AccessibleKeystrokeListenerCB callback);
Remove an in-process callback function from an existing
|
the |
|
an AccessibleKeystrokeListenerCB function pointer. |
Returns : |
|
SPIBoolean AccessibleKeystrokeListener_addCallback (AccessibleKeystrokeListener *listener, AccessibleKeystrokeListenerCB callback,void *user_data);
Add an in-process callback function to an existing
|
the |
|
an AccessibleKeystrokeListenerCB function pointer. |
|
a pointer to data which will be passed to the callback when invoked. |
Returns : |
|
SPIBoolean SPI_generateKeyboardEvent (longint keyval,char *keystring, AccessibleKeySynthType synth_type);
Synthesize a keyboard event (as if a hardware keyboard event occurred in the current UI context).
|
a long integer indicating the keycode or keysym of the key event being synthesized. |
|
an (optional) UTF-8 string which, if keyval is NULL,
indicates a 'composed' keyboard input string which is
being synthesized; this type of keyboard event synthesis does
not emulate hardware keypresses but injects the string
as though a composing input method (such as XIM) were used.
|
|
a AccessibleKeySynthType flag indicating whether keyval
is to be interpreted as a keysym rather than a keycode
(CSPI_KEYSYM), or whether to synthesize
SPI_KEY_PRESS, SPI_KEY_RELEASE, or both (SPI_KEY_PRESSRELEASE).
|
Returns : |
|
SPIBoolean SPI_generateMouseEvent (longint x, longint y,char *name);
Synthesize a mouse event at a specific screen coordinate.
Most AT clients should use the
|
a |
|
a |
|
a string indicating which mouse event to be synthesized (e.g. "b1p", "b1c", "b2r", "rel", "abs"). |
Returns : |
|
typedef struct {
long keyID;
short keycode;
char * keystring;
long timestamp;
AccessibleDeviceEventType type;
unsigned short modifiers;
SPIBoolean is_text;
} AccessibleDeviceEvent;
A structure encapsulating information relevant to a device event notification.
AccessibleDeviceEvent is a struct which encapsulates a device event.
|
A symbolic name for the key or switch, or, if is_text is true, a string approximating the inserted text characters which would result from this event, if a text entry field has keyboard focus. |
| The AccessibleDeviceEventType identifying the specific type of event. | |
unsigned |
|
|
A boolean value indicating whether the event represents 'printable' text (i.e. whether it changes the current insertion buffer of a focussed text entry component or not). Whitespace is considered "printable" in this context, since it typically inserts characters into the buffer. |
typedef unsigned long AccessibleDeviceEventMask;
AccessibleDeviceEventMask is a set of types of key events. It is used in SPI_registerDeviceEventListener to specify the events to be listener for.
typedef enum {
SPI_KEY_PRESSED = 1<<0,
SPI_KEY_RELEASED = 1<<1,
SPI_BUTTON_PRESSED = 1<<2,
SPI_BUTTON_RELEASED = 1<<3
} AccessibleDeviceEventType;
The type of an AccessibleDeviceEvent.
SPIBoolean (*AccessibleDeviceListenerCB) (const AccessibleDeviceEvent *stroke,void *user_data);
A callback function prototype via which clients receive device event notifications.
This is a function which is specified when creating a DeviceListener. It is called when an event being listened for occurs.
|
The AccessibleDeviceEvent for which notification is being received. |
|
Data which is passed to the client each time this callback is notified. |
Returns : |
TRUEFALSE |
AccessibleDeviceListener * SPI_createAccessibleDeviceListener (AccessibleDeviceListenerCB callback,void *user_data);
Create a new
|
an AccessibleDeviceListenerCB callback function, or NULL. |
|
a pointer to data which will be passed to the callback when invoked. |
Returns : |
a pointer to a newly-created |
SPIBoolean SPI_registerDeviceEventListener (AccessibleDeviceListener *listener, AccessibleDeviceEventMask eventmask,void *filter);
Register a listener for device events, for instance button events.
|
a pointer to the |
|
an AccessibleDeviceEventMask mask indicating which types of key events are requested (SPI_KEY_PRESSED, etc.). |
|
Unused parameter. |
Returns : |
|
SPIBoolean SPI_deregisterDeviceEventListener (AccessibleDeviceListener *listener,void *filter);
Removes a device event listener from the registry's listener queue, ceasing notification of events of the specified type.
|
a pointer to the |
|
Unused parameter. |
Returns : |
|
SPIBoolean AccessibleDeviceListener_addCallback (AccessibleDeviceListener *listener, AccessibleDeviceListenerCB callback,void *user_data);
Add an in-process callback function to an existing
|
the |
|
an AccessibleDeviceListenerCB function pointer. |
|
a pointer to data which will be passed to the callback when invoked. |
Returns : |
|
SPIBoolean AccessibleDeviceListener_removeCallback (AccessibleDeviceListener *listener, AccessibleDeviceListenerCB callback);
Remove an in-process callback function from an existing
|
the |
|
an AccessibleDeviceListenerCB function pointer. |
Returns : |
|