Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions src/xdamage.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
// The X11 libraries are available under the MIT license.
// These bindings are public domain.

use std::os::raw::{
c_int,
c_ulong,
};

use ::xlib::XserverRegion;
use ::xlib::{
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In rust 2018 this has to be crate::xlib

Bool,
XID,
XRectangle,
Status,
Window,
Display,
Drawable,
Damage,
Time,
};


//
// functions
//

x11_link! { Xdamage, xdamage, ["libXdamage.so.1.1.0", "libXdamage.so"], 6,
pub fn XDamageQueryExtension(_3: *mut Display, _2: *mut c_int, _1: *mut c_int) -> Bool,
pub fn XDamageQueryVersion(_3: *mut Display, _2: *mut c_int, _1: *mut c_int) -> Status,
pub fn XDamageCreate(_3: *mut Display, _2: Drawable, _1: c_int) -> Damage,
pub fn XDamageDestroy(_2: *mut Display, _1: Damage) -> (),
pub fn XDamageSubtract(_4: *mut Display, _3: Damage, _2: XserverRegion, _1: XserverRegion) -> (),
pub fn XDamageAdd(_3: *mut Display, _2: Drawable, _1: XserverRegion) -> (),

variadic:
globals:
}


//
// types
//

pub type Damage = XID;

#[derive(Debug, Clone, Copy, PartialEq)]
#[repr(C)]
struct XDamageNotifyEvent {
_type: c_int,
serial: c_ulong,
send_event: Bool,
display: *mut Display,
drawable: Drawable,
damage: Damage,
level: c_int,
more: Bool,
timestamp: Time,
area: XRectangle,
geometry: XRectangle,
}


//
// constants
//

pub const DAMAGE_NAME: &'static str = "DAMAGE";
pub const DAMAGE_MAJOR: c_int = 1;
pub const DAMAGE_MINOR: c_int = 1;

pub const XDamageReportRawRectangles: c_int = 0;
pub const XDamageReportDeltaRectangles: c_int = 1;
pub const XDamageReportBoundingBox: c_int = 2;
pub const XDamageReportNonEmpty: c_int = 3;

pub const X_DamageQueryVersion: c_int = 0;
pub const X_DamageCreate: c_int = 1;
pub const X_DamageDestroy: c_int = 2;
pub const X_DamageSubtract: c_int = 3;
pub const X_DamageAdd: c_int = 4;
pub const XDamageNumberRequests: c_int = 5;

pub const XDamageNotify: c_int = 0;
pub const XDamageNumberEvents: c_int = 1;

pub const BadDamage: c_int = 0;
pub const XDamageNumberErrors: c_int = 0;
2 changes: 1 addition & 1 deletion x11-dl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "x11-dl"
version = "2.19.0"
version = "2.19.1"
authors = [
"daggerbot <daggerbot@gmail.com>",
"Erle Pereira <erle@erlepereira.com>",
Expand Down
1 change: 1 addition & 0 deletions x11-dl/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fn main() {
("xext", "xext"),
("gl", "gl"),
("xcursor", "xcursor"),
("xdamange", "xdamage"),
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

("xxf86vm", "xxf86vm"),
("xft", "xft"),
("xinerama", "xinerama"),
Expand Down
1 change: 1 addition & 0 deletions x11-dl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub mod dpms;
pub mod glx;
pub mod keysym;
pub mod xcursor;
pub mod xdamage;
pub mod xf86vmode;
pub mod xfixes;
pub mod xft;
Expand Down
1 change: 1 addition & 0 deletions x11-dl/src/xdamage.rs
3 changes: 2 additions & 1 deletion x11/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "x11"
version = "2.19.0"
version = "2.19.1"
authors = [
"daggerbot <daggerbot@gmail.com>",
"Erle Pereira <erle@erlepereira.com>",
Expand All @@ -18,6 +18,7 @@ edition = "2018"
dpms = []
glx = []
xcursor = []
xdamage = []
xf86vmode = []
xft = []
xinerama = []
Expand Down
1 change: 1 addition & 0 deletions x11/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ fn main() {
("gl", "1", "glx"),
("x11", "1.4.99.1", "xlib"),
("x11-xcb", "1.6", "xlib_xcb"),
("xdamage", "1.1.0", "xdamage"),
("xcursor", "1.1", "xcursor"),
("xext", "1.3", "dpms"),
("xft", "2.1", "xft"),
Expand Down
1 change: 1 addition & 0 deletions x11/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub mod dpms;
pub mod glx;
pub mod keysym;
pub mod xcursor;
pub mod xdamage;
pub mod xf86vmode;
pub mod xfixes;
pub mod xft;
Expand Down
1 change: 1 addition & 0 deletions x11/src/xdamage.rs