| 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 | #include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 21 | |
| 22 | #include <glib-object.h> |
| 23 | #include "gdkdisplay.h"cxx . . $ `<file>/gdk/gdkdisplay.h`/ |
| 24 | #include "gdkdevice.h"cxx . . $ `<file>/gdk/gdkdevice.h`/ |
| 25 | #include "gdkdevicetoolprivate.h"cxx . . $ `<file>/gdk/gdkdevicetoolprivate.h`/ |
| 26 | #include "gdkseatprivate.h"cxx . . $ `<file>/gdk/gdkseatprivate.h`/ |
| 27 | #include "gdkdeviceprivate.h"cxx . . $ `<file>/gdk/gdkdeviceprivate.h`/ |
| 28 | #include <glib/gi18n-lib.h> |
| 29 | |
| 30 | /** |
| 31 | * GdkSeat: |
| 32 | * |
| 33 | * Represents a collection of input devices that belong to a user. |
| 34 | */ |
| 35 | |
| 36 | typedef struct _GdkSeatPrivatecxx . . $ _GdkSeatPrivate# GdkSeatPrivatecxx . . $ GdkSeatPrivate#; |
| 37 | |
| 38 | struct _GdkSeatPrivatecxx . . $ _GdkSeatPrivate# |
| 39 | { |
| 40 | GdkDisplaycxx . . $ GdkDisplay# *displaycxx . . $ _GdkSeatPrivate#display.; |
| 41 | }; |
| 42 | |
| 43 | enumcxx . . $ $anonymous_type_76964a6ce2a48455_0# { |
| 44 | DEVICE_ADDEDcxx . . $ DEVICE_ADDED., |
| 45 | DEVICE_REMOVEDcxx . . $ DEVICE_REMOVED., |
| 46 | TOOL_ADDEDcxx . . $ TOOL_ADDED., |
| 47 | TOOL_REMOVEDcxx . . $ TOOL_REMOVED., |
| 48 | N_SIGNALScxx . . $ N_SIGNALS. |
| 49 | }; |
| 50 | |
| 51 | enumcxx . . $ $anonymous_type_76964a6ce2a48455_1# { |
| 52 | PROP_0cxx . . $ PROP_0., |
| 53 | PROP_DISPLAYcxx . . $ PROP_DISPLAY., |
| 54 | N_PROPScxx . . $ N_PROPS. |
| 55 | }; |
| 56 | |
| 57 | static guintcxx . . $ guint# signalscxx . . $ signals.[N_SIGNALScxx . . $ N_SIGNALS.] = { 0 }; |
| 58 | static GParamSpeccxx . . $ GParamSpec# *propscxx . . $ props.[N_PROPScxx . . $ N_PROPS.] = { NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! }; |
| 59 | |
| 60 | G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATEcxx . . $ `<external>/9567554376676449156/gtype.h:1924:9`! (GdkSeat, gdk_seat, G_TYPE_OBJECTcxx . . $ `<external>/9567554376676449156/gtype.h:189:9`!) |
| 61 | |
| 62 | static void |
| 63 | gdk_seat_set_propertycxx . . $ gdk_seat_set_property(d7c4bb29f36c0dc4). (GObjectcxx . . $ GObject# *object, |
| 64 | guintcxx . . $ guint# prop_id, |
| 65 | const GValuecxx . . $ GValue# *value, |
| 66 | GParamSpeccxx . . $ GParamSpec# *pspec) |
| 67 | { |
| 68 | GdkSeatPrivatecxx . . $ GdkSeatPrivate# *priv = gdk_seat_get_instance_privatecxx . . $ gdk_seat_get_instance_private(2cf2c29f94bcbd6e). (GDK_SEATcxx . . $ `gdk/gdkseat.h:34:9`! (object)); |
| 69 | |
| 70 | switch (prop_id) |
| 71 | { |
| 72 | case PROP_DISPLAYcxx . . $ PROP_DISPLAY.: |
| 73 | priv->displaycxx . . $ _GdkSeatPrivate#display. = g_value_get_objectcxx . . $ g_value_get_object(e12dff36056c2cce). (value); |
| 74 | break; |
| 75 | default: |
| 76 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec); |
| 77 | break; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | static void |
| 82 | gdk_seat_get_propertycxx . . $ gdk_seat_get_property(cee2c52f22407c66). (GObjectcxx . . $ GObject# *object, |
| 83 | guintcxx . . $ guint# prop_id, |
| 84 | GValuecxx . . $ GValue# *value, |
| 85 | GParamSpeccxx . . $ GParamSpec# *pspec) |
| 86 | { |
| 87 | GdkSeatPrivatecxx . . $ GdkSeatPrivate# *priv = gdk_seat_get_instance_privatecxx . . $ gdk_seat_get_instance_private(2cf2c29f94bcbd6e). (GDK_SEATcxx . . $ `gdk/gdkseat.h:34:9`! (object)); |
| 88 | |
| 89 | switch (prop_id) |
| 90 | { |
| 91 | case PROP_DISPLAYcxx . . $ PROP_DISPLAY.: |
| 92 | g_value_set_objectcxx . . $ g_value_set_object(e945b84c1e9702f). (value, priv->displaycxx . . $ _GdkSeatPrivate#display.); |
| 93 | break; |
| 94 | default: |
| 95 | G_OBJECT_WARN_INVALID_PROPERTY_IDcxx . . $ `<external>/1341695927569185362/gobject.h:690:9`! (object, prop_id, pspec); |
| 96 | break; |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | static void |
| 101 | gdk_seat_class_initcxx . . $ gdk_seat_class_init(6505e6adcd5a6acf). (GdkSeatClasscxx . . $ GdkSeatClass# *klass) |
| 102 | { |
| 103 | GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass); |
| 104 | |
| 105 | object_class->set_propertycxx . . $ _GObjectClass#set_property. = gdk_seat_set_propertycxx . . $ gdk_seat_set_property(d7c4bb29f36c0dc4).; |
| 106 | object_class->get_propertycxx . . $ _GObjectClass#get_property. = gdk_seat_get_propertycxx . . $ gdk_seat_get_property(cee2c52f22407c66).; |
| 107 | |
| 108 | /** |
| 109 | * GdkSeat::device-added: |
| 110 | * @seat: the object on which the signal is emitted |
| 111 | * @device: the newly added `GdkDevice`. |
| 112 | * |
| 113 | * Emitted when a new input device is related to this seat. |
| 114 | */ |
| 115 | signalscxx . . $ signals. [DEVICE_ADDEDcxx . . $ DEVICE_ADDED.] = |
| 116 | g_signal_newcxx . . $ g_signal_new(b0aa5e8090fb95c0). (g_intern_static_stringcxx . . $ g_intern_static_string(fb58d2e09a2a1ce6). ("device-added"), |
| 117 | G_TYPE_FROM_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:657:9`! (klass), |
| 118 | G_SIGNAL_RUN_LASTcxx . . $ G_SIGNAL_RUN_LAST., |
| 119 | G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GdkSeatClass, device_added), |
| 120 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 121 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 122 | G_TYPE_NONEcxx . . $ `<external>/9567554376676449156/gtype.h:72:9`!, 1, |
| 123 | GDK_TYPE_DEVICEcxx . . $ `gdk/gdkdevice.h:30:9`!); |
| 124 | |
| 125 | /** |
| 126 | * GdkSeat::device-removed: |
| 127 | * @seat: the object on which the signal is emitted |
| 128 | * @device: the just removed `GdkDevice`. |
| 129 | * |
| 130 | * Emitted when an input device is removed (e.g. unplugged). |
| 131 | */ |
| 132 | signalscxx . . $ signals. [DEVICE_REMOVEDcxx . . $ DEVICE_REMOVED.] = |
| 133 | g_signal_newcxx . . $ g_signal_new(b0aa5e8090fb95c0). (g_intern_static_stringcxx . . $ g_intern_static_string(fb58d2e09a2a1ce6). ("device-removed"), |
| 134 | G_TYPE_FROM_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:657:9`! (klass), |
| 135 | G_SIGNAL_RUN_LASTcxx . . $ G_SIGNAL_RUN_LAST., |
| 136 | G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GdkSeatClass, device_removed), |
| 137 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 138 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 139 | G_TYPE_NONEcxx . . $ `<external>/9567554376676449156/gtype.h:72:9`!, 1, |
| 140 | GDK_TYPE_DEVICEcxx . . $ `gdk/gdkdevice.h:30:9`!); |
| 141 | |
| 142 | /** |
| 143 | * GdkSeat::tool-added: |
| 144 | * @seat: the object on which the signal is emitted |
| 145 | * @tool: the new `GdkDeviceTool` known to the seat |
| 146 | * |
| 147 | * Emitted whenever a new tool is made known to the seat. |
| 148 | * |
| 149 | * The tool may later be assigned to a device (i.e. on |
| 150 | * proximity with a tablet). The device will emit the |
| 151 | * [[email protected]::tool-changed] signal accordingly. |
| 152 | * |
| 153 | * A same tool may be used by several devices. |
| 154 | */ |
| 155 | signalscxx . . $ signals. [TOOL_ADDEDcxx . . $ TOOL_ADDED.] = |
| 156 | g_signal_newcxx . . $ g_signal_new(b0aa5e8090fb95c0). (g_intern_static_stringcxx . . $ g_intern_static_string(fb58d2e09a2a1ce6). ("tool-added"), |
| 157 | G_TYPE_FROM_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:657:9`! (klass), |
| 158 | G_SIGNAL_RUN_LASTcxx . . $ G_SIGNAL_RUN_LAST., |
| 159 | 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 160 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 161 | G_TYPE_NONEcxx . . $ `<external>/9567554376676449156/gtype.h:72:9`!, 1, |
| 162 | GDK_TYPE_DEVICE_TOOLcxx . . $ `gdk/gdkdevicetool.h:28:9`!); |
| 163 | |
| 164 | /** |
| 165 | * GdkSeat::tool-removed: |
| 166 | * @seat: the object on which the signal is emitted |
| 167 | * @tool: the just removed `GdkDeviceTool` |
| 168 | * |
| 169 | * Emitted whenever a tool is no longer known to this @seat. |
| 170 | */ |
| 171 | signalscxx . . $ signals. [TOOL_REMOVEDcxx . . $ TOOL_REMOVED.] = |
| 172 | g_signal_newcxx . . $ g_signal_new(b0aa5e8090fb95c0). (g_intern_static_stringcxx . . $ g_intern_static_string(fb58d2e09a2a1ce6). ("tool-removed"), |
| 173 | G_TYPE_FROM_CLASScxx . . $ `<external>/9567554376676449156/gtype.h:657:9`! (klass), |
| 174 | G_SIGNAL_RUN_LASTcxx . . $ G_SIGNAL_RUN_LAST., |
| 175 | 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 176 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 177 | G_TYPE_NONEcxx . . $ `<external>/9567554376676449156/gtype.h:72:9`!, 1, |
| 178 | GDK_TYPE_DEVICE_TOOLcxx . . $ `gdk/gdkdevicetool.h:28:9`!); |
| 179 | |
| 180 | /** |
| 181 | * GdkSeat:display: |
| 182 | * |
| 183 | * `GdkDisplay` of this seat. |
| 184 | */ |
| 185 | propscxx . . $ props.[PROP_DISPLAYcxx . . $ PROP_DISPLAY.] = |
| 186 | g_param_spec_objectcxx . . $ g_param_spec_object(faf99966f027a127). ("display", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, |
| 187 | GDK_TYPE_DISPLAYcxx . . $ `gdk/gdkdisplay.h:35:9`!, |
| 188 | G_PARAM_READWRITEcxx . . $ G_PARAM_READWRITE. | |
| 189 | G_PARAM_CONSTRUCT_ONLYcxx . . $ G_PARAM_CONSTRUCT_ONLY. | |
| 190 | G_PARAM_STATIC_STRINGScxx . . $ `<external>/7453068347527694854/gparam.h:187:9`!); |
| 191 | |
| 192 | g_object_class_install_propertiescxx . . $ g_object_class_install_properties(569d03e6a4088541). (object_class, N_PROPScxx . . $ N_PROPS., propscxx . . $ props.); |
| 193 | } |
| 194 | |
| 195 | static void |
| 196 | gdk_seat_initcxx . . $ gdk_seat_init(27d3ca6fe668c180). (GdkSeatcxx . . $ GdkSeat# *seat) |
| 197 | { |
| 198 | } |
| 199 | |
| 200 | /** |
| 201 | * gdk_seat_get_capabilities: |
| 202 | * @seat: a `GdkSeat` |
| 203 | * |
| 204 | * Returns the capabilities this `GdkSeat` currently has. |
| 205 | * |
| 206 | * Returns: the seat capabilities |
| 207 | */ |
| 208 | GdkSeatCapabilitiescxx . . $ GdkSeatCapabilities# |
| 209 | gdk_seat_get_capabilitiescxx . . $ gdk_seat_get_capabilities(2ca3cb027cb5cc44). (GdkSeatcxx . . $ GdkSeat# *seat) |
| 210 | { |
| 211 | GdkSeatClasscxx . . $ GdkSeatClass# *seat_class; |
| 212 | |
| 213 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_SEATcxx . . $ `gdk/gdkseat.h:35:9`! (seat), GDK_SEAT_CAPABILITY_NONE); |
| 214 | |
| 215 | seat_class = GDK_SEAT_GET_CLASScxx . . $ `gdk/gdkseatprivate.h:33:9`! (seat); |
| 216 | return seat_class->get_capabilitiescxx . . $ _GdkSeatClass#get_capabilities. (seat); |
| 217 | } |
| 218 | |
| 219 | /* |
| 220 | * gdk_seat_grab: |
| 221 | * @seat: a `GdkSeat` |
| 222 | * @surface: the `GdkSurface` which will own the grab |
| 223 | * @capabilities: capabilities that will be grabbed |
| 224 | * @owner_events: if %FALSE then all device events are reported with respect to |
| 225 | * @surface and are only reported if selected by @event_mask. If %TRUE then |
| 226 | * pointer events for this application are reported as normal, but pointer |
| 227 | * events outside this application are reported with respect to @surface and |
| 228 | * only if selected by @event_mask. In either mode, unreported events are |
| 229 | * discarded. |
| 230 | * @cursor: (nullable): the cursor to display while the grab is active. |
| 231 | * If this is %NULL then the normal cursors are used for @surface and |
| 232 | * its descendants, and the cursor for @surface is used elsewhere. |
| 233 | * @event: (nullable): the event that is triggering the grab, or %NULL if none |
| 234 | * is available. |
| 235 | * @prepare_func: (nullable) (scope call): function to prepare the surface |
| 236 | * to be grabbed, it can be %NULL if @surface is visible before this call. |
| 237 | * @prepare_func_data: (closure): user data to pass to @prepare_func |
| 238 | * |
| 239 | * Grabs the seat so that all events corresponding to the given @capabilities |
| 240 | * are passed to this application. |
| 241 | * |
| 242 | * The grab remains in place until the seat is ungrabbed with |
| 243 | * [[email protected]], or the surface becomes hidden. This overrides |
| 244 | * any previous grab on the seat by this client. |
| 245 | * |
| 246 | * As a rule of thumb, if a grab is desired over %GDK_SEAT_CAPABILITY_POINTER, |
| 247 | * all other "pointing" capabilities (eg. %GDK_SEAT_CAPABILITY_TOUCH) should |
| 248 | * be grabbed too, so the user is able to interact with all of those while |
| 249 | * the grab holds, you should thus use %GDK_SEAT_CAPABILITY_ALL_POINTING most |
| 250 | * commonly. |
| 251 | * |
| 252 | * Grabs are used for operations which need complete control over the |
| 253 | * events corresponding to the given capabilities. For example in GTK this |
| 254 | * is used for Drag and Drop operations, popup menus and such. |
| 255 | * |
| 256 | * Note that if the event mask of a `GdkSurface` has selected both button press |
| 257 | * and button release events, or touch begin and touch end, then a press event |
| 258 | * will cause an automatic grab until the button is released, equivalent to a |
| 259 | * grab on the surface with @owner_events set to %TRUE. This is done because |
| 260 | * most applications expect to receive paired press and release events. |
| 261 | * |
| 262 | * If you set up anything at the time you take the grab that needs to be |
| 263 | * cleaned up when the grab ends, you should handle the `GdkEventGrabBroken` |
| 264 | * events that are emitted when the grab ends unvoluntarily. |
| 265 | * |
| 266 | * Returns: %GDK_GRAB_SUCCESS if the grab was successful. |
| 267 | */ |
| 268 | GdkGrabStatuscxx . . $ GdkGrabStatus# |
| 269 | gdk_seat_grabcxx . . $ gdk_seat_grab(bb544b740f83e3da). (GdkSeatcxx . . $ GdkSeat# *seat, |
| 270 | GdkSurfacecxx . . $ GdkSurface# *surface, |
| 271 | GdkSeatCapabilitiescxx . . $ GdkSeatCapabilities# capabilities, |
| 272 | gbooleancxx . . $ gboolean# owner_events, |
| 273 | GdkCursorcxx . . $ GdkCursor# *cursor, |
| 274 | GdkEventcxx . . $ GdkEvent# *event, |
| 275 | GdkSeatGrabPrepareFunccxx . . $ GdkSeatGrabPrepareFunc# prepare_func, |
| 276 | gpointercxx . . $ gpointer# prepare_func_data) |
| 277 | { |
| 278 | GdkSeatClasscxx . . $ GdkSeatClass# *seat_class; |
| 279 | |
| 280 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_SEATcxx . . $ `gdk/gdkseat.h:35:9`! (seat), GDK_GRAB_FAILED); |
| 281 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_SURFACEcxx . . $ `gdk/gdksurface.h:44:9`! (surface), GDK_GRAB_FAILED); |
| 282 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (gdk_surface_get_display (surface) == gdk_seat_get_display (seat), GDK_GRAB_FAILED); |
| 283 | |
| 284 | capabilities &= GDK_SEAT_CAPABILITY_ALLcxx . . $ GDK_SEAT_CAPABILITY_ALL.; |
| 285 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (capabilities != GDK_SEAT_CAPABILITY_NONE, GDK_GRAB_FAILED); |
| 286 | |
| 287 | seat_class = GDK_SEAT_GET_CLASScxx . . $ `gdk/gdkseatprivate.h:33:9`! (seat); |
| 288 | |
| 289 | return seat_class->grabcxx . . $ _GdkSeatClass#grab. (seat, surface, capabilities, owner_events, cursor, |
| 290 | event, prepare_func, prepare_func_data); |
| 291 | } |
| 292 | |
| 293 | /* |
| 294 | * gdk_seat_ungrab: |
| 295 | * @seat: a `GdkSeat` |
| 296 | * |
| 297 | * Releases a grab. |
| 298 | * |
| 299 | * See [[email protected]] for more information. |
| 300 | */ |
| 301 | void |
| 302 | gdk_seat_ungrabcxx . . $ gdk_seat_ungrab(27d3ca6fe668c180). (GdkSeatcxx . . $ GdkSeat# *seat) |
| 303 | { |
| 304 | GdkSeatClasscxx . . $ GdkSeatClass# *seat_class; |
| 305 | |
| 306 | g_return_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:652:9`! (GDK_IS_SEATcxx . . $ `gdk/gdkseat.h:35:9`! (seat)); |
| 307 | |
| 308 | seat_class = GDK_SEAT_GET_CLASScxx . . $ `gdk/gdkseatprivate.h:33:9`! (seat); |
| 309 | seat_class->ungrabcxx . . $ _GdkSeatClass#ungrab. (seat); |
| 310 | } |
| 311 | |
| 312 | /** |
| 313 | * gdk_seat_get_devices: |
| 314 | * @seat: a `GdkSeat` |
| 315 | * @capabilities: capabilities to get devices for |
| 316 | * |
| 317 | * Returns the devices that match the given capabilities. |
| 318 | * |
| 319 | * Returns: (transfer container) (element-type GdkDevice): A list |
| 320 | * of `GdkDevices`. The list must be freed with g_list_free(), |
| 321 | * the elements are owned by GTK and must not be freed. |
| 322 | */ |
| 323 | GListcxx . . $ GList# * |
| 324 | gdk_seat_get_devicescxx . . $ gdk_seat_get_devices(135afe3d61e95f28). (GdkSeatcxx . . $ GdkSeat# *seat, |
| 325 | GdkSeatCapabilitiescxx . . $ GdkSeatCapabilities# capabilities) |
| 326 | { |
| 327 | GdkSeatClasscxx . . $ GdkSeatClass# *seat_class; |
| 328 | |
| 329 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_SEATcxx . . $ `gdk/gdkseat.h:35:9`! (seat), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 330 | |
| 331 | seat_class = GDK_SEAT_GET_CLASScxx . . $ `gdk/gdkseatprivate.h:33:9`! (seat); |
| 332 | return seat_class->get_devicescxx . . $ _GdkSeatClass#get_devices. (seat, capabilities); |
| 333 | } |
| 334 | |
| 335 | /** |
| 336 | * gdk_seat_get_pointer: |
| 337 | * @seat: a `GdkSeat` |
| 338 | * |
| 339 | * Returns the device that routes pointer events. |
| 340 | * |
| 341 | * Returns: (transfer none) (nullable): a `GdkDevice` with pointer |
| 342 | * capabilities. This object is owned by GTK and must not be freed. |
| 343 | */ |
| 344 | GdkDevicecxx . . $ GdkDevice# * |
| 345 | gdk_seat_get_pointercxx . . $ gdk_seat_get_pointer(bcf9d88e6a2df60a). (GdkSeatcxx . . $ GdkSeat# *seat) |
| 346 | { |
| 347 | GdkSeatClasscxx . . $ GdkSeatClass# *seat_class; |
| 348 | |
| 349 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_SEATcxx . . $ `gdk/gdkseat.h:35:9`! (seat), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 350 | |
| 351 | seat_class = GDK_SEAT_GET_CLASScxx . . $ `gdk/gdkseatprivate.h:33:9`! (seat); |
| 352 | return seat_class->get_logical_devicecxx . . $ _GdkSeatClass#get_logical_device. (seat, GDK_SEAT_CAPABILITY_POINTERcxx . . $ GDK_SEAT_CAPABILITY_POINTER.); |
| 353 | } |
| 354 | |
| 355 | /** |
| 356 | * gdk_seat_get_keyboard: |
| 357 | * @seat: a `GdkSeat` |
| 358 | * |
| 359 | * Returns the device that routes keyboard events. |
| 360 | * |
| 361 | * Returns: (transfer none) (nullable): a `GdkDevice` with keyboard |
| 362 | * capabilities. This object is owned by GTK and must not be freed. |
| 363 | */ |
| 364 | GdkDevicecxx . . $ GdkDevice# * |
| 365 | gdk_seat_get_keyboardcxx . . $ gdk_seat_get_keyboard(bcf9d88e6a2df60a). (GdkSeatcxx . . $ GdkSeat# *seat) |
| 366 | { |
| 367 | GdkSeatClasscxx . . $ GdkSeatClass# *seat_class; |
| 368 | |
| 369 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_SEATcxx . . $ `gdk/gdkseat.h:35:9`! (seat), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 370 | |
| 371 | seat_class = GDK_SEAT_GET_CLASScxx . . $ `gdk/gdkseatprivate.h:33:9`! (seat); |
| 372 | return seat_class->get_logical_devicecxx . . $ _GdkSeatClass#get_logical_device. (seat, GDK_SEAT_CAPABILITY_KEYBOARDcxx . . $ GDK_SEAT_CAPABILITY_KEYBOARD.); |
| 373 | } |
| 374 | |
| 375 | void |
| 376 | gdk_seat_device_addedcxx . . $ gdk_seat_device_added(5748a382f73b4915). (GdkSeatcxx . . $ GdkSeat# *seat, |
| 377 | GdkDevicecxx . . $ GdkDevice# *device) |
| 378 | { |
| 379 | gdk_device_set_seatcxx . . $ gdk_device_set_seat(8111cb75bce9c102). (device, seat); |
| 380 | g_signal_emitcxx . . $ g_signal_emit(cc3f7c2ba1c6a182). (seat, signalscxx . . $ signals.[DEVICE_ADDEDcxx . . $ DEVICE_ADDED.], 0, device); |
| 381 | } |
| 382 | |
| 383 | void |
| 384 | gdk_seat_device_removedcxx . . $ gdk_seat_device_removed(5748a382f73b4915). (GdkSeatcxx . . $ GdkSeat# *seat, |
| 385 | GdkDevicecxx . . $ GdkDevice# *device) |
| 386 | { |
| 387 | gdk_device_set_seatcxx . . $ gdk_device_set_seat(8111cb75bce9c102). (device, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 388 | g_signal_emitcxx . . $ g_signal_emit(cc3f7c2ba1c6a182). (seat, signalscxx . . $ signals.[DEVICE_REMOVEDcxx . . $ DEVICE_REMOVED.], 0, device); |
| 389 | } |
| 390 | |
| 391 | /** |
| 392 | * gdk_seat_get_display: |
| 393 | * @seat: a `GdkSeat` |
| 394 | * |
| 395 | * Returns the `GdkDisplay` this seat belongs to. |
| 396 | * |
| 397 | * Returns: (transfer none): a `GdkDisplay`. This object |
| 398 | * is owned by GTK and must not be freed. |
| 399 | */ |
| 400 | GdkDisplaycxx . . $ GdkDisplay# * |
| 401 | gdk_seat_get_displaycxx . . $ gdk_seat_get_display(df4bd6f4d670a1ca). (GdkSeatcxx . . $ GdkSeat# *seat) |
| 402 | { |
| 403 | GdkSeatPrivatecxx . . $ GdkSeatPrivate# *priv = gdk_seat_get_instance_privatecxx . . $ gdk_seat_get_instance_private(2cf2c29f94bcbd6e). (seat); |
| 404 | |
| 405 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_SEATcxx . . $ `gdk/gdkseat.h:35:9`! (seat), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 406 | |
| 407 | return priv->displaycxx . . $ _GdkSeatPrivate#display.; |
| 408 | } |
| 409 | |
| 410 | void |
| 411 | gdk_seat_tool_addedcxx . . $ gdk_seat_tool_added(2e57776298fcb5da). (GdkSeatcxx . . $ GdkSeat# *seat, |
| 412 | GdkDeviceToolcxx . . $ GdkDeviceTool# *tool) |
| 413 | { |
| 414 | g_signal_emitcxx . . $ g_signal_emit(cc3f7c2ba1c6a182). (seat, signalscxx . . $ signals.[TOOL_ADDEDcxx . . $ TOOL_ADDED.], 0, tool); |
| 415 | } |
| 416 | |
| 417 | void |
| 418 | gdk_seat_tool_removedcxx . . $ gdk_seat_tool_removed(2e57776298fcb5da). (GdkSeatcxx . . $ GdkSeat# *seat, |
| 419 | GdkDeviceToolcxx . . $ GdkDeviceTool# *tool) |
| 420 | { |
| 421 | g_signal_emitcxx . . $ g_signal_emit(cc3f7c2ba1c6a182). (seat, signalscxx . . $ signals.[TOOL_REMOVEDcxx . . $ TOOL_REMOVED.], 0, tool); |
| 422 | } |
| 423 | |
| 424 | GdkDeviceToolcxx . . $ GdkDeviceTool# * |
| 425 | gdk_seat_get_toolcxx . . $ gdk_seat_get_tool(4af9d59a37ea1f2e). (GdkSeatcxx . . $ GdkSeat# *seat, |
| 426 | guint64cxx . . $ guint64# serial, |
| 427 | guint64cxx . . $ guint64# hw_id, |
| 428 | GdkDeviceToolTypecxx . . $ GdkDeviceToolType# type) |
| 429 | { |
| 430 | GdkDeviceToolcxx . . $ GdkDeviceTool# *match = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 431 | GListcxx . . $ GList# *tools, *l; |
| 432 | |
| 433 | tools = gdk_seat_get_toolscxx . . $ gdk_seat_get_tools(77f306e6b47c8790). (seat); |
| 434 | |
| 435 | for (l = tools; l; l = l->nextcxx . . $ _GList#next.) |
| 436 | { |
| 437 | GdkDeviceToolcxx . . $ GdkDeviceTool# *tool = l->datacxx . . $ _GList#data.; |
| 438 | |
| 439 | if (tool->serialcxx . . $ _GdkDeviceTool#serial. == serial && tool->hw_idcxx . . $ _GdkDeviceTool#hw_id. == hw_id && tool->typecxx . . $ _GdkDeviceTool#type. == type) |
| 440 | { |
| 441 | match = tool; |
| 442 | break; |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | g_list_freecxx . . $ g_list_free(d1b6ff1ff9a6d4b6). (tools); |
| 447 | |
| 448 | return match; |
| 449 | } |
| 450 | |
| 451 | /** |
| 452 | * gdk_seat_get_tools: |
| 453 | * @seat: a `GdkSeat` |
| 454 | * |
| 455 | * Returns all `GdkDeviceTools` that are known to the application. |
| 456 | * |
| 457 | * Returns: (transfer container) (element-type Gdk.DeviceTool): |
| 458 | * A list of tools. Free with g_list_free(). |
| 459 | */ |
| 460 | GListcxx . . $ GList# * |
| 461 | gdk_seat_get_toolscxx . . $ gdk_seat_get_tools(77f306e6b47c8790). (GdkSeatcxx . . $ GdkSeat# *seat) |
| 462 | { |
| 463 | GdkSeatClasscxx . . $ GdkSeatClass# *seat_class; |
| 464 | |
| 465 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (GDK_IS_SEATcxx . . $ `gdk/gdkseat.h:35:9`! (seat), NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 466 | |
| 467 | seat_class = GDK_SEAT_GET_CLASScxx . . $ `gdk/gdkseatprivate.h:33:9`! (seat); |
| 468 | return seat_class->get_toolscxx . . $ _GdkSeatClass#get_tools. (seat); |
| 469 | } |