shape.pp 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. (************************************************************
  2. Copyright 1989, 1998 The Open Group
  3. Permission to use, copy, modify, distribute, and sell this software and its
  4. documentation for any purpose is hereby granted without fee, provided that
  5. the above copyright notice appear in all copies and that both that
  6. copyright notice and this permission notice appear in supporting
  7. documentation.
  8. The above copyright notice and this permission notice shall be included in
  9. all copies or substantial portions of the Software.
  10. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  14. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  15. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  16. Except as contained in this notice, the name of The Open Group shall not be
  17. used in advertising or otherwise to promote the sale, use or other dealings
  18. in this Software without prior written authorization from The Open Group.
  19. ********************************************************)
  20. {$IFNDEF FPC_DOTTEDUNITS}
  21. unit shape;
  22. {$ENDIF FPC_DOTTEDUNITS}
  23. {$PACKRECORDS C}
  24. interface
  25. {$IFDEF FPC_DOTTEDUNITS}
  26. uses
  27. System.CTypes, Api.X11.X, Api.X11.Xlib, Api.X11.Xutil;
  28. {$ELSE FPC_DOTTEDUNITS}
  29. uses
  30. ctypes, x, xlib, xutil;
  31. {$ENDIF FPC_DOTTEDUNITS}
  32. const
  33. libXext = 'Xext';
  34. {$I shapeconst.inc}
  35. //#include <X11/Xutil.h>
  36. type
  37. PXShapeEvent = ^TXShapeEvent;
  38. TXShapeEvent = record
  39. _type: cint; { of event }
  40. serial: culong; { # of last request processed by server }
  41. send_event: TBool; { true if this came frome a SendEvent request }
  42. display: PDisplay; { Display the event was read from }
  43. window: TWindow; { window of event }
  44. kind: cint; { ShapeBounding or ShapeClip }
  45. x, y: cint; { extents of new region }
  46. width, height: cunsigned;
  47. time: TTime; { server timestamp when region changed }
  48. shaped: TBool; { true if the region exists }
  49. end;
  50. function XShapeQueryExtension(
  51. display: PDisplay;
  52. event_base,
  53. error_base: Pcint
  54. ): TBoolResult; cdecl; external libXext;
  55. function XShapeQueryVersion(
  56. display: PDisplay;
  57. major_version,
  58. minor_version: Pcint
  59. ): TStatus; cdecl; external libXext;
  60. procedure XShapeCombineRegion(
  61. display: PDisplay;
  62. dest: TWindow;
  63. dest_kind: cint;
  64. x_off,
  65. y_off: cint;
  66. region: TRegion;
  67. op: cint
  68. ); cdecl; external libXext;
  69. procedure XShapeCombineRectangles(
  70. display: PDisplay;
  71. dest: TWindow;
  72. dest_kind: cint;
  73. x_off,
  74. y_off: cint;
  75. rectangles: PXRectangle;
  76. n_rects: cint;
  77. op: cint;
  78. ordering: cint
  79. ); cdecl; external libXext;
  80. procedure XShapeCombineMask(
  81. display: PDisplay;
  82. dest: TWindow;
  83. dest_kind: cint;
  84. x_off,
  85. y_off: cint;
  86. src: TPixmap;
  87. op: cint
  88. ); cdecl; external libXext;
  89. procedure XShapeCombineShape(
  90. display: PDisplay;
  91. dest: TWindow;
  92. dest_kind: cint;
  93. x_off,
  94. y_off: cint;
  95. src: TWindow;
  96. src_kind: cint;
  97. op: cint
  98. ); cdecl; external libXext;
  99. procedure XShapeOffsetShape(
  100. display: PDisplay;
  101. dest: TWindow;
  102. dest_kind: cint;
  103. x_off,
  104. y_off: cint
  105. ); cdecl; external libXext;
  106. function XShapeQueryExtents(
  107. display: PDisplay;
  108. window: TWindow;
  109. bounding_shaped: PBool;
  110. x_bounding,
  111. y_bounding: Pcint;
  112. w_bounding,
  113. h_bounding: Pcuint;
  114. clip_shaped: PBool;
  115. x_clip,
  116. y_clip: Pcint;
  117. w_clip,
  118. h_clip: Pcuint
  119. ): TStatus; cdecl; external libXext;
  120. procedure XShapeSelectInput(
  121. display: PDisplay;
  122. window: TWindow;
  123. mask: culong
  124. ); cdecl; external libXext;
  125. function XShapeInputSelected(
  126. display: PDisplay;
  127. window: TWindow
  128. ): culong; cdecl; external libXext;
  129. function XShapeGetRectangles(
  130. display: PDisplay;
  131. window: TWindow;
  132. kind: cint;
  133. count,
  134. ordering: Pcint
  135. ): PXRectangle; cdecl; external libXext;
  136. implementation
  137. end.