gdkdevice.h 4.48 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* GDK - The GIMP Drawing Kit
 * Copyright (C) 2009 Carlos Garnacho <carlosg@gnome.org>
 *
 * 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 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
Javier Jardón's avatar
Javier Jardón committed
15
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16
17
 */

18
19
20
#ifndef __GDK_DEVICE_H__
#define __GDK_DEVICE_H__

21
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
22
23
24
#error "Only <gdk/gdk.h> can be included directly."
#endif

25
#include <gdk/gdkversionmacros.h>
26
#include <gdk/gdktypes.h>
Matthias Clasen's avatar
Matthias Clasen committed
27
#include <gdk/gdkdevicetool.h>
Benjamin Otte's avatar
Benjamin Otte committed
28
#include <gdk/gdkenums.h>
29
30
31
32
33
34
35
36
37
38
39
40
41


G_BEGIN_DECLS

#define GDK_TYPE_DEVICE         (gdk_device_get_type ())
#define GDK_DEVICE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE, GdkDevice))
#define GDK_IS_DEVICE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE))

typedef struct _GdkTimeCoord GdkTimeCoord;

/**
 * GdkInputSource:
 * @GDK_SOURCE_MOUSE: the device is a mouse. (This will be reported for the core
Matthias Clasen's avatar
Matthias Clasen committed
42
 *   pointer, even if it is something else, such as a trackball.)
43
44
 * @GDK_SOURCE_PEN: the device is a stylus of a graphics tablet or similar device.
 * @GDK_SOURCE_KEYBOARD: the device is a keyboard.
45
 * @GDK_SOURCE_TOUCHSCREEN: the device is a direct-input touch device, such
Matthias Clasen's avatar
Matthias Clasen committed
46
 *   as a touchscreen or tablet
47
 * @GDK_SOURCE_TOUCHPAD: the device is an indirect touch device, such
Matthias Clasen's avatar
Matthias Clasen committed
48
 *   as a touchpad
49
 * @GDK_SOURCE_TRACKPOINT: the device is a trackpoint
50
 * @GDK_SOURCE_TABLET_PAD: the device is a "pad", a collection of buttons,
Matthias Clasen's avatar
Matthias Clasen committed
51
 *   rings and strips found in drawing tablets
52
53
54
55
56
57
58
 *
 * An enumeration describing the type of an input device in general terms.
 */
typedef enum
{
  GDK_SOURCE_MOUSE,
  GDK_SOURCE_PEN,
59
60
  GDK_SOURCE_KEYBOARD,
  GDK_SOURCE_TOUCHSCREEN,
61
  GDK_SOURCE_TOUCHPAD,
62
63
  GDK_SOURCE_TRACKPOINT,
  GDK_SOURCE_TABLET_PAD
64
65
66
67
} GdkInputSource;

/**
 * GdkTimeCoord:
Matthias Clasen's avatar
Matthias Clasen committed
68
 * @time: The timestamp for this event
Matthias Clasen's avatar
Matthias Clasen committed
69
 * @flags: Flags indicating what axes are present
70
 * @axes: (array fixed-size=12): axis values
71
 *
Matthias Clasen's avatar
Matthias Clasen committed
72
 * A `GdkTimeCoord` stores a single event in a motion history.
73
74
75
76
 */
struct _GdkTimeCoord
{
  guint32 time;
Matthias Clasen's avatar
Matthias Clasen committed
77
78
  GdkAxisFlags flags;
  double axes[GDK_AXIS_LAST];
79
80
};

81
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
82
GType               gdk_device_get_type                 (void) G_GNUC_CONST;
83

84
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
85
const char *        gdk_device_get_name                 (GdkDevice *device);
86
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
87
const char *        gdk_device_get_vendor_id            (GdkDevice *device);
88
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
89
const char *        gdk_device_get_product_id           (GdkDevice *device);
90

91
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
92
GdkDisplay *        gdk_device_get_display              (GdkDevice *device);
Matthias Clasen's avatar
Matthias Clasen committed
93
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
94
GdkSeat *           gdk_device_get_seat                 (GdkDevice *device);
Matthias Clasen's avatar
Matthias Clasen committed
95
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
96
GdkDeviceTool *     gdk_device_get_device_tool          (GdkDevice *device);
97

Matthias Clasen's avatar
Matthias Clasen committed
98
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
99
GdkInputSource      gdk_device_get_source               (GdkDevice *device);
Matthias Clasen's avatar
Matthias Clasen committed
100
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
101
gboolean            gdk_device_get_has_cursor           (GdkDevice *device);
Matthias Clasen's avatar
Matthias Clasen committed
102
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
103
guint               gdk_device_get_num_touches          (GdkDevice *device);
104
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
105
GdkModifierType     gdk_device_get_modifier_state       (GdkDevice *device);
106
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
107
PangoDirection      gdk_device_get_direction            (GdkDevice *device);
108
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
109
gboolean            gdk_device_has_bidi_layouts         (GdkDevice *device);
110
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
111
gboolean            gdk_device_get_caps_lock_state      (GdkDevice *device);
112
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
113
gboolean            gdk_device_get_num_lock_state       (GdkDevice *device);
114
GDK_AVAILABLE_IN_ALL
Matthias Clasen's avatar
Matthias Clasen committed
115
gboolean            gdk_device_get_scroll_lock_state    (GdkDevice *device);
116

Matthias Clasen's avatar
Matthias Clasen committed
117
118
119
120
GDK_AVAILABLE_IN_ALL
GdkSurface *        gdk_device_get_surface_at_position  (GdkDevice *device,
                                                         double    *win_x,
                                                         double    *win_y);
121
122
123

GDK_AVAILABLE_IN_4_2
guint32             gdk_device_get_timestamp            (GdkDevice *device);
124
125
126
G_END_DECLS

#endif /* __GDK_DEVICE_H__ */