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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
// 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

#![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(docsrs, feature(doc_cfg))]

use gdk4_sys as gdk;
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, off_t, size_t, ssize_t, time_t, uintptr_t, FILE,
};
#[cfg(unix)]
#[allow(unused_imports)]
use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t};

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

// Enums
pub type GdkWin32MessageFilterReturn = c_int;
pub const GDK_WIN32_MESSAGE_FILTER_CONTINUE: GdkWin32MessageFilterReturn = 0;
pub const GDK_WIN32_MESSAGE_FILTER_REMOVE: GdkWin32MessageFilterReturn = 1;

// Callbacks
pub type GdkWin32MessageFilterFunc = Option<
    unsafe extern "C" fn(
        *mut GdkWin32Display,
        gpointer,
        *mut c_int,
        gpointer,
    ) -> GdkWin32MessageFilterReturn,
>;

// Records
#[repr(C)]
pub struct _GdkWin32DisplayClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32DisplayClass = _GdkWin32DisplayClass;

#[repr(C)]
pub struct _GdkWin32DisplayManagerClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32DisplayManagerClass = _GdkWin32DisplayManagerClass;

#[repr(C)]
pub struct _GdkWin32DragClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32DragClass = _GdkWin32DragClass;

#[repr(C)]
pub struct _GdkWin32GLContextClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32GLContextClass = _GdkWin32GLContextClass;

#[repr(C)]
pub struct _GdkWin32HCursorClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32HCursorClass = _GdkWin32HCursorClass;

#[repr(C)]
pub struct _GdkWin32MonitorClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32MonitorClass = _GdkWin32MonitorClass;

#[repr(C)]
pub struct _GdkWin32ScreenClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32ScreenClass = _GdkWin32ScreenClass;

#[repr(C)]
pub struct _GdkWin32SurfaceClass {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type GdkWin32SurfaceClass = _GdkWin32SurfaceClass;

// Classes
#[repr(C)]
pub struct GdkWin32Display {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct GdkWin32DisplayManager {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct GdkWin32Drag {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct GdkWin32GLContext {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct GdkWin32HCursor {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct GdkWin32Monitor {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct GdkWin32Screen {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

#[repr(C)]
pub struct GdkWin32Surface {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

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

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

    //=========================================================================
    // GdkWin32Display
    //=========================================================================
    pub fn gdk_win32_display_get_type() -> GType;
    pub fn gdk_win32_display_get_primary_monitor(
        display: *mut gdk::GdkDisplay,
    ) -> *mut gdk::GdkMonitor;
    pub fn gdk_win32_display_get_wgl_version(
        display: *mut gdk::GdkDisplay,
        major: *mut c_int,
        minor: *mut c_int,
    ) -> gboolean;
    pub fn gdk_win32_display_add_filter(
        display: *mut GdkWin32Display,
        function: GdkWin32MessageFilterFunc,
        data: gpointer,
    );
    #[cfg(feature = "v4_4")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v4_4")))]
    pub fn gdk_win32_display_get_egl_display(display: *mut GdkWin32Display) -> gpointer;
    pub fn gdk_win32_display_get_win32hcursor(
        display: *mut GdkWin32Display,
        cursor: *mut gdk::GdkCursor,
    ) -> *mut GdkWin32HCursor;
    pub fn gdk_win32_display_remove_filter(
        display: *mut GdkWin32Display,
        function: GdkWin32MessageFilterFunc,
        data: gpointer,
    );
    pub fn gdk_win32_display_set_cursor_theme(
        display: *mut GdkWin32Display,
        name: *const c_char,
        size: c_int,
    );

    //=========================================================================
    // GdkWin32DisplayManager
    //=========================================================================
    pub fn gdk_win32_display_manager_get_type() -> GType;

    //=========================================================================
    // GdkWin32Drag
    //=========================================================================
    pub fn gdk_win32_drag_get_type() -> GType;

    //=========================================================================
    // GdkWin32GLContext
    //=========================================================================
    pub fn gdk_win32_gl_context_get_type() -> GType;

    //=========================================================================
    // GdkWin32HCursor
    //=========================================================================
    pub fn gdk_win32_hcursor_get_type() -> GType;
    pub fn gdk_win32_hcursor_new(
        display: *mut GdkWin32Display,
        handle: ssize_t,
        destroyable: gboolean,
    ) -> *mut GdkWin32HCursor;

    //=========================================================================
    // GdkWin32Monitor
    //=========================================================================
    pub fn gdk_win32_monitor_get_type() -> GType;
    pub fn gdk_win32_monitor_get_workarea(
        monitor: *mut gdk::GdkMonitor,
        workarea: *mut gdk::GdkRectangle,
    );

    //=========================================================================
    // GdkWin32Screen
    //=========================================================================
    pub fn gdk_win32_screen_get_type() -> GType;

    //=========================================================================
    // GdkWin32Surface
    //=========================================================================
    pub fn gdk_win32_surface_get_type() -> GType;
    pub fn gdk_win32_surface_get_impl_hwnd(surface: *mut gdk::GdkSurface) -> ssize_t;
    pub fn gdk_win32_surface_is_win32(surface: *mut gdk::GdkSurface) -> gboolean;
    pub fn gdk_win32_surface_lookup_for_display(
        display: *mut gdk::GdkDisplay,
        anid: ssize_t,
    ) -> *mut gdk::GdkSurface;
    pub fn gdk_win32_surface_get_handle(surface: *mut GdkWin32Surface) -> ssize_t;
    pub fn gdk_win32_surface_set_urgency_hint(surface: *mut GdkWin32Surface, urgent: gboolean);

    //=========================================================================
    // Other functions
    //=========================================================================
    pub fn gdk_win32_handle_table_lookup(handle: ssize_t) -> gpointer;

}