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 <[email protected]> |
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 | |
32 | G_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 | */ |
52 | typedef 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 | */ |
75 | typedef void (* GdkSeatGrabPrepareFunc) (GdkSeat *seat, |
76 | GdkWindow *window, |
77 | gpointer user_data); |
78 | |
79 | struct _GdkSeat |
80 | { |
81 | GObject parent_instance; |
82 | }; |
83 | |
84 | GDK_AVAILABLE_IN_3_20 |
85 | GType gdk_seat_get_type (void) G_GNUC_CONST; |
86 | |
87 | GDK_AVAILABLE_IN_3_20 |
88 | GdkGrabStatus 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); |
96 | GDK_AVAILABLE_IN_3_20 |
97 | void gdk_seat_ungrab (GdkSeat *seat); |
98 | |
99 | GDK_AVAILABLE_IN_3_20 |
100 | GdkDisplay * gdk_seat_get_display (GdkSeat *seat); |
101 | |
102 | GDK_AVAILABLE_IN_3_20 |
103 | GdkSeatCapabilities |
104 | gdk_seat_get_capabilities (GdkSeat *seat); |
105 | |
106 | GDK_AVAILABLE_IN_3_20 |
107 | GList * gdk_seat_get_slaves (GdkSeat *seat, |
108 | GdkSeatCapabilities capabilities); |
109 | |
110 | GDK_AVAILABLE_IN_3_20 |
111 | GdkDevice * gdk_seat_get_pointer (GdkSeat *seat); |
112 | GDK_AVAILABLE_IN_3_20 |
113 | GdkDevice * gdk_seat_get_keyboard (GdkSeat *seat); |
114 | |
115 | G_END_DECLS |
116 | |
117 | #endif /* __GDK_SEAT_H__ */ |
118 | |