gvnc_sys/
lib.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from
3// from gir-files (https://github.com/gtk-rs/gir-files.git)
4// DO NOT EDIT
5
6#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
7#![allow(
8    clippy::approx_constant,
9    clippy::type_complexity,
10    clippy::unreadable_literal,
11    clippy::upper_case_acronyms
12)]
13#![cfg_attr(docsrs, feature(doc_cfg))]
14
15use gio_sys as gio;
16use glib_sys as glib;
17use gobject_sys as gobject;
18
19#[cfg(unix)]
20#[allow(unused_imports)]
21use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t};
22#[allow(unused_imports)]
23use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE};
24#[allow(unused_imports)]
25use std::ffi::{
26    c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
27};
28
29#[allow(unused_imports)]
30use glib::{gboolean, gconstpointer, gpointer, GType};
31
32// Enums
33pub type VncAudioFormatType = c_int;
34pub const VNC_AUDIO_FORMAT_RAW_U8: VncAudioFormatType = 0;
35pub const VNC_AUDIO_FORMAT_RAW_S8: VncAudioFormatType = 1;
36pub const VNC_AUDIO_FORMAT_RAW_U16: VncAudioFormatType = 2;
37pub const VNC_AUDIO_FORMAT_RAW_S16: VncAudioFormatType = 3;
38pub const VNC_AUDIO_FORMAT_RAW_U32: VncAudioFormatType = 4;
39pub const VNC_AUDIO_FORMAT_RAW_S32: VncAudioFormatType = 5;
40
41pub type VncConnectionAuth = c_int;
42pub const VNC_CONNECTION_AUTH_INVALID: VncConnectionAuth = 0;
43pub const VNC_CONNECTION_AUTH_NONE: VncConnectionAuth = 1;
44pub const VNC_CONNECTION_AUTH_VNC: VncConnectionAuth = 2;
45pub const VNC_CONNECTION_AUTH_RA2: VncConnectionAuth = 5;
46pub const VNC_CONNECTION_AUTH_RA2NE: VncConnectionAuth = 6;
47pub const VNC_CONNECTION_AUTH_TIGHT: VncConnectionAuth = 16;
48pub const VNC_CONNECTION_AUTH_ULTRA: VncConnectionAuth = 17;
49pub const VNC_CONNECTION_AUTH_TLS: VncConnectionAuth = 18;
50pub const VNC_CONNECTION_AUTH_VENCRYPT: VncConnectionAuth = 19;
51pub const VNC_CONNECTION_AUTH_SASL: VncConnectionAuth = 20;
52pub const VNC_CONNECTION_AUTH_ARD: VncConnectionAuth = 30;
53pub const VNC_CONNECTION_AUTH_MSLOGONII: VncConnectionAuth = 113;
54pub const VNC_CONNECTION_AUTH_MSLOGON: VncConnectionAuth = -6;
55
56pub type VncConnectionAuthVencrypt = c_int;
57pub const VNC_CONNECTION_AUTH_VENCRYPT_PLAIN: VncConnectionAuthVencrypt = 256;
58pub const VNC_CONNECTION_AUTH_VENCRYPT_TLSNONE: VncConnectionAuthVencrypt = 257;
59pub const VNC_CONNECTION_AUTH_VENCRYPT_TLSVNC: VncConnectionAuthVencrypt = 258;
60pub const VNC_CONNECTION_AUTH_VENCRYPT_TLSPLAIN: VncConnectionAuthVencrypt = 259;
61pub const VNC_CONNECTION_AUTH_VENCRYPT_X509NONE: VncConnectionAuthVencrypt = 260;
62pub const VNC_CONNECTION_AUTH_VENCRYPT_X509VNC: VncConnectionAuthVencrypt = 261;
63pub const VNC_CONNECTION_AUTH_VENCRYPT_X509PLAIN: VncConnectionAuthVencrypt = 262;
64pub const VNC_CONNECTION_AUTH_VENCRYPT_X509SASL: VncConnectionAuthVencrypt = 263;
65pub const VNC_CONNECTION_AUTH_VENCRYPT_TLSSASL: VncConnectionAuthVencrypt = 264;
66
67pub type VncConnectionCredential = c_int;
68pub const VNC_CONNECTION_CREDENTIAL_PASSWORD: VncConnectionCredential = 0;
69pub const VNC_CONNECTION_CREDENTIAL_USERNAME: VncConnectionCredential = 1;
70pub const VNC_CONNECTION_CREDENTIAL_CLIENTNAME: VncConnectionCredential = 2;
71
72pub type VncConnectionEncoding = c_int;
73pub const VNC_CONNECTION_ENCODING_RAW: VncConnectionEncoding = 0;
74pub const VNC_CONNECTION_ENCODING_COPY_RECT: VncConnectionEncoding = 1;
75pub const VNC_CONNECTION_ENCODING_RRE: VncConnectionEncoding = 2;
76pub const VNC_CONNECTION_ENCODING_CORRE: VncConnectionEncoding = 4;
77pub const VNC_CONNECTION_ENCODING_HEXTILE: VncConnectionEncoding = 5;
78pub const VNC_CONNECTION_ENCODING_TIGHT: VncConnectionEncoding = 7;
79pub const VNC_CONNECTION_ENCODING_ZRLE: VncConnectionEncoding = 16;
80pub const VNC_CONNECTION_ENCODING_TIGHT_JPEG0: VncConnectionEncoding = -32;
81pub const VNC_CONNECTION_ENCODING_TIGHT_JPEG1: VncConnectionEncoding = -31;
82pub const VNC_CONNECTION_ENCODING_TIGHT_JPEG2: VncConnectionEncoding = -30;
83pub const VNC_CONNECTION_ENCODING_TIGHT_JPEG3: VncConnectionEncoding = -29;
84pub const VNC_CONNECTION_ENCODING_TIGHT_JPEG4: VncConnectionEncoding = -28;
85pub const VNC_CONNECTION_ENCODING_TIGHT_JPEG5: VncConnectionEncoding = -27;
86pub const VNC_CONNECTION_ENCODING_TIGHT_JPEG6: VncConnectionEncoding = -26;
87pub const VNC_CONNECTION_ENCODING_TIGHT_JPEG7: VncConnectionEncoding = -25;
88pub const VNC_CONNECTION_ENCODING_TIGHT_JPEG8: VncConnectionEncoding = -24;
89pub const VNC_CONNECTION_ENCODING_TIGHT_JPEG9: VncConnectionEncoding = -23;
90pub const VNC_CONNECTION_ENCODING_DESKTOP_RESIZE: VncConnectionEncoding = -223;
91pub const VNC_CONNECTION_ENCODING_LAST_RECT: VncConnectionEncoding = -224;
92pub const VNC_CONNECTION_ENCODING_WMVi: VncConnectionEncoding = 1464686185;
93pub const VNC_CONNECTION_ENCODING_CURSOR_POS: VncConnectionEncoding = -232;
94pub const VNC_CONNECTION_ENCODING_RICH_CURSOR: VncConnectionEncoding = -239;
95pub const VNC_CONNECTION_ENCODING_XCURSOR: VncConnectionEncoding = -240;
96pub const VNC_CONNECTION_ENCODING_POINTER_CHANGE: VncConnectionEncoding = -257;
97pub const VNC_CONNECTION_ENCODING_EXT_KEY_EVENT: VncConnectionEncoding = -258;
98pub const VNC_CONNECTION_ENCODING_AUDIO: VncConnectionEncoding = -259;
99pub const VNC_CONNECTION_ENCODING_LED_STATE: VncConnectionEncoding = -261;
100pub const VNC_CONNECTION_ENCODING_DESKTOP_NAME: VncConnectionEncoding = -307;
101pub const VNC_CONNECTION_ENCODING_EXTENDED_DESKTOP_RESIZE: VncConnectionEncoding = -308;
102pub const VNC_CONNECTION_ENCODING_XVP: VncConnectionEncoding = -309;
103pub const VNC_CONNECTION_ENCODING_ALPHA_CURSOR: VncConnectionEncoding = -314;
104
105pub type VncConnectionPowerAction = c_int;
106pub const VNC_CONNECTION_POWER_ACTION_SHUTDOWN: VncConnectionPowerAction = 2;
107pub const VNC_CONNECTION_POWER_ACTION_REBOOT: VncConnectionPowerAction = 3;
108pub const VNC_CONNECTION_POWER_ACTION_RESET: VncConnectionPowerAction = 4;
109
110pub type VncConnectionResizeStatus = c_int;
111pub const VNC_CONNECTION_RESIZE_STATUS_UNSUPPORTED: VncConnectionResizeStatus = -1;
112pub const VNC_CONNECTION_RESIZE_STATUS_OK: VncConnectionResizeStatus = 0;
113pub const VNC_CONNECTION_RESIZE_STATUS_ADMIN_PROHIBITED: VncConnectionResizeStatus = 1;
114pub const VNC_CONNECTION_RESIZE_STATUS_OUT_OF_RESOURCES: VncConnectionResizeStatus = 2;
115pub const VNC_CONNECTION_RESIZE_STATUS_INVALID_LAOUT: VncConnectionResizeStatus = 3;
116pub const VNC_CONNECTION_RESIZE_STATUS_FORWARDED: VncConnectionResizeStatus = 4;
117
118// Constants
119pub const VNC_LEDSTATE_CAPS_LOCK: c_int = 4;
120pub const VNC_LEDSTATE_NUM_LOCK: c_int = 2;
121pub const VNC_LEDSTATE_SCROLL_LOCK: c_int = 1;
122pub const VNC_MAJOR_VERSION: c_int = 1;
123pub const VNC_MICRO_VERSION: c_int = 1;
124pub const VNC_MINOR_VERSION: c_int = 3;
125pub const VNC_PADDING: c_int = 4;
126pub const VNC_PADDING_LARGE: c_int = 20;
127
128// Records
129#[derive(Copy, Clone)]
130#[repr(C)]
131pub struct VncAudioFormat {
132    pub format: u8,
133    pub nchannels: u8,
134    pub frequency: u32,
135}
136
137impl ::std::fmt::Debug for VncAudioFormat {
138    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
139        f.debug_struct(&format!("VncAudioFormat @ {self:p}"))
140            .field("format", &self.format)
141            .field("nchannels", &self.nchannels)
142            .field("frequency", &self.frequency)
143            .finish()
144    }
145}
146
147#[derive(Copy, Clone)]
148#[repr(C)]
149pub struct VncAudioInterface {
150    pub parent: gobject::GTypeInterface,
151    pub playback_start:
152        Option<unsafe extern "C" fn(*mut VncAudio, *mut VncAudioFormat) -> gboolean>,
153    pub playback_stop: Option<unsafe extern "C" fn(*mut VncAudio) -> gboolean>,
154    pub playback_data: Option<unsafe extern "C" fn(*mut VncAudio, *mut VncAudioSample) -> gboolean>,
155}
156
157impl ::std::fmt::Debug for VncAudioInterface {
158    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
159        f.debug_struct(&format!("VncAudioInterface @ {self:p}"))
160            .field("parent", &self.parent)
161            .field("playback_start", &self.playback_start)
162            .field("playback_stop", &self.playback_stop)
163            .field("playback_data", &self.playback_data)
164            .finish()
165    }
166}
167
168#[derive(Copy, Clone)]
169#[repr(C)]
170pub struct VncAudioSample {
171    pub data: *mut u8,
172    pub length: u32,
173    pub capacity: u32,
174}
175
176impl ::std::fmt::Debug for VncAudioSample {
177    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
178        f.debug_struct(&format!("VncAudioSample @ {self:p}"))
179            .field("data", &self.data)
180            .field("length", &self.length)
181            .field("capacity", &self.capacity)
182            .finish()
183    }
184}
185
186#[derive(Copy, Clone)]
187#[repr(C)]
188pub struct VncBaseAudioClass {
189    pub parent_class: gobject::GObjectClass,
190    pub playback_start:
191        Option<unsafe extern "C" fn(*mut VncBaseAudio, *mut VncAudioFormat) -> gboolean>,
192    pub playback_stop: Option<unsafe extern "C" fn(*mut VncBaseAudio) -> gboolean>,
193    pub playback_data:
194        Option<unsafe extern "C" fn(*mut VncBaseAudio, *mut VncAudioSample) -> gboolean>,
195}
196
197impl ::std::fmt::Debug for VncBaseAudioClass {
198    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
199        f.debug_struct(&format!("VncBaseAudioClass @ {self:p}"))
200            .field("parent_class", &self.parent_class)
201            .field("playback_start", &self.playback_start)
202            .field("playback_stop", &self.playback_stop)
203            .field("playback_data", &self.playback_data)
204            .finish()
205    }
206}
207
208#[repr(C)]
209#[allow(dead_code)]
210pub struct _VncBaseAudioPrivate {
211    _data: [u8; 0],
212    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
213}
214
215pub type VncBaseAudioPrivate = _VncBaseAudioPrivate;
216
217#[derive(Copy, Clone)]
218#[repr(C)]
219pub struct VncBaseFramebufferClass {
220    pub parent_class: gobject::GObjectClass,
221    pub _vnc_reserved: [gpointer; 4],
222}
223
224impl ::std::fmt::Debug for VncBaseFramebufferClass {
225    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
226        f.debug_struct(&format!("VncBaseFramebufferClass @ {self:p}"))
227            .field("parent_class", &self.parent_class)
228            .field("_vnc_reserved", &self._vnc_reserved)
229            .finish()
230    }
231}
232
233#[repr(C)]
234#[allow(dead_code)]
235pub struct _VncBaseFramebufferPrivate {
236    _data: [u8; 0],
237    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
238}
239
240pub type VncBaseFramebufferPrivate = _VncBaseFramebufferPrivate;
241
242#[derive(Copy, Clone)]
243#[repr(C)]
244pub struct VncColorMap {
245    pub offset: u16,
246    pub size: u16,
247    pub colors: *mut VncColorMapEntry,
248}
249
250impl ::std::fmt::Debug for VncColorMap {
251    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
252        f.debug_struct(&format!("VncColorMap @ {self:p}"))
253            .field("offset", &self.offset)
254            .field("size", &self.size)
255            .field("colors", &self.colors)
256            .finish()
257    }
258}
259
260#[derive(Copy, Clone)]
261#[repr(C)]
262pub struct VncColorMapEntry {
263    pub red: u16,
264    pub green: u16,
265    pub blue: u16,
266}
267
268impl ::std::fmt::Debug for VncColorMapEntry {
269    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
270        f.debug_struct(&format!("VncColorMapEntry @ {self:p}"))
271            .field("red", &self.red)
272            .field("green", &self.green)
273            .field("blue", &self.blue)
274            .finish()
275    }
276}
277
278#[derive(Copy, Clone)]
279#[repr(C)]
280pub struct VncConnectionClass {
281    pub parent_class: gobject::GObjectClass,
282    pub vnc_cursor_changed: Option<unsafe extern "C" fn(*mut VncConnection, *mut VncCursor)>,
283    pub vnc_pointer_mode_changed: Option<unsafe extern "C" fn(*mut VncConnection, gboolean)>,
284    pub vnc_bell: Option<unsafe extern "C" fn(*mut VncConnection)>,
285    pub vnc_server_cut_text: Option<unsafe extern "C" fn(*mut VncConnection, *const glib::GString)>,
286    pub vnc_framebuffer_update:
287        Option<unsafe extern "C" fn(*mut VncConnection, u16, u16, u16, u16)>,
288    pub vnc_desktop_resize: Option<unsafe extern "C" fn(*mut VncConnection, u16, u16)>,
289    pub vnc_pixel_format_changed:
290        Option<unsafe extern "C" fn(*mut VncConnection, *mut VncPixelFormat)>,
291    pub vnc_auth_failure: Option<unsafe extern "C" fn(*mut VncConnection, *const c_char)>,
292    pub vnc_auth_unsupported: Option<unsafe extern "C" fn(*mut VncConnection, c_uint)>,
293    pub vnc_auth_credential:
294        Option<unsafe extern "C" fn(*mut VncConnection, *mut gobject::GValueArray)>,
295    pub vnc_auth_choose_type:
296        Option<unsafe extern "C" fn(*mut VncConnection, *mut gobject::GValueArray)>,
297    pub vnc_auth_choose_subtype:
298        Option<unsafe extern "C" fn(*mut VncConnection, c_uint, *mut gobject::GValueArray)>,
299    pub vnc_connected: Option<unsafe extern "C" fn(*mut VncConnection)>,
300    pub vnc_initialized: Option<unsafe extern "C" fn(*mut VncConnection)>,
301    pub vnc_disconnected: Option<unsafe extern "C" fn(*mut VncConnection)>,
302    pub vnc_led_state: Option<unsafe extern "C" fn(*mut VncConnection)>,
303    pub vnc_error: Option<unsafe extern "C" fn(*mut VncConnection, *const c_char)>,
304    pub vnc_power_control_initialized: Option<unsafe extern "C" fn(*mut VncConnection)>,
305    pub vnc_power_control_failed: Option<unsafe extern "C" fn(*mut VncConnection)>,
306    pub vnc_desktop_rename: Option<unsafe extern "C" fn(*mut VncConnection, *const c_char)>,
307    pub _vnc_reserved: [gpointer; 15],
308}
309
310impl ::std::fmt::Debug for VncConnectionClass {
311    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
312        f.debug_struct(&format!("VncConnectionClass @ {self:p}"))
313            .field("parent_class", &self.parent_class)
314            .field("vnc_cursor_changed", &self.vnc_cursor_changed)
315            .field("vnc_pointer_mode_changed", &self.vnc_pointer_mode_changed)
316            .field("vnc_bell", &self.vnc_bell)
317            .field("vnc_server_cut_text", &self.vnc_server_cut_text)
318            .field("vnc_framebuffer_update", &self.vnc_framebuffer_update)
319            .field("vnc_desktop_resize", &self.vnc_desktop_resize)
320            .field("vnc_pixel_format_changed", &self.vnc_pixel_format_changed)
321            .field("vnc_auth_failure", &self.vnc_auth_failure)
322            .field("vnc_auth_unsupported", &self.vnc_auth_unsupported)
323            .field("vnc_auth_credential", &self.vnc_auth_credential)
324            .field("vnc_auth_choose_type", &self.vnc_auth_choose_type)
325            .field("vnc_auth_choose_subtype", &self.vnc_auth_choose_subtype)
326            .field("vnc_connected", &self.vnc_connected)
327            .field("vnc_initialized", &self.vnc_initialized)
328            .field("vnc_disconnected", &self.vnc_disconnected)
329            .field("vnc_led_state", &self.vnc_led_state)
330            .field("vnc_error", &self.vnc_error)
331            .field(
332                "vnc_power_control_initialized",
333                &self.vnc_power_control_initialized,
334            )
335            .field("vnc_power_control_failed", &self.vnc_power_control_failed)
336            .field("vnc_desktop_rename", &self.vnc_desktop_rename)
337            .field("_vnc_reserved", &self._vnc_reserved)
338            .finish()
339    }
340}
341
342#[repr(C)]
343#[allow(dead_code)]
344pub struct _VncConnectionPrivate {
345    _data: [u8; 0],
346    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
347}
348
349pub type VncConnectionPrivate = _VncConnectionPrivate;
350
351#[derive(Copy, Clone)]
352#[repr(C)]
353pub struct VncCursorClass {
354    pub parent_class: gobject::GObjectClass,
355    pub _vnc_reserved: [gpointer; 4],
356}
357
358impl ::std::fmt::Debug for VncCursorClass {
359    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
360        f.debug_struct(&format!("VncCursorClass @ {self:p}"))
361            .field("parent_class", &self.parent_class)
362            .field("_vnc_reserved", &self._vnc_reserved)
363            .finish()
364    }
365}
366
367#[repr(C)]
368#[allow(dead_code)]
369pub struct _VncCursorPrivate {
370    _data: [u8; 0],
371    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
372}
373
374pub type VncCursorPrivate = _VncCursorPrivate;
375
376#[derive(Copy, Clone)]
377#[repr(C)]
378pub struct VncFramebufferInterface {
379    pub parent: gobject::GTypeInterface,
380    pub get_width: Option<unsafe extern "C" fn(*mut VncFramebuffer) -> u16>,
381    pub get_height: Option<unsafe extern "C" fn(*mut VncFramebuffer) -> u16>,
382    pub get_rowstride: Option<unsafe extern "C" fn(*mut VncFramebuffer) -> c_int>,
383    pub get_buffer: Option<unsafe extern "C" fn(*mut VncFramebuffer) -> *mut u8>,
384    pub get_local_format:
385        Option<unsafe extern "C" fn(*mut VncFramebuffer) -> *const VncPixelFormat>,
386    pub get_remote_format:
387        Option<unsafe extern "C" fn(*mut VncFramebuffer) -> *const VncPixelFormat>,
388    pub perfect_format_match: Option<unsafe extern "C" fn(*mut VncFramebuffer) -> gboolean>,
389    pub set_pixel_at: Option<unsafe extern "C" fn(*mut VncFramebuffer, *mut u8, u16, u16)>,
390    pub fill: Option<unsafe extern "C" fn(*mut VncFramebuffer, *mut u8, u16, u16, u16, u16)>,
391    pub copyrect: Option<unsafe extern "C" fn(*mut VncFramebuffer, u16, u16, u16, u16, u16, u16)>,
392    pub blt: Option<unsafe extern "C" fn(*mut VncFramebuffer, *mut u8, c_int, u16, u16, u16, u16)>,
393    pub rgb24_blt:
394        Option<unsafe extern "C" fn(*mut VncFramebuffer, *mut u8, c_int, u16, u16, u16, u16)>,
395    pub set_color_map: Option<unsafe extern "C" fn(*mut VncFramebuffer, *mut VncColorMap)>,
396}
397
398impl ::std::fmt::Debug for VncFramebufferInterface {
399    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
400        f.debug_struct(&format!("VncFramebufferInterface @ {self:p}"))
401            .field("parent", &self.parent)
402            .field("get_width", &self.get_width)
403            .field("get_height", &self.get_height)
404            .field("get_rowstride", &self.get_rowstride)
405            .field("get_buffer", &self.get_buffer)
406            .field("get_local_format", &self.get_local_format)
407            .field("get_remote_format", &self.get_remote_format)
408            .field("perfect_format_match", &self.perfect_format_match)
409            .field("set_pixel_at", &self.set_pixel_at)
410            .field("fill", &self.fill)
411            .field("copyrect", &self.copyrect)
412            .field("blt", &self.blt)
413            .field("rgb24_blt", &self.rgb24_blt)
414            .field("set_color_map", &self.set_color_map)
415            .finish()
416    }
417}
418
419#[derive(Copy, Clone)]
420#[repr(C)]
421pub struct VncPixelFormat {
422    pub bits_per_pixel: u8,
423    pub depth: u8,
424    pub byte_order: u16,
425    pub true_color_flag: u8,
426    pub red_max: u16,
427    pub green_max: u16,
428    pub blue_max: u16,
429    pub red_shift: u8,
430    pub green_shift: u8,
431    pub blue_shift: u8,
432}
433
434impl ::std::fmt::Debug for VncPixelFormat {
435    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
436        f.debug_struct(&format!("VncPixelFormat @ {self:p}"))
437            .field("bits_per_pixel", &self.bits_per_pixel)
438            .field("depth", &self.depth)
439            .field("byte_order", &self.byte_order)
440            .field("true_color_flag", &self.true_color_flag)
441            .field("red_max", &self.red_max)
442            .field("green_max", &self.green_max)
443            .field("blue_max", &self.blue_max)
444            .field("red_shift", &self.red_shift)
445            .field("green_shift", &self.green_shift)
446            .field("blue_shift", &self.blue_shift)
447            .finish()
448    }
449}
450
451// Classes
452#[derive(Copy, Clone)]
453#[repr(C)]
454pub struct VncBaseAudio {
455    pub parent: gobject::GObject,
456    pub priv_: *mut VncBaseAudioPrivate,
457}
458
459impl ::std::fmt::Debug for VncBaseAudio {
460    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
461        f.debug_struct(&format!("VncBaseAudio @ {self:p}"))
462            .field("parent", &self.parent)
463            .field("priv_", &self.priv_)
464            .finish()
465    }
466}
467
468#[derive(Copy, Clone)]
469#[repr(C)]
470pub struct VncBaseFramebuffer {
471    pub parent: gobject::GObject,
472    pub priv_: *mut VncBaseFramebufferPrivate,
473}
474
475impl ::std::fmt::Debug for VncBaseFramebuffer {
476    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
477        f.debug_struct(&format!("VncBaseFramebuffer @ {self:p}"))
478            .field("parent", &self.parent)
479            .field("priv_", &self.priv_)
480            .finish()
481    }
482}
483
484#[derive(Copy, Clone)]
485#[repr(C)]
486pub struct VncConnection {
487    pub parent: gobject::GObject,
488    pub priv_: *mut VncConnectionPrivate,
489}
490
491impl ::std::fmt::Debug for VncConnection {
492    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
493        f.debug_struct(&format!("VncConnection @ {self:p}"))
494            .field("parent", &self.parent)
495            .field("priv_", &self.priv_)
496            .finish()
497    }
498}
499
500#[derive(Copy, Clone)]
501#[repr(C)]
502pub struct VncCursor {
503    pub parent: gobject::GObject,
504    pub priv_: *mut VncCursorPrivate,
505}
506
507impl ::std::fmt::Debug for VncCursor {
508    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
509        f.debug_struct(&format!("VncCursor @ {self:p}"))
510            .field("parent", &self.parent)
511            .field("priv_", &self.priv_)
512            .finish()
513    }
514}
515
516// Interfaces
517#[repr(C)]
518#[allow(dead_code)]
519pub struct VncAudio {
520    _data: [u8; 0],
521    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
522}
523
524impl ::std::fmt::Debug for VncAudio {
525    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
526        write!(f, "VncAudio @ {self:p}")
527    }
528}
529
530#[repr(C)]
531#[allow(dead_code)]
532pub struct VncFramebuffer {
533    _data: [u8; 0],
534    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
535}
536
537impl ::std::fmt::Debug for VncFramebuffer {
538    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
539        write!(f, "VncFramebuffer @ {self:p}")
540    }
541}
542
543extern "C" {
544
545    //=========================================================================
546    // VncConnectionAuth
547    //=========================================================================
548    pub fn vnc_connection_auth_get_type() -> GType;
549
550    //=========================================================================
551    // VncConnectionAuthVencrypt
552    //=========================================================================
553    pub fn vnc_connection_auth_vencrypt_get_type() -> GType;
554
555    //=========================================================================
556    // VncConnectionCredential
557    //=========================================================================
558    pub fn vnc_connection_credential_get_type() -> GType;
559
560    //=========================================================================
561    // VncConnectionEncoding
562    //=========================================================================
563    pub fn vnc_connection_encoding_get_type() -> GType;
564
565    //=========================================================================
566    // VncConnectionPowerAction
567    //=========================================================================
568    pub fn vnc_connection_power_action_get_type() -> GType;
569
570    //=========================================================================
571    // VncConnectionResizeStatus
572    //=========================================================================
573    pub fn vnc_connection_resize_status_get_type() -> GType;
574
575    //=========================================================================
576    // VncAudioFormat
577    //=========================================================================
578    pub fn vnc_audio_format_get_type() -> GType;
579    pub fn vnc_audio_format_new() -> *mut VncAudioFormat;
580    pub fn vnc_audio_format_copy(format: *mut VncAudioFormat) -> *mut VncAudioFormat;
581    pub fn vnc_audio_format_free(format: *mut VncAudioFormat);
582
583    //=========================================================================
584    // VncAudioSample
585    //=========================================================================
586    pub fn vnc_audio_sample_get_type() -> GType;
587    pub fn vnc_audio_sample_new(capacity: u32) -> *mut VncAudioSample;
588    pub fn vnc_audio_sample_copy(sample: *mut VncAudioSample) -> *mut VncAudioSample;
589    pub fn vnc_audio_sample_free(sample: *mut VncAudioSample);
590
591    //=========================================================================
592    // VncColorMap
593    //=========================================================================
594    pub fn vnc_color_map_get_type() -> GType;
595    pub fn vnc_color_map_new(offset: u16, size: u16) -> *mut VncColorMap;
596    pub fn vnc_color_map_copy(map: *mut VncColorMap) -> *mut VncColorMap;
597    pub fn vnc_color_map_free(map: *mut VncColorMap);
598    pub fn vnc_color_map_lookup(
599        map: *mut VncColorMap,
600        idx: u16,
601        red: *mut u16,
602        green: *mut u16,
603        blue: *mut u16,
604    ) -> gboolean;
605    pub fn vnc_color_map_set(
606        map: *mut VncColorMap,
607        idx: u16,
608        red: u16,
609        green: u16,
610        blue: u16,
611    ) -> gboolean;
612
613    //=========================================================================
614    // VncPixelFormat
615    //=========================================================================
616    pub fn vnc_pixel_format_get_type() -> GType;
617    pub fn vnc_pixel_format_new() -> *mut VncPixelFormat;
618    pub fn vnc_pixel_format_copy(format: *mut VncPixelFormat) -> *mut VncPixelFormat;
619    pub fn vnc_pixel_format_free(format: *mut VncPixelFormat);
620    pub fn vnc_pixel_format_match(
621        format: *const VncPixelFormat,
622        other: *const VncPixelFormat,
623    ) -> gboolean;
624
625    //=========================================================================
626    // VncBaseAudio
627    //=========================================================================
628    pub fn vnc_base_audio_get_type() -> GType;
629    pub fn vnc_base_audio_new() -> *mut VncBaseAudio;
630
631    //=========================================================================
632    // VncBaseFramebuffer
633    //=========================================================================
634    pub fn vnc_base_framebuffer_get_type() -> GType;
635    pub fn vnc_base_framebuffer_new(
636        buffer: *mut u8,
637        width: u16,
638        height: u16,
639        rowstride: c_int,
640        localFormat: *const VncPixelFormat,
641        remoteFormat: *const VncPixelFormat,
642    ) -> *mut VncBaseFramebuffer;
643
644    //=========================================================================
645    // VncConnection
646    //=========================================================================
647    pub fn vnc_connection_get_type() -> GType;
648    pub fn vnc_connection_new() -> *mut VncConnection;
649    pub fn vnc_connection_audio_disable(conn: *mut VncConnection) -> gboolean;
650    pub fn vnc_connection_audio_enable(conn: *mut VncConnection) -> gboolean;
651    pub fn vnc_connection_client_cut_text(
652        conn: *mut VncConnection,
653        data: *mut c_void,
654        length: size_t,
655    ) -> gboolean;
656    pub fn vnc_connection_framebuffer_update_request(
657        conn: *mut VncConnection,
658        incremental: gboolean,
659        x: u16,
660        y: u16,
661        width: u16,
662        height: u16,
663    ) -> gboolean;
664    pub fn vnc_connection_get_abs_pointer(conn: *mut VncConnection) -> gboolean;
665    pub fn vnc_connection_get_audio_format(conn: *mut VncConnection) -> *const VncAudioFormat;
666    pub fn vnc_connection_get_cursor(conn: *mut VncConnection) -> *mut VncCursor;
667    pub fn vnc_connection_get_ext_key_event(conn: *mut VncConnection) -> gboolean;
668    pub fn vnc_connection_get_height(conn: *mut VncConnection) -> c_int;
669    pub fn vnc_connection_get_ledstate(conn: *mut VncConnection) -> c_int;
670    pub fn vnc_connection_get_name(conn: *mut VncConnection) -> *const c_char;
671    pub fn vnc_connection_get_pixel_format(conn: *mut VncConnection) -> *const VncPixelFormat;
672    pub fn vnc_connection_get_power_control(conn: *mut VncConnection) -> gboolean;
673    pub fn vnc_connection_get_shared(conn: *mut VncConnection) -> gboolean;
674    pub fn vnc_connection_get_width(conn: *mut VncConnection) -> c_int;
675    pub fn vnc_connection_has_error(conn: *mut VncConnection) -> gboolean;
676    pub fn vnc_connection_is_initialized(conn: *mut VncConnection) -> gboolean;
677    pub fn vnc_connection_is_open(conn: *mut VncConnection) -> gboolean;
678    pub fn vnc_connection_key_event(
679        conn: *mut VncConnection,
680        down_flag: gboolean,
681        key: u32,
682        scancode: u16,
683    ) -> gboolean;
684    pub fn vnc_connection_open_addr(
685        conn: *mut VncConnection,
686        addr: *mut gio::GSocketAddress,
687        hostname: *const c_char,
688    ) -> gboolean;
689    pub fn vnc_connection_open_fd(conn: *mut VncConnection, fd: c_int) -> gboolean;
690    pub fn vnc_connection_open_fd_with_hostname(
691        conn: *mut VncConnection,
692        fd: c_int,
693        hostname: *const c_char,
694    ) -> gboolean;
695    pub fn vnc_connection_open_host(
696        conn: *mut VncConnection,
697        host: *const c_char,
698        port: *const c_char,
699    ) -> gboolean;
700    pub fn vnc_connection_pointer_event(
701        conn: *mut VncConnection,
702        button_mask: u8,
703        x: u16,
704        y: u16,
705    ) -> gboolean;
706    pub fn vnc_connection_power_control(
707        conn: *mut VncConnection,
708        action: VncConnectionPowerAction,
709    ) -> gboolean;
710    pub fn vnc_connection_set_audio(conn: *mut VncConnection, audio: *mut VncAudio) -> gboolean;
711    pub fn vnc_connection_set_audio_format(
712        conn: *mut VncConnection,
713        fmt: *const VncAudioFormat,
714    ) -> gboolean;
715    pub fn vnc_connection_set_auth_subtype(conn: *mut VncConnection, type_: c_uint) -> gboolean;
716    pub fn vnc_connection_set_auth_type(conn: *mut VncConnection, type_: c_uint) -> gboolean;
717    pub fn vnc_connection_set_credential(
718        conn: *mut VncConnection,
719        type_: c_int,
720        data: *const c_char,
721    ) -> gboolean;
722    pub fn vnc_connection_set_encodings(
723        conn: *mut VncConnection,
724        n_encoding: c_int,
725        encoding: *mut i32,
726    ) -> gboolean;
727    pub fn vnc_connection_set_framebuffer(
728        conn: *mut VncConnection,
729        fb: *mut VncFramebuffer,
730    ) -> gboolean;
731    pub fn vnc_connection_set_pixel_format(
732        conn: *mut VncConnection,
733        fmt: *const VncPixelFormat,
734    ) -> gboolean;
735    pub fn vnc_connection_set_shared(conn: *mut VncConnection, shared: gboolean) -> gboolean;
736    pub fn vnc_connection_set_size(
737        conn: *mut VncConnection,
738        width: c_uint,
739        height: c_uint,
740    ) -> VncConnectionResizeStatus;
741    pub fn vnc_connection_shutdown(conn: *mut VncConnection);
742
743    //=========================================================================
744    // VncCursor
745    //=========================================================================
746    pub fn vnc_cursor_get_type() -> GType;
747    pub fn vnc_cursor_new(
748        data: *mut u8,
749        hotx: u16,
750        hoty: u16,
751        width: u16,
752        height: u16,
753    ) -> *mut VncCursor;
754    pub fn vnc_cursor_get_data(cursor: *mut VncCursor) -> *const u8;
755    pub fn vnc_cursor_get_height(cursor: *mut VncCursor) -> u16;
756    pub fn vnc_cursor_get_hotx(cursor: *mut VncCursor) -> u16;
757    pub fn vnc_cursor_get_hoty(cursor: *mut VncCursor) -> u16;
758    pub fn vnc_cursor_get_width(cursor: *mut VncCursor) -> u16;
759
760    //=========================================================================
761    // VncAudio
762    //=========================================================================
763    pub fn vnc_audio_get_type() -> GType;
764    pub fn vnc_audio_playback_data(aud: *mut VncAudio, sample: *mut VncAudioSample);
765    pub fn vnc_audio_playback_start(aud: *mut VncAudio, format: *mut VncAudioFormat);
766    pub fn vnc_audio_playback_stop(aud: *mut VncAudio);
767
768    //=========================================================================
769    // VncFramebuffer
770    //=========================================================================
771    pub fn vnc_framebuffer_get_type() -> GType;
772    pub fn vnc_framebuffer_blt(
773        fb: *mut VncFramebuffer,
774        src: *mut u8,
775        rowstride: c_int,
776        x: u16,
777        y: u16,
778        width: u16,
779        height: u16,
780    );
781    pub fn vnc_framebuffer_copyrect(
782        fb: *mut VncFramebuffer,
783        srcx: u16,
784        srcy: u16,
785        dstx: u16,
786        dsty: u16,
787        width: u16,
788        height: u16,
789    );
790    pub fn vnc_framebuffer_fill(
791        fb: *mut VncFramebuffer,
792        src: *mut u8,
793        x: u16,
794        y: u16,
795        width: u16,
796        height: u16,
797    );
798    pub fn vnc_framebuffer_get_buffer(fb: *mut VncFramebuffer) -> *mut u8;
799    pub fn vnc_framebuffer_get_height(fb: *mut VncFramebuffer) -> u16;
800    pub fn vnc_framebuffer_get_local_format(fb: *mut VncFramebuffer) -> *const VncPixelFormat;
801    pub fn vnc_framebuffer_get_remote_format(fb: *mut VncFramebuffer) -> *const VncPixelFormat;
802    pub fn vnc_framebuffer_get_rowstride(fb: *mut VncFramebuffer) -> c_int;
803    pub fn vnc_framebuffer_get_width(fb: *mut VncFramebuffer) -> u16;
804    pub fn vnc_framebuffer_perfect_format_match(fb: *mut VncFramebuffer) -> gboolean;
805    pub fn vnc_framebuffer_rgb24_blt(
806        fb: *mut VncFramebuffer,
807        src: *mut u8,
808        rowstride: c_int,
809        x: u16,
810        y: u16,
811        width: u16,
812        height: u16,
813    );
814    pub fn vnc_framebuffer_set_color_map(fb: *mut VncFramebuffer, map: *mut VncColorMap);
815    pub fn vnc_framebuffer_set_pixel_at(fb: *mut VncFramebuffer, src: *mut u8, x: u16, y: u16);
816
817    //=========================================================================
818    // Other functions
819    //=========================================================================
820    pub fn vnc_util_check_version(major: c_int, minor: c_int, micro: c_int) -> gboolean;
821    pub fn vnc_util_get_debug() -> gboolean;
822    pub fn vnc_util_get_version() -> c_int;
823    pub fn vnc_util_get_version_string() -> *const c_char;
824    pub fn vnc_util_set_debug(enabled: gboolean);
825
826}