xrender.nim 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. import
  2. x, xlib
  3. when defined(use_pkg_config) or defined(use_pkg_config_static):
  4. {.pragma: libxrender, cdecl, importc.}
  5. when defined(use_pkg_config):
  6. {.passl: gorge("pkg-config xrender --libs").}
  7. else:
  8. {.passl: gorge("pkg-config xrender --static --libs").}
  9. else:
  10. when defined(macosx):
  11. const
  12. libXrender* = "libXrender.dylib"
  13. else:
  14. const
  15. libXrender* = "libXrender.so"
  16. {.pragma: libxrender, dynlib: libXrender, cdecl, importc.}
  17. #const
  18. # libXrender* = "libXrender.so"
  19. #
  20. # Automatically converted by H2Pas 0.99.15 from xrender.h
  21. # The following command line parameters were used:
  22. # -p
  23. # -T
  24. # -S
  25. # -d
  26. # -c
  27. # xrender.h
  28. #
  29. type
  30. PGlyph* = ptr TGlyph
  31. TGlyph* = int32
  32. PGlyphSet* = ptr TGlyphSet
  33. TGlyphSet* = int32
  34. PPicture* = ptr TPicture
  35. TPicture* = int32
  36. PPictFormat* = ptr TPictFormat
  37. TPictFormat* = int32
  38. const
  39. RENDER_NAME* = "RENDER"
  40. RENDER_MAJOR* = 0
  41. RENDER_MINOR* = 0
  42. constX_RenderQueryVersion* = 0
  43. X_RenderQueryPictFormats* = 1
  44. X_RenderQueryPictIndexValues* = 2
  45. X_RenderQueryDithers* = 3
  46. constX_RenderCreatePicture* = 4
  47. constX_RenderChangePicture* = 5
  48. X_RenderSetPictureClipRectangles* = 6
  49. constX_RenderFreePicture* = 7
  50. constX_RenderComposite* = 8
  51. X_RenderScale* = 9
  52. X_RenderTrapezoids* = 10
  53. X_RenderTriangles* = 11
  54. X_RenderTriStrip* = 12
  55. X_RenderTriFan* = 13
  56. X_RenderColorTrapezoids* = 14
  57. X_RenderColorTriangles* = 15
  58. X_RenderTransform* = 16
  59. constX_RenderCreateGlyphSet* = 17
  60. constX_RenderReferenceGlyphSet* = 18
  61. constX_RenderFreeGlyphSet* = 19
  62. constX_RenderAddGlyphs* = 20
  63. constX_RenderAddGlyphsFromPicture* = 21
  64. constX_RenderFreeGlyphs* = 22
  65. constX_RenderCompositeGlyphs8* = 23
  66. constX_RenderCompositeGlyphs16* = 24
  67. constX_RenderCompositeGlyphs32* = 25
  68. BadPictFormat* = 0
  69. BadPicture* = 1
  70. BadPictOp* = 2
  71. BadGlyphSet* = 3
  72. BadGlyph* = 4
  73. RenderNumberErrors* = BadGlyph + 1
  74. PictTypeIndexed* = 0
  75. PictTypeDirect* = 1
  76. PictOpClear* = 0
  77. PictOpSrc* = 1
  78. PictOpDst* = 2
  79. PictOpOver* = 3
  80. PictOpOverReverse* = 4
  81. PictOpIn* = 5
  82. PictOpInReverse* = 6
  83. PictOpOut* = 7
  84. PictOpOutReverse* = 8
  85. PictOpAtop* = 9
  86. PictOpAtopReverse* = 10
  87. PictOpXor* = 11
  88. PictOpAdd* = 12
  89. PictOpSaturate* = 13
  90. PictOpMaximum* = 13
  91. PolyEdgeSharp* = 0
  92. PolyEdgeSmooth* = 1
  93. PolyModePrecise* = 0
  94. PolyModeImprecise* = 1
  95. CPRepeat* = 1 shl 0
  96. CPAlphaMap* = 1 shl 1
  97. CPAlphaXOrigin* = 1 shl 2
  98. CPAlphaYOrigin* = 1 shl 3
  99. CPClipXOrigin* = 1 shl 4
  100. CPClipYOrigin* = 1 shl 5
  101. CPClipMask* = 1 shl 6
  102. CPGraphicsExposure* = 1 shl 7
  103. CPSubwindowMode* = 1 shl 8
  104. CPPolyEdge* = 1 shl 9
  105. CPPolyMode* = 1 shl 10
  106. CPDither* = 1 shl 11
  107. CPLastBit* = 11
  108. type
  109. PXRenderDirectFormat* = ptr TXRenderDirectFormat
  110. TXRenderDirectFormat*{.final.} = object
  111. red*: int16
  112. redMask*: int16
  113. green*: int16
  114. greenMask*: int16
  115. blue*: int16
  116. blueMask*: int16
  117. alpha*: int16
  118. alphaMask*: int16
  119. PXRenderPictFormat* = ptr TXRenderPictFormat
  120. TXRenderPictFormat*{.final.} = object
  121. id*: TPictFormat
  122. thetype*: int32
  123. depth*: int32
  124. direct*: TXRenderDirectFormat
  125. colormap*: TColormap
  126. const
  127. PictFormatID* = 1 shl 0
  128. PictFormatType* = 1 shl 1
  129. PictFormatDepth* = 1 shl 2
  130. PictFormatRed* = 1 shl 3
  131. PictFormatRedMask* = 1 shl 4
  132. PictFormatGreen* = 1 shl 5
  133. PictFormatGreenMask* = 1 shl 6
  134. PictFormatBlue* = 1 shl 7
  135. PictFormatBlueMask* = 1 shl 8
  136. PictFormatAlpha* = 1 shl 9
  137. PictFormatAlphaMask* = 1 shl 10
  138. PictFormatColormap* = 1 shl 11
  139. type
  140. PXRenderVisual* = ptr TXRenderVisual
  141. TXRenderVisual*{.final.} = object
  142. visual*: PVisual
  143. format*: PXRenderPictFormat
  144. PXRenderDepth* = ptr TXRenderDepth
  145. TXRenderDepth*{.final.} = object
  146. depth*: int32
  147. nvisuals*: int32
  148. visuals*: PXRenderVisual
  149. PXRenderScreen* = ptr TXRenderScreen
  150. TXRenderScreen*{.final.} = object
  151. depths*: PXRenderDepth
  152. ndepths*: int32
  153. fallback*: PXRenderPictFormat
  154. PXRenderInfo* = ptr TXRenderInfo
  155. TXRenderInfo*{.final.} = object
  156. format*: PXRenderPictFormat
  157. nformat*: int32
  158. screen*: PXRenderScreen
  159. nscreen*: int32
  160. depth*: PXRenderDepth
  161. ndepth*: int32
  162. visual*: PXRenderVisual
  163. nvisual*: int32
  164. PXRenderPictureAttributes* = ptr TXRenderPictureAttributes
  165. TXRenderPictureAttributes*{.final.} = object
  166. repeat*: TBool
  167. alpha_map*: TPicture
  168. alpha_x_origin*: int32
  169. alpha_y_origin*: int32
  170. clip_x_origin*: int32
  171. clip_y_origin*: int32
  172. clip_mask*: TPixmap
  173. graphics_exposures*: TBool
  174. subwindow_mode*: int32
  175. poly_edge*: int32
  176. poly_mode*: int32
  177. dither*: TAtom
  178. PXGlyphInfo* = ptr TXGlyphInfo
  179. TXGlyphInfo*{.final.} = object
  180. width*: int16
  181. height*: int16
  182. x*: int16
  183. y*: int16
  184. xOff*: int16
  185. yOff*: int16
  186. proc XRenderQueryExtension*(dpy: PDisplay, event_basep: ptr int32,
  187. error_basep: ptr int32): TBool{.libxrender.}
  188. proc XRenderQueryVersion*(dpy: PDisplay, major_versionp: ptr int32,
  189. minor_versionp: ptr int32): TStatus{.libxrender.}
  190. proc XRenderQueryFormats*(dpy: PDisplay): TStatus{.libxrender.}
  191. proc XRenderFindVisualFormat*(dpy: PDisplay, visual: PVisual): PXRenderPictFormat{.
  192. libxrender.}
  193. proc XRenderFindFormat*(dpy: PDisplay, mask: int32,
  194. `template`: PXRenderPictFormat, count: int32): PXRenderPictFormat{.
  195. libxrender.}
  196. proc XRenderCreatePicture*(dpy: PDisplay, drawable: TDrawable,
  197. format: PXRenderPictFormat, valuemask: int32,
  198. attributes: PXRenderPictureAttributes): TPicture{.
  199. libxrender.}
  200. proc XRenderChangePicture*(dpy: PDisplay, picture: TPicture, valuemask: int32,
  201. attributes: PXRenderPictureAttributes){.libxrender.}
  202. proc XRenderFreePicture*(dpy: PDisplay, picture: TPicture){.libxrender.}
  203. proc XRenderComposite*(dpy: PDisplay, op: int32, src: TPicture, mask: TPicture,
  204. dst: TPicture, src_x: int32, src_y: int32, mask_x: int32,
  205. mask_y: int32, dst_x: int32, dst_y: int32, width: int32,
  206. height: int32){.libxrender.}
  207. proc XRenderCreateGlyphSet*(dpy: PDisplay, format: PXRenderPictFormat): TGlyphSet{.
  208. libxrender.}
  209. proc XRenderReferenceGlyphSet*(dpy: PDisplay, existing: TGlyphSet): TGlyphSet{.
  210. libxrender.}
  211. proc XRenderFreeGlyphSet*(dpy: PDisplay, glyphset: TGlyphSet){.libxrender.}
  212. proc XRenderAddGlyphs*(dpy: PDisplay, glyphset: TGlyphSet, gids: PGlyph,
  213. glyphs: PXGlyphInfo, nglyphs: int32, images: cstring,
  214. nbyte_images: int32){.libxrender.}
  215. proc XRenderFreeGlyphs*(dpy: PDisplay, glyphset: TGlyphSet, gids: PGlyph,
  216. nglyphs: int32){.libxrender.}
  217. proc XRenderCompositeString8*(dpy: PDisplay, op: int32, src: TPicture,
  218. dst: TPicture, maskFormat: PXRenderPictFormat,
  219. glyphset: TGlyphSet, xSrc: int32, ySrc: int32,
  220. xDst: int32, yDst: int32, str: cstring,
  221. nchar: int32){.libxrender.}
  222. # implementation