aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11/ffi.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/x11/ffi.rs')
-rw-r--r--src/x11/ffi.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/x11/ffi.rs b/src/x11/ffi.rs
index 2bd2075..fe91033 100644
--- a/src/x11/ffi.rs
+++ b/src/x11/ffi.rs
@@ -29,6 +29,7 @@ pub type XrmDatabase = *const (); // TODO: not sure
pub type XIC = *mut ();
pub type XID = uint;
pub type XIM = *mut ();
+pub type Screen = ();
pub static AllocNone: libc::c_int = 0;
pub static AllocAll: libc::c_int = 1;
@@ -1337,8 +1338,26 @@ pub struct XButtonEvent {
pub same_screen: Bool,
}
+#[repr(C)]
+pub struct XF86VidModeModeInfo {
+ pub dotclock: libc::c_uint,
+ pub hdisplay: libc::c_ushort,
+ pub hsyncstart: libc::c_ushort,
+ pub hsyncend: libc::c_ushort,
+ pub htotal: libc::c_ushort,
+ pub hskew: libc::c_ushort,
+ pub vdisplay: libc::c_ushort,
+ pub vsyncstart: libc::c_ushort,
+ pub vsyncend: libc::c_ushort,
+ pub vtotal: libc::c_ushort,
+ pub flags: libc::c_uint,
+ privsize: libc::c_int,
+ private: libc::c_long,
+}
+
#[link(name = "GL")]
#[link(name = "X11")]
+#[link(name = "Xxf86vm")]
extern "C" {
pub fn XCloseDisplay(display: *mut Display);
pub fn XCheckMaskEvent(display: *mut Display, event_mask: libc::c_long,
@@ -1375,6 +1394,10 @@ extern "C" {
pub fn XSetWMProtocols(display: *mut Display, w: Window, protocols: *mut Atom,
count: libc::c_int) -> Status;
pub fn XStoreName(display: *mut Display, w: Window, window_name: *const libc::c_char);
+ pub fn XScreenCount(display: *mut Display) -> libc::c_int;
+ pub fn XScreenOfDisplay(display: *mut Display, screen_number: libc::c_int) -> *const Screen;
+ pub fn XWidthOfScreen(screen: *const Screen) -> libc::c_int;
+ pub fn XHeightOfScreen(screen: *const Screen) -> libc::c_int;
pub fn XCloseIM(im: XIM) -> Status;
pub fn XOpenIM(display: *mut Display, db: XrmDatabase, res_name: *mut libc::c_char,
@@ -1408,6 +1431,13 @@ extern "C" {
pub fn glXSwapBuffers(dpy: *mut Display, drawable: GLXDrawable);
pub fn XkbSetDetectableAutoRepeat(dpy: *mut Display, detectable: bool, supported_rtm: *mut bool) -> bool;
+
+ pub fn XF86VidModeSwitchToMode(dpy: *mut Display, screen: libc::c_int,
+ modeline: *mut XF86VidModeModeInfo) -> Bool;
+ pub fn XF86VidModeSetViewPort(dpy: *mut Display, screen: libc::c_int,
+ x: libc::c_int, y: libc::c_int) -> Bool;
+ pub fn XF86VidModeGetAllModeLines(dpy: *mut Display, screen: libc::c_int,
+ modecount_return: *mut libc::c_int, modesinfo: *mut *mut *mut XF86VidModeModeInfo) -> Bool;
}
/*