summaryrefslogtreecommitdiff
path: root/resize2/resize2.h
diff options
context:
space:
mode:
Diffstat (limited to 'resize2/resize2.h')
-rw-r--r--resize2/resize2.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/resize2/resize2.h b/resize2/resize2.h
new file mode 100644
index 0000000..f20c7ea
--- /dev/null
+++ b/resize2/resize2.h
@@ -0,0 +1,68 @@
+static int displayPrivateIndex = 0;
+
+typedef struct _ResizeDisplay ResizeDisplay;
+typedef struct _ResizeScreen ResizeScreen;
+typedef struct _ResizePointer ResizePointer;
+typedef struct _ResizeCorner ResizeCorner;
+typedef struct _ResizeWindow ResizeWindow;
+
+struct _ResizeDisplay
+{
+ ResizePointer *pointerHead;
+ int type_pressed, type_release, type_motion, type_enter, type_leave;
+
+ int screenPrivateIndex;
+ HandleEventProc handleEvent;
+};
+
+struct _ResizeScreen
+{
+ int windowPrivateIndex;
+};
+
+struct _ResizePointer
+{
+ XDevice *device;
+ XID deviceid;
+ CompWindow *w; /* this is a pointer to the window that it is currently resizing, NULL if none */
+
+ ResizePointer *next;
+
+ int x, y;
+};
+
+struct _ResizeCorner
+{
+ ResizePointer **device;
+ int nDevices;
+};
+
+struct _ResizeWindow
+{
+ Bool resizing;
+ ResizeCorner corner[9]; //Maybe should be 8 - depends if we are going to do moving as well
+ int x1, y1, x2, y2;
+};
+
+#define GET_RESIZE_DISPLAY(d) \
+ ((ResizeDisplay *) (d)->base.privates[displayPrivateIndex].ptr)
+
+#define RESIZE_DISPLAY(d) \
+ ResizeDisplay *rd = GET_RESIZE_DISPLAY (d)
+
+#define GET_RESIZE_SCREEN(s, ad) \
+ ((ResizeScreen *) (s)->base.privates[(ad)->screenPrivateIndex].ptr)
+
+#define RESIZE_SCREEN(s) \
+ ResizeScreen *rs = GET_RESIZE_SCREEN (s, GET_RESIZE_DISPLAY (s->display))
+
+#define GET_RESIZE_WINDOW(w, as) \
+ ((ResizeWindow *) (w)->base.privates[(as)->windowPrivateIndex].ptr)
+
+#define RESIZE_WINDOW(w) \
+ ResizeWindow *rw = GET_RESIZE_WINDOW (w, \
+ GET_RESIZE_SCREEN (w->screen, \
+ GET_RESIZE_DISPLAY (w->screen->display)))
+
+
+