1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// Generated by gir (https://github.com/gtk-rs/gir @ bb52094f1b0d)
// from ../gir-files (@ e570164a57ea)
// DO NOT EDIT

#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
#![allow(clippy::approx_constant, clippy::type_complexity, clippy::unreadable_literal, clippy::upper_case_acronyms)]
#![cfg_attr(feature = "dox", feature(doc_cfg))]


mod manual;

pub use manual::*;

#[allow(unused_imports)]
use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
    c_short, c_ushort, c_long, c_ulong,
    c_void, size_t, ssize_t, intptr_t, uintptr_t, FILE};

#[allow(unused_imports)]
use glib::{gboolean, gconstpointer, gpointer, GType};

// Enums
pub type AppIndicatorCategory = c_int;
pub const APP_INDICATOR_CATEGORY_APPLICATION_STATUS: AppIndicatorCategory = 0;
pub const APP_INDICATOR_CATEGORY_COMMUNICATIONS: AppIndicatorCategory = 1;
pub const APP_INDICATOR_CATEGORY_SYSTEM_SERVICES: AppIndicatorCategory = 2;
pub const APP_INDICATOR_CATEGORY_HARDWARE: AppIndicatorCategory = 3;
pub const APP_INDICATOR_CATEGORY_OTHER: AppIndicatorCategory = 4;

pub type AppIndicatorStatus = c_int;
pub const APP_INDICATOR_STATUS_PASSIVE: AppIndicatorStatus = 0;
pub const APP_INDICATOR_STATUS_ACTIVE: AppIndicatorStatus = 1;
pub const APP_INDICATOR_STATUS_ATTENTION: AppIndicatorStatus = 2;

// Constants
pub const APP_INDICATOR_SIGNAL_CONNECTION_CHANGED: *const c_char = b"connection-changed\0" as *const u8 as *const c_char;
pub const APP_INDICATOR_SIGNAL_NEW_ATTENTION_ICON: *const c_char = b"new-attention-icon\0" as *const u8 as *const c_char;
pub const APP_INDICATOR_SIGNAL_NEW_ICON: *const c_char = b"new-icon\0" as *const u8 as *const c_char;
pub const APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH: *const c_char = b"new-icon-theme-path\0" as *const u8 as *const c_char;
pub const APP_INDICATOR_SIGNAL_NEW_LABEL: *const c_char = b"new-label\0" as *const u8 as *const c_char;
pub const APP_INDICATOR_SIGNAL_NEW_STATUS: *const c_char = b"new-status\0" as *const u8 as *const c_char;
pub const APP_INDICATOR_SIGNAL_SCROLL_EVENT: *const c_char = b"scroll-event\0" as *const u8 as *const c_char;

// Records
#[derive(Copy, Clone)]
#[repr(C)]
pub struct AppIndicatorClass {
    pub parent_class: gobject::GObjectClass,
    pub new_icon: Option<unsafe extern "C" fn(*mut AppIndicator, gpointer)>,
    pub new_attention_icon: Option<unsafe extern "C" fn(*mut AppIndicator, gpointer)>,
    pub new_status: Option<unsafe extern "C" fn(*mut AppIndicator, *const c_char, gpointer)>,
    pub new_icon_theme_path: Option<unsafe extern "C" fn(*mut AppIndicator, *const c_char, gpointer)>,
    pub new_label: Option<unsafe extern "C" fn(*mut AppIndicator, *const c_char, *const c_char, gpointer)>,
    pub connection_changed: Option<unsafe extern "C" fn(*mut AppIndicator, gboolean, gpointer)>,
    pub scroll_event: Option<unsafe extern "C" fn(*mut AppIndicator, c_int, gdk::GdkScrollDirection, gpointer)>,
    pub app_indicator_reserved_ats: Option<unsafe extern "C" fn()>,
    pub fallback: Option<unsafe extern "C" fn(*mut AppIndicator) -> *mut gtk::GtkStatusIcon>,
    pub unfallback: Option<unsafe extern "C" fn(*mut AppIndicator, *mut gtk::GtkStatusIcon)>,
    pub app_indicator_reserved_1: Option<unsafe extern "C" fn()>,
    pub app_indicator_reserved_2: Option<unsafe extern "C" fn()>,
    pub app_indicator_reserved_3: Option<unsafe extern "C" fn()>,
    pub app_indicator_reserved_4: Option<unsafe extern "C" fn()>,
    pub app_indicator_reserved_5: Option<unsafe extern "C" fn()>,
    pub app_indicator_reserved_6: Option<unsafe extern "C" fn()>,
}

