leanshot/imlib2/lib.rs

28 lines
673 B
Rust
Raw Normal View History

2018-09-11 04:13:33 +00:00
//! Safe-ish bindings to imlib2 (at least the only parts I need).
#![deny(missing_docs)]
#[macro_use]
extern crate failure;
extern crate imlib2_sys;
extern crate x11;
mod errors;
mod image;
2018-09-11 18:21:59 +00:00
mod visual;
2018-09-11 04:13:33 +00:00
pub use errors::Error;
pub use image::Image;
pub use imlib2_sys::{Drawable, Pixmap};
2018-09-11 18:21:59 +00:00
pub use visual::Visual;
/// Set the display for the imlib context.
pub fn context_set_display(display: *mut x11::xlib::Display) {
unsafe { imlib2_sys::imlib_context_set_display(display as *mut imlib2_sys::_XDisplay) };
}
/// Set the visual for the imlib context.
pub fn context_set_visual(visual: Visual) {
unsafe { imlib2_sys::imlib_context_set_visual(visual.inner) };
}