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