You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Xregion.h 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. /* $Xorg: Xutil.h,v 1.8 2001/02/09 02:03:39 xorgcvs Exp $ */
  2. /***********************************************************
  3. Copyright 1987, 1998 The Open Group
  4. Permission to use, copy, modify, distribute, and sell this software and its
  5. documentation for any purpose is hereby granted without fee, provided that
  6. the above copyright notice appear in all copies and that both that
  7. copyright notice and this permission notice appear in supporting
  8. documentation.
  9. The above copyright notice and this permission notice shall be included in
  10. all copies or substantial portions of the Software.
  11. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  15. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  16. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  17. Except as contained in this notice, the name of The Open Group shall not be
  18. used in advertising or otherwise to promote the sale, use or other dealings
  19. in this Software without prior written authorization from The Open Group.
  20. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  21. All Rights Reserved
  22. Permission to use, copy, modify, and distribute this software and its
  23. documentation for any purpose and without fee is hereby granted,
  24. provided that the above copyright notice appear in all copies and that
  25. both that copyright notice and this permission notice appear in
  26. supporting documentation, and that the name of Digital not be
  27. used in advertising or publicity pertaining to distribution of the
  28. software without specific, written prior permission.
  29. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  30. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  31. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  32. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  33. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  34. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  35. SOFTWARE.
  36. ******************************************************************/
  37. /* $XFree86: xc/lib/X11/Xutil.h,v 3.4 2001/12/14 19:54:10 dawes Exp $ */
  38. #ifndef _XREGION_H_
  39. #define _XREGION_H_
  40. // - Faked defines to fool the X11 region code
  41. #include <stdlib.h>
  42. #include <string.h>
  43. #define Bool int
  44. #define Xmalloc malloc
  45. #define Xfree free
  46. #define Xrealloc realloc
  47. #ifndef max
  48. #define max(a,b) (((a) > (b)) ? (a) : (b))
  49. #endif
  50. #ifndef min
  51. #define min(a,b) (((a) < (b)) ? (a) : (b))
  52. #endif
  53. #define NeedFunctionPrototypes 1
  54. // - Cribbed from Xlib.h
  55. typedef struct {
  56. short x, y;
  57. } XPoint;
  58. typedef struct {
  59. short x, y;
  60. unsigned short width, height;
  61. } XRectangle;
  62. /*
  63. * opaque reference to Region data type
  64. */
  65. typedef struct _XRegion *Region;
  66. /* Return values from XRectInRegion() */
  67. #define RectangleOut 0
  68. #define RectangleIn 1
  69. #define RectanglePart 2
  70. #ifdef __cplusplus
  71. extern "C" {
  72. #endif
  73. extern int XClipBox(
  74. #if NeedFunctionPrototypes
  75. Region /* r */,
  76. XRectangle* /* rect_return */
  77. #endif
  78. );
  79. extern Region XCreateRegion(
  80. #if NeedFunctionPrototypes
  81. void
  82. #endif
  83. );
  84. extern const char *XDefaultString (void);
  85. extern int XDestroyRegion(
  86. #if NeedFunctionPrototypes
  87. Region /* r */
  88. #endif
  89. );
  90. extern int XEmptyRegion(
  91. #if NeedFunctionPrototypes
  92. Region /* r */
  93. #endif
  94. );
  95. extern int XEqualRegion(
  96. #if NeedFunctionPrototypes
  97. Region /* r1 */,
  98. Region /* r2 */
  99. #endif
  100. );
  101. extern int XIntersectRegion(
  102. #if NeedFunctionPrototypes
  103. Region /* sra */,
  104. Region /* srb */,
  105. Region /* dr_return */
  106. #endif
  107. );
  108. extern int XOffsetRegion(
  109. #if NeedFunctionPrototypes
  110. Region /* r */,
  111. int /* dx */,
  112. int /* dy */
  113. #endif
  114. );
  115. extern Bool XPointInRegion(
  116. #if NeedFunctionPrototypes
  117. Region /* r */,
  118. int /* x */,
  119. int /* y */
  120. #endif
  121. );
  122. extern Region XPolygonRegion(
  123. #if NeedFunctionPrototypes
  124. XPoint* /* points */,
  125. int /* n */,
  126. int /* fill_rule */
  127. #endif
  128. );
  129. extern int XRectInRegion(
  130. #if NeedFunctionPrototypes
  131. Region /* r */,
  132. int /* x */,
  133. int /* y */,
  134. unsigned int /* width */,
  135. unsigned int /* height */
  136. #endif
  137. );
  138. extern int XShrinkRegion(
  139. #if NeedFunctionPrototypes
  140. Region /* r */,
  141. int /* dx */,
  142. int /* dy */
  143. #endif
  144. );
  145. extern int XSubtractRegion(
  146. #if NeedFunctionPrototypes
  147. Region /* sra */,
  148. Region /* srb */,
  149. Region /* dr_return */
  150. #endif
  151. );
  152. extern int XUnionRectWithRegion(
  153. #if NeedFunctionPrototypes
  154. XRectangle* /* rectangle */,
  155. Region /* src_region */,
  156. Region /* dest_region_return */
  157. #endif
  158. );
  159. extern int XUnionRegion(
  160. #if NeedFunctionPrototypes
  161. Region /* sra */,
  162. Region /* srb */,
  163. Region /* dr_return */
  164. #endif
  165. );
  166. extern int XXorRegion(
  167. #if NeedFunctionPrototypes
  168. Region /* sra */,
  169. Region /* srb */,
  170. Region /* dr_return */
  171. #endif
  172. );
  173. #ifdef __cplusplus
  174. };
  175. #endif
  176. #endif /* _XUTIL_H_ */