Skip to main content

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