1#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
6#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal, clippy::upper_case_acronyms)]
7#![cfg_attr(feature = "dox", feature(doc_cfg))]
8
9
10mod manual;
11
12pub use manual::*;
13
14#[allow(unused_imports)]
15use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
16 c_short, c_ushort, c_long, c_ulong,
17 c_void, size_t, ssize_t, intptr_t, uintptr_t, FILE};
18
19#[allow(unused_imports)]
20use glib::{gboolean, gconstpointer, gpointer, GType};
21
22pub type AppIndicatorCategory = c_int;
24pub const APP_INDICATOR_CATEGORY_APPLICATION_STATUS: AppIndicatorCategory = 0;
25pub const APP_INDICATOR_CATEGORY_COMMUNICATIONS: AppIndicatorCategory = 1;
26pub const APP_INDICATOR_CATEGORY_SYSTEM_SERVICES: AppIndicatorCategory = 2;
27pub const APP_INDICATOR_CATEGORY_HARDWARE: AppIndicatorCategory = 3;
28pub const APP_INDICATOR_CATEGORY_OTHER: AppIndicatorCategory = 4;
29
30pub type AppIndicatorStatus = c_int;
31pub const APP_INDICATOR_STATUS_PASSIVE: AppIndicatorStatus = 0;
32pub const APP_INDICATOR_STATUS_ACTIVE: AppIndicatorStatus = 1;
33pub const APP_INDICATOR_STATUS_ATTENTION: AppIndicatorStatus = 2;
34
35pub const APP_INDICATOR_SIGNAL_CONNECTION_CHANGED: *const c_char = b"connection-changed\0" as *const u8 as *const c_char;
37pub const APP_INDICATOR_SIGNAL_NEW_ATTENTION_ICON: *const c_char = b"new-attention-icon\0" as *const u8 as *const c_char;
38pub const APP_INDICATOR_SIGNAL_NEW_ICON: *const c_char = b"new-icon\0" as *const u8 as *const c_char;
39pub const APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH: *const c_char = b"new-icon-theme-path\0" as *const u8 as *const c_char;
40pub const APP_INDICATOR_SIGNAL_NEW_LABEL: *const c_char = b"new-label\0" as *const u8 as *const c_char;
41pub const APP_INDICATOR_SIGNAL_NEW_STATUS: *const c_char = b"new-status\0" as *const u8 as *const c_char;
42pub const APP_INDICATOR_SIGNAL_SCROLL_EVENT: *const c_char = b"scroll-event\0" as *const u8 as *const c_char;
43
44#[derive(Copy, Clone)]
46#[repr(C)]
47pub struct AppIndicatorClass {
48 pub parent_class: gobject::GObjectClass,
49 pub new_icon: Option<unsafe extern "C" fn(*mut AppIndicator, gpointer)>,
50 pub new_attention_icon: Option<unsafe extern "C" fn(*mut AppIndicator, gpointer)>,
51 pub new_status: Option<unsafe extern "C" fn(*mut AppIndicator, *const c_char, gpointer)>,
52 pub new_icon_theme_path: Option<unsafe extern "C" fn(*mut AppIndicator, *const c_char, gpointer)>,
53 pub new_label: Option<unsafe extern "C" fn(*mut AppIndicator, *const c_char, *const c_char, gpointer)>,
54 pub connection_changed: Option<unsafe extern "C" fn(*mut AppIndicator, gboolean, gpointer)>,
55 pub scroll_event: Option<unsafe extern "C" fn(*mut AppIndicator, c_int, gdk::GdkScrollDirection, gpointer)>,
56 pub app_indicator_reserved_ats: Option<unsafe extern "C" fn()>,
57 pub fallback: Option<unsafe extern "C" fn(*mut AppIndicator) -> *mut gtk::GtkStatusIcon>,
58 pub unfallback: Option<unsafe extern "C" fn(*mut AppIndicator, *mut gtk::GtkStatusIcon)>,
59 pub app_indicator_reserved_1: Option<unsafe extern "C" fn()>,
60 pub app_indicator_reserved_2: Option<unsafe extern "C" fn()>,
61 pub app_indicator_reserved_3: Option<unsafe extern "C" fn()>,
62 pub app_indicator_reserved_4: Option<unsafe extern "C" fn()>,
63 pub app_indicator_reserved_5: Option<unsafe extern "C" fn()>,
64 pub app_indicator_reserved_6: Option<unsafe extern "C" fn()>,
65}
66
67impl ::std::fmt::Debug for AppIndicatorClass {
68 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
69 f.debug_struct(&format!("AppIndicatorClass @ {:p}", self))
70 .field("parent_class", &self.parent_class)
71 .field("new_icon", &self.new_icon)
72 .field("new_attention_icon", &self.new_attention_icon)
73 .field("new_status", &self.new_status)
74 .field("new_icon_theme_path", &self.new_icon_theme_path)
75 .field("new_label", &self.new_label)
76 .field("connection_changed", &self.connection_changed)
77 .field("scroll_event", &self.scroll_event)
78 .field("app_indicator_reserved_ats", &self.app_indicator_reserved_ats)
79 .field("fallback", &self.fallback)
80 .field("unfallback", &self.unfallback)
81 .field("app_indicator_reserved_1", &self.app_indicator_reserved_1)
82 .field("app_indicator_reserved_2", &self.app_indicator_reserved_2)
83 .field("app_indicator_reserved_3", &self.app_indicator_reserved_3)
84 .field("app_indicator_reserved_4", &self.app_indicator_reserved_4)
85 .field("app_indicator_reserved_5", &self.app_indicator_reserved_5)
86 .field("app_indicator_reserved_6", &self.app_indicator_reserved_6)
87 .finish()
88 }
89}
90
91#[repr(C)]
92pub struct _AppIndicatorPrivate {
93 _data: [u8; 0],
94 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
95}
96
97pub type AppIndicatorPrivate = *mut _AppIndicatorPrivate;
98
99#[derive(Copy, Clone)]
101#[repr(C)]
102pub struct AppIndicator {
103 pub parent: gobject::GObject,
104 pub priv_: *mut AppIndicatorPrivate,
105}
106
107impl ::std::fmt::Debug for AppIndicator {
108 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
109 f.debug_struct(&format!("AppIndicator @ {:p}", self))
110 .field("parent", &self.parent)
111 .field("priv_", &self.priv_)
112 .finish()
113 }
114}
115
116extern "C" {
117
118 pub fn app_indicator_get_type() -> GType;
122 pub fn app_indicator_new(id: *const c_char, icon_name: *const c_char, category: AppIndicatorCategory) -> *mut AppIndicator;
123 pub fn app_indicator_new_with_path(id: *const c_char, icon_name: *const c_char, category: AppIndicatorCategory, icon_theme_path: *const c_char) -> *mut AppIndicator;
124 pub fn app_indicator_build_menu_from_desktop(self_: *mut AppIndicator, desktop_file: *const c_char, desktop_profile: *const c_char);
125 pub fn app_indicator_get_attention_icon(self_: *mut AppIndicator) -> *const c_char;
126 pub fn app_indicator_get_attention_icon_desc(self_: *mut AppIndicator) -> *const c_char;
127 pub fn app_indicator_get_category(self_: *mut AppIndicator) -> AppIndicatorCategory;
128 pub fn app_indicator_get_icon(self_: *mut AppIndicator) -> *const c_char;
129 pub fn app_indicator_get_icon_desc(self_: *mut AppIndicator) -> *const c_char;
130 pub fn app_indicator_get_icon_theme_path(self_: *mut AppIndicator) -> *const c_char;
131 pub fn app_indicator_get_id(self_: *mut AppIndicator) -> *const c_char;
132 pub fn app_indicator_get_label(self_: *mut AppIndicator) -> *const c_char;
133 pub fn app_indicator_get_label_guide(self_: *mut AppIndicator) -> *const c_char;
134 pub fn app_indicator_get_menu(self_: *mut AppIndicator) -> *mut gtk::GtkMenu;
135 pub fn app_indicator_get_ordering_index(self_: *mut AppIndicator) -> u32;
136 pub fn app_indicator_get_secondary_activate_target(self_: *mut AppIndicator) -> *mut gtk::GtkWidget;
137 pub fn app_indicator_get_status(self_: *mut AppIndicator) -> AppIndicatorStatus;
138 #[cfg(any(feature = "v0_5", feature = "dox"))]
139 #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_5")))]
140 pub fn app_indicator_get_title(self_: *mut AppIndicator) -> *const c_char;
141 pub fn app_indicator_set_attention_icon(self_: *mut AppIndicator, icon_name: *const c_char);
142 pub fn app_indicator_set_attention_icon_full(self_: *mut AppIndicator, icon_name: *const c_char, icon_desc: *const c_char);
143 pub fn app_indicator_set_icon(self_: *mut AppIndicator, icon_name: *const c_char);
144 pub fn app_indicator_set_icon_full(self_: *mut AppIndicator, icon_name: *const c_char, icon_desc: *const c_char);
145 pub fn app_indicator_set_icon_theme_path(self_: *mut AppIndicator, icon_theme_path: *const c_char);
146 pub fn app_indicator_set_label(self_: *mut AppIndicator, label: *const c_char, guide: *const c_char);
147 pub fn app_indicator_set_menu(self_: *mut AppIndicator, menu: *mut gtk::GtkMenu);
148 pub fn app_indicator_set_ordering_index(self_: *mut AppIndicator, ordering_index: u32);
149 pub fn app_indicator_set_secondary_activate_target(self_: *mut AppIndicator, menuitem: *mut gtk::GtkWidget);
150 pub fn app_indicator_set_status(self_: *mut AppIndicator, status: AppIndicatorStatus);
151 #[cfg(any(feature = "v0_5", feature = "dox"))]
152 #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_5")))]
153 pub fn app_indicator_set_title(self_: *mut AppIndicator, title: *const c_char);
154
155}