* object:column-deleted
* object:model-changed
*
+ * (window events)
+ *
+ * window:minimize
+ * window:maximize
+ * window:restore
+ * window:close
+ * window:create
+ * window:reparent
+ * window:desktop-create
+ * window:desktop-destroy
+ * window:focus-in
+ * window:focus-out
+ * window:raise
+ * window:lower
+ * window:move
+ * window:resize
+ * window:shade
+ * window:unshade
+ * window:restyle
+ *
* 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.
/**
* SPI_getDesktopList:
- * @list: a pointer to an array of #Accessible objects.
+ * @desktop_list: a pointer to an array of #Accessible references.
*
* Get the list of virtual desktops. On return, @list will point
- * to a newly-created array of virtual desktop pointers.
+ * 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.
*
* placed in the list pointed to by parameter @list.
**/
int
-SPI_getDesktopList (Accessible **list)
+SPI_getDesktopList (Accessible ***desktop_list)
+{
+ int i;
+ Accessible **list;
+ Accessibility_DesktopSeq *desktops;
+
+ if (!desktop_list)
+ return 0;
+
+ *desktop_list = NULL;
+
+ desktops = Accessibility_Registry_getDesktopList (cspi_registry (),
+ cspi_ev ());
+
+ cspi_return_val_if_ev ("getting desktop list", 0);
+
+ list = g_new0 (Accessible *, desktops->_length + 1);
+
+ for (i = 0; i < desktops->_length; i++)
+ {
+ list [i] = cspi_object_add (
+ CORBA_Object_duplicate (desktops->_buffer [i], cspi_ev ()));
+ }
+ list [i] = NULL;
+
+ CORBA_free (desktops);
+
+ *desktop_list = list;
+
+ return i;
+}
+
+/**
+ * SPI_freeDesktopList:
+ * @desktop_list: a pointer to an array of #Accessible objects
+ * as returned from @SPI_getDesktopList
+ *
+ * This routine frees the memory associated with the list.
+ **/
+void
+SPI_freeDesktopList (Accessible **desktop_list)
{
- *list = NULL;
- return 0;
+ Accessible **p;
+
+ for (p = desktop_list; p && *p; p++)
+ {
+ cspi_object_unref (*p);
+ }
+ g_free (desktop_list);
}
/**
* Returns: #TRUE if successful, otherwise #FALSE.
**/
SPIBoolean
-SPI_registerAccessibleKeystrokeListener (AccessibleKeystrokeListener *listener,
- AccessibleKeySet *keys,
- AccessibleKeyMaskType modmask,
- AccessibleKeyEventMask eventmask,
+SPI_registerAccessibleKeystrokeListener (AccessibleKeystrokeListener *listener,
+ AccessibleKeySet *keys,
+ AccessibleKeyMaskType modmask,
+ AccessibleKeyEventMask eventmask,
AccessibleKeyListenerSyncType sync_type)
{
gint i, mask;
Accessibility_KeyEventTypeSeq key_events;
Accessibility_ControllerEventMask controller_event_mask;
Accessibility_DeviceEventController device_event_controller;
+ Accessibility_EventListenerMode listener_mode;
if (!listener)
{
controller_event_mask = (CORBA_unsigned_long) modmask;
+ listener_mode.synchronous =
+ (CORBA_boolean) ((sync_type & SPI_KEYLISTENER_SYNCHRONOUS)!=0);
+ listener_mode.preemptive =
+ (CORBA_boolean) ((sync_type & SPI_KEYLISTENER_CANCONSUME)!=0);
+ listener_mode.global =
+ (CORBA_boolean) ((sync_type & SPI_KEYLISTENER_ALL_WINDOWS)!=0);
+
Accessibility_DeviceEventController_registerKeystrokeListener (
device_event_controller,
cspi_event_listener_get_corba (listener),
&key_set,
controller_event_mask,
&key_events,
- ((sync_type & SPI_KEYLISTENER_ALL_WINDOWS)!=0) ? CORBA_TRUE : CORBA_FALSE,
+ &listener_mode,
cspi_ev ());
cspi_return_val_if_ev ("registering keystroke listener", FALSE);
&key_set,
controller_event_mask,
&key_events,
- (CORBA_boolean) TRUE,
cspi_ev ());
cspi_release_unref (device_event_controller);
}
/**
- * SPI_generateKeyEvent:
+ * SPI_generateKeyboardEvent:
* @keyval: a long integer indicating the keycode or keysym of the key event
* being synthesized.
+ * @keystring: 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.
* @synth_type: a #AccessibleKeySynthType flag indicating whether @keyval
* is to be interpreted as a keysym rather than a keycode
* (CSPI_KEYSYM), or whether to synthesize
* Returns: #TRUE if successful, otherwise #FALSE.
**/
SPIBoolean
-SPI_generateKeyEvent (long int keyval, AccessibleKeySynthType synth_type)
+SPI_generateKeyboardEvent (long int keyval,
+ char *keystring,
+ AccessibleKeySynthType synth_type)
{
/* TODO: check current modifier status and
* send keycode to alter, if necessary
*/
+
+ /* TODO: implement keystring use case */
+ Accessibility_KeySynthType keysynth_type;
Accessibility_DeviceEventController device_event_controller =
Accessibility_Registry_getDeviceEventController (cspi_registry (), cspi_ev ());
- g_print ("keyval %d\n", (int) keyval);
- cspi_return_val_if_ev ("getting event controller", FALSE);
+ cspi_return_val_if_ev ("getting event controller for key event gen", FALSE);
+
+ switch (synth_type)
+ {
+ case SPI_KEY_PRESS:
+ keysynth_type = Accessibility_KEY_PRESS;
+ break;
+ case SPI_KEY_RELEASE:
+ keysynth_type = Accessibility_KEY_RELEASE;
+ break;
+ case SPI_KEY_PRESSRELEASE:
+ keysynth_type = Accessibility_KEY_PRESSRELEASE;
+ break;
+ case SPI_KEY_SYM:
+ keysynth_type = Accessibility_KEY_SYM;
+ break;
+ case SPI_KEY_STRING:
+ keysynth_type = Accessibility_KEY_STRING;
+ break;
+ default:
+ return FALSE;
+ }
+
+ Accessibility_DeviceEventController_generateKeyboardEvent (device_event_controller,
+ keyval,
+ "",
+ keysynth_type,
+ cspi_ev ());
- Accessibility_DeviceEventController_generateKeyEvent (device_event_controller,
- keyval,
- (unsigned long) synth_type,
- cspi_ev ());
+ cspi_return_val_if_ev ("generating keyboard event", FALSE);
cspi_release_unref (device_event_controller);