1use super::xlib::{Bool, Display, Drawable, Pixmap, Visual, XImage, GC};
2use std::os::raw::{c_char, c_int, c_uint, c_ulong};
3
4x11_link! { Xext, xext, ["libXext.so.6", "libXext.so"], 10,
5 pub fn XShmQueryExtension(_1: *mut Display) -> Bool,
6 pub fn XShmGetEventBase(_1: *mut Display) -> c_int,
7 pub fn XShmQueryVersion(_4: *mut Display, _3: *mut c_int, _2: *mut c_int, _1: *mut Bool) -> Bool,
8 pub fn XShmPixmapFormat(_1: *mut Display) -> c_int,
9 pub fn XShmAttach(_2: *mut Display, _1: *mut XShmSegmentInfo) -> Bool,
10 pub fn XShmDetach(_2: *mut Display, _1: *mut XShmSegmentInfo) -> Bool,
11 pub fn XShmPutImage(_11: *mut Display, _10: Drawable, _9: GC, _8: *mut XImage, _7: c_int, _6: c_int, _5: c_int, _4: c_int, _3: c_uint, _2: c_uint, _1: Bool) -> Bool,
12 pub fn XShmGetImage(_6: *mut Display, _5: Drawable, _4: *mut XImage, _3: c_int, _2: c_int, _1: c_uint) -> Bool,
13 pub fn XShmCreateImage(_8: *mut Display, _7: *mut Visual, _6: c_uint, _5: c_int, _4: *mut c_char, _3: *mut XShmSegmentInfo, _2: c_uint, _1: c_uint) -> *mut XImage,
14 pub fn XShmCreatePixmap(_7: *mut Display, _6: Drawable, _5: *mut c_char, _4: *mut XShmSegmentInfo, _3: c_uint, _2: c_uint, _1: c_uint) -> Pixmap,
15
16variadic:
17globals:
18}
19
20pub type ShmSeg = c_ulong;
21
22#[derive(Copy, Clone, Debug, PartialEq)]
23#[repr(C)]
24pub struct XShmCompletionEvent {
25 /// of event
26 pub _type: c_int,
27 /// # of last request processed by server
28 pub serial: c_uint,
29 /// true if this came from a SendEvent request
30 pub send_event: Bool,
31 /// Display the event was read from
32 pub diplay: *mut Display,
33 /// drawable of request
34 pub drawable: *mut Drawable,
35 /// ShmReqCode
36 pub major_code: c_int,
37 /// X_ShmPutImage
38 pub minor_code: c_int,
39 /// the ShmSeg used in the request
40 pub shmseg: ShmSeg,
41 /// the offset into ShmSeg used in the request
42 pub offset: c_ulong,
43}
44
45#[derive(Copy, Clone, Debug, PartialEq)]
46#[repr(C)]
47pub struct XShmSegmentInfo {
48 /// resource id
49 pub shmseg: ShmSeg,
50 /// kernel id
51 pub shmid: c_int,
52 /// address in client
53 pub shmaddr: *mut c_char,
54 /// how the server should attach it
55 pub readOnly: Bool,
56}
57