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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files.git)
// DO NOT EDIT

#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
#![allow(
    clippy::approx_constant,
    clippy::type_complexity,
    clippy::unreadable_literal,
    clippy::upper_case_acronyms
)]
#![cfg_attr(feature = "dox", feature(doc_cfg))]

use glib_sys as glib;

#[allow(unused_imports)]
use libc::{
    c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
    intptr_t, size_t, ssize_t, time_t, uintptr_t, FILE,
};

#[allow(unused_imports)]
use glib::{gboolean, gconstpointer, gpointer, GType};

// Callbacks
pub type GdkWaylandToplevelExported =
    Option<unsafe extern "C" fn(*mut GdkWaylandToplevel, *const c_char, gpointer)>;

// Records
#[repr(C)]
pub struct _GdkWaylandDeviceClass(c_void);

pub type GdkWaylandDeviceClass = *mut _GdkWaylandDeviceClass;

#[repr(C)]
pub struct _GdkWaylandDisplayClass(c_void);

pub type GdkWaylandDisplayClass = *mut _GdkWaylandDisplayClass;

#[repr(C)]
pub struct _GdkWaylandGLContextClass(c_void);

pub type GdkWaylandGLContextClass = *mut _GdkWaylandGLContextClass;

#[repr(C)]
pub struct _GdkWaylandMonitorClass(c_void);

pub type GdkWaylandMonitorClass = *mut _GdkWaylandMonitorClass;

#[repr(C)]
pub struct _GdkWaylandSeatClass(c_void);

pub type GdkWaylandSeatClass = *mut _GdkWaylandSeatClass;

// Classes
#[repr(C)]
pub struct GdkWaylandDevice(c_void);

impl ::std::fmt::Debug for GdkWaylandDevice {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GdkWaylandDevice @ {:p}", self))
            .finish()
    }
}

#[repr(C)]
pub struct GdkWaylandDisplay(c_void);

impl ::std::fmt::Debug for GdkWaylandDisplay {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GdkWaylandDisplay @ {:p}", self))
            .finish()
    }
}

#[repr(C)]
pub struct GdkWaylandGLContext(c_void);

impl ::std::fmt::Debug for GdkWaylandGLContext {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GdkWaylandGLContext @ {:p}", self))
            .finish()
    }
}

#[repr(C)]
pub struct GdkWaylandMonitor(c_void);

impl ::std::fmt::Debug for GdkWaylandMonitor {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GdkWaylandMonitor @ {:p}", self))
            .finish()
    }
}

#[repr(C)]
pub struct GdkWaylandPopup(c_void);

impl ::std::fmt::Debug for GdkWaylandPopup {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GdkWaylandPopup @ {:p}", self))
            .finish()
    }
}

#[repr(C)]
pub struct GdkWaylandSeat(c_void);

impl ::std::fmt::Debug for GdkWaylandSeat {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GdkWaylandSeat @ {:p}", self))
            .finish()
    }
}

#[repr(C)]
pub struct GdkWaylandSurface(c_void);

impl ::std::fmt::Debug for GdkWaylandSurface {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GdkWaylandSurface @ {:p}", self))
            .finish()
    }
}

#[repr(C)]
pub struct GdkWaylandToplevel(c_void);

impl ::std::fmt::Debug for GdkWaylandToplevel {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("GdkWaylandToplevel @ {:p}", self))
            .finish()
    }
}

#[link(name = "gtk-4")]
extern "C" {

    //=========================================================================
    // GdkWaylandDevice
    //=========================================================================
    pub fn gdk_wayland_device_get_type() -> GType;
    pub fn gdk_wayland_device_get_node_path(device: *mut GdkWaylandDevice) -> *const c_char;
    pub fn gdk_wayland_device_get_wl_keyboard(device: *mut GdkWaylandDevice) -> gpointer;
    pub fn gdk_wayland_device_get_wl_pointer(device: *mut GdkWaylandDevice) -> gpointer;
    pub fn gdk_wayland_device_get_wl_seat(device: *mut GdkWaylandDevice) -> gpointer;

    //=========================================================================
    // GdkWaylandDisplay
    //=========================================================================
    pub fn gdk_wayland_display_get_type() -> GType;
    pub fn gdk_wayland_display_get_startup_notification_id(
        display: *mut GdkWaylandDisplay,
    ) -> *const c_char;
    pub fn gdk_wayland_display_get_wl_compositor(display: *mut GdkWaylandDisplay) -> gpointer;
    pub fn gdk_wayland_display_get_wl_display(display: *mut GdkWaylandDisplay) -> gpointer;
    pub fn gdk_wayland_display_query_registry(
        display: *mut GdkWaylandDisplay,
        global: *const c_char,
    ) -> gboolean;
    pub fn gdk_wayland_display_set_cursor_theme(
        display: *mut GdkWaylandDisplay,
        name: *const c_char,
        size: c_int,
    );
    pub fn gdk_wayland_display_set_startup_notification_id(
        display: *mut GdkWaylandDisplay,
        startup_id: *const c_char,
    );

    //=========================================================================
    // GdkWaylandGLContext
    //=========================================================================
    pub fn gdk_wayland_gl_context_get_type() -> GType;

    //=========================================================================
    // GdkWaylandMonitor
    //=========================================================================
    pub fn gdk_wayland_monitor_get_type() -> GType;
    pub fn gdk_wayland_monitor_get_wl_output(monitor: *mut GdkWaylandMonitor) -> gpointer;

    //=========================================================================
    // GdkWaylandPopup
    //=========================================================================
    pub fn gdk_wayland_popup_get_type() -> GType;

    //=========================================================================
    // GdkWaylandSeat
    //=========================================================================
    pub fn gdk_wayland_seat_get_type() -> GType;
    pub fn gdk_wayland_seat_get_wl_seat(seat: *mut GdkWaylandSeat) -> gpointer;

    //=========================================================================
    // GdkWaylandSurface
    //=========================================================================
    pub fn gdk_wayland_surface_get_type() -> GType;
    pub fn gdk_wayland_surface_get_wl_surface(surface: *mut GdkWaylandSurface) -> gpointer;

    //=========================================================================
    // GdkWaylandToplevel
    //=========================================================================
    pub fn gdk_wayland_toplevel_get_type() -> GType;
    pub fn gdk_wayland_toplevel_export_handle(
        toplevel: *mut GdkWaylandToplevel,
        callback: GdkWaylandToplevelExported,
        user_data: gpointer,
        destroy_func: glib::GDestroyNotify,
    ) -> gboolean;
    pub fn gdk_wayland_toplevel_set_application_id(
        toplevel: *mut GdkWaylandToplevel,
        application_id: *const c_char,
    );
    pub fn gdk_wayland_toplevel_set_transient_for_exported(
        toplevel: *mut GdkWaylandToplevel,
        parent_handle_str: *const c_char,
    ) -> gboolean;
    pub fn gdk_wayland_toplevel_unexport_handle(toplevel: *mut GdkWaylandToplevel);

}