Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:16

0001 /*
0002  * AT-SPI - Assistive Technology Service Provider Interface
0003  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
0004  *
0005  * Copyright 2020 SUSE LLC.
0006  *
0007  *
0008  * This library is free software; you can redistribute it and/or
0009  * modify it under the terms of the GNU Lesser General Public
0010  * License as published by the Free Software Foundation; either
0011  * version 2.1 of the License, or (at your option) any later version.
0012  *
0013  * This library is distributed in the hope that it will be useful,
0014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016  * Lesser General Public License for more details.
0017  *
0018  * You should have received a copy of the GNU Lesser General Public
0019  * License along with this library; if not, write to the
0020  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0021  * Boston, MA 02110-1301, USA.
0022  */
0023 
0024 #ifndef _ATSPI_DEVICE_H_
0025 #define _ATSPI_DEVICE_H_
0026 
0027 #include "glib-object.h"
0028 
0029 #include "atspi-types.h"
0030 
0031 G_BEGIN_DECLS
0032 
0033 #define ATSPI_TYPE_DEVICE (atspi_device_get_type ())
0034 #define ATSPI_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_TYPE_DEVICE, AtspiDevice))
0035 #define ATSPI_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATSPI_TYPE_DEVICE, AtspiDeviceClass))
0036 #define ATSPI_IS_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_TYPE_DEVICE))
0037 #define ATSPI_IS_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATSPI_TYPE_DEVICE))
0038 #define ATSPI_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATSPI_TYPE_DEVICE, AtspiDeviceClass))
0039 
0040 typedef struct _AtspiDevice AtspiDevice;
0041 struct _AtspiDevice
0042 {
0043   GObject parent;
0044 };
0045 
0046 typedef struct _AtspiDeviceClass AtspiDeviceClass;
0047 struct _AtspiDeviceClass
0048 {
0049   GObjectClass parent_class;
0050 
0051   gboolean (*add_key_grab) (AtspiDevice *device, AtspiKeyDefinition *kd);
0052   void (*remove_key_grab) (AtspiDevice *device, guint id);
0053   guint (*map_modifier) (AtspiDevice *device, gint keycode);
0054   void (*unmap_modifier) (AtspiDevice *device, gint keycode);
0055   guint (*get_modifier) (AtspiDevice *device, gint keycode);
0056   gboolean (*grab_keyboard) (AtspiDevice *device);
0057   void (*ungrab_keyboard) (AtspiDevice *device);
0058   guint (*get_locked_modifiers) (AtspiDevice *device);
0059   void (*generate_mouse_event) (AtspiDevice *device, AtspiAccessible *obj, gint x, gint y, const gchar *name, GError **error);
0060 };
0061 
0062 GType atspi_device_get_type (void);
0063 
0064 /**
0065  * AtspiKeyCallback:
0066  * @device: the device.
0067  * @pressed: TRUE if the key is being pressed, FALSE if being released.
0068  * @keycode: the hardware code for the key.
0069  * @keysym: the keysym for the key.
0070  * @modifiers: a bitflag indicating which key modifiers are active.
0071  * @keystring: the text corresponding to the keypress.
0072  * @user_data: (closure): user-supplied data
0073  *
0074  * A callback that will be invoked when a key is pressed.
0075  */
0076 typedef void (*AtspiKeyCallback) (AtspiDevice *device, gboolean pressed, guint keycode, guint keysym, guint modifiers, const gchar *keystring, void *user_data);
0077 
0078 AtspiDevice *atspi_device_new ();
0079 
0080 gboolean atspi_device_notify_key (AtspiDevice *device, gboolean pressed, int keycode, int keysym, gint state, const gchar *text);
0081 
0082 guint atspi_device_add_key_grab (AtspiDevice *device, AtspiKeyDefinition *kd, AtspiKeyCallback callback, void *user_data, GDestroyNotify callback_destroyed);
0083 
0084 void atspi_device_remove_key_grab (AtspiDevice *device, guint id);
0085 
0086 void atspi_device_add_key_watcher (AtspiDevice *device, AtspiKeyCallback callback, void *user_data, GDestroyNotify callback_destroyed);
0087 
0088 AtspiKeyDefinition *atspi_device_get_grab_by_id (AtspiDevice *device, guint id);
0089 
0090 guint atspi_device_map_modifier (AtspiDevice *device, gint keycode);
0091 
0092 void atspi_device_unmap_modifier (AtspiDevice *device, gint keycode);
0093 
0094 guint atspi_device_get_modifier (AtspiDevice *device, gint keycode);
0095 
0096 guint atspi_device_get_locked_modifiers (AtspiDevice *device);
0097 
0098 gboolean atspi_device_grab_keyboard (AtspiDevice *device);
0099 
0100 void atspi_device_ungrab_keyboard (AtspiDevice *device);
0101 
0102 void atspi_device_generate_mouse_event (AtspiDevice *device, AtspiAccessible *obj, gint x, gint y, const gchar *name, GError **error);
0103 
0104 G_END_DECLS
0105 
0106 #endif /* _ATSPI_DEVICE_H_ */