2010-05-25 22:38:44 +00:00
|
|
|
/* 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
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2010-05-25 22:38:44 +00:00
|
|
|
*/
|
|
|
|
|
2012-12-28 14:57:34 +00:00
|
|
|
#ifndef __GDK_DEVICE_H__
|
|
|
|
#define __GDK_DEVICE_H__
|
|
|
|
|
2019-11-27 13:33:43 +00:00
|
|
|
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
2010-05-25 22:38:44 +00:00
|
|
|
#error "Only <gdk/gdk.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
2013-03-15 09:58:39 +00:00
|
|
|
#include <gdk/gdkversionmacros.h>
|
2010-05-25 22:38:44 +00:00
|
|
|
#include <gdk/gdktypes.h>
|
2020-02-24 13:00:11 +00:00
|
|
|
#include <gdk/gdkdevicetool.h>
|
2021-10-25 00:14:18 +00:00
|
|
|
#include <gdk/gdkenums.h>
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
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
|
2021-05-18 21:05:26 +00:00
|
|
|
* pointer, even if it is something else, such as a trackball.)
|
2010-05-25 22:38:44 +00:00
|
|
|
* @GDK_SOURCE_PEN: the device is a stylus of a graphics tablet or similar device.
|
|
|
|
* @GDK_SOURCE_KEYBOARD: the device is a keyboard.
|
2012-03-01 02:58:36 +00:00
|
|
|
* @GDK_SOURCE_TOUCHSCREEN: the device is a direct-input touch device, such
|
2021-05-18 21:05:26 +00:00
|
|
|
* as a touchscreen or tablet
|
2012-03-01 02:58:36 +00:00
|
|
|
* @GDK_SOURCE_TOUCHPAD: the device is an indirect touch device, such
|
2021-05-18 21:05:26 +00:00
|
|
|
* as a touchpad
|
2020-06-28 01:46:22 +00:00
|
|
|
* @GDK_SOURCE_TRACKPOINT: the device is a trackpoint
|
2016-08-04 17:01:38 +00:00
|
|
|
* @GDK_SOURCE_TABLET_PAD: the device is a "pad", a collection of buttons,
|
2021-05-18 21:05:26 +00:00
|
|
|
* rings and strips found in drawing tablets
|
2010-05-25 22:38:44 +00:00
|
|
|
*
|
|
|
|
* An enumeration describing the type of an input device in general terms.
|
|
|
|
*/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GDK_SOURCE_MOUSE,
|
|
|
|
GDK_SOURCE_PEN,
|
2012-03-01 02:58:36 +00:00
|
|
|
GDK_SOURCE_KEYBOARD,
|
|
|
|
GDK_SOURCE_TOUCHSCREEN,
|
2016-06-01 10:57:46 +00:00
|
|
|
GDK_SOURCE_TOUCHPAD,
|
2016-08-04 17:01:38 +00:00
|
|
|
GDK_SOURCE_TRACKPOINT,
|
|
|
|
GDK_SOURCE_TABLET_PAD
|
2010-05-25 22:38:44 +00:00
|
|
|
} GdkInputSource;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GdkTimeCoord:
|
2021-05-20 03:39:18 +00:00
|
|
|
* @time: The timestamp for this event
|
2022-06-06 12:55:51 +00:00
|
|
|
* @flags: Flags indicating what axes are present, see [flags@Gdk.AxisFlags]
|
|
|
|
* @axes: (array fixed-size=12): axis values, indexed by [enum@Gdk.AxisUse]
|
2010-05-25 22:38:44 +00:00
|
|
|
*
|
2021-05-20 03:39:18 +00:00
|
|
|
* A `GdkTimeCoord` stores a single event in a motion history.
|
2022-06-06 12:55:51 +00:00
|
|
|
*
|
|
|
|
* To check whether an axis is present, check whether the corresponding
|
|
|
|
* flag from the [flags@Gdk.AxisFlags] enumeration is set in the @flags
|
|
|
|
* To access individual axis values, use the values of the values of
|
|
|
|
* the [enum@Gdk.AxisUse] enumerations as indices.
|
2010-05-25 22:38:44 +00:00
|
|
|
*/
|
|
|
|
struct _GdkTimeCoord
|
|
|
|
{
|
|
|
|
guint32 time;
|
2020-06-09 17:38:48 +00:00
|
|
|
GdkAxisFlags flags;
|
|
|
|
double axes[GDK_AXIS_LAST];
|
2010-05-25 22:38:44 +00:00
|
|
|
};
|
|
|
|
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
GType gdk_device_get_type (void) G_GNUC_CONST;
|
2010-05-25 22:38:44 +00:00
|
|
|
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
const char * gdk_device_get_name (GdkDevice *device);
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
const char * gdk_device_get_vendor_id (GdkDevice *device);
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
const char * gdk_device_get_product_id (GdkDevice *device);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
2013-03-15 09:58:39 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
GdkDisplay * gdk_device_get_display (GdkDevice *device);
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
GdkSeat * gdk_device_get_seat (GdkDevice *device);
|
2022-02-09 12:55:28 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
GdkDeviceTool * gdk_device_get_device_tool (GdkDevice *device);
|
2014-11-18 13:24:52 +00:00
|
|
|
|
2018-02-05 19:13:20 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
GdkInputSource gdk_device_get_source (GdkDevice *device);
|
2020-02-24 13:00:11 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
gboolean gdk_device_get_has_cursor (GdkDevice *device);
|
2020-02-24 13:00:11 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
guint gdk_device_get_num_touches (GdkDevice *device);
|
2020-04-05 04:36:42 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
GdkModifierType gdk_device_get_modifier_state (GdkDevice *device);
|
2020-04-05 04:36:42 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
PangoDirection gdk_device_get_direction (GdkDevice *device);
|
2020-04-05 04:36:42 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
gboolean gdk_device_has_bidi_layouts (GdkDevice *device);
|
2020-04-05 04:36:42 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
gboolean gdk_device_get_caps_lock_state (GdkDevice *device);
|
2020-04-05 04:36:42 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
gboolean gdk_device_get_num_lock_state (GdkDevice *device);
|
2020-04-05 04:36:42 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-08-14 01:00:36 +00:00
|
|
|
gboolean gdk_device_get_scroll_lock_state (GdkDevice *device);
|
2020-04-05 04:36:42 +00:00
|
|
|
|
2020-08-14 01:00:36 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
GdkSurface * gdk_device_get_surface_at_position (GdkDevice *device,
|
|
|
|
double *win_x,
|
|
|
|
double *win_y);
|
2021-03-26 02:39:15 +00:00
|
|
|
|
|
|
|
GDK_AVAILABLE_IN_4_2
|
|
|
|
guint32 gdk_device_get_timestamp (GdkDevice *device);
|
2022-09-23 23:08:25 +00:00
|
|
|
|
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDevice, g_object_unref)
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GDK_DEVICE_H__ */
|