1/* GDK - The GIMP Drawing Kit
2 * Copyright (C) 2015 Red Hat
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 * Author: Carlos Garnacho <carlosg@gnome.org>
18 */
19
20#ifndef __GDK_SEAT_H__
21#define __GDK_SEAT_H__
22
23#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
24#error "Only <gdk/gdk.h> can be included directly."
25#endif
26
27#include <glib-object.h>
28#include <gdk/gdkwindow.h>
29#include <gdk/gdkevents.h>
30#include <gdk/gdktypes.h>
31
32G_BEGIN_DECLS
33
34#define GDK_TYPE_SEAT (gdk_seat_get_type ())
35#define GDK_SEAT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_SEAT, GdkSeat))
36#define GDK_IS_SEAT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_SEAT))
37
38/**
39 * GdkSeatCapabilities:
40 * @GDK_SEAT_CAPABILITY_NONE: No input capabilities
41 * @GDK_SEAT_CAPABILITY_POINTER: The seat has a pointer (e.g. mouse)
42 * @GDK_SEAT_CAPABILITY_TOUCH: The seat has touchscreen(s) attached
43 * @GDK_SEAT_CAPABILITY_TABLET_STYLUS: The seat has drawing tablet(s) attached
44 * @GDK_SEAT_CAPABILITY_KEYBOARD: The seat has keyboard(s) attached
45 * @GDK_SEAT_CAPABILITY_ALL_POINTING: The union of all pointing capabilities
46 * @GDK_SEAT_CAPABILITY_ALL: The union of all capabilities
47 *
48 * Flags describing the seat capabilities.
49 *
50 * Since: 3.20
51 */
52typedef enum {
53 GDK_SEAT_CAPABILITY_NONE = 0,
54 GDK_SEAT_CAPABILITY_POINTER = 1 << 0,
55 GDK_SEAT_CAPABILITY_TOUCH = 1 << 1,
56 GDK_SEAT_CAPABILITY_TABLET_STYLUS = 1 << 2,
57 GDK_SEAT_CAPABILITY_KEYBOARD = 1 << 3,
58 GDK_SEAT_CAPABILITY_ALL_POINTING = (GDK_SEAT_CAPABILITY_POINTER | GDK_SEAT_CAPABILITY_TOUCH | GDK_SEAT_CAPABILITY_TABLET_STYLUS),
59 GDK_SEAT_CAPABILITY_ALL = (GDK_SEAT_CAPABILITY_ALL_POINTING | GDK_SEAT_CAPABILITY_KEYBOARD)
60} GdkSeatCapabilities;
61
62/**
63 * GdkSeatGrabPrepareFunc:
64 * @seat: the #GdkSeat being grabbed
65 * @window: the #GdkWindow being grabbed
66 * @user_data: user data passed in gdk_seat_grab()
67 *
68 * Type of the callback used to set up @window so it can be
69 * grabbed. A typical action would be ensuring the window is
70 * visible, although there's room for other initialization
71 * actions.
72 *
73 * Since: 3.20
74 */
75typedef void (* GdkSeatGrabPrepareFunc) (GdkSeat *seat,
76 GdkWindow *window,
77 gpointer user_data);
78
79struct _GdkSeat
80{
81 GObject parent_instance;
82};
83
84GDK_AVAILABLE_IN_3_20
85GType gdk_seat_get_type (void) G_GNUC_CONST;
86
87GDK_AVAILABLE_IN_3_20
88GdkGrabStatus gdk_seat_grab (GdkSeat *seat,
89 GdkWindow *window,
90 GdkSeatCapabilities capabilities,
91 gboolean owner_events,
92 GdkCursor *cursor,
93 const GdkEvent *event,
94 GdkSeatGrabPrepareFunc prepare_func,
95 gpointer prepare_func_data);
96GDK_AVAILABLE_IN_3_20
97void gdk_seat_ungrab (GdkSeat *seat);
98
99GDK_AVAILABLE_IN_3_20
100GdkDisplay * gdk_seat_get_display (GdkSeat *seat);
101
102GDK_AVAILABLE_IN_3_20
103GdkSeatCapabilities
104 gdk_seat_get_capabilities (GdkSeat *seat);
105
106GDK_AVAILABLE_IN_3_20
107GList * gdk_seat_get_slaves (GdkSeat *seat,
108 GdkSeatCapabilities capabilities);
109
110GDK_AVAILABLE_IN_3_20
111GdkDevice * gdk_seat_get_pointer (GdkSeat *seat);
112GDK_AVAILABLE_IN_3_20
113GdkDevice * gdk_seat_get_keyboard (GdkSeat *seat);
114
115G_END_DECLS
116
117#endif /* __GDK_SEAT_H__ */
118

source code of include/gtk-3.0/gdk/gdkseat.h