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
5use super::xlib::{Atom, Bool, Cursor, Display, Pixmap, Status, Time, Window, XRectangle, GC, XID};
6use libc::{c_char, c_int, c_short, c_uint, c_ulong, c_ushort};
7
8//
9// functions
10//
11
12x11_link! { Xlib, x11, ["libXfixes.so.3", "libXfixes.so"], 35,
13 pub fn XFixesQueryExtension(dpy: *mut Display, event_base: *mut c_int, error_base: *mut c_int) -> Bool,
14 pub fn XFixesQueryVersion(dpy: *mut Display, major_version: *mut c_int, minor_version: *const c_int) -> Status,
15 pub fn XFixesVersion() -> c_int,
16 pub fn XFixesChangeSaveSet(dpy: *mut Display, win: Window, mode: c_int, target: c_int, map: c_int) -> (),
17 pub fn XFixesSelectSelectionInput(dpy: *mut Display, win: Window, selection: Atom, event_mask: c_ulong) -> (),
18 pub fn XFixesSelectCursorInput(dpy: Display, win: Window, event_mask: c_ulong) -> (),
19 pub fn XFixesGetCursorImage(dpy: *mut Display) -> *mut XFixesCursorImage,
20 pub fn XFixesCreateRegion(dpy: *mut Display, rectangles: *mut XRectangle, nrectangles: c_int) -> XserverRegion,
21 pub fn XFixesCreateRegionFromBitmap(dpy: *mut Display, bitmap: Pixmap) -> XserverRegion,
22 pub fn XFixesCreateRegionFromWindow(dpy: *mut Display, win: Window, kind: c_int) -> XserverRegion,
23 pub fn XFixesCreateRegionFromGC(dpy: *mut Display, gc: GC) -> XserverRegion,
24 pub fn XFixesCreateRegionFromPicture(dpy: *mut Display, picture: XID) -> XserverRegion,
25 pub fn XFixesDestroyRegion(dpy: *mut Display, region: XserverRegion) -> (),
26 pub fn XFixesSetRegion(dpy: *mut Display, region: XserverRegion, rectangles: *mut XRectangle, nrectangles: c_int) -> (),
27 pub fn XFixesCopyRegion(dpy: *mut Display, dst: XserverRegion, src: XserverRegion) -> (),
28 pub fn XFixesUnionRegion(dpy: *mut Display, dst: XserverRegion, src1: XserverRegion, src2: XserverRegion) -> (),
29 pub fn XFixesIntersectRegion(dpy: *mut Display, dst: XserverRegion, src1: XserverRegion, src2: XserverRegion) -> (),
30 pub fn XFixesSubtractRegion(dpy: *mut Display, dst: XserverRegion, src1: XserverRegion, src2: XserverRegion) -> (),
31 pub fn XFixesInvertRegion(dpy: *mut Display, dst: XserverRegion, rect: *mut XRectangle, src: XserverRegion) -> (),
32 pub fn XFixesTranslateRegion(dpy: *mut Display, region: XserverRegion, dx: c_int, dy: c_int) -> (),
33 pub fn XFixesRegionExtents(dpy: *mut Display, dst: XserverRegion, src: XserverRegion) -> (),
34 pub fn XFixesFetchRegion(dpy: *mut Display, region: XserverRegion, nrectangles: *mut c_int) -> *mut XRectangle,
35 pub fn XFixesFetchRegionAndBounds(dpy: *mut Display, region: XserverRegion, nrectangles: *mut c_int, bounds: *mut XRectangle) -> *mut XRectangle,
36 pub fn XFixesSetGCClipRegion(dpy: *mut Display, gc: GC, clip_x_origin: c_int, clip_y_origin: c_int, region: XserverRegion) -> (),
37 pub fn XFixesSetWindowShapeRegion(dpy: *mut Display, win: Window, shape_kind: c_int, x_off: c_int, y_off: c_int, region: XserverRegion) -> (),
38 pub fn XFixesSetPictureClipRegion(dpy: *mut Display, picture: XID, clip_x_origin: c_int, clip_y_origin: c_int, region: XserverRegion) -> (),
39 pub fn XFixesSetCursorName(dpy: *mut Display, cursor: Cursor, name: *const c_char) -> (),
40 pub fn XFixesGetCursorName(dpy: *mut Display, cursor: Cursor, atom: *mut Atom) -> *const c_char,
41 pub fn XFixesChangeCursor(dpy: *mut Display, source: Cursor, destination: Cursor) -> (),
42 pub fn XFixesChangeCursorByName(dpy: *mut Display, source: Cursor, name: *const c_char) -> (),
43 pub fn XFixesExpandRegion(dpy: *mut Display, dst: XserverRegion, src: XserverRegion, left: c_uint, right: c_uint, top: c_uint, bottom: c_uint) -> (),
44 pub fn XFixesHideCursor(dpy: *mut Display, win: Window) -> (),
45 pub fn XFixesShowCursor(dpy: *mut Display, win: Window) -> (),
46 pub fn XFixesCreatePointerBarrier(dpy: *mut Display, w: Window, x1: c_int, y1: c_int, x2: c_int, y2: c_int, directions: c_int, num_devices: c_int, devices: *mut c_int) -> PointerBarrier,
47 pub fn XFixesDestroyPointerBarrier(dpy: *mut Display, b: PointerBarrier) -> (),
48variadic:
49globals:
50}
51
52//
53// types
54//
55
56pub type PointerBarrier = XID;
57pub type XserverRegion = XID;
58
59//
60// structs
61//
62
63#[derive(Debug, Clone, Copy, PartialEq)]
64#[repr(C)]
65pub struct XFixesSelectionNotifyEvent {
66 pub _type: c_int,
67 pub serial: c_ulong,
68 pub send_event: Bool,
69 pub display: *mut Display,
70 pub window: Window,
71 pub subtype: c_int,
72 pub owner: Window,
73 pub selection: Atom,
74 pub timestamp: Time,
75 pub selection_timestamp: Time,
76}
77
78#[derive(Debug, Clone, Copy, PartialEq)]
79#[repr(C)]
80pub struct XFixesCursorNotifyEvent {
81 pub _type: c_int,
82 pub serial: c_ulong,
83 pub send_event: Bool,
84 pub display: *mut Display,
85 pub window: Window,
86 pub subtype: c_int,
87 pub cursor_serial: c_ulong,
88 pub timestamp: Time,
89 pub cursor_name: Atom,
90}
91
92#[derive(Debug, Clone, Copy, PartialEq)]
93#[repr(C)]
94pub struct XFixesCursorImage {
95 pub x: c_short,
96 pub y: c_short,
97 pub width: c_ushort,
98 pub height: c_ushort,
99 pub xhot: c_ushort,
100 pub yhot: c_ushort,
101 pub cursor_serial: c_ulong,
102 pub pixels: *mut c_ulong,
103 pub atom: Atom,
104 pub name: *const c_char,
105}
106