1#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
7#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal, clippy::upper_case_acronyms)]
8#![cfg_attr(docsrs, feature(doc_cfg))]
9
10use glib_sys as glib;
11use gobject_sys as gobject;
12use gio_sys as gio;
13
14#[allow(unused_imports)]
15use std::ffi::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
16 c_short, c_ushort, c_long, c_ulong, c_void};
17#[allow(unused_imports)]
18use libc::{size_t, ssize_t, time_t, off_t, intptr_t, uintptr_t, FILE};
19#[cfg(unix)]
20#[allow(unused_imports)]
21use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t};
22
23#[allow(unused_imports)]
24use glib::{gboolean, gconstpointer, gpointer, GType};
25
26pub type AstalNotifdClosedReason = c_int;
28pub const ASTAL_NOTIFD_CLOSED_REASON_EXPIRED: AstalNotifdClosedReason = 1;
29pub const ASTAL_NOTIFD_CLOSED_REASON_DISMISSED_BY_USER: AstalNotifdClosedReason = 2;
30pub const ASTAL_NOTIFD_CLOSED_REASON_CLOSED: AstalNotifdClosedReason = 3;
31pub const ASTAL_NOTIFD_CLOSED_REASON_UNDEFINED: AstalNotifdClosedReason = 4;
32
33pub type AstalNotifdState = c_int;
34pub const ASTAL_NOTIFD_STATE_DRAFT: AstalNotifdState = 0;
35pub const ASTAL_NOTIFD_STATE_SENT: AstalNotifdState = 1;
36pub const ASTAL_NOTIFD_STATE_RECEIVED: AstalNotifdState = 2;
37
38pub type AstalNotifdUrgency = c_int;
39pub const ASTAL_NOTIFD_URGENCY_LOW: AstalNotifdUrgency = 0;
40pub const ASTAL_NOTIFD_URGENCY_NORMAL: AstalNotifdUrgency = 1;
41pub const ASTAL_NOTIFD_URGENCY_CRITICAL: AstalNotifdUrgency = 2;
42
43pub const ASTAL_NOTIFD_MAJOR_VERSION: c_int = 0;
45pub const ASTAL_NOTIFD_MINOR_VERSION: c_int = 1;
46pub const ASTAL_NOTIFD_MICRO_VERSION: c_int = 0;
47pub const ASTAL_NOTIFD_VERSION: &[u8] = b"0.1.0\0";
48
49#[derive(Copy, Clone)]
51#[repr(C)]
52pub struct AstalNotifdActionClass {
53 pub parent_class: gobject::GObjectClass,
54}
55
56impl ::std::fmt::Debug for AstalNotifdActionClass {
57 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
58 f.debug_struct(&format!("AstalNotifdActionClass @ {self:p}"))
59 .finish()
60 }
61}
62
63#[repr(C)]
64#[allow(dead_code)]
65pub struct _AstalNotifdActionPrivate {
66 _data: [u8; 0],
67 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
68}
69
70pub type AstalNotifdActionPrivate = _AstalNotifdActionPrivate;
71
72#[derive(Copy, Clone)]
73#[repr(C)]
74pub struct AstalNotifdNotifdClass {
75 pub parent_class: gobject::GObjectClass,
76 pub notified: Option<unsafe extern "C" fn(*mut AstalNotifdNotifd, c_uint, gboolean)>,
77 pub resolved: Option<unsafe extern "C" fn(*mut AstalNotifdNotifd, c_uint, AstalNotifdClosedReason)>,
78}
79
80impl ::std::fmt::Debug for AstalNotifdNotifdClass {
81 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
82 f.debug_struct(&format!("AstalNotifdNotifdClass @ {self:p}"))
83 .field("notified", &self.notified)
84 .field("resolved", &self.resolved)
85 .finish()
86 }
87}
88
89#[repr(C)]
90#[allow(dead_code)]
91pub struct _AstalNotifdNotifdPrivate {
92 _data: [u8; 0],
93 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
94}
95
96pub type AstalNotifdNotifdPrivate = _AstalNotifdNotifdPrivate;
97
98#[derive(Copy, Clone)]
99#[repr(C)]
100pub struct AstalNotifdNotificationClass {
101 pub parent_class: gobject::GObjectClass,
102}
103
104impl ::std::fmt::Debug for AstalNotifdNotificationClass {
105 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
106 f.debug_struct(&format!("AstalNotifdNotificationClass @ {self:p}"))
107 .finish()
108 }
109}
110
111#[repr(C)]
112#[allow(dead_code)]
113pub struct _AstalNotifdNotificationPrivate {
114 _data: [u8; 0],
115 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
116}
117
118pub type AstalNotifdNotificationPrivate = _AstalNotifdNotificationPrivate;
119
120#[derive(Copy, Clone)]
122#[repr(C)]
123pub struct AstalNotifdAction {
124 pub parent_instance: gobject::GObject,
125 pub priv_: *mut AstalNotifdActionPrivate,
126}
127
128impl ::std::fmt::Debug for AstalNotifdAction {
129 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
130 f.debug_struct(&format!("AstalNotifdAction @ {self:p}"))
131 .finish()
132 }
133}
134
135#[derive(Copy, Clone)]
136#[repr(C)]
137pub struct AstalNotifdNotifd {
138 pub parent_instance: gobject::GObject,
139 pub priv_: *mut AstalNotifdNotifdPrivate,
140}
141
142impl ::std::fmt::Debug for AstalNotifdNotifd {
143 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
144 f.debug_struct(&format!("AstalNotifdNotifd @ {self:p}"))
145 .finish()
146 }
147}
148
149#[derive(Copy, Clone)]
150#[repr(C)]
151pub struct AstalNotifdNotification {
152 pub parent_instance: gobject::GObject,
153 pub priv_: *mut AstalNotifdNotificationPrivate,
154}
155
156impl ::std::fmt::Debug for AstalNotifdNotification {
157 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
158 f.debug_struct(&format!("AstalNotifdNotification @ {self:p}"))
159 .finish()
160 }
161}
162
163extern "C" {
164
165 pub fn astal_notifd_closed_reason_get_type() -> GType;
169
170 pub fn astal_notifd_state_get_type() -> GType;
174
175 pub fn astal_notifd_urgency_get_type() -> GType;
179
180 pub fn astal_notifd_action_get_type() -> GType;
184 pub fn astal_notifd_action_new(id: *const c_char, label: *const c_char) -> *mut AstalNotifdAction;
185 pub fn astal_notifd_action_invoke(self_: *mut AstalNotifdAction);
186 pub fn astal_notifd_action_get_id(self_: *mut AstalNotifdAction) -> *const c_char;
187 pub fn astal_notifd_action_set_id(self_: *mut AstalNotifdAction, value: *const c_char);
188 pub fn astal_notifd_action_get_label(self_: *mut AstalNotifdAction) -> *const c_char;
189 pub fn astal_notifd_action_set_label(self_: *mut AstalNotifdAction, value: *const c_char);
190
191 pub fn astal_notifd_notifd_get_type() -> GType;
195 pub fn astal_notifd_notifd_get_default() -> *mut AstalNotifdNotifd;
196 pub fn astal_notifd_notifd_get_notification(self_: *mut AstalNotifdNotifd, id: c_uint) -> *mut AstalNotifdNotification;
197 pub fn astal_notifd_notifd_new() -> *mut AstalNotifdNotifd;
198 pub fn astal_notifd_notifd_get_ignore_timeout(self_: *mut AstalNotifdNotifd) -> gboolean;
199 pub fn astal_notifd_notifd_set_ignore_timeout(self_: *mut AstalNotifdNotifd, value: gboolean);
200 pub fn astal_notifd_notifd_get_dont_disturb(self_: *mut AstalNotifdNotifd) -> gboolean;
201 pub fn astal_notifd_notifd_set_dont_disturb(self_: *mut AstalNotifdNotifd, value: gboolean);
202 pub fn astal_notifd_notifd_get_default_timeout(self_: *mut AstalNotifdNotifd) -> c_int;
203 pub fn astal_notifd_notifd_set_default_timeout(self_: *mut AstalNotifdNotifd, value: c_int);
204 pub fn astal_notifd_notifd_get_notifications(self_: *mut AstalNotifdNotifd) -> *mut glib::GList;
205
206 pub fn astal_notifd_notification_get_type() -> GType;
210 pub fn astal_notifd_notification_dismiss(self_: *mut AstalNotifdNotification);
211 pub fn astal_notifd_notification_expire(self_: *mut AstalNotifdNotification);
212 pub fn astal_notifd_notification_invoke(self_: *mut AstalNotifdNotification, action_id: *const c_char);
213 pub fn astal_notifd_notification_add_action(self_: *mut AstalNotifdNotification, action: *mut AstalNotifdAction) -> *mut AstalNotifdNotification;
214 pub fn astal_notifd_notification_set_hint(self_: *mut AstalNotifdNotification, name: *const c_char, value: *mut glib::GVariant) -> *mut AstalNotifdNotification;
215 pub fn astal_notifd_notification_get_hint(self_: *mut AstalNotifdNotification, name: *const c_char) -> *mut glib::GVariant;
216 pub fn astal_notifd_notification_new() -> *mut AstalNotifdNotification;
217 pub fn astal_notifd_notification_get_state(self_: *mut AstalNotifdNotification) -> AstalNotifdState;
218 pub fn astal_notifd_notification_get_time(self_: *mut AstalNotifdNotification) -> i64;
219 pub fn astal_notifd_notification_get_id(self_: *mut AstalNotifdNotification) -> u32;
220 pub fn astal_notifd_notification_set_id(self_: *mut AstalNotifdNotification, value: u32);
221 pub fn astal_notifd_notification_get_app_name(self_: *mut AstalNotifdNotification) -> *const c_char;
222 pub fn astal_notifd_notification_set_app_name(self_: *mut AstalNotifdNotification, value: *const c_char);
223 pub fn astal_notifd_notification_get_app_icon(self_: *mut AstalNotifdNotification) -> *const c_char;
224 pub fn astal_notifd_notification_set_app_icon(self_: *mut AstalNotifdNotification, value: *const c_char);
225 pub fn astal_notifd_notification_get_summary(self_: *mut AstalNotifdNotification) -> *const c_char;
226 pub fn astal_notifd_notification_set_summary(self_: *mut AstalNotifdNotification, value: *const c_char);
227 pub fn astal_notifd_notification_get_body(self_: *mut AstalNotifdNotification) -> *const c_char;
228 pub fn astal_notifd_notification_set_body(self_: *mut AstalNotifdNotification, value: *const c_char);
229 pub fn astal_notifd_notification_get_expire_timeout(self_: *mut AstalNotifdNotification) -> i32;
230 pub fn astal_notifd_notification_set_expire_timeout(self_: *mut AstalNotifdNotification, value: i32);
231 pub fn astal_notifd_notification_get_actions(self_: *mut AstalNotifdNotification) -> *mut glib::GList;
232 pub fn astal_notifd_notification_get_hints(self_: *mut AstalNotifdNotification) -> *mut glib::GVariant;
233 pub fn astal_notifd_notification_get_image(self_: *mut AstalNotifdNotification) -> *mut c_char;
234 pub fn astal_notifd_notification_set_image(self_: *mut AstalNotifdNotification, value: *const c_char);
235 pub fn astal_notifd_notification_get_action_icons(self_: *mut AstalNotifdNotification) -> gboolean;
236 pub fn astal_notifd_notification_set_action_icons(self_: *mut AstalNotifdNotification, value: gboolean);
237 pub fn astal_notifd_notification_get_category(self_: *mut AstalNotifdNotification) -> *mut c_char;
238 pub fn astal_notifd_notification_set_category(self_: *mut AstalNotifdNotification, value: *const c_char);
239 pub fn astal_notifd_notification_get_desktop_entry(self_: *mut AstalNotifdNotification) -> *mut c_char;
240 pub fn astal_notifd_notification_set_desktop_entry(self_: *mut AstalNotifdNotification, value: *const c_char);
241 pub fn astal_notifd_notification_get_resident(self_: *mut AstalNotifdNotification) -> gboolean;
242 pub fn astal_notifd_notification_set_resident(self_: *mut AstalNotifdNotification, value: gboolean);
243 pub fn astal_notifd_notification_get_sound_file(self_: *mut AstalNotifdNotification) -> *mut c_char;
244 pub fn astal_notifd_notification_set_sound_file(self_: *mut AstalNotifdNotification, value: *const c_char);
245 pub fn astal_notifd_notification_get_sound_name(self_: *mut AstalNotifdNotification) -> *mut c_char;
246 pub fn astal_notifd_notification_set_sound_name(self_: *mut AstalNotifdNotification, value: *const c_char);
247 pub fn astal_notifd_notification_get_suppress_sound(self_: *mut AstalNotifdNotification) -> gboolean;
248 pub fn astal_notifd_notification_set_suppress_sound(self_: *mut AstalNotifdNotification, value: gboolean);
249 pub fn astal_notifd_notification_get_transient(self_: *mut AstalNotifdNotification) -> gboolean;
250 pub fn astal_notifd_notification_set_transient(self_: *mut AstalNotifdNotification, value: gboolean);
251 pub fn astal_notifd_notification_get_x(self_: *mut AstalNotifdNotification) -> c_int;
252 pub fn astal_notifd_notification_set_x(self_: *mut AstalNotifdNotification, value: c_int);
253 pub fn astal_notifd_notification_get_y(self_: *mut AstalNotifdNotification) -> c_int;
254 pub fn astal_notifd_notification_set_y(self_: *mut AstalNotifdNotification, value: c_int);
255 pub fn astal_notifd_notification_get_urgency(self_: *mut AstalNotifdNotification) -> AstalNotifdUrgency;
256 pub fn astal_notifd_notification_set_urgency(self_: *mut AstalNotifdNotification, value: AstalNotifdUrgency);
257
258 pub fn astal_notifd_get_default() -> *mut AstalNotifdNotifd;
262 pub fn astal_notifd_send_notification(notification: *mut AstalNotifdNotification, _callback_: gio::GAsyncReadyCallback, _callback__target: *mut c_void);
263 pub fn astal_notifd_send_notification_finish(_res_: *mut gio::GAsyncResult, error: *mut *mut glib::GError);
264
265}