3 import arsd
.simpledisplay
;
6 // ////////////////////////////////////////////////////////////////////////// //
7 public extern(C
) nothrow @nogc {
9 import core
.stdc
.config
: c_long
, c_ulong
;
14 alias XBox
= XBoxRec
*;
24 alias XRegion
= XRegionRec
*;
29 enum ShapeIntersect
= 2;
30 enum ShapeSubtract
= 3;
33 enum ShapeBounding
= 0;
37 enum ShapeNotifyMask
= 1U<<0;
40 enum ShapeNumberEvents
= ShapeNotify
+1;
43 int type
; /* of event */
44 c_ulong serial
; /* # of last request processed by server */
45 Bool send_event
; /* true if this came frome a SendEvent request */
46 Display
* display
; /* Display the event was read from */
47 Window window
; /* window of event */
48 int kind
; /* ShapeBounding or ShapeClip */
49 int x
, y
; /* extents of new region */
51 Time time
; /* server timestamp when region changed */
52 Bool shaped
; /* true if the region exists */
56 Bool
XShapeQueryExtension (
62 Status
XShapeQueryVersion (
68 void XShapeCombineRegion (
78 void XShapeCombineRectangles (
84 XRectangle
* rectangles
,
90 void XShapeCombineMask (
100 void XShapeCombineShape (
111 void XShapeOffsetShape (
119 Status
XShapeQueryExtents (
122 Bool
* bounding_shaped
,
134 void XShapeSelectInput (
140 c_ulong
XShapeInputSelected (
145 XRectangle
*XShapeGetRectangles (
153 // ////////////////////////////////////////////////////////////////////////// //
154 //struct XRegionRec {}
155 //alias XRegion = XRegionRec*;
163 XRegion
XCreateRegion ();
164 int XDestroyRegion (XRegion r
);
165 XRegion
XPolygonRegion (XPoint
* points
, int n
, int fill_rule
);
166 int XUnionRegion (XRegion sra
, XRegion srb
, XRegion dr_return
);
171 // ////////////////////////////////////////////////////////////////////////// //
173 public int shapeEvent () {
174 __gshared
static int event
= -666;
177 if (!XShapeQueryExtension(XDisplayConnection
.get(), &event
, &dummy
)) event
= -1;
186 rects[0] = XRectangle(0, 0, 60, 20);
187 rects[1] = XRectangle(100, 100, 60, 20);
188 XShapeCombineRectangles(win.impl.display, win.impl.window, ShapeBounding, 0, 0, rects.ptr, rects.length, ShapeIntersect, 0);
189 //XShapeCombineRectangles(win.impl.display, win.impl.window, ShapeClip, 0, 0, rects.ptr, rects.length, ShapeIntersect, 0);