1/*
2 * AT-SPI - Assistive Technology Service Provider Interface
3 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4 *
5 * Copyright 2002 Ximian, Inc.
6 * 2002 Sun Microsystems Inc.
7 *
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the
21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301, USA.
23 */
24
25#ifndef _ATSPI_TYPES_H_
26#define _ATSPI_TYPES_H_
27
28#include "glib-object.h"
29
30#include "atspi-constants.h"
31
32/**
33 * AtspiTypes:
34 *
35 * Type definitions needed by multiple interfaces.
36 */
37
38typedef struct _AtspiAccessible AtspiAccessible;
39typedef struct _AtspiAction AtspiAction;
40typedef struct _AtspiCollection AtspiCollection;
41typedef struct _AtspiComponent AtspiComponent;
42typedef struct _AtspiDocument AtspiDocument;
43typedef struct _AtspiEditableText AtspiEditableText;
44typedef struct _AtspiHyperlink AtspiHyperlink;
45typedef struct _AtspiHypertext AtspiHypertext;
46typedef struct _AtspiImage AtspiImage;
47typedef struct _AtspiSelection AtspiSelection;
48typedef struct _AtspiTable AtspiTable;
49typedef struct _AtspiTableCell AtspiTableCell;
50typedef struct _AtspiText AtspiText;
51typedef struct _AtspiValue AtspiValue;
52
53typedef guint AtspiControllerEventMask;
54
55typedef guint AtspiKeyMaskType;
56
57typedef guint AtspiKeyEventMask;
58typedef guint AtspiDeviceEventMask;
59
60// TODO: auto-generate the below structs
61typedef struct _AtspiDeviceEvent AtspiDeviceEvent;
62struct _AtspiDeviceEvent
63{
64 AtspiEventType type;
65 guint id;
66 gushort hw_code;
67 gushort modifiers;
68 guint timestamp;
69 gchar *event_string;
70 gboolean is_text;
71};
72
73typedef struct _AtspiEventListenerMode AtspiEventListenerMode;
74struct _AtspiEventListenerMode
75{
76 gboolean synchronous;
77 gboolean preemptive;
78 gboolean global;
79};
80
81typedef struct _AtspiKeyDefinition AtspiKeyDefinition;
82struct _AtspiKeyDefinition
83{
84 gint keycode;
85 gint keysym;
86 gchar *keystring;
87 guint modifiers;
88};
89
90/**
91 * ATSPI_TYPE_KEY_DEFINITION:
92 *
93 * The #GType for a boxed type holding a #AtspiKeyDefinition.
94 */
95#define ATSPI_TYPE_KEY_DEFINITION (atspi_key_definition_get_type ())
96
97typedef struct _AtspiEvent AtspiEvent;
98struct _AtspiEvent
99{
100 gchar *type;
101 AtspiAccessible *source;
102 gint detail1;
103 gint detail2;
104 GValue any_data;
105 AtspiAccessible *sender;
106};
107
108/**
109 * ATSPI_TYPE_DEVICE_EVENT:
110 *
111 * The #GType for a boxed type holding a #AtspiDeviceEvent.
112 */
113#define ATSPI_TYPE_DEVICE_EVENT (atspi_device_event_get_type ())
114
115/**
116 * ATSPI_TYPE_EVENT:
117 *
118 * The #GType for a boxed type holding a #AtspiEvent.
119 */
120#define ATSPI_TYPE_EVENT (atspi_event_get_type ())
121
122typedef void AtspiKeystrokeListener;
123
124/**
125 * AtspiKeySet:
126 * @keysyms:
127 * @keycodes:
128 * @len:
129 *
130 * Structure containing identifying information about a set of keycode or
131 * keysyms.
132 **/
133typedef struct _AtspiKeySet
134{
135 guint *keysyms;
136 gushort *keycodes;
137 gchar **keystrings;
138 gshort len;
139} AtspiKeySet;
140
141/**
142 * AtspiKeyListenerSyncType:
143 * @ATSPI_KEYLISTENER_NOSYNC: Events may be delivered asynchronously,
144 * which means in some cases they may already have been delivered to the
145 * application before the AT client receives the notification.
146 * @ATSPI_KEYLISTENER_SYNCHRONOUS: Events are delivered synchronously, before the
147 * currently focused application sees them.
148 * @ATSPI_KEYLISTENER_CANCONSUME: Events may be consumed by the AT client. Presumes and
149 * requires #ATSPI_KEYLISTENER_SYNCHRONOUS, incompatible with #ATSPI_KEYLISTENER_NOSYNC.
150 * @ATSPI_KEYLISTENER_ALL_WINDOWS: Events are received not from the application toolkit layer, but
151 * from the device driver or windowing system subsystem; such notifications are 'global' in the
152 * sense that they are not broken or defeated by applications that participate poorly
153 * in the accessibility APIs, or not at all; however because of the intrusive nature of
154 * such snooping, it can have side-effects on certain older platforms. If unconditional
155 * event notifications, even when inaccessible or "broken" applications have focus, are not
156 * required, it may be best to avoid this enum value/flag.
157 *
158 * Specifies the type of a key listener event.
159 * The values above can and should be bitwise-'OR'-ed
160 * together, observing the compatibility limitations specified in the description of
161 * each value. For instance, #ATSPI_KEYLISTENER_ALL_WINDOWS | #ATSPI_KEYLISTENER_CANCONSUME is
162 * a commonly used combination which gives the AT complete control over the delivery of matching
163 * events. However, such filters should be used sparingly as they may have a negative impact on
164 * system performance.
165 **/
166typedef enum
167{
168 ATSPI_KEYLISTENER_NOSYNC = 0,
169 ATSPI_KEYLISTENER_SYNCHRONOUS = 1 << 0,
170 ATSPI_KEYLISTENER_CANCONSUME = 1 << 1,
171 ATSPI_KEYLISTENER_ALL_WINDOWS = 1 << 2
172} AtspiKeyListenerSyncType;
173#endif /* _ATSPI_TYPES_H_ */
174

source code of include/at-spi-2.0/atspi/atspi-types.h