| 1 | /* GDK - The GIMP Drawing Kit |
| 2 | * Copyright (C) 2009 Carlos Garnacho <carlosg@gnome.org> |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ |
| 17 | |
| 18 | #ifndef __GDK_DEVICE_H__ |
| 19 | #define __GDK_DEVICE_H__ |
| 20 | |
| 21 | #if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION) |
| 22 | #error "Only <gdk/gdk.h> can be included directly." |
| 23 | #endif |
| 24 | |
| 25 | #include <gdk/gdkversionmacros.h> |
| 26 | #include <gdk/gdktypes.h> |
| 27 | #include <gdk/gdkdevicetool.h> |
| 28 | #include <gdk/gdkenums.h> |
| 29 | |
| 30 | |
| 31 | G_BEGIN_DECLS |
| 32 | |
| 33 | #define GDK_TYPE_DEVICE (gdk_device_get_type ()) |
| 34 | #define GDK_DEVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE, GdkDevice)) |
| 35 | #define GDK_IS_DEVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE)) |
| 36 | |
| 37 | typedef struct _GdkTimeCoord GdkTimeCoord; |
| 38 | |
| 39 | /** |
| 40 | * GdkInputSource: |
| 41 | * @GDK_SOURCE_MOUSE: the device is a mouse. (This will be reported for the core |
| 42 | * pointer, even if it is something else, such as a trackball.) |
| 43 | * @GDK_SOURCE_PEN: the device is a stylus of a graphics tablet or similar device. |
| 44 | * @GDK_SOURCE_KEYBOARD: the device is a keyboard. |
| 45 | * @GDK_SOURCE_TOUCHSCREEN: the device is a direct-input touch device, such |
| 46 | * as a touchscreen or tablet |
| 47 | * @GDK_SOURCE_TOUCHPAD: the device is an indirect touch device, such |
| 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, |
| 51 | * rings and strips found in drawing tablets |
| 52 | * |
| 53 | * An enumeration describing the type of an input device in general terms. |
| 54 | */ |
| 55 | typedef enum |
| 56 | { |
| 57 | GDK_SOURCE_MOUSE, |
| 58 | GDK_SOURCE_PEN, |
| 59 | GDK_SOURCE_KEYBOARD, |
| 60 | GDK_SOURCE_TOUCHSCREEN, |
| 61 | GDK_SOURCE_TOUCHPAD, |
| 62 | GDK_SOURCE_TRACKPOINT, |
| 63 | GDK_SOURCE_TABLET_PAD |
| 64 | } GdkInputSource; |
| 65 | |
| 66 | /** |
| 67 | * GdkTimeCoord: |
| 68 | * @time: The timestamp for this event |
| 69 | * @flags: Flags indicating what axes are present |
| 70 | * @axes: (array fixed-size=12): axis values |
| 71 | * |
| 72 | * A `GdkTimeCoord` stores a single event in a motion history. |
| 73 | */ |
| 74 | struct _GdkTimeCoord |
| 75 | { |
| 76 | guint32 time; |
| 77 | GdkAxisFlags flags; |
| 78 | double axes[GDK_AXIS_LAST]; |
| 79 | }; |
| 80 | |
| 81 | GDK_AVAILABLE_IN_ALL |
| 82 | GType gdk_device_get_type (void) G_GNUC_CONST; |
| 83 | |
| 84 | GDK_AVAILABLE_IN_ALL |
| 85 | const char * gdk_device_get_name (GdkDevice *device); |
| 86 | GDK_AVAILABLE_IN_ALL |
| 87 | const char * gdk_device_get_vendor_id (GdkDevice *device); |
| 88 | GDK_AVAILABLE_IN_ALL |
| 89 | const char * gdk_device_get_product_id (GdkDevice *device); |
| 90 | |
| 91 | GDK_AVAILABLE_IN_ALL |
| 92 | GdkDisplay * gdk_device_get_display (GdkDevice *device); |
| 93 | GDK_AVAILABLE_IN_ALL |
| 94 | GdkSeat * gdk_device_get_seat (GdkDevice *device); |
| 95 | GDK_AVAILABLE_IN_ALL |
| 96 | GdkDeviceTool * gdk_device_get_device_tool (GdkDevice *device); |
| 97 | |
| 98 | GDK_AVAILABLE_IN_ALL |
| 99 | GdkInputSource gdk_device_get_source (GdkDevice *device); |
| 100 | GDK_AVAILABLE_IN_ALL |
| 101 | gboolean gdk_device_get_has_cursor (GdkDevice *device); |
| 102 | GDK_AVAILABLE_IN_ALL |
| 103 | guint gdk_device_get_num_touches (GdkDevice *device); |
| 104 | GDK_AVAILABLE_IN_ALL |
| 105 | GdkModifierType gdk_device_get_modifier_state (GdkDevice *device); |
| 106 | GDK_AVAILABLE_IN_ALL |
| 107 | PangoDirection gdk_device_get_direction (GdkDevice *device); |
| 108 | GDK_AVAILABLE_IN_ALL |
| 109 | gboolean gdk_device_has_bidi_layouts (GdkDevice *device); |
| 110 | GDK_AVAILABLE_IN_ALL |
| 111 | gboolean gdk_device_get_caps_lock_state (GdkDevice *device); |
| 112 | GDK_AVAILABLE_IN_ALL |
| 113 | gboolean gdk_device_get_num_lock_state (GdkDevice *device); |
| 114 | GDK_AVAILABLE_IN_ALL |
| 115 | gboolean gdk_device_get_scroll_lock_state (GdkDevice *device); |
| 116 | |
| 117 | GDK_AVAILABLE_IN_ALL |
| 118 | GdkSurface * gdk_device_get_surface_at_position (GdkDevice *device, |
| 119 | double *win_x, |
| 120 | double *win_y); |
| 121 | |
| 122 | GDK_AVAILABLE_IN_4_2 |
| 123 | guint32 gdk_device_get_timestamp (GdkDevice *device); |
| 124 | G_END_DECLS |
| 125 | |
| 126 | #endif /* __GDK_DEVICE_H__ */ |
| 127 | |