1 // x11-rs: Rust bindings for X11 libraries 2 // The X11 libraries are available under the MIT license. 3 // These bindings are public domain. 4 5 use std::os::raw::{ 6 c_int, 7 c_short, 8 }; 9 10 use ::xlib::{ 11 Bool, 12 Display, 13 Drawable, 14 Status, 15 Window, 16 XID, 17 }; 18 19 20 // 21 // functions 22 // 23 24 25 x11_link! { Xlib, xinerama, ["libXinerama.so.1", "libXinerama.so"], 10, 26 pub fn XineramaIsActive (dpy: *mut Display) -> Bool, 27 pub fn XineramaQueryExtension (dpy: *mut Display, event_base: *mut c_int, error_base: *mut c_int) -> Bool, 28 pub fn XineramaQueryScreens (dpy: *mut Display, number: *mut c_int) -> *mut XineramaScreenInfo, 29 pub fn XineramaQueryVersion (dpy: *mut Display, major_versionp: *mut c_int, minor_versionp: *mut c_int) -> Status, 30 pub fn XPanoramiXAllocInfo () -> *mut XPanoramiXInfo, 31 pub fn XPanoramiXGetScreenCount (dpy: *mut Display, drawable: Drawable, panoramiX_info: *mut XPanoramiXInfo) -> Status, 32 pub fn XPanoramiXGetScreenSize (dpy: *mut Display, drawable: Drawable, screen_num: c_int, panoramiX_info: *mut XPanoramiXInfo) -> Status, 33 pub fn XPanoramiXGetState (dpy: *mut Display, drawable: Drawable, panoramiX_info: *mut XPanoramiXInfo) -> Status, 34 pub fn XPanoramiXQueryExtension (dpy: *mut Display, event_base_return: *mut c_int, error_base_return: *mut c_int) -> Bool, 35 pub fn XPanoramiXQueryVersion (dpy: *mut Display, major_version_return: *mut c_int, minor_version_return: *mut c_int) -> Status, 36 variadic: 37 globals: 38 } 39 40 41 // 42 // types 43 // 44 45 46 #[derive(Debug, Clone, Copy, PartialEq)] 47 #[repr(C)] 48 pub struct XineramaScreenInfo { 49 pub screen_number: c_int, 50 pub x_org: c_short, 51 pub y_org: c_short, 52 pub width: c_short, 53 pub height: c_short, 54 } 55 56 #[derive(Debug, Clone, Copy, PartialEq)] 57 #[repr(C)] 58 pub struct XPanoramiXInfo { 59 pub window: Window, 60 pub screen: c_int, 61 pub State: c_int, 62 pub width: c_int, 63 pub height: c_int, 64 pub ScreenCount: c_int, 65 pub eventMask: XID, 66 } 67