rust-libnotify/src/lib.rs

53 lines
1.2 KiB
Rust
Raw Normal View History

2015-03-10 07:46:54 +00:00
//! Rustic bindings to [libnotify](https://developer.gnome.org/libnotify/)
//!
//! ```rust
//! extern crate libnotify;
2015-11-02 23:50:27 +00:00
//!
//! fn main() {
2017-07-09 23:09:21 +00:00
//! // Init libnotify
//! libnotify::init("myapp").unwrap();
2017-07-11 12:36:21 +00:00
//! // Create a new notification (doesn't show it yet)
2017-07-09 23:09:21 +00:00
//! let n = libnotify::Notification::new("Summary",
//! Some("Optional Body"),
2017-07-10 21:21:16 +00:00
//! None);
2017-07-09 23:09:21 +00:00
//! // Show the notification
//! n.show().unwrap();
2017-07-11 13:18:40 +00:00
//! // Update the existent notification
2017-07-09 23:09:21 +00:00
//! n.update("I am another notification", None, None).unwrap();
2017-07-11 13:18:40 +00:00
//! // Show the updated notification
2017-07-09 23:09:21 +00:00
//! n.show().unwrap();
//! // We are done, deinit
//! libnotify::uninit();
//! }
2015-03-10 07:46:54 +00:00
//!
//! ```
2015-11-02 23:51:20 +00:00
#![warn(missing_docs)]
extern crate gdk_pixbuf;
2017-07-10 21:21:16 +00:00
#[macro_use]
2017-07-09 12:23:37 +00:00
extern crate glib;
2017-07-10 21:21:16 +00:00
extern crate glib_sys as glib_ffi;
extern crate gobject_sys as gobject_ffi;
extern crate libnotify_sys as ffi;
2017-07-10 21:21:16 +00:00
pub use enums::*;
pub use functions::*;
pub use notification::*;
2017-07-10 21:21:16 +00:00
macro_rules! assert_initialized_libnotify {
() => {
2017-07-10 21:21:16 +00:00
use functions::*;
if !is_initted() {
panic!("Notify system not initialized, invalid call of function");
}
}
}
2017-07-09 12:25:30 +00:00
2017-07-10 21:21:16 +00:00
mod enums;
mod functions;
mod notification;