libnotify_sys/
lib.rs

1// This file was generated by gir (89daf8f) from gir-files (1f01de0)
2// DO NOT EDIT
3
4#![allow(non_camel_case_types, non_upper_case_globals)]
5
6extern crate libc;
7extern crate bitflags;
8extern crate glib_sys as glib;
9extern crate gobject_sys as gobject;
10extern crate gdk_pixbuf_sys as gdk_pixbuf;
11
12#[allow(unused_imports)]
13use libc::{c_int, c_char, c_uchar, c_float, c_uint, c_double,
14    c_short, c_ushort, c_long, c_ulong,
15    c_void, size_t, ssize_t, intptr_t, uintptr_t, time_t, FILE};
16
17#[allow(unused_imports)]
18use glib::{gboolean, gconstpointer, gpointer, GType, Volatile};
19
20// Enums
21#[derive(Clone, Copy, Debug, Eq, PartialEq)]
22#[repr(C)]
23pub enum NotifyUrgency {
24    Low = 0,
25    Normal = 1,
26    Critical = 2,
27}
28pub const NOTIFY_URGENCY_LOW: NotifyUrgency = NotifyUrgency::Low;
29pub const NOTIFY_URGENCY_NORMAL: NotifyUrgency = NotifyUrgency::Normal;
30pub const NOTIFY_URGENCY_CRITICAL: NotifyUrgency = NotifyUrgency::Critical;
31
32// Constants
33pub const NOTIFY_EXPIRES_DEFAULT: c_int = -1;
34pub const NOTIFY_EXPIRES_NEVER: c_int = 0;
35pub const NOTIFY_VERSION_MAJOR: c_int = 0;
36pub const NOTIFY_VERSION_MICRO: c_int = 7;
37pub const NOTIFY_VERSION_MINOR: c_int = 7;
38
39// Callbacks
40pub type NotifyActionCallback = Option<unsafe extern "C" fn(*mut NotifyNotification, *mut c_char, gpointer)>;
41
42// Records
43#[repr(C)]
44pub struct NotifyNotificationClass {
45    pub parent_class: gobject::GObjectClass,
46    pub closed: Option<unsafe extern "C" fn(*mut NotifyNotification)>,
47}
48
49#[repr(C)]
50pub struct NotifyNotificationPrivate(c_void);
51
52// Classes
53#[repr(C)]
54pub struct NotifyNotification {
55    pub parent_object: gobject::GObject,
56    pub priv_: *mut NotifyNotificationPrivate,
57}
58
59extern "C" {
60
61    //=========================================================================
62    // NotifyNotification
63    //=========================================================================
64    pub fn notify_notification_get_type() -> GType;
65    pub fn notify_notification_new(summary: *const c_char, body: *const c_char, icon: *const c_char) -> *mut NotifyNotification;
66    //pub fn notify_notification_add_action(notification: *mut NotifyNotification, action: *const c_char, label: *const c_char, callback: NotifyActionCallback, user_data: gpointer, free_func: /*Metadata mismatch*/[c:type mismatch `GFreeFunc` != `GDestroyNotify` of `DestroyNotify`]);
67    pub fn notify_notification_clear_actions(notification: *mut NotifyNotification);
68    pub fn notify_notification_clear_hints(notification: *mut NotifyNotification);
69    pub fn notify_notification_close(notification: *mut NotifyNotification, error: *mut *mut glib::GError) -> gboolean;
70    pub fn notify_notification_get_closed_reason(notification: *const NotifyNotification) -> c_int;
71    pub fn notify_notification_set_app_name(notification: *mut NotifyNotification, app_name: *const c_char);
72    pub fn notify_notification_set_category(notification: *mut NotifyNotification, category: *const c_char);
73    pub fn notify_notification_set_hint(notification: *mut NotifyNotification, key: *const c_char, value: *mut glib::GVariant);
74    pub fn notify_notification_set_hint_byte(notification: *mut NotifyNotification, key: *const c_char, value: c_uchar);
75    pub fn notify_notification_set_hint_byte_array(notification: *mut NotifyNotification, key: *const c_char, value: *mut u8, len: size_t);
76    pub fn notify_notification_set_hint_double(notification: *mut NotifyNotification, key: *const c_char, value: c_double);
77    pub fn notify_notification_set_hint_int32(notification: *mut NotifyNotification, key: *const c_char, value: c_int);
78    pub fn notify_notification_set_hint_string(notification: *mut NotifyNotification, key: *const c_char, value: *const c_char);
79    pub fn notify_notification_set_hint_uint32(notification: *mut NotifyNotification, key: *const c_char, value: c_uint);
80    pub fn notify_notification_set_icon_from_pixbuf(notification: *mut NotifyNotification, icon: *mut gdk_pixbuf::GdkPixbuf);
81    pub fn notify_notification_set_image_from_pixbuf(notification: *mut NotifyNotification, pixbuf: *mut gdk_pixbuf::GdkPixbuf);
82    pub fn notify_notification_set_timeout(notification: *mut NotifyNotification, timeout: c_int);
83    pub fn notify_notification_set_urgency(notification: *mut NotifyNotification, urgency: NotifyUrgency);
84    pub fn notify_notification_show(notification: *mut NotifyNotification, error: *mut *mut glib::GError) -> gboolean;
85    pub fn notify_notification_update(notification: *mut NotifyNotification, summary: *const c_char, body: *const c_char, icon: *const c_char) -> gboolean;
86
87    //=========================================================================
88    // Other functions
89    //=========================================================================
90    pub fn notify_get_app_name() -> *const c_char;
91    pub fn notify_get_server_caps() -> *mut glib::GList;
92    pub fn notify_get_server_info(ret_name: *mut *mut c_char, ret_vendor: *mut *mut c_char, ret_version: *mut *mut c_char, ret_spec_version: *mut *mut c_char) -> gboolean;
93    pub fn notify_init(app_name: *const c_char) -> gboolean;
94    pub fn notify_is_initted() -> gboolean;
95    pub fn notify_set_app_name(app_name: *const c_char);
96    pub fn notify_uninit();
97
98}