]> Pileus Git - ~andy/gtk/blob - gdk/gdkinput.h
Merges from gtk-1-2
[~andy/gtk] / gdk / gdkinput.h
1 #ifndef __GDK_INPUT_H__
2 #define __GDK_INPUT_H__
3
4 #include <gdk/gdktypes.h>
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif /* __cplusplus */
9
10 typedef struct _GdkDeviceKey        GdkDeviceKey;
11 typedef struct _GdkDeviceInfo       GdkDeviceInfo;
12 typedef struct _GdkTimeCoord        GdkTimeCoord;
13
14 typedef enum
15 {
16   GDK_EXTENSION_EVENTS_NONE,
17   GDK_EXTENSION_EVENTS_ALL,
18   GDK_EXTENSION_EVENTS_CURSOR
19 } GdkExtensionMode;
20
21 typedef enum
22 {
23   GDK_SOURCE_MOUSE,
24   GDK_SOURCE_PEN,
25   GDK_SOURCE_ERASER,
26   GDK_SOURCE_CURSOR
27 } GdkInputSource;
28
29 typedef enum
30 {
31   GDK_MODE_DISABLED,
32   GDK_MODE_SCREEN,
33   GDK_MODE_WINDOW
34 } GdkInputMode;
35
36 typedef enum
37 {
38   GDK_AXIS_IGNORE,
39   GDK_AXIS_X,
40   GDK_AXIS_Y,
41   GDK_AXIS_PRESSURE,
42   GDK_AXIS_XTILT,
43   GDK_AXIS_YTILT,
44   GDK_AXIS_LAST
45 } GdkAxisUse;
46
47 struct _GdkDeviceInfo
48 {
49   guint32 deviceid;
50   gchar *name;
51   GdkInputSource source;
52   GdkInputMode mode;
53   gint has_cursor;      /* TRUE if the X pointer follows device motion */
54   gint num_axes;
55   GdkAxisUse *axes;    /* Specifies use for each axis */
56   gint num_keys;
57   GdkDeviceKey *keys;
58 };
59
60 struct _GdkDeviceKey
61 {
62   guint keyval;
63   GdkModifierType modifiers;
64 };
65
66 struct _GdkTimeCoord
67 {
68   guint32 time;
69   gdouble x;
70   gdouble y;
71   gdouble pressure;
72   gdouble xtilt;
73   gdouble ytilt;
74 };
75
76 GList *       gdk_input_list_devices         (void);
77 void          gdk_input_set_extension_events (GdkWindow        *window,
78                                               gint              mask,
79                                               GdkExtensionMode  mode);
80 void          gdk_input_set_source           (guint32           deviceid,
81                                               GdkInputSource    source);
82 gboolean      gdk_input_set_mode             (guint32           deviceid,
83                                               GdkInputMode      mode);
84 void          gdk_input_set_axes             (guint32           deviceid,
85                                               GdkAxisUse       *axes);
86 void          gdk_input_set_key              (guint32           deviceid,
87                                               guint             index,
88                                               guint             keyval,
89                                               GdkModifierType   modifiers);
90 void          gdk_input_window_get_pointer   (GdkWindow        *window,
91                                               guint32           deviceid,
92                                               gdouble          *x,
93                                               gdouble          *y,
94                                               gdouble          *pressure,
95                                               gdouble          *xtilt,
96                                               gdouble          *ytilt,
97                                               GdkModifierType  *mask);
98 GdkTimeCoord *gdk_input_motion_events        (GdkWindow        *window,
99                                               guint32           deviceid,
100                                               guint32           start,
101                                               guint32           stop,
102                                               gint             *nevents_return);
103
104 #ifdef __cplusplus
105 }
106 #endif /* __cplusplus */
107
108 #endif /* __GDK_INPUT_H__ */