1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::X11DeviceCore;
use crate::X11DeviceManagerCore;
use crate::X11Display;
use crate::X11Window;
use glib::object::IsA;
use glib::translate::*;
use x11::xlib;

#[doc(alias = "gdk_x11_atom_to_xatom")]
pub fn x11_atom_to_xatom(atom: &gdk::Atom) -> xlib::Atom {
    assert_initialized_main_thread!();
    unsafe { ffi::gdk_x11_atom_to_xatom(atom.to_glib_none().0) }
}

#[doc(alias = "gdk_x11_atom_to_xatom_for_display")]
pub fn x11_atom_to_xatom_for_display(display: &X11Display, atom: &gdk::Atom) -> xlib::Atom {
    skip_assert_initialized!();
    unsafe {
        ffi::gdk_x11_atom_to_xatom_for_display(display.to_glib_none().0, atom.to_glib_none().0)
    }
}

#[doc(alias = "gdk_x11_device_get_id")]
pub fn x11_device_get_id(device: &X11DeviceCore) -> i32 {
    skip_assert_initialized!();
    unsafe { ffi::gdk_x11_device_get_id(device.to_glib_none().0) }
}

#[doc(alias = "gdk_x11_device_manager_lookup")]
pub fn x11_device_manager_lookup(
    device_manager: &impl IsA<X11DeviceManagerCore>,
    device_id: i32,
) -> Option<X11DeviceCore> {
    skip_assert_initialized!();
    unsafe {
        from_glib_none(ffi::gdk_x11_device_manager_lookup(
            device_manager.as_ref().to_glib_none().0,
            device_id,
        ))
    }
}

#[doc(alias = "gdk_x11_get_default_root_xwindow")]
pub fn x11_get_default_root_xwindow() -> xlib::Window {
    assert_initialized_main_thread!();
    unsafe { ffi::gdk_x11_get_default_root_xwindow() }
}

#[doc(alias = "gdk_x11_get_default_screen")]
pub fn x11_get_default_screen() -> i32 {
    assert_initialized_main_thread!();
    unsafe { ffi::gdk_x11_get_default_screen() }
}

//#[cfg_attr(feature = "v3_24", deprecated = "Since 3.24")]
//#[cfg(any(feature = "v3_24_2", feature = "dox"))]
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v3_24_2")))]
//#[doc(alias = "gdk_x11_get_parent_relative_pattern")]
//pub fn x11_get_parent_relative_pattern() -> /*Ignored*/Option<cairo::Pattern> {
//    unsafe { TODO: call ffi:gdk_x11_get_parent_relative_pattern() }
//}

#[doc(alias = "gdk_x11_get_server_time")]
pub fn x11_get_server_time(window: &X11Window) -> u32 {
    skip_assert_initialized!();
    unsafe { ffi::gdk_x11_get_server_time(window.to_glib_none().0) }
}

#[doc(alias = "gdk_x11_get_xatom_by_name")]
pub fn x11_get_xatom_by_name(atom_name: &str) -> xlib::Atom {
    assert_initialized_main_thread!();
    unsafe { ffi::gdk_x11_get_xatom_by_name(atom_name.to_glib_none().0) }
}

#[doc(alias = "gdk_x11_get_xatom_by_name_for_display")]
pub fn x11_get_xatom_by_name_for_display(display: &X11Display, atom_name: &str) -> xlib::Atom {
    skip_assert_initialized!();
    unsafe {
        ffi::gdk_x11_get_xatom_by_name_for_display(
            display.to_glib_none().0,
            atom_name.to_glib_none().0,
        )
    }
}

#[doc(alias = "gdk_x11_get_xatom_name")]
pub fn x11_get_xatom_name(xatom: xlib::Atom) -> Option<glib::GString> {
    assert_initialized_main_thread!();
    unsafe { from_glib_none(ffi::gdk_x11_get_xatom_name(xatom)) }
}

#[doc(alias = "gdk_x11_get_xatom_name_for_display")]
pub fn x11_get_xatom_name_for_display(
    display: &X11Display,
    xatom: xlib::Atom,
) -> Option<glib::GString> {
    skip_assert_initialized!();
    unsafe {
        from_glib_none(ffi::gdk_x11_get_xatom_name_for_display(
            display.to_glib_none().0,
            xatom,
        ))
    }
}

#[doc(alias = "gdk_x11_grab_server")]
pub fn x11_grab_server() {
    assert_initialized_main_thread!();
    unsafe {
        ffi::gdk_x11_grab_server();
    }
}

#[doc(alias = "gdk_x11_register_standard_event_type")]
pub fn x11_register_standard_event_type(display: &X11Display, event_base: i32, n_events: i32) {
    skip_assert_initialized!();
    unsafe {
        ffi::gdk_x11_register_standard_event_type(display.to_glib_none().0, event_base, n_events);
    }
}

#[doc(alias = "gdk_x11_set_sm_client_id")]
pub fn x11_set_sm_client_id(sm_client_id: Option<&str>) {
    assert_initialized_main_thread!();
    unsafe {
        ffi::gdk_x11_set_sm_client_id(sm_client_id.to_glib_none().0);
    }
}

#[doc(alias = "gdk_x11_ungrab_server")]
pub fn x11_ungrab_server() {
    assert_initialized_main_thread!();
    unsafe {
        ffi::gdk_x11_ungrab_server();
    }
}

#[doc(alias = "gdk_x11_xatom_to_atom")]
pub fn x11_xatom_to_atom(xatom: xlib::Atom) -> Option<gdk::Atom> {
    assert_initialized_main_thread!();
    unsafe { from_glib_none(ffi::gdk_x11_xatom_to_atom(xatom)) }
}

#[doc(alias = "gdk_x11_xatom_to_atom_for_display")]
pub fn x11_xatom_to_atom_for_display(display: &X11Display, xatom: xlib::Atom) -> Option<gdk::Atom> {
    skip_assert_initialized!();
    unsafe {
        from_glib_none(ffi::gdk_x11_xatom_to_atom_for_display(
            display.to_glib_none().0,
            xatom,
        ))
    }
}