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
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GDK_DEVICE_PRIVATE_H__
|
|
|
|
#define __GDK_DEVICE_PRIVATE_H__
|
|
|
|
|
2010-12-11 02:55:56 +00:00
|
|
|
#include "gdkdevice.h"
|
2016-04-09 19:20:07 +00:00
|
|
|
#include "gdkdevicetool.h"
|
2010-12-11 02:55:56 +00:00
|
|
|
#include "gdkevents.h"
|
2015-11-26 18:50:57 +00:00
|
|
|
#include "gdkseat.h"
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2020-08-14 01:20:52 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GDK_GRAB_SUCCESS = 0,
|
|
|
|
GDK_GRAB_ALREADY_GRABBED = 1,
|
|
|
|
GDK_GRAB_INVALID_TIME = 2,
|
|
|
|
GDK_GRAB_NOT_VIEWABLE = 3,
|
|
|
|
GDK_GRAB_FROZEN = 4,
|
|
|
|
GDK_GRAB_FAILED = 5
|
|
|
|
} GdkGrabStatus;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GDK_EXPOSURE_MASK = 1 << 1,
|
|
|
|
GDK_POINTER_MOTION_MASK = 1 << 2,
|
|
|
|
GDK_BUTTON_MOTION_MASK = 1 << 4,
|
|
|
|
GDK_BUTTON1_MOTION_MASK = 1 << 5,
|
|
|
|
GDK_BUTTON2_MOTION_MASK = 1 << 6,
|
|
|
|
GDK_BUTTON3_MOTION_MASK = 1 << 7,
|
|
|
|
GDK_BUTTON_PRESS_MASK = 1 << 8,
|
|
|
|
GDK_BUTTON_RELEASE_MASK = 1 << 9,
|
|
|
|
GDK_KEY_PRESS_MASK = 1 << 10,
|
|
|
|
GDK_KEY_RELEASE_MASK = 1 << 11,
|
|
|
|
GDK_ENTER_NOTIFY_MASK = 1 << 12,
|
|
|
|
GDK_LEAVE_NOTIFY_MASK = 1 << 13,
|
|
|
|
GDK_FOCUS_CHANGE_MASK = 1 << 14,
|
|
|
|
GDK_STRUCTURE_MASK = 1 << 15,
|
|
|
|
GDK_PROPERTY_CHANGE_MASK = 1 << 16,
|
|
|
|
GDK_PROXIMITY_IN_MASK = 1 << 18,
|
|
|
|
GDK_PROXIMITY_OUT_MASK = 1 << 19,
|
|
|
|
GDK_SUBSTRUCTURE_MASK = 1 << 20,
|
|
|
|
GDK_SCROLL_MASK = 1 << 21,
|
|
|
|
GDK_TOUCH_MASK = 1 << 22,
|
|
|
|
GDK_SMOOTH_SCROLL_MASK = 1 << 23,
|
|
|
|
GDK_TOUCHPAD_GESTURE_MASK = 1 << 24,
|
|
|
|
GDK_TABLET_PAD_MASK = 1 << 25,
|
|
|
|
GDK_ALL_EVENTS_MASK = 0x3FFFFFE
|
|
|
|
} GdkEventMask;
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
#define GDK_DEVICE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE, GdkDeviceClass))
|
|
|
|
#define GDK_IS_DEVICE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE))
|
|
|
|
#define GDK_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE, GdkDeviceClass))
|
|
|
|
|
2010-12-24 20:54:12 +00:00
|
|
|
typedef struct _GdkDeviceClass GdkDeviceClass;
|
2010-12-11 02:55:56 +00:00
|
|
|
|
|
|
|
struct _GdkDevice
|
|
|
|
{
|
|
|
|
GObject parent_instance;
|
|
|
|
|
2020-07-24 18:40:36 +00:00
|
|
|
char *name;
|
2010-12-11 02:55:56 +00:00
|
|
|
GdkInputSource source;
|
|
|
|
gboolean has_cursor;
|
|
|
|
GdkDisplay *display;
|
2020-06-18 18:22:20 +00:00
|
|
|
/* The paired logical device for logical devices,
|
|
|
|
* or the associated logical device for physical ones
|
2010-12-11 02:55:56 +00:00
|
|
|
*/
|
|
|
|
GdkDevice *associated;
|
2020-06-18 18:22:20 +00:00
|
|
|
GList *physical_devices;
|
2010-12-11 02:55:56 +00:00
|
|
|
GArray *axes;
|
2016-02-25 13:25:14 +00:00
|
|
|
guint num_touches;
|
2014-11-18 13:24:52 +00:00
|
|
|
|
2020-07-24 18:40:36 +00:00
|
|
|
char *vendor_id;
|
|
|
|
char *product_id;
|
2015-11-26 18:50:57 +00:00
|
|
|
|
|
|
|
GdkSeat *seat;
|
2015-01-06 13:44:15 +00:00
|
|
|
GdkDeviceTool *last_tool;
|
2010-12-11 02:55:56 +00:00
|
|
|
};
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
struct _GdkDeviceClass
|
|
|
|
{
|
|
|
|
GObjectClass parent_class;
|
|
|
|
|
2018-03-21 08:06:31 +00:00
|
|
|
void (* set_surface_cursor)(GdkDevice *device,
|
2018-03-20 14:14:10 +00:00
|
|
|
GdkSurface *surface,
|
2010-05-25 22:38:44 +00:00
|
|
|
GdkCursor *cursor);
|
|
|
|
|
|
|
|
GdkGrabStatus (* grab) (GdkDevice *device,
|
2018-03-20 14:14:10 +00:00
|
|
|
GdkSurface *surface,
|
2010-05-25 22:38:44 +00:00
|
|
|
gboolean owner_events,
|
|
|
|
GdkEventMask event_mask,
|
2018-03-20 10:40:08 +00:00
|
|
|
GdkSurface *confine_to,
|
2010-05-25 22:38:44 +00:00
|
|
|
GdkCursor *cursor,
|
|
|
|
guint32 time_);
|
|
|
|
void (*ungrab) (GdkDevice *device,
|
|
|
|
guint32 time_);
|
|
|
|
|
2018-03-20 11:05:26 +00:00
|
|
|
GdkSurface * (* surface_at_position) (GdkDevice *device,
|
2018-03-21 08:06:31 +00:00
|
|
|
double *win_x,
|
|
|
|
double *win_y,
|
2020-05-19 19:00:32 +00:00
|
|
|
GdkModifierType *mask);
|
2010-05-25 22:38:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void _gdk_device_set_associated_device (GdkDevice *device,
|
|
|
|
GdkDevice *relative);
|
|
|
|
|
|
|
|
void _gdk_device_reset_axes (GdkDevice *device);
|
|
|
|
guint _gdk_device_add_axis (GdkDevice *device,
|
|
|
|
GdkAxisUse use,
|
2020-07-24 20:32:16 +00:00
|
|
|
double min_value,
|
|
|
|
double max_value,
|
|
|
|
double resolution);
|
2012-04-03 08:54:25 +00:00
|
|
|
void _gdk_device_get_axis_info (GdkDevice *device,
|
2020-06-09 19:26:04 +00:00
|
|
|
guint index,
|
|
|
|
GdkAxisUse *use,
|
2020-07-24 20:32:16 +00:00
|
|
|
double *min_value,
|
|
|
|
double *max_value,
|
|
|
|
double *resolution);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
2018-03-20 11:05:26 +00:00
|
|
|
gboolean _gdk_device_translate_surface_coord (GdkDevice *device,
|
2018-03-21 08:06:31 +00:00
|
|
|
GdkSurface *surface,
|
|
|
|
guint index,
|
2020-07-24 20:32:16 +00:00
|
|
|
double value,
|
|
|
|
double *axis_value);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
|
|
gboolean _gdk_device_translate_screen_coord (GdkDevice *device,
|
2018-03-20 14:14:10 +00:00
|
|
|
GdkSurface *surface,
|
2020-07-24 20:32:16 +00:00
|
|
|
double surface_root_x,
|
|
|
|
double surface_root_y,
|
|
|
|
double screen_width,
|
|
|
|
double screen_height,
|
2010-05-25 22:38:44 +00:00
|
|
|
guint index,
|
2020-07-24 20:32:16 +00:00
|
|
|
double value,
|
|
|
|
double *axis_value);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
|
|
gboolean _gdk_device_translate_axis (GdkDevice *device,
|
|
|
|
guint index,
|
2020-07-24 20:32:16 +00:00
|
|
|
double value,
|
|
|
|
double *axis_value);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
|
|
|
GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device,
|
2020-07-24 13:54:49 +00:00
|
|
|
int n_events);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
2020-07-30 15:15:14 +00:00
|
|
|
GList * gdk_device_list_physical_devices (GdkDevice *device);
|
|
|
|
|
2020-06-18 18:22:20 +00:00
|
|
|
void _gdk_device_add_physical_device (GdkDevice *device,
|
|
|
|
GdkDevice *physical);
|
|
|
|
void _gdk_device_remove_physical_device (GdkDevice *device,
|
|
|
|
GdkDevice *physical);
|
|
|
|
|
2018-03-21 08:06:31 +00:00
|
|
|
GdkSurface * _gdk_device_surface_at_position (GdkDevice *device,
|
2020-07-24 20:32:16 +00:00
|
|
|
double *win_x,
|
|
|
|
double *win_y,
|
2020-05-19 19:00:32 +00:00
|
|
|
GdkModifierType *mask);
|
2010-05-25 22:38:44 +00:00
|
|
|
|
2015-11-26 18:50:57 +00:00
|
|
|
void gdk_device_set_seat (GdkDevice *device,
|
|
|
|
GdkSeat *seat);
|
|
|
|
|
2015-01-06 13:44:15 +00:00
|
|
|
void gdk_device_update_tool (GdkDevice *device,
|
|
|
|
GdkDeviceTool *tool);
|
2015-01-06 13:38:14 +00:00
|
|
|
|
2020-08-14 01:20:52 +00:00
|
|
|
GdkGrabStatus gdk_device_grab (GdkDevice *device,
|
|
|
|
GdkSurface *surface,
|
|
|
|
gboolean owner_events,
|
|
|
|
GdkEventMask event_mask,
|
|
|
|
GdkCursor *cursor,
|
|
|
|
guint32 time_);
|
|
|
|
void gdk_device_ungrab (GdkDevice *device,
|
|
|
|
guint32 time_);
|
|
|
|
int gdk_device_get_n_axes (GdkDevice *device);
|
|
|
|
gboolean gdk_device_get_axis (GdkDevice *device,
|
|
|
|
double *axes,
|
|
|
|
GdkAxisUse use,
|
|
|
|
double *value);
|
|
|
|
GdkAxisUse gdk_device_get_axis_use (GdkDevice *device,
|
|
|
|
guint index_);
|
|
|
|
|
|
|
|
|
2010-05-25 22:38:44 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GDK_DEVICE_PRIVATE_H__ */
|