astal_bluetooth_sys/
lib.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from ../../../girs
3// from ../../../gtk-girs
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// Constants
33pub const ASTAL_BLUETOOTH_MAJOR_VERSION: c_int = 0;
34pub const ASTAL_BLUETOOTH_MINOR_VERSION: c_int = 1;
35pub const ASTAL_BLUETOOTH_MICRO_VERSION: c_int = 0;
36pub const ASTAL_BLUETOOTH_VERSION: &[u8] = b"0.1.0\0";
37
38// Records
39#[derive(Copy, Clone)]
40#[repr(C)]
41pub struct AstalBluetoothAdapterClass {
42    pub parent_class: gobject::GObjectClass,
43}
44
45impl ::std::fmt::Debug for AstalBluetoothAdapterClass {
46    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
47        f.debug_struct(&format!("AstalBluetoothAdapterClass @ {self:p}"))
48            .finish()
49    }
50}
51
52#[repr(C)]
53#[allow(dead_code)]
54pub struct _AstalBluetoothAdapterPrivate {
55    _data: [u8; 0],
56    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
57}
58
59pub type AstalBluetoothAdapterPrivate = _AstalBluetoothAdapterPrivate;
60
61#[derive(Copy, Clone)]
62#[repr(C)]
63pub struct AstalBluetoothBluetoothClass {
64    pub parent_class: gobject::GObjectClass,
65    pub device_added:
66        Option<unsafe extern "C" fn(*mut AstalBluetoothBluetooth, *mut AstalBluetoothDevice)>,
67    pub device_removed:
68        Option<unsafe extern "C" fn(*mut AstalBluetoothBluetooth, *mut AstalBluetoothDevice)>,
69    pub adapter_added:
70        Option<unsafe extern "C" fn(*mut AstalBluetoothBluetooth, *mut AstalBluetoothAdapter)>,
71    pub adapter_removed:
72        Option<unsafe extern "C" fn(*mut AstalBluetoothBluetooth, *mut AstalBluetoothAdapter)>,
73}
74
75impl ::std::fmt::Debug for AstalBluetoothBluetoothClass {
76    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
77        f.debug_struct(&format!("AstalBluetoothBluetoothClass @ {self:p}"))
78            .field("device_added", &self.device_added)
79            .field("device_removed", &self.device_removed)
80            .field("adapter_added", &self.adapter_added)
81            .field("adapter_removed", &self.adapter_removed)
82            .finish()
83    }
84}
85
86#[repr(C)]
87#[allow(dead_code)]
88pub struct _AstalBluetoothBluetoothPrivate {
89    _data: [u8; 0],
90    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
91}
92
93pub type AstalBluetoothBluetoothPrivate = _AstalBluetoothBluetoothPrivate;
94
95#[derive(Copy, Clone)]
96#[repr(C)]
97pub struct AstalBluetoothDeviceClass {
98    pub parent_class: gobject::GObjectClass,
99}
100
101impl ::std::fmt::Debug for AstalBluetoothDeviceClass {
102    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
103        f.debug_struct(&format!("AstalBluetoothDeviceClass @ {self:p}"))
104            .finish()
105    }
106}
107
108#[repr(C)]
109#[allow(dead_code)]
110pub struct _AstalBluetoothDevicePrivate {
111    _data: [u8; 0],
112    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
113}
114
115pub type AstalBluetoothDevicePrivate = _AstalBluetoothDevicePrivate;
116
117// Classes
118#[derive(Copy, Clone)]
119#[repr(C)]
120pub struct AstalBluetoothAdapter {
121    pub parent_instance: gobject::GObject,
122    pub priv_: *mut AstalBluetoothAdapterPrivate,
123}
124
125impl ::std::fmt::Debug for AstalBluetoothAdapter {
126    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
127        f.debug_struct(&format!("AstalBluetoothAdapter @ {self:p}"))
128            .finish()
129    }
130}
131
132#[derive(Copy, Clone)]
133#[repr(C)]
134pub struct AstalBluetoothBluetooth {
135    pub parent_instance: gobject::GObject,
136    pub priv_: *mut AstalBluetoothBluetoothPrivate,
137}
138
139impl ::std::fmt::Debug for AstalBluetoothBluetooth {
140    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
141        f.debug_struct(&format!("AstalBluetoothBluetooth @ {self:p}"))
142            .finish()
143    }
144}
145
146#[derive(Copy, Clone)]
147#[repr(C)]
148pub struct AstalBluetoothDevice {
149    pub parent_instance: gobject::GObject,
150    pub priv_: *mut AstalBluetoothDevicePrivate,
151}
152
153impl ::std::fmt::Debug for AstalBluetoothDevice {
154    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
155        f.debug_struct(&format!("AstalBluetoothDevice @ {self:p}"))
156            .finish()
157    }
158}
159
160extern "C" {
161
162    //=========================================================================
163    // AstalBluetoothAdapter
164    //=========================================================================
165    pub fn astal_bluetooth_adapter_get_type() -> GType;
166    pub fn astal_bluetooth_adapter_remove_device(
167        self_: *mut AstalBluetoothAdapter,
168        device: *mut AstalBluetoothDevice,
169        error: *mut *mut glib::GError,
170    );
171    pub fn astal_bluetooth_adapter_start_discovery(
172        self_: *mut AstalBluetoothAdapter,
173        error: *mut *mut glib::GError,
174    );
175    pub fn astal_bluetooth_adapter_stop_discovery(
176        self_: *mut AstalBluetoothAdapter,
177        error: *mut *mut glib::GError,
178    );
179    pub fn astal_bluetooth_adapter_get_uuids(
180        self_: *mut AstalBluetoothAdapter,
181        result_length1: *mut c_int,
182    ) -> *mut *mut c_char;
183    pub fn astal_bluetooth_adapter_get_discovering(self_: *mut AstalBluetoothAdapter) -> gboolean;
184    pub fn astal_bluetooth_adapter_get_modalias(self_: *mut AstalBluetoothAdapter) -> *mut c_char;
185    pub fn astal_bluetooth_adapter_get_name(self_: *mut AstalBluetoothAdapter) -> *mut c_char;
186    pub fn astal_bluetooth_adapter_get_class(self_: *mut AstalBluetoothAdapter) -> c_uint;
187    pub fn astal_bluetooth_adapter_get_address(self_: *mut AstalBluetoothAdapter) -> *mut c_char;
188    pub fn astal_bluetooth_adapter_get_discoverable(self_: *mut AstalBluetoothAdapter) -> gboolean;
189    pub fn astal_bluetooth_adapter_set_discoverable(
190        self_: *mut AstalBluetoothAdapter,
191        value: gboolean,
192    );
193    pub fn astal_bluetooth_adapter_get_pairable(self_: *mut AstalBluetoothAdapter) -> gboolean;
194    pub fn astal_bluetooth_adapter_set_pairable(self_: *mut AstalBluetoothAdapter, value: gboolean);
195    pub fn astal_bluetooth_adapter_get_powered(self_: *mut AstalBluetoothAdapter) -> gboolean;
196    pub fn astal_bluetooth_adapter_set_powered(self_: *mut AstalBluetoothAdapter, value: gboolean);
197    pub fn astal_bluetooth_adapter_get_alias(self_: *mut AstalBluetoothAdapter) -> *mut c_char;
198    pub fn astal_bluetooth_adapter_set_alias(
199        self_: *mut AstalBluetoothAdapter,
200        value: *const c_char,
201    );
202    pub fn astal_bluetooth_adapter_get_discoverable_timeout(
203        self_: *mut AstalBluetoothAdapter,
204    ) -> c_uint;
205    pub fn astal_bluetooth_adapter_set_discoverable_timeout(
206        self_: *mut AstalBluetoothAdapter,
207        value: c_uint,
208    );
209    pub fn astal_bluetooth_adapter_get_pairable_timeout(
210        self_: *mut AstalBluetoothAdapter,
211    ) -> c_uint;
212    pub fn astal_bluetooth_adapter_set_pairable_timeout(
213        self_: *mut AstalBluetoothAdapter,
214        value: c_uint,
215    );
216
217    //=========================================================================
218    // AstalBluetoothBluetooth
219    //=========================================================================
220    pub fn astal_bluetooth_bluetooth_get_type() -> GType;
221    pub fn astal_bluetooth_bluetooth_get_default() -> *mut AstalBluetoothBluetooth;
222    pub fn astal_bluetooth_bluetooth_toggle(self_: *mut AstalBluetoothBluetooth);
223    pub fn astal_bluetooth_bluetooth_new() -> *mut AstalBluetoothBluetooth;
224    pub fn astal_bluetooth_bluetooth_get_is_powered(
225        self_: *mut AstalBluetoothBluetooth,
226    ) -> gboolean;
227    pub fn astal_bluetooth_bluetooth_get_is_connected(
228        self_: *mut AstalBluetoothBluetooth,
229    ) -> gboolean;
230    pub fn astal_bluetooth_bluetooth_get_adapter(
231        self_: *mut AstalBluetoothBluetooth,
232    ) -> *mut AstalBluetoothAdapter;
233    pub fn astal_bluetooth_bluetooth_get_adapters(
234        self_: *mut AstalBluetoothBluetooth,
235    ) -> *mut glib::GList;
236    pub fn astal_bluetooth_bluetooth_get_devices(
237        self_: *mut AstalBluetoothBluetooth,
238    ) -> *mut glib::GList;
239
240    //=========================================================================
241    // AstalBluetoothDevice
242    //=========================================================================
243    pub fn astal_bluetooth_device_get_type() -> GType;
244    pub fn astal_bluetooth_device_connect_device(
245        self_: *mut AstalBluetoothDevice,
246        _callback_: gio::GAsyncReadyCallback,
247        _callback__target: *mut c_void,
248    );
249    pub fn astal_bluetooth_device_connect_device_finish(
250        self_: *mut AstalBluetoothDevice,
251        _res_: *mut gio::GAsyncResult,
252        error: *mut *mut glib::GError,
253    );
254    pub fn astal_bluetooth_device_disconnect_device(
255        self_: *mut AstalBluetoothDevice,
256        _callback_: gio::GAsyncReadyCallback,
257        _callback__target: *mut c_void,
258    );
259    pub fn astal_bluetooth_device_disconnect_device_finish(
260        self_: *mut AstalBluetoothDevice,
261        _res_: *mut gio::GAsyncResult,
262        error: *mut *mut glib::GError,
263    );
264    pub fn astal_bluetooth_device_connect_profile(
265        self_: *mut AstalBluetoothDevice,
266        uuid: *const c_char,
267        error: *mut *mut glib::GError,
268    );
269    pub fn astal_bluetooth_device_disconnect_profile(
270        self_: *mut AstalBluetoothDevice,
271        uuid: *const c_char,
272        error: *mut *mut glib::GError,
273    );
274    pub fn astal_bluetooth_device_pair(
275        self_: *mut AstalBluetoothDevice,
276        error: *mut *mut glib::GError,
277    );
278    pub fn astal_bluetooth_device_cancel_pairing(
279        self_: *mut AstalBluetoothDevice,
280        error: *mut *mut glib::GError,
281    );
282    pub fn astal_bluetooth_device_get_uuids(
283        self_: *mut AstalBluetoothDevice,
284        result_length1: *mut c_int,
285    ) -> *mut *mut c_char;
286    pub fn astal_bluetooth_device_get_connected(self_: *mut AstalBluetoothDevice) -> gboolean;
287    pub fn astal_bluetooth_device_get_legacy_pairing(self_: *mut AstalBluetoothDevice) -> gboolean;
288    pub fn astal_bluetooth_device_get_paired(self_: *mut AstalBluetoothDevice) -> gboolean;
289    pub fn astal_bluetooth_device_get_rssi(self_: *mut AstalBluetoothDevice) -> i16;
290    pub fn astal_bluetooth_device_get_adapter(self_: *mut AstalBluetoothDevice) -> *mut c_char;
291    pub fn astal_bluetooth_device_get_address(self_: *mut AstalBluetoothDevice) -> *mut c_char;
292    pub fn astal_bluetooth_device_get_icon(self_: *mut AstalBluetoothDevice) -> *mut c_char;
293    pub fn astal_bluetooth_device_get_modalias(self_: *mut AstalBluetoothDevice) -> *mut c_char;
294    pub fn astal_bluetooth_device_get_name(self_: *mut AstalBluetoothDevice) -> *mut c_char;
295    pub fn astal_bluetooth_device_get_appearance(self_: *mut AstalBluetoothDevice) -> u16;
296    pub fn astal_bluetooth_device_get_class(self_: *mut AstalBluetoothDevice) -> u32;
297    pub fn astal_bluetooth_device_get_connecting(self_: *mut AstalBluetoothDevice) -> gboolean;
298    pub fn astal_bluetooth_device_get_blocked(self_: *mut AstalBluetoothDevice) -> gboolean;
299    pub fn astal_bluetooth_device_set_blocked(self_: *mut AstalBluetoothDevice, value: gboolean);
300    pub fn astal_bluetooth_device_get_trusted(self_: *mut AstalBluetoothDevice) -> gboolean;
301    pub fn astal_bluetooth_device_set_trusted(self_: *mut AstalBluetoothDevice, value: gboolean);
302    pub fn astal_bluetooth_device_get_battery_percentage(
303        self_: *mut AstalBluetoothDevice,
304    ) -> c_double;
305    pub fn astal_bluetooth_device_get_alias(self_: *mut AstalBluetoothDevice) -> *mut c_char;
306    pub fn astal_bluetooth_device_set_alias(self_: *mut AstalBluetoothDevice, value: *const c_char);
307
308    //=========================================================================
309    // Other functions
310    //=========================================================================
311    pub fn astal_bluetooth_get_default() -> *mut AstalBluetoothBluetooth;
312
313}