impl ::std::fmt::Debug for AppIndicatorClass {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("AppIndicatorClass @ {:p}", self))
         .field("parent_class", &self.parent_class)
         .field("new_icon", &self.new_icon)
         .field("new_attention_icon", &self.new_attention_icon)
         .field("new_status", &self.new_status)
         .field("new_icon_theme_path", &self.new_icon_theme_path)
         .field("new_label", &self.new_label)
         .field("connection_changed", &self.connection_changed)
         .field("scroll_event", &self.scroll_event)
         .field("app_indicator_reserved_ats", &self.app_indicator_reserved_ats)
         .field("fallback", &self.fallback)
         .field("unfallback", &self.unfallback)
         .field("app_indicator_reserved_1", &self.app_indicator_reserved_1)
         .field("app_indicator_reserved_2", &self.app_indicator_reserved_2)
         .field("app_indicator_reserved_3", &self.app_indicator_reserved_3)
         .field("app_indicator_reserved_4", &self.app_indicator_reserved_4)
         .field("app_indicator_reserved_5", &self.app_indicator_reserved_5)
         .field("app_indicator_reserved_6", &self.app_indicator_reserved_6)
         .finish()
    }
}

#[repr(C)]
pub struct _AppIndicatorPrivate {
    _data: [u8; 0],
    _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}

pub type AppIndicatorPrivate = *mut _AppIndicatorPrivate;

// Classes
#[derive(Copy, Clone)]
#[repr(C)]
pub struct AppIndicator {
    pub parent: gobject::GObject,
    pub priv_: *mut AppIndicatorPrivate,
}

impl ::std::fmt::Debug for AppIndicator {
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
        f.debug_struct(&format!("AppIndicator @ {:p}", self))
         .field("parent", &self.parent)
         .field("priv_", &self.priv_)
         .finish()
    }
}

extern "C" {

    //=========================================================================
    // AppIndicator
    //=========================================================================
    pub fn app_indicator_get_type() -> GType;
    pub fn app_indicator_new(id: *const c_char, icon_name: *const c_char, category: AppIndicatorCategory) -> *mut AppIndicator;
    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;
    pub fn app_indicator_build_menu_from_desktop(self_: *mut AppIndicator, desktop_file: *const c_char, desktop_profile: *const c_char);
    pub fn app_indicator_get_attention_icon(self_: *mut AppIndicator) -> *const c_char;
    pub fn app_indicator_get_attention_icon_desc(self_: *mut AppIndicator) -> *const c_char;
    pub fn app_indicator_get_category(self_: *mut AppIndicator) -> AppIndicatorCategory;
    pub fn app_indicator_get_icon(self_: *mut AppIndicator) -> *const c_char;
    pub fn app_indicator_get_icon_desc(self_: *mut AppIndicator) -> *const c_char;
    pub fn app_indicator_get_icon_theme_path(self_: *mut AppIndicator) -> *const c_char;
    pub fn app_indicator_get_id(self_: *mut AppIndicator) -> *const c_char;
    pub fn app_indicator_get_label(self_: *mut AppIndicator) -> *const c_char;
    pub fn app_indicator_get_label_guide(self_: *mut AppIndicator) -> *const c_char;
    pub fn app_indicator_get_menu(self_: *mut AppIndicator) -> *mut gtk::GtkMenu;
    pub fn app_indicator_get_ordering_index(self_: *mut AppIndicator) -> u32;
    pub fn app_indicator_get_secondary_activate_target(self_: *mut AppIndicator) -> *mut gtk::GtkWidget;
    pub fn app_indicator_get_status(self_: *mut AppIndicator) -> AppIndicatorStatus;
    #[cfg(any(feature = "v0_5", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_5")))]
    pub fn app_indicator_get_title(self_: *mut AppIndicator) -> *const c_char;
    pub fn app_indicator_set_attention_icon(self_: *mut AppIndicator, icon_name: *const c_char);
    pub fn app_indicator_set_attention_icon_full(self_: *mut AppIndicator, icon_name: *const c_char, icon_desc: *const c_char);
    pub fn app_indicator_set_icon(self_: *mut AppIndicator, icon_name: *const c_char);
    pub fn app_indicator_set_icon_full(self_: *mut AppIndicator, icon_name: *const c_char, icon_desc: *const c_char);
    pub fn app_indicator_set_icon_theme_path(self_: *mut AppIndicator, icon_theme_path: *const c_char);
    pub fn app_indicator_set_label(self_: *mut AppIndicator, label: *const c_char, guide: *const c_char);
    pub fn app_indicator_set_menu(self_: *mut AppIndicator, menu: *mut gtk::GtkMenu);
    pub fn app_indicator_set_ordering_index(self_: *mut AppIndicator, ordering_index: u32);
    pub fn app_indicator_set_secondary_activate_target(self_: *mut AppIndicator, menuitem: *mut gtk::GtkWidget);
    pub fn app_indicator_set_status(self_: *mut AppIndicator, status: AppIndicatorStatus);
    #[cfg(any(feature = "v0_5", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_5")))]
    pub fn app_indicator_set_title(self_: *mut AppIndicator, title: *const c_char);

}