summaryrefslogtreecommitdiff
path: root/atspi/atspi-types.h
blob: 4486b5844ef29658c5dd333b3456ed40c3e9627b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
/*
 * AT-SPI - Assistive Technology Service Provider Interface
 * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
 *
 * Copyright 2002 Ximian, Inc.
 *           2002 Sun Microsystems Inc.
 *
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#ifndef _ATSPI_TYPES_H_
#define _ATSPI_TYPES_H_

#include "glib-object.h"

#include "atspi-constants.h"

/**
 * AtspiTypes:
 *
 * Type definitions needed by multiple interfaces.
 */

typedef struct _AtspiAccessible AtspiAccessible;
typedef struct _AtspiAction AtspiAction;
typedef struct _AtspiCollection AtspiCollection;
typedef struct _AtspiComponent AtspiComponent;
typedef struct _AtspiDocument AtspiDocument;
typedef struct _AtspiEditableText AtspiEditableText;
typedef struct _AtspiHyperlink AtspiHyperlink;
typedef struct _AtspiHypertext AtspiHypertext;
typedef struct _AtspiImage AtspiImage;
typedef struct _AtspiSelection AtspiSelection;
typedef struct _AtspiTable AtspiTable;
typedef struct _AtspiTableCell AtspiTableCell;
typedef struct _AtspiText AtspiText;
typedef struct _AtspiValue AtspiValue;

typedef guint AtspiControllerEventMask;

typedef guint AtspiKeyMaskType;

typedef guint AtspiKeyEventMask;
typedef guint AtspiDeviceEventMask;

// TODO: auto-generate the below structs
typedef struct _AtspiDeviceEvent AtspiDeviceEvent;
struct _AtspiDeviceEvent
{
  AtspiEventType type;
  guint id;
  gushort hw_code;
  gushort modifiers;
  guint timestamp;
  gchar *event_string;
  gboolean is_text;
};

typedef struct _AtspiEventListenerMode AtspiEventListenerMode;
struct _AtspiEventListenerMode
{
  gboolean synchronous;
  gboolean preemptive;
  gboolean global;
};

typedef struct _AtspiKeyDefinition AtspiKeyDefinition;
struct _AtspiKeyDefinition
{
  gint keycode;
  gint keysym;
  gchar *keystring;
  guint modifiers;
};

/**
 * ATSPI_TYPE_KEY_DEFINITION:
 *
 * The #GType for a boxed type holding a #AtspiKeyDefinition.
 */
#define ATSPI_TYPE_KEY_DEFINITION (atspi_key_definition_get_type ())

typedef struct _AtspiEvent AtspiEvent;
struct _AtspiEvent
{
  gchar *type;
  AtspiAccessible *source;
  gint detail1;
  gint detail2;
  GValue any_data;
  AtspiAccessible *sender;
};

/**
 * ATSPI_TYPE_DEVICE_EVENT:
 *
 * The #GType for a boxed type holding a #AtspiDeviceEvent.
 */
#define ATSPI_TYPE_DEVICE_EVENT (atspi_device_event_get_type ())

/**
 * ATSPI_TYPE_EVENT:
 *
 * The #GType for a boxed type holding a #AtspiEvent.
 */
#define ATSPI_TYPE_EVENT (atspi_event_get_type ())

typedef void AtspiKeystrokeListener;

/**
 * AtspiKeySet:
 * @keysyms:
 * @keycodes:
 * @len:
 *
 * Structure containing identifying information about a set of keycode or
 *        keysyms.
 **/
typedef struct _AtspiKeySet
{
  guint *keysyms;
  gushort *keycodes;
  gchar **keystrings;
  gshort len;
} AtspiKeySet;

/**
 * AtspiKeyListenerSyncType:
 * @ATSPI_KEYLISTENER_NOSYNC: 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.
 * @ATSPI_KEYLISTENER_SYNCHRONOUS: Events are delivered synchronously, before the
 * currently focused application sees them.
 * @ATSPI_KEYLISTENER_CANCONSUME: Events may be consumed by the AT client.  Presumes and
 * requires #ATSPI_KEYLISTENER_SYNCHRONOUS, incompatible with #ATSPI_KEYLISTENER_NOSYNC.
 * @ATSPI_KEYLISTENER_ALL_WINDOWS: 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.
 *
 * Specifies the type of a key listener event.
 * The values above can and should be bitwise-'OR'-ed
 * together, observing the compatibility limitations specified in the description of
 * each value.  For instance, #ATSPI_KEYLISTENER_ALL_WINDOWS | #ATSPI_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.
 **/
typedef enum
{
  ATSPI_KEYLISTENER_NOSYNC = 0,
  ATSPI_KEYLISTENER_SYNCHRONOUS = 1 << 0,
  ATSPI_KEYLISTENER_CANCONSUME = 1 << 1,
  ATSPI_KEYLISTENER_ALL_WINDOWS = 1 << 2
} AtspiKeyListenerSyncType;
#endif /* _ATSPI_TYPES_H_ */