astal_tray_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 gdk_pixbuf_sys as gdk_pixbuf;
16use gio_sys as gio;
17use glib_sys as glib;
18use gobject_sys as gobject;
19
20#[cfg(unix)]
21#[allow(unused_imports)]
22use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t};
23#[allow(unused_imports)]
24use libc::{intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE};
25#[allow(unused_imports)]
26use std::ffi::{
27    c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
28};
29
30#[allow(unused_imports)]
31use glib::{gboolean, gconstpointer, gpointer, GType};
32
33// Enums
34pub type AstalTrayCategory = c_int;
35pub const ASTAL_TRAY_CATEGORY_APPLICATION: AstalTrayCategory = 0;
36pub const ASTAL_TRAY_CATEGORY_COMMUNICATIONS: AstalTrayCategory = 1;
37pub const ASTAL_TRAY_CATEGORY_SYSTEM: AstalTrayCategory = 2;
38pub const ASTAL_TRAY_CATEGORY_HARDWARE: AstalTrayCategory = 3;
39
40pub type AstalTrayStatus = c_int;
41pub const ASTAL_TRAY_STATUS_PASSIVE: AstalTrayStatus = 0;
42pub const ASTAL_TRAY_STATUS_ACTIVE: AstalTrayStatus = 1;
43pub const ASTAL_TRAY_STATUS_NEEDS_ATTENTION: AstalTrayStatus = 2;
44
45// Constants
46pub const ASTAL_TRAY_MAJOR_VERSION: c_int = 0;
47pub const ASTAL_TRAY_MINOR_VERSION: c_int = 1;
48pub const ASTAL_TRAY_MICRO_VERSION: c_int = 0;
49pub const ASTAL_TRAY_VERSION: &[u8] = b"0.1.0\0";
50
51// Records
52#[derive(Copy, Clone)]
53#[repr(C)]
54pub struct AstalTrayPixmap {
55    pub width: c_int,
56    pub height: c_int,
57    pub bytes: *mut u8,
58    pub bytes_length1: c_int,
59}
60
61impl ::std::fmt::Debug for AstalTrayPixmap {
62    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
63        f.debug_struct(&format!("AstalTrayPixmap @ {self:p}"))
64            .field("width", &self.width)
65            .field("height", &self.height)
66            .field("bytes", &self.bytes)
67            .field("bytes_length1", &self.bytes_length1)
68            .finish()
69    }
70}
71
72#[derive(Copy, Clone)]
73#[repr(C)]
74pub struct AstalTrayTooltip {
75    pub icon_name: *mut c_char,
76    pub icon: *mut AstalTrayPixmap,
77    pub icon_length1: c_int,
78    pub title: *mut c_char,
79    pub description: *mut c_char,
80}
81
82impl ::std::fmt::Debug for AstalTrayTooltip {
83    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
84        f.debug_struct(&format!("AstalTrayTooltip @ {self:p}"))
85            .field("icon_name", &self.icon_name)
86            .field("icon", &self.icon)
87            .field("icon_length1", &self.icon_length1)
88            .field("title", &self.title)
89            .field("description", &self.description)
90            .finish()
91    }
92}
93
94#[derive(Copy, Clone)]
95#[repr(C)]
96pub struct AstalTrayTrayClass {
97    pub parent_class: gobject::GObjectClass,
98    pub item_added: Option<unsafe extern "C" fn(*mut AstalTrayTray, *const c_char)>,
99    pub item_removed: Option<unsafe extern "C" fn(*mut AstalTrayTray, *const c_char)>,
100}
101
102impl ::std::fmt::Debug for AstalTrayTrayClass {
103    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
104        f.debug_struct(&format!("AstalTrayTrayClass @ {self:p}"))
105            .field("item_added", &self.item_added)
106            .field("item_removed", &self.item_removed)
107            .finish()
108    }
109}
110
111#[derive(Copy, Clone)]
112#[repr(C)]
113pub struct AstalTrayTrayItemClass {
114    pub parent_class: gobject::GObjectClass,
115}
116
117impl ::std::fmt::Debug for AstalTrayTrayItemClass {
118    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
119        f.debug_struct(&format!("AstalTrayTrayItemClass @ {self:p}"))
120            .finish()
121    }
122}
123
124#[repr(C)]
125#[allow(dead_code)]
126pub struct _AstalTrayTrayItemPrivate {
127    _data: [u8; 0],
128    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
129}
130
131pub type AstalTrayTrayItemPrivate = _AstalTrayTrayItemPrivate;
132
133#[repr(C)]
134#[allow(dead_code)]
135pub struct _AstalTrayTrayPrivate {
136    _data: [u8; 0],
137    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
138}
139
140pub type AstalTrayTrayPrivate = _AstalTrayTrayPrivate;
141
142// Classes
143#[derive(Copy, Clone)]
144#[repr(C)]
145pub struct AstalTrayTray {
146    pub parent_instance: gobject::GObject,
147    pub priv_: *mut AstalTrayTrayPrivate,
148}
149
150impl ::std::fmt::Debug for AstalTrayTray {
151    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
152        f.debug_struct(&format!("AstalTrayTray @ {self:p}"))
153            .finish()
154    }
155}
156
157#[derive(Copy, Clone)]
158#[repr(C)]
159pub struct AstalTrayTrayItem {
160    pub parent_instance: gobject::GObject,
161    pub priv_: *mut AstalTrayTrayItemPrivate,
162}
163
164impl ::std::fmt::Debug for AstalTrayTrayItem {
165    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
166        f.debug_struct(&format!("AstalTrayTrayItem @ {self:p}"))
167            .finish()
168    }
169}
170
171extern "C" {
172
173    //=========================================================================
174    // AstalTrayCategory
175    //=========================================================================
176    pub fn astal_tray_category_get_type() -> GType;
177
178    //=========================================================================
179    // AstalTrayStatus
180    //=========================================================================
181    pub fn astal_tray_status_get_type() -> GType;
182
183    //=========================================================================
184    // AstalTrayPixmap
185    //=========================================================================
186    pub fn astal_tray_pixmap_get_type() -> GType;
187
188    //=========================================================================
189    // AstalTrayTooltip
190    //=========================================================================
191    pub fn astal_tray_tooltip_get_type() -> GType;
192
193    //=========================================================================
194    // AstalTrayTray
195    //=========================================================================
196    pub fn astal_tray_tray_get_type() -> GType;
197    pub fn astal_tray_tray_get_default() -> *mut AstalTrayTray;
198    pub fn astal_tray_tray_get_item(
199        self_: *mut AstalTrayTray,
200        item_id: *const c_char,
201    ) -> *mut AstalTrayTrayItem;
202    pub fn astal_tray_tray_new() -> *mut AstalTrayTray;
203    pub fn astal_tray_tray_get_items(self_: *mut AstalTrayTray) -> *mut glib::GList;
204    pub fn astal_tray_tray_get_items_model(self_: *mut AstalTrayTray) -> *mut gio::GListModel;
205
206    //=========================================================================
207    // AstalTrayTrayItem
208    //=========================================================================
209    pub fn astal_tray_tray_item_get_type() -> GType;
210    pub fn astal_tray_tray_item_about_to_show(self_: *mut AstalTrayTrayItem);
211    pub fn astal_tray_tray_item_activate(self_: *mut AstalTrayTrayItem, x: c_int, y: c_int);
212    pub fn astal_tray_tray_item_secondary_activate(
213        self_: *mut AstalTrayTrayItem,
214        x: c_int,
215        y: c_int,
216    );
217    pub fn astal_tray_tray_item_scroll(
218        self_: *mut AstalTrayTrayItem,
219        delta: c_int,
220        orientation: *const c_char,
221    );
222    pub fn astal_tray_tray_item_to_json_string(self_: *mut AstalTrayTrayItem) -> *mut c_char;
223    pub fn astal_tray_tray_item_get_title(self_: *mut AstalTrayTrayItem) -> *const c_char;
224    pub fn astal_tray_tray_item_get_category(self_: *mut AstalTrayTrayItem) -> AstalTrayCategory;
225    pub fn astal_tray_tray_item_get_status(self_: *mut AstalTrayTrayItem) -> AstalTrayStatus;
226    pub fn astal_tray_tray_item_get_tooltip(self_: *mut AstalTrayTrayItem)
227        -> *mut AstalTrayTooltip;
228    pub fn astal_tray_tray_item_get_tooltip_markup(self_: *mut AstalTrayTrayItem) -> *mut c_char;
229    pub fn astal_tray_tray_item_get_tooltip_text(self_: *mut AstalTrayTrayItem) -> *mut c_char;
230    pub fn astal_tray_tray_item_get_id(self_: *mut AstalTrayTrayItem) -> *const c_char;
231    pub fn astal_tray_tray_item_get_is_menu(self_: *mut AstalTrayTrayItem) -> gboolean;
232    pub fn astal_tray_tray_item_get_icon_theme_path(self_: *mut AstalTrayTrayItem)
233        -> *const c_char;
234    pub fn astal_tray_tray_item_get_icon_name(self_: *mut AstalTrayTrayItem) -> *mut c_char;
235    pub fn astal_tray_tray_item_get_icon_pixbuf(
236        self_: *mut AstalTrayTrayItem,
237    ) -> *mut gdk_pixbuf::GdkPixbuf;
238    pub fn astal_tray_tray_item_get_gicon(self_: *mut AstalTrayTrayItem) -> *mut gio::GIcon;
239    pub fn astal_tray_tray_item_get_item_id(self_: *mut AstalTrayTrayItem) -> *const c_char;
240    pub fn astal_tray_tray_item_get_menu_path(self_: *mut AstalTrayTrayItem) -> *const c_char;
241    pub fn astal_tray_tray_item_get_menu_model(
242        self_: *mut AstalTrayTrayItem,
243    ) -> *mut gio::GMenuModel;
244    pub fn astal_tray_tray_item_get_action_group(
245        self_: *mut AstalTrayTrayItem,
246    ) -> *mut gio::GActionGroup;
247
248    //=========================================================================
249    // Other functions
250    //=========================================================================
251    pub fn astal_tray_category_to_nick(self_: AstalTrayCategory) -> *mut c_char;
252    pub fn astal_tray_category_from_string(
253        value: *const c_char,
254        error: *mut *mut glib::GError,
255    ) -> AstalTrayCategory;
256    pub fn astal_tray_status_to_nick(self_: AstalTrayStatus) -> *mut c_char;
257    pub fn astal_tray_status_from_string(
258        value: *const c_char,
259        error: *mut *mut glib::GError,
260    ) -> AstalTrayStatus;
261    pub fn astal_tray_get_default() -> *mut AstalTrayTray;
262
263}