-
Notifications
You must be signed in to change notification settings - Fork 68
Add Xdamage bindings #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
malwrar
wants to merge
8
commits into
AltF02:master
Choose a base branch
from
malwrar:xdamage
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add Xdamage bindings #122
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8d83873
Add Xdamage bindings.
malwrar 8ce2958
Fix file that wasn't a symlink after all!
malwrar 3521891
Remove C stuff.
malwrar 216a20f
Fix typo.
malwrar 96ab3e1
Add constants.
malwrar d81f648
Merge branch 'master' into xdamage
AltF02 7dbc920
fix: update to 2018
AltF02 2734f3f
Merge branch 'master' into xdamage
AltF02 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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::{ | ||
| 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; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ fn main() { | |
| ("xext", "xext"), | ||
| ("gl", "gl"), | ||
| ("xcursor", "xcursor"), | ||
| ("xdamange", "xdamage"), | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo |
||
| ("xxf86vm", "xxf86vm"), | ||
| ("xft", "xft"), | ||
| ("xinerama", "xinerama"), | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../src/xdamage.rs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../../src/xdamage.rs |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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