| 1 | // Public API from X11/extensions/Xinerama.h. The C headers own the ABI. |
| 2 | module xinerama |
| 3 | |
| 4 | import vx11 |
| 5 | |
| 6 | #flag -lXinerama |
| 7 | #include <X11/extensions/Xinerama.h> |
| 8 | |
| 9 | @[typedef] |
| 10 | pub struct C.XineramaScreenInfo { |
| 11 | pub mut: |
| 12 | screen_number i32 |
| 13 | x_org i16 |
| 14 | y_org i16 |
| 15 | width i16 |
| 16 | height i16 |
| 17 | } |
| 18 | |
| 19 | pub type XineramaScreenInfo = C.XineramaScreenInfo |
| 20 | |
| 21 | fn C.XineramaQueryExtension(&vx11.Display, &i32, &i32) i32 |
| 22 | fn C.XineramaQueryVersion(&vx11.Display, &i32, &i32) i32 |
| 23 | fn C.XineramaIsActive(&vx11.Display) i32 |
| 24 | fn C.XineramaQueryScreens(&vx11.Display, &i32) &XineramaScreenInfo |
| 25 | |
| 26 | pub fn query_extension(display &vx11.Display, event_base &i32, error_base &i32) i32 { |
| 27 | return C.XineramaQueryExtension(display, event_base, error_base) |
| 28 | } |
| 29 | |
| 30 | pub fn query_version(display &vx11.Display, major &i32, minor &i32) i32 { |
| 31 | return C.XineramaQueryVersion(display, major, minor) |
| 32 | } |
| 33 | |
| 34 | pub fn is_active(display &vx11.Display) i32 { return C.XineramaIsActive(display) } |
| 35 | |
| 36 | // The returned array belongs to the caller; release it with vx11.free. |
| 37 | pub fn query_screens(display &vx11.Display, count &i32) &XineramaScreenInfo { |
| 38 | return C.XineramaQueryScreens(display, count) |
| 39 | } |
| 40 | |