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
#![doc(html_logo_url = "https://msandova.pages.gitlab.gnome.org/trinket/libtrinket.svg")]
use gtk::gdk;
use gtk::prelude::*;
use std::sync::Once;
#[cfg(feature = "bindings")]
pub mod ffi;
pub mod prelude;
pub mod subclass;
mod notification;
mod notification_bin;
mod notification_widget;
mod progress_icon;
mod qr_code;
pub use notification::{Notification, NONE_NOTIFICATION};
pub use notification_bin::{NotificationBin, NONE_NOTIFICATION_BIN};
pub(crate) use notification_widget::NotificationWidget;
pub use progress_icon::{ProgressIcon, NONE_PROGRESS_ICON};
pub use qr_code::{QRCode, NONE_QR_CODE};
#[doc(alias = "tri_init")]
pub fn init() {
static INIT: Once = Once::new();
INIT.call_once(|| {
ProgressIcon::static_type();
NotificationBin::static_type();
QRCode::static_type();
gtk::init().unwrap();
let provider = gtk::CssProvider::new();
provider.load_from_data(include_bytes!("style.css"));
if let Some(display) = gdk::Display::default() {
gtk::StyleContext::add_provider_for_display(
&display,
&provider,
gtk::STYLE_PROVIDER_PRIORITY_THEME,
);
}
});
}