summaryrefslogtreecommitdiff
path: root/gdk/gdkinput.h
blob: 35550b2655f0288ea208b4480fed8dbae8b6fab3 (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
#ifndef __GDK_INPUT_H__
#define __GDK_INPUT_H__

#include <gdk/gdktypes.h>

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

typedef struct _GdkDeviceKey	    GdkDeviceKey;
typedef struct _GdkDeviceInfo	    GdkDeviceInfo;
typedef struct _GdkTimeCoord	    GdkTimeCoord;

typedef enum
{
  GDK_EXTENSION_EVENTS_NONE,
  GDK_EXTENSION_EVENTS_ALL,
  GDK_EXTENSION_EVENTS_CURSOR
} GdkExtensionMode;

typedef enum
{
  GDK_SOURCE_MOUSE,
  GDK_SOURCE_PEN,
  GDK_SOURCE_ERASER,
  GDK_SOURCE_CURSOR
} GdkInputSource;

typedef enum
{
  GDK_MODE_DISABLED,
  GDK_MODE_SCREEN,
  GDK_MODE_WINDOW
} GdkInputMode;

typedef enum
{
  GDK_AXIS_IGNORE,
  GDK_AXIS_X,
  GDK_AXIS_Y,
  GDK_AXIS_PRESSURE,
  GDK_AXIS_XTILT,
  GDK_AXIS_YTILT,
  GDK_AXIS_LAST
} GdkAxisUse;

struct _GdkDeviceInfo
{
  guint32 deviceid;
  gchar *name;
  GdkInputSource source;
  GdkInputMode mode;
  gint has_cursor;	/* TRUE if the X pointer follows device motion */
  gint num_axes;
  GdkAxisUse *axes;    /* Specifies use for each axis */
  gint num_keys;
  GdkDeviceKey *keys;
};

struct _GdkDeviceKey
{
  guint keyval;
  GdkModifierType modifiers;
};

struct _GdkTimeCoord
{
  guint32 time;
  gdouble x;
  gdouble y;
  gdouble pressure;
  gdouble xtilt;
  gdouble ytilt;
};

GList *       gdk_input_list_devices         (void);
void          gdk_input_set_extension_events (GdkWindow        *window,
					      gint              mask,
					      GdkExtensionMode  mode);
void          gdk_input_set_source           (guint32           deviceid,
					      GdkInputSource    source);
gboolean      gdk_input_set_mode             (guint32           deviceid,
					      GdkInputMode      mode);
void          gdk_input_set_axes             (guint32           deviceid,
					      GdkAxisUse       *axes);
void          gdk_input_set_key              (guint32           deviceid,
					      guint             index,
					      guint             keyval,
					      GdkModifierType   modifiers);
void          gdk_input_window_get_pointer   (GdkWindow        *window,
					      guint32           deviceid,
					      gdouble          *x,
					      gdouble          *y,
					      gdouble          *pressure,
					      gdouble          *xtilt,
					      gdouble          *ytilt,
					      GdkModifierType  *mask);
GdkTimeCoord *gdk_input_motion_events        (GdkWindow        *window,
					      guint32           deviceid,
					      guint32           start,
					      guint32           stop,
					      gint             *nevents_return);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __GDK_INPUT_H__ */