summaryrefslogtreecommitdiffstats
path: root/region.h
diff options
context:
space:
mode:
authordscho <dscho>2001-09-25 10:52:57 +0000
committerdscho <dscho>2001-09-25 10:52:57 +0000
commit94f04a8631dfcb3688e58dc579265981c107e005 (patch)
tree8a5f6bdfcf9c30cbd891c58223ad40908faf89d1 /region.h
parentcb3b9c77001189d2d0d72153f1c0667fd3f289f2 (diff)
downloadlibtdevnc-94f04a8631dfcb3688e58dc579265981c107e005.tar.gz
libtdevnc-94f04a8631dfcb3688e58dc579265981c107e005.zip
fix cursor bug; missing keysym; fix align problem on SGI; clean up cursor.c
clean up rfb.h a bit; endian issues
Diffstat (limited to 'region.h')
-rw-r--r--region.h71
1 files changed, 32 insertions, 39 deletions
diff --git a/region.h b/region.h
index 3de2403..f4863db 100644
--- a/region.h
+++ b/region.h
@@ -1,43 +1,14 @@
-/*#define KeySym ___KeySym
-#define Bool ___Bool
-#define _Box ___Box
-#define BoxRec ___BoxRec
-#define _RegData ___RegData
-#define RegDataRec ___RegDataRec
-#define RegDataPtr ___RegDataPtr
-#define _Region ___Region
-#define RegionRec ___RegionRec
-#define RegionPtr ___RegionPtr
-#define CARD8 ___CARD8
-#define CARD16 ___CARD16
-#define CARD32 ___CARD32
-#include "X11/Xalloca.h"
-#include "Xserver/regionstr.h"
-#undef KeySym
-#undef Bool
-#undef _Box
-#undef BoxRec
-#undef _RegData
-#undef RegDataRec
-#undef RegDataPtr
-#undef _Region
-#undef RegionRec
-#undef RegionPtr
-#undef CARD8
-#undef CARD16
-#undef CARD32
+#ifndef REGION_H
+#define REGION_H
-#undef REGION_INTERSECT
-#undef REGION_UNION
-#undef REGION_SUBTRACT
-#undef REGION_TRANSLATE
-#undef REGION_INIT
-#undef REGION_UNINIT
-#undef REGION_EMPTY
-#undef REGION_NOTEMPTY
-#undef FALSE
-#undef TRUE
-*/
+#define NullRegion ((RegionPtr)0)
+#define NullBox ((BoxPtr)0)
+
+typedef struct RegDataRec {
+ long size;
+ long numRects;
+/* BoxRec rects[size]; in memory but not explicitly declared */
+} RegDataRec;
extern void miRegionInit(RegionPtr,BoxPtr,int);
extern void miRegionUninit(RegionPtr);
@@ -47,3 +18,25 @@ extern Bool miIntersect(RegionPtr,RegionPtr,RegionPtr);
extern Bool miSubtract(RegionPtr,RegionPtr,RegionPtr);
extern Bool miUnion(RegionPtr,RegionPtr,RegionPtr);
extern void miTranslateRegion(RegionPtr,int,int);
+
+#define REGION_NIL(reg) ((reg)->data && !(reg)->data->numRects)
+#define REGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1)
+#define REGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0)
+#define REGION_RECTS(reg) ((reg)->data ? (BoxPtr)((reg)->data + 1) \
+ : &(reg)->extents)
+#define REGION_BOXPTR(reg) ((BoxPtr)((reg)->data + 1))
+#define REGION_BOX(reg,i) (&REGION_BOXPTR(reg)[i])
+#define REGION_TOP(reg) REGION_BOX(reg, (reg)->data->numRects)
+#define REGION_END(reg) REGION_BOX(reg, (reg)->data->numRects - 1)
+#define REGION_SZOF(n) (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)))
+
+#define REGION_INIT(s,pReg,rect,size) miRegionInit(pReg,rect,size)
+#define REGION_EMPTY(s,pReg) miRegionEmpty(pReg)
+#define REGION_UNINIT(s,pReg) miRegionUninit(pReg)
+#define REGION_NOTEMPTY(s,pReg) miRegionNotEmpty(pReg)
+#define REGION_INTERSECT(s,newReg,reg1,reg2) miIntersect(newReg,reg1,reg2)
+#define REGION_SUBTRACT(s,newReg,reg1,reg2) miSubtract(newReg,reg1,reg2)
+#define REGION_UNION(s,newReg,reg1,reg2) miUnion(newReg,reg1,reg2)
+#define REGION_TRANSLATE(s,pReg,x,y) miTranslateRegion(pReg,x,y)
+
+#endif