Skip to main content

gdk4_x11/auto/
functions.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::{X11DeviceManagerXI2, X11DeviceXI2, X11Surface, ffi};
6use glib::translate::*;
7
8/// Returns the device ID as seen by XInput2.
9///
10/// # Deprecated since 4.18
11///
12/// ## `device`
13/// a [`gdk::Device`][crate::gdk::Device]
14///
15/// # Returns
16///
17/// the XInput2 device ID
18#[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
19#[allow(deprecated)]
20#[doc(alias = "gdk_x11_device_get_id")]
21pub fn x11_device_get_id(device: &X11DeviceXI2) -> i32 {
22    skip_assert_initialized!();
23    unsafe { ffi::gdk_x11_device_get_id(device.to_glib_none().0) }
24}
25
26/// Returns the [`gdk::Device`][crate::gdk::Device] that wraps the given device ID.
27///
28/// # Deprecated since 4.18
29///
30/// ## `device_manager`
31/// a `GdkDeviceManager`
32/// ## `device_id`
33/// a device ID, as understood by the XInput2 protocol
34///
35/// # Returns
36///
37/// t currently represent a device.
38#[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
39#[allow(deprecated)]
40#[doc(alias = "gdk_x11_device_manager_lookup")]
41pub fn x11_device_manager_lookup(
42    device_manager: &X11DeviceManagerXI2,
43    device_id: i32,
44) -> Option<X11DeviceXI2> {
45    skip_assert_initialized!();
46    unsafe {
47        from_glib_none(ffi::gdk_x11_device_manager_lookup(
48            device_manager.to_glib_none().0,
49            device_id,
50        ))
51    }
52}
53
54/// Routine to get the current X server time stamp.
55///
56/// # Deprecated since 4.18
57///
58/// ## `surface`
59/// a [`gdk::Surface`][crate::gdk::Surface], used for communication
60///   with the server. The surface must have `GDK_PROPERTY_CHANGE_MASK` in
61///   its events mask or a hang will result.
62///
63/// # Returns
64///
65/// the time stamp
66#[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
67#[allow(deprecated)]
68#[doc(alias = "gdk_x11_get_server_time")]
69pub fn x11_get_server_time(surface: &X11Surface) -> u32 {
70    skip_assert_initialized!();
71    unsafe { ffi::gdk_x11_get_server_time(surface.to_glib_none().0) }
72}
73
74/// s state using the X11R6 ICCCM
75/// session management protocol.
76///
77/// See the X Session Management Library documentation for more information on
78/// session management and the Inter-Client Communication Conventions Manual
79///
80/// # Deprecated since 4.18
81///
82/// ## `sm_client_id`
83/// the client id assigned by the session manager
84///    when the connection was opened, or [`None`] to remove the property.
85#[cfg_attr(feature = "v4_18", deprecated = "Since 4.18")]
86#[allow(deprecated)]
87#[doc(alias = "gdk_x11_set_sm_client_id")]
88pub fn x11_set_sm_client_id(sm_client_id: Option<&str>) {
89    assert_initialized_main_thread!();
90    unsafe {
91        ffi::gdk_x11_set_sm_client_id(sm_client_id.to_glib_none().0);
92    }
93}