gtk/gdk/gdkdeviceprivate.h
Emmanuele Bassi 1c856a208f Rename master and slave device
We already use the "logical/virtual" and "physical" names in the
documentation, there's no reason to use loaded terms just because X11
uses them.
2020-06-18 19:22:20 +01:00

160 lines
6.6 KiB
C

/* 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
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_DEVICE_PRIVATE_H__
#define __GDK_DEVICE_PRIVATE_H__
#include "gdkdevice.h"
#include "gdkdevicetool.h"
#include "gdkevents.h"
#include "gdkseat.h"
#include "gdkinternals.h"
G_BEGIN_DECLS
#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))
typedef struct _GdkDeviceClass GdkDeviceClass;
struct _GdkDevice
{
GObject parent_instance;
gchar *name;
GdkInputSource source;
gboolean has_cursor;
GdkAxisFlags axis_flags;
GdkDisplay *display;
/* The paired logical device for logical devices,
* or the associated logical device for physical ones
*/
GdkDevice *associated;
GList *physical_devices;
GdkDeviceType type;
GArray *axes;
guint num_touches;
gchar *vendor_id;
gchar *product_id;
GdkSeat *seat;
GdkDeviceTool *last_tool;
};
struct _GdkDeviceClass
{
GObjectClass parent_class;
void (* get_state) (GdkDevice *device,
GdkSurface *surface,
gdouble *axes,
GdkModifierType *mask);
void (* set_surface_cursor)(GdkDevice *device,
GdkSurface *surface,
GdkCursor *cursor);
void (* query_state) (GdkDevice *device,
GdkSurface *surface,
GdkSurface **child_surface,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask);
GdkGrabStatus (* grab) (GdkDevice *device,
GdkSurface *surface,
gboolean owner_events,
GdkEventMask event_mask,
GdkSurface *confine_to,
GdkCursor *cursor,
guint32 time_);
void (*ungrab) (GdkDevice *device,
guint32 time_);
GdkSurface * (* surface_at_position) (GdkDevice *device,
double *win_x,
double *win_y,
GdkModifierType *mask);
};
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,
gdouble min_value,
gdouble max_value,
gdouble resolution);
void _gdk_device_get_axis_info (GdkDevice *device,
guint index,
GdkAxisUse *use,
gdouble *min_value,
gdouble *max_value,
gdouble *resolution);
gboolean _gdk_device_translate_surface_coord (GdkDevice *device,
GdkSurface *surface,
guint index,
gdouble value,
gdouble *axis_value);
gboolean _gdk_device_translate_screen_coord (GdkDevice *device,
GdkSurface *surface,
gdouble surface_root_x,
gdouble surface_root_y,
gdouble screen_width,
gdouble screen_height,
guint index,
gdouble value,
gdouble *axis_value);
gboolean _gdk_device_translate_axis (GdkDevice *device,
guint index,
gdouble value,
gdouble *axis_value);
GdkTimeCoord ** _gdk_device_allocate_history (GdkDevice *device,
gint n_events);
void _gdk_device_add_physical_device (GdkDevice *device,
GdkDevice *physical);
void _gdk_device_remove_physical_device (GdkDevice *device,
GdkDevice *physical);
void _gdk_device_query_state (GdkDevice *device,
GdkSurface *surface,
GdkSurface **child_surface,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask);
GdkSurface * _gdk_device_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
GdkModifierType *mask);
void gdk_device_set_seat (GdkDevice *device,
GdkSeat *seat);
void gdk_device_update_tool (GdkDevice *device,
GdkDeviceTool *tool);
G_END_DECLS
#endif /* __GDK_DEVICE_PRIVATE_H__ */