cairo.pp 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  1. (* cairo - a vector graphics library with display and print output
  2. *
  3. * Copyright © 2002 University of Southern California
  4. * Copyright © 2005 Red Hat, Inc.
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it either under the terms of the GNU Lesser General Public
  8. * License version 2.1 as published by the Free Software Foundation
  9. * (the "LGPL") or, at your option, under the terms of the Mozilla
  10. * Public License Version 1.1 (the "MPL"). If you do not alter this
  11. * notice, a recipient may use your version of this file under either
  12. * the MPL or the LGPL.
  13. *
  14. * You should have received a copy of the LGPL along with this library
  15. * in the file COPYING-LGPL-2.1; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. * You should have received a copy of the MPL along with this library
  18. * in the file COPYING-MPL-1.1
  19. *
  20. * The contents of this file are subject to the Mozilla Public License
  21. * Version 1.1 (the "License"); you may not use this file except in
  22. * compliance with the License. You may obtain a copy of the License at
  23. * http://www.mozilla.org/MPL/
  24. *
  25. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
  26. * OF ANY KIND, either express or implied. See the LGPL or the MPL for
  27. * the specific language governing rights and limitations.
  28. *
  29. * The Original Code is the cairo graphics library.
  30. *
  31. * The Initial Developer of the Original Code is University of Southern
  32. * California.
  33. *
  34. * Contributor(s):
  35. * Carl D. Worth <[email protected]>
  36. *)
  37. (*
  38. * This FreePascal binding generated August 26, 2005
  39. * by Jeffrey Pohlmeyer <[email protected]>
  40. *)
  41. unit cairo;
  42. interface
  43. uses x, xlib, xrender, freetypeh;
  44. const
  45. LIB_CAIRO='cairo';
  46. CAIRO_HAS_FT_FONT = 1;
  47. CAIRO_HAS_PNG_FUNCTIONS = 1;
  48. CAIRO_HAS_XLIB_SURFACE = 1;
  49. CAIRO_VERSION_MAJOR = 1;
  50. CAIRO_VERSION_MICRO = 0;
  51. CAIRO_VERSION_MINOR = 0;
  52. CAIRO_VERSION_STRING = '1.0.0';
  53. {$IFDEF FPC}
  54. {$PACKRECORDS C}
  55. {$ENDIF}
  56. type
  57. cairo_status_t = (
  58. CAIRO_STATUS_SUCCESS = 0,
  59. CAIRO_STATUS_NO_MEMORY,
  60. CAIRO_STATUS_INVALID_RESTORE,
  61. CAIRO_STATUS_INVALID_POP_GROUP,
  62. CAIRO_STATUS_NO_CURRENT_POINT,
  63. CAIRO_STATUS_INVALID_MATRIX,
  64. CAIRO_STATUS_INVALID_STATUS,
  65. CAIRO_STATUS_NULL_POINTER,
  66. CAIRO_STATUS_INVALID_STRING,
  67. CAIRO_STATUS_INVALID_PATH_DATA,
  68. CAIRO_STATUS_READ_ERROR,
  69. CAIRO_STATUS_WRITE_ERROR,
  70. CAIRO_STATUS_SURFACE_FINISHED,
  71. CAIRO_STATUS_SURFACE_TYPE_MISMATCH,
  72. CAIRO_STATUS_PATTERN_TYPE_MISMATCH,
  73. CAIRO_STATUS_INVALID_CONTENT,
  74. CAIRO_STATUS_INVALID_FORMAT,
  75. CAIRO_STATUS_INVALID_VISUAL,
  76. CAIRO_STATUS_FILE_NOT_FOUND,
  77. CAIRO_STATUS_INVALID_DASH
  78. );
  79. cairo_operator_t = (
  80. CAIRO_OPERATOR_CLEAR,
  81. CAIRO_OPERATOR_SOURCE,
  82. CAIRO_OPERATOR_OVER,
  83. CAIRO_OPERATOR_IN,
  84. CAIRO_OPERATOR_OUT,
  85. CAIRO_OPERATOR_ATOP,
  86. CAIRO_OPERATOR_DEST,
  87. CAIRO_OPERATOR_DEST_OVER,
  88. CAIRO_OPERATOR_DEST_IN,
  89. CAIRO_OPERATOR_DEST_OUT,
  90. CAIRO_OPERATOR_DEST_ATOP,
  91. CAIRO_OPERATOR_XOR,
  92. CAIRO_OPERATOR_ADD,
  93. CAIRO_OPERATOR_SATURATE
  94. );
  95. cairo_antialias_t = (
  96. CAIRO_ANTIALIAS_DEFAULT,
  97. CAIRO_ANTIALIAS_NONE,
  98. CAIRO_ANTIALIAS_GRAY,
  99. CAIRO_ANTIALIAS_SUBPIXEL
  100. );
  101. cairo_fill_rule_t = (
  102. CAIRO_FILL_RULE_WINDING,
  103. CAIRO_FILL_RULE_EVEN_ODD
  104. );
  105. cairo_line_cap_t = (
  106. CAIRO_LINE_CAP_BUTT,
  107. CAIRO_LINE_CAP_ROUND,
  108. CAIRO_LINE_CAP_SQUARE
  109. );
  110. cairo_line_join_t = (
  111. CAIRO_LINE_JOIN_MITER,
  112. CAIRO_LINE_JOIN_ROUND,
  113. CAIRO_LINE_JOIN_BEVEL
  114. );
  115. cairo_font_slant_t = (
  116. CAIRO_FONT_SLANT_NORMAL,
  117. CAIRO_FONT_SLANT_ITALIC,
  118. CAIRO_FONT_SLANT_OBLIQUE
  119. );
  120. cairo_font_weight_t = (
  121. CAIRO_FONT_WEIGHT_NORMAL,
  122. CAIRO_FONT_WEIGHT_BOLD
  123. );
  124. cairo_subpixel_order_t = (
  125. CAIRO_SUBPIXEL_ORDER_DEFAULT,
  126. CAIRO_SUBPIXEL_ORDER_RGB,
  127. CAIRO_SUBPIXEL_ORDER_BGR,
  128. CAIRO_SUBPIXEL_ORDER_VRGB,
  129. CAIRO_SUBPIXEL_ORDER_VBGR
  130. );
  131. cairo_hint_style_t = (
  132. CAIRO_HINT_STYLE_DEFAULT,
  133. CAIRO_HINT_STYLE_NONE,
  134. CAIRO_HINT_STYLE_SLIGHT,
  135. CAIRO_HINT_STYLE_MEDIUM,
  136. CAIRO_HINT_STYLE_FULL
  137. );
  138. cairo_hint_metrics_t = (
  139. CAIRO_HINT_METRICS_DEFAULT,
  140. CAIRO_HINT_METRICS_OFF,
  141. CAIRO_HINT_METRICS_ON
  142. );
  143. cairo_path_data_type_t = (
  144. CAIRO_PATH_MOVE_TO,
  145. CAIRO_PATH_LINE_TO,
  146. CAIRO_PATH_CURVE_TO,
  147. CAIRO_PATH_CLOSE_PATH
  148. );
  149. cairo_content_t = (
  150. CAIRO_CONTENT_COLOR = $1000,
  151. CAIRO_CONTENT_ALPHA = $2000,
  152. CAIRO_CONTENT_COLOR_ALPHA = $3000
  153. );
  154. cairo_format_t = (
  155. CAIRO_FORMAT_ARGB32,
  156. CAIRO_FORMAT_RGB24,
  157. CAIRO_FORMAT_A8,
  158. CAIRO_FORMAT_A1
  159. );
  160. cairo_extend_t = (
  161. CAIRO_EXTEND_NONE,
  162. CAIRO_EXTEND_REPEAT,
  163. CAIRO_EXTEND_REFLECT
  164. );
  165. cairo_filter_t = (
  166. CAIRO_FILTER_FAST,
  167. CAIRO_FILTER_GOOD,
  168. CAIRO_FILTER_BEST,
  169. CAIRO_FILTER_NEAREST,
  170. CAIRO_FILTER_BILINEAR,
  171. CAIRO_FILTER_GAUSSIAN
  172. );
  173. FcPattern=pointer;
  174. PFcPattern = ^FcPattern;
  175. Pcairo_surface_t = ^cairo_surface_t;
  176. Pcairo_t = ^cairo_t;
  177. Pcairo_pattern_t = ^cairo_pattern_t;
  178. Pcairo_font_options_t = ^cairo_font_options_t;
  179. Pcairo_font_face_t = ^cairo_font_face_t;
  180. Pcairo_scaled_font_t = ^cairo_scaled_font_t;
  181. Pcairo_bool_t = ^cairo_bool_t;
  182. cairo_bool_t = longint;
  183. Pcairo_matrix_t = ^cairo_matrix_t;
  184. Pcairo_user_data_key_t = ^cairo_user_data_key_t;
  185. Pcairo_glyph_t = ^cairo_glyph_t;
  186. Pcairo_text_extents_t = ^cairo_text_extents_t;
  187. Pcairo_font_extents_t = ^cairo_font_extents_t;
  188. Pcairo_path_data_type_t = ^cairo_path_data_type_t;
  189. Pcairo_path_data_t = ^cairo_path_data_t;
  190. Pcairo_path_t = ^cairo_path_t;
  191. cairo_destroy_func_t = procedure (data:pointer); cdecl;
  192. cairo_write_func_t = function (closure:pointer; data:Pbyte; length:dword):cairo_status_t; cdecl;
  193. cairo_read_func_t = function (closure:pointer; data:Pbyte; length:dword):cairo_status_t; cdecl;
  194. cairo_t = record {OPAQUE} end;
  195. cairo_surface_t = record {OPAQUE} end;
  196. cairo_pattern_t = record {OPAQUE} end;
  197. cairo_scaled_font_t = record {OPAQUE} end;
  198. cairo_font_face_t = record {OPAQUE} end;
  199. cairo_font_options_t = record {OPAQUE} end;
  200. cairo_matrix_t = record
  201. xx : double;
  202. yx : double;
  203. xy : double;
  204. yy : double;
  205. x0 : double;
  206. y0 : double;
  207. end;
  208. cairo_user_data_key_t = record
  209. unused : longint;
  210. end;
  211. cairo_glyph_t = record
  212. index : dword;
  213. x : double;
  214. y : double;
  215. end;
  216. cairo_text_extents_t = record
  217. x_bearing : double;
  218. y_bearing : double;
  219. width : double;
  220. height : double;
  221. x_advance : double;
  222. y_advance : double;
  223. end;
  224. cairo_font_extents_t = record
  225. ascent : double;
  226. descent : double;
  227. height : double;
  228. max_x_advance : double;
  229. max_y_advance : double;
  230. end;
  231. cairo_path_data_t = record
  232. case longint of
  233. 0 : ( header : record
  234. _type : cairo_path_data_type_t;
  235. length : longint;
  236. end );
  237. 1 : ( point : record
  238. x : double;
  239. y : double;
  240. end );
  241. end;
  242. cairo_path_t = record
  243. status : cairo_status_t;
  244. data : Pcairo_path_data_t;
  245. num_data : longint;
  246. end;
  247. function cairo_create(target:Pcairo_surface_t):Pcairo_t; cdecl; external LIB_CAIRO;
  248. function cairo_reference(cr:Pcairo_t):Pcairo_t; cdecl; external LIB_CAIRO;
  249. procedure cairo_destroy(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  250. procedure cairo_save(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  251. procedure cairo_restore(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  252. procedure cairo_set_operator(cr:Pcairo_t; op:cairo_operator_t); cdecl; external LIB_CAIRO;
  253. procedure cairo_set_source(cr:Pcairo_t; source:Pcairo_pattern_t); cdecl; external LIB_CAIRO;
  254. procedure cairo_set_source_rgb(cr:Pcairo_t; red:double; green:double; blue:double); cdecl; external LIB_CAIRO;
  255. procedure cairo_set_source_rgba(cr:Pcairo_t; red:double; green:double; blue:double; alpha:double); cdecl; external LIB_CAIRO;
  256. procedure cairo_set_source_surface(cr:Pcairo_t; surface:Pcairo_surface_t; x:double; y:double); cdecl; external LIB_CAIRO;
  257. procedure cairo_set_tolerance(cr:Pcairo_t; tolerance:double); cdecl; external LIB_CAIRO;
  258. procedure cairo_set_antialias(cr:Pcairo_t; antialias:cairo_antialias_t); cdecl; external LIB_CAIRO;
  259. procedure cairo_set_fill_rule(cr:Pcairo_t; fill_rule:cairo_fill_rule_t); cdecl; external LIB_CAIRO;
  260. procedure cairo_set_line_width(cr:Pcairo_t; width:double); cdecl; external LIB_CAIRO;
  261. procedure cairo_set_line_cap(cr:Pcairo_t; line_cap:cairo_line_cap_t); cdecl; external LIB_CAIRO;
  262. procedure cairo_set_line_join(cr:Pcairo_t; line_join:cairo_line_join_t); cdecl; external LIB_CAIRO;
  263. procedure cairo_set_dash(cr:Pcairo_t; dashes:Pdouble; num_dashes:longint; offset:double); cdecl; external LIB_CAIRO;
  264. procedure cairo_set_miter_limit(cr:Pcairo_t; limit:double); cdecl; external LIB_CAIRO;
  265. procedure cairo_translate(cr:Pcairo_t; tx:double; ty:double); cdecl; external LIB_CAIRO;
  266. procedure cairo_scale(cr:Pcairo_t; sx:double; sy:double); cdecl; external LIB_CAIRO;
  267. procedure cairo_rotate(cr:Pcairo_t; angle:double); cdecl; external LIB_CAIRO;
  268. procedure cairo_transform(cr:Pcairo_t; matrix:Pcairo_matrix_t); cdecl; external LIB_CAIRO;
  269. procedure cairo_set_matrix(cr:Pcairo_t; matrix:Pcairo_matrix_t); cdecl; external LIB_CAIRO;
  270. procedure cairo_identity_matrix(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  271. procedure cairo_user_to_device(cr:Pcairo_t; x:Pdouble; y:Pdouble); cdecl; external LIB_CAIRO;
  272. procedure cairo_user_to_device_distance(cr:Pcairo_t; dx:Pdouble; dy:Pdouble); cdecl; external LIB_CAIRO;
  273. procedure cairo_device_to_user(cr:Pcairo_t; x:Pdouble; y:Pdouble); cdecl; external LIB_CAIRO;
  274. procedure cairo_device_to_user_distance(cr:Pcairo_t; dx:Pdouble; dy:Pdouble); cdecl; external LIB_CAIRO;
  275. procedure cairo_new_path(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  276. procedure cairo_move_to(cr:Pcairo_t; x:double; y:double); cdecl; external LIB_CAIRO;
  277. procedure cairo_line_to(cr:Pcairo_t; x:double; y:double); cdecl; external LIB_CAIRO;
  278. procedure cairo_curve_to(cr:Pcairo_t; x1:double; y1:double; x2:double; y2:double; x3:double; y3:double); cdecl; external LIB_CAIRO;
  279. procedure cairo_arc(cr:Pcairo_t; xc:double; yc:double; radius:double; angle1:double; angle2:double); cdecl; external LIB_CAIRO;
  280. procedure cairo_arc_negative(cr:Pcairo_t; xc:double; yc:double; radius:double; angle1:double; angle2:double); cdecl; external LIB_CAIRO;
  281. procedure cairo_rel_move_to(cr:Pcairo_t; dx:double; dy:double); cdecl; external LIB_CAIRO;
  282. procedure cairo_rel_line_to(cr:Pcairo_t; dx:double; dy:double); cdecl; external LIB_CAIRO;
  283. procedure cairo_rel_curve_to(cr:Pcairo_t; dx1:double; dy1:double; dx2:double; dy2:double; dx3:double; dy3:double); cdecl; external LIB_CAIRO;
  284. procedure cairo_rectangle(cr:Pcairo_t; x:double; y:double; width:double; height:double); cdecl; external LIB_CAIRO;
  285. procedure cairo_close_path(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  286. procedure cairo_paint(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  287. procedure cairo_paint_with_alpha(cr:Pcairo_t; alpha:double); cdecl; external LIB_CAIRO;
  288. procedure cairo_mask(cr:Pcairo_t; pattern:Pcairo_pattern_t); cdecl; external LIB_CAIRO;
  289. procedure cairo_mask_surface(cr:Pcairo_t; surface:Pcairo_surface_t; surface_x:double; surface_y:double); cdecl; external LIB_CAIRO;
  290. procedure cairo_stroke(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  291. procedure cairo_stroke_preserve(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  292. procedure cairo_fill(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  293. procedure cairo_fill_preserve(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  294. procedure cairo_copy_page(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  295. procedure cairo_show_page(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  296. function cairo_in_stroke(cr:Pcairo_t; x:double; y:double):cairo_bool_t; cdecl; external LIB_CAIRO;
  297. function cairo_in_fill(cr:Pcairo_t; x:double; y:double):cairo_bool_t; cdecl; external LIB_CAIRO;
  298. procedure cairo_stroke_extents(cr:Pcairo_t; x1:Pdouble; y1:Pdouble; x2:Pdouble; y2:Pdouble); cdecl; external LIB_CAIRO;
  299. procedure cairo_fill_extents(cr:Pcairo_t; x1:Pdouble; y1:Pdouble; x2:Pdouble; y2:Pdouble); cdecl; external LIB_CAIRO;
  300. procedure cairo_reset_clip(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  301. procedure cairo_clip(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  302. procedure cairo_clip_preserve(cr:Pcairo_t); cdecl; external LIB_CAIRO;
  303. function cairo_font_options_create:Pcairo_font_options_t; cdecl; external LIB_CAIRO;
  304. function cairo_font_options_copy(original:Pcairo_font_options_t):Pcairo_font_options_t; cdecl; external LIB_CAIRO;
  305. procedure cairo_font_options_destroy(options:Pcairo_font_options_t); cdecl; external LIB_CAIRO;
  306. function cairo_font_options_status(options:Pcairo_font_options_t):cairo_status_t; cdecl; external LIB_CAIRO;
  307. procedure cairo_font_options_merge(options:Pcairo_font_options_t; other:Pcairo_font_options_t); cdecl; external LIB_CAIRO;
  308. function cairo_font_options_equal(options:Pcairo_font_options_t; other:Pcairo_font_options_t):cairo_bool_t; cdecl; external LIB_CAIRO;
  309. function cairo_font_options_hash(options:Pcairo_font_options_t):dword; cdecl; external LIB_CAIRO;
  310. procedure cairo_font_options_set_antialias(options:Pcairo_font_options_t; antialias:cairo_antialias_t); cdecl; external LIB_CAIRO;
  311. function cairo_font_options_get_antialias(options:Pcairo_font_options_t):cairo_antialias_t; cdecl; external LIB_CAIRO;
  312. procedure cairo_font_options_set_subpixel_order(options:Pcairo_font_options_t; subpixel_order:cairo_subpixel_order_t); cdecl; external LIB_CAIRO;
  313. function cairo_font_options_get_subpixel_order(options:Pcairo_font_options_t):cairo_subpixel_order_t; cdecl; external LIB_CAIRO;
  314. procedure cairo_font_options_set_hint_style(options:Pcairo_font_options_t; hint_style:cairo_hint_style_t); cdecl; external LIB_CAIRO;
  315. function cairo_font_options_get_hint_style(options:Pcairo_font_options_t):cairo_hint_style_t; cdecl; external LIB_CAIRO;
  316. procedure cairo_font_options_set_hint_metrics(options:Pcairo_font_options_t; hint_metrics:cairo_hint_metrics_t); cdecl; external LIB_CAIRO;
  317. function cairo_font_options_get_hint_metrics(options:Pcairo_font_options_t):cairo_hint_metrics_t; cdecl; external LIB_CAIRO;
  318. procedure cairo_select_font_face(cr:Pcairo_t; family:Pchar; slant:cairo_font_slant_t; weight:cairo_font_weight_t); cdecl; external LIB_CAIRO;
  319. procedure cairo_set_font_size(cr:Pcairo_t; size:double); cdecl; external LIB_CAIRO;
  320. procedure cairo_set_font_matrix(cr:Pcairo_t; matrix:Pcairo_matrix_t); cdecl; external LIB_CAIRO;
  321. procedure cairo_get_font_matrix(cr:Pcairo_t; matrix:Pcairo_matrix_t); cdecl; external LIB_CAIRO;
  322. procedure cairo_set_font_options(cr:Pcairo_t; options:Pcairo_font_options_t); cdecl; external LIB_CAIRO;
  323. procedure cairo_get_font_options(cr:Pcairo_t; options:Pcairo_font_options_t); cdecl; external LIB_CAIRO;
  324. procedure cairo_show_text(cr:Pcairo_t; utf8:Pchar); cdecl; external LIB_CAIRO;
  325. procedure cairo_show_glyphs(cr:Pcairo_t; glyphs:Pcairo_glyph_t; num_glyphs:longint); cdecl; external LIB_CAIRO;
  326. function cairo_get_font_face(cr:Pcairo_t):Pcairo_font_face_t; cdecl; external LIB_CAIRO;
  327. procedure cairo_font_extents(cr:Pcairo_t; extents:Pcairo_font_extents_t); cdecl; external LIB_CAIRO;
  328. procedure cairo_set_font_face(cr:Pcairo_t; font_face:Pcairo_font_face_t); cdecl; external LIB_CAIRO;
  329. procedure cairo_text_extents(cr:Pcairo_t; utf8:Pchar; extents:Pcairo_text_extents_t); cdecl; external LIB_CAIRO;
  330. procedure cairo_glyph_extents(cr:Pcairo_t; glyphs:Pcairo_glyph_t; num_glyphs:longint; extents:Pcairo_text_extents_t); cdecl; external LIB_CAIRO;
  331. procedure cairo_text_path(cr:Pcairo_t; utf8:Pchar); cdecl; external LIB_CAIRO;
  332. procedure cairo_glyph_path(cr:Pcairo_t; glyphs:Pcairo_glyph_t; num_glyphs:longint); cdecl; external LIB_CAIRO;
  333. function cairo_font_face_reference(font_face:Pcairo_font_face_t):Pcairo_font_face_t; cdecl; external LIB_CAIRO;
  334. procedure cairo_font_face_destroy(font_face:Pcairo_font_face_t); cdecl; external LIB_CAIRO;
  335. function cairo_font_face_status(font_face:Pcairo_font_face_t):cairo_status_t; cdecl; external LIB_CAIRO;
  336. function cairo_font_face_get_user_data(font_face:Pcairo_font_face_t; key:Pcairo_user_data_key_t):pointer; cdecl; external LIB_CAIRO;
  337. function cairo_font_face_set_user_data(font_face:Pcairo_font_face_t; key:Pcairo_user_data_key_t; user_data:pointer; destroy:cairo_destroy_func_t):cairo_status_t; cdecl; external LIB_CAIRO;
  338. function cairo_scaled_font_create(font_face:Pcairo_font_face_t; font_matrix:Pcairo_matrix_t; ctm:Pcairo_matrix_t; options:Pcairo_font_options_t):Pcairo_scaled_font_t; cdecl; external LIB_CAIRO;
  339. function cairo_scaled_font_reference(scaled_font:Pcairo_scaled_font_t):Pcairo_scaled_font_t; cdecl; external LIB_CAIRO;
  340. procedure cairo_scaled_font_destroy(scaled_font:Pcairo_scaled_font_t); cdecl; external LIB_CAIRO;
  341. function cairo_scaled_font_status(scaled_font:Pcairo_scaled_font_t):cairo_status_t; cdecl; external LIB_CAIRO;
  342. procedure cairo_scaled_font_extents(scaled_font:Pcairo_scaled_font_t; extents:Pcairo_font_extents_t); cdecl; external LIB_CAIRO;
  343. procedure cairo_scaled_font_glyph_extents(scaled_font:Pcairo_scaled_font_t; glyphs:Pcairo_glyph_t; num_glyphs:longint; extents:Pcairo_text_extents_t); cdecl; external LIB_CAIRO;
  344. function cairo_get_operator(cr:Pcairo_t):cairo_operator_t; cdecl; external LIB_CAIRO;
  345. function cairo_get_source(cr:Pcairo_t):Pcairo_pattern_t; cdecl; external LIB_CAIRO;
  346. function cairo_get_tolerance(cr:Pcairo_t):double; cdecl; external LIB_CAIRO;
  347. function cairo_get_antialias(cr:Pcairo_t):cairo_antialias_t; cdecl; external LIB_CAIRO;
  348. procedure cairo_get_current_point(cr:Pcairo_t; x:Pdouble; y:Pdouble); cdecl; external LIB_CAIRO;
  349. function cairo_get_fill_rule(cr:Pcairo_t):cairo_fill_rule_t; cdecl; external LIB_CAIRO;
  350. function cairo_get_line_width(cr:Pcairo_t):double; cdecl; external LIB_CAIRO;
  351. function cairo_get_line_cap(cr:Pcairo_t):cairo_line_cap_t; cdecl; external LIB_CAIRO;
  352. function cairo_get_line_join(cr:Pcairo_t):cairo_line_join_t; cdecl; external LIB_CAIRO;
  353. function cairo_get_miter_limit(cr:Pcairo_t):double; cdecl; external LIB_CAIRO;
  354. procedure cairo_get_matrix(cr:Pcairo_t; matrix:Pcairo_matrix_t); cdecl; external LIB_CAIRO;
  355. function cairo_get_target(cr:Pcairo_t):Pcairo_surface_t; cdecl; external LIB_CAIRO;
  356. function cairo_copy_path(cr:Pcairo_t):Pcairo_path_t; cdecl; external LIB_CAIRO;
  357. function cairo_copy_path_flat(cr:Pcairo_t):Pcairo_path_t; cdecl; external LIB_CAIRO;
  358. procedure cairo_append_path(cr:Pcairo_t; path:Pcairo_path_t); cdecl; external LIB_CAIRO;
  359. procedure cairo_path_destroy(path:Pcairo_path_t); cdecl; external LIB_CAIRO;
  360. function cairo_status(cr:Pcairo_t):cairo_status_t; cdecl; external LIB_CAIRO;
  361. function cairo_status_to_string(status:cairo_status_t):Pchar; cdecl; external LIB_CAIRO;
  362. function cairo_surface_create_similar(other:Pcairo_surface_t; content:cairo_content_t; width:longint; height:longint):Pcairo_surface_t; cdecl; external LIB_CAIRO;
  363. function cairo_surface_reference(surface:Pcairo_surface_t):Pcairo_surface_t; cdecl; external LIB_CAIRO;
  364. procedure cairo_surface_destroy(surface:Pcairo_surface_t); cdecl; external LIB_CAIRO;
  365. function cairo_surface_status(surface:Pcairo_surface_t):cairo_status_t; cdecl; external LIB_CAIRO;
  366. procedure cairo_surface_finish(surface:Pcairo_surface_t); cdecl; external LIB_CAIRO;
  367. function cairo_surface_write_to_png(surface:Pcairo_surface_t; filename:Pchar):cairo_status_t; cdecl; external LIB_CAIRO;
  368. function cairo_surface_write_to_png_stream(surface:Pcairo_surface_t; write_func:cairo_write_func_t; closure:pointer):cairo_status_t; cdecl; external LIB_CAIRO;
  369. function cairo_surface_get_user_data(surface:Pcairo_surface_t; key:Pcairo_user_data_key_t):pointer; cdecl; external LIB_CAIRO;
  370. function cairo_surface_set_user_data(surface:Pcairo_surface_t; key:Pcairo_user_data_key_t; user_data:pointer; destroy:cairo_destroy_func_t):cairo_status_t; cdecl; external LIB_CAIRO;
  371. procedure cairo_surface_get_font_options(surface:Pcairo_surface_t; options:Pcairo_font_options_t); cdecl; external LIB_CAIRO;
  372. procedure cairo_surface_flush(surface:Pcairo_surface_t); cdecl; external LIB_CAIRO;
  373. procedure cairo_surface_mark_dirty(surface:Pcairo_surface_t); cdecl; external LIB_CAIRO;
  374. procedure cairo_surface_mark_dirty_rectangle(surface:Pcairo_surface_t; x:longint; y:longint; width:longint; height:longint); cdecl; external LIB_CAIRO;
  375. procedure cairo_surface_set_device_offset(surface:Pcairo_surface_t; x_offset:double; y_offset:double); cdecl; external LIB_CAIRO;
  376. function cairo_image_surface_create(format:cairo_format_t; width:longint; height:longint):Pcairo_surface_t; cdecl; external LIB_CAIRO;
  377. function cairo_image_surface_create_for_data(data:Pbyte; format:cairo_format_t; width:longint; height:longint; stride:longint):Pcairo_surface_t; cdecl; external LIB_CAIRO;
  378. function cairo_image_surface_get_width(surface:Pcairo_surface_t):longint; cdecl; external LIB_CAIRO;
  379. function cairo_image_surface_get_height(surface:Pcairo_surface_t):longint; cdecl; external LIB_CAIRO;
  380. function cairo_image_surface_create_from_png(filename:Pchar):Pcairo_surface_t; cdecl; external LIB_CAIRO;
  381. function cairo_image_surface_create_from_png_stream(read_func:cairo_read_func_t; closure:pointer):Pcairo_surface_t; cdecl; external LIB_CAIRO;
  382. function cairo_pattern_create_rgb(red:double; green:double; blue:double):Pcairo_pattern_t; cdecl; external LIB_CAIRO;
  383. function cairo_pattern_create_rgba(red:double; green:double; blue:double; alpha:double):Pcairo_pattern_t; cdecl; external LIB_CAIRO;
  384. function cairo_pattern_create_for_surface(surface:Pcairo_surface_t):Pcairo_pattern_t; cdecl; external LIB_CAIRO;
  385. function cairo_pattern_create_linear(x0:double; y0:double; x1:double; y1:double):Pcairo_pattern_t; cdecl; external LIB_CAIRO;
  386. function cairo_pattern_create_radial(cx0:double; cy0:double; radius0:double; cx1:double; cy1:double; radius1:double):Pcairo_pattern_t; cdecl; external LIB_CAIRO;
  387. function cairo_pattern_reference(pattern:Pcairo_pattern_t):Pcairo_pattern_t; cdecl; external LIB_CAIRO;
  388. procedure cairo_pattern_destroy(pattern:Pcairo_pattern_t); cdecl; external LIB_CAIRO;
  389. function cairo_pattern_status(pattern:Pcairo_pattern_t):cairo_status_t; cdecl; external LIB_CAIRO;
  390. procedure cairo_pattern_add_color_stop_rgb(pattern:Pcairo_pattern_t; offset:double; red:double; green:double; blue:double); cdecl; external LIB_CAIRO;
  391. procedure cairo_pattern_add_color_stop_rgba(pattern:Pcairo_pattern_t; offset:double; red:double; green:double; blue:double; alpha:double); cdecl; external LIB_CAIRO;
  392. procedure cairo_pattern_set_matrix(pattern:Pcairo_pattern_t; matrix:Pcairo_matrix_t); cdecl; external LIB_CAIRO;
  393. procedure cairo_pattern_get_matrix(pattern:Pcairo_pattern_t; matrix:Pcairo_matrix_t); cdecl; external LIB_CAIRO;
  394. procedure cairo_pattern_set_extend(pattern:Pcairo_pattern_t; extend:cairo_extend_t); cdecl; external LIB_CAIRO;
  395. function cairo_pattern_get_extend(pattern:Pcairo_pattern_t):cairo_extend_t; cdecl; external LIB_CAIRO;
  396. procedure cairo_pattern_set_filter(pattern:Pcairo_pattern_t; filter:cairo_filter_t); cdecl; external LIB_CAIRO;
  397. function cairo_pattern_get_filter(pattern:Pcairo_pattern_t):cairo_filter_t; cdecl; external LIB_CAIRO;
  398. procedure cairo_matrix_init(matrix:Pcairo_matrix_t; xx:double; yx:double; xy:double; yy:double; x0:double; y0:double); cdecl; external LIB_CAIRO;
  399. procedure cairo_matrix_init_identity(matrix:Pcairo_matrix_t); cdecl; external LIB_CAIRO;
  400. procedure cairo_matrix_init_translate(matrix:Pcairo_matrix_t; tx:double; ty:double); cdecl; external LIB_CAIRO;
  401. procedure cairo_matrix_init_scale(matrix:Pcairo_matrix_t; sx:double; sy:double); cdecl; external LIB_CAIRO;
  402. procedure cairo_matrix_init_rotate(matrix:Pcairo_matrix_t; radians:double); cdecl; external LIB_CAIRO;
  403. procedure cairo_matrix_translate(matrix:Pcairo_matrix_t; tx:double; ty:double); cdecl; external LIB_CAIRO;
  404. procedure cairo_matrix_scale(matrix:Pcairo_matrix_t; sx:double; sy:double); cdecl; external LIB_CAIRO;
  405. procedure cairo_matrix_rotate(matrix:Pcairo_matrix_t; radians:double); cdecl; external LIB_CAIRO;
  406. function cairo_matrix_invert(matrix:Pcairo_matrix_t):cairo_status_t; cdecl; external LIB_CAIRO;
  407. procedure cairo_matrix_multiply(result:Pcairo_matrix_t; a:Pcairo_matrix_t; b:Pcairo_matrix_t); cdecl; external LIB_CAIRO;
  408. procedure cairo_matrix_transform_distance(matrix:Pcairo_matrix_t; dx:Pdouble; dy:Pdouble); cdecl; external LIB_CAIRO;
  409. procedure cairo_matrix_transform_point(matrix:Pcairo_matrix_t; x:Pdouble; y:Pdouble); cdecl; external LIB_CAIRO;
  410. function cairo_xlib_surface_create(dpy:PDisplay; drawable:TDrawable; visual:PVisual; width:longint; height:longint):Pcairo_surface_t; cdecl; external LIB_CAIRO;
  411. function cairo_xlib_surface_create_for_bitmap(dpy:PDisplay; bitmap:TPixmap; screen:PScreen; width:longint; height:longint):Pcairo_surface_t; cdecl; external LIB_CAIRO;
  412. procedure cairo_xlib_surface_set_size(surface:Pcairo_surface_t; width:longint; height:longint); cdecl; external LIB_CAIRO;
  413. procedure cairo_xlib_surface_set_drawable(surface:Pcairo_surface_t; drawable:TDrawable; width:longint; height:longint); cdecl; external LIB_CAIRO;
  414. function cairo_xlib_surface_create_with_xrender_format(dpy:PDisplay; drawable:TDrawable; screen:PScreen; format:PXRenderPictFormat; width:longint; height:longint):Pcairo_surface_t; cdecl; external LIB_CAIRO;
  415. function cairo_ft_font_face_create_for_pattern(pattern:PFcPattern):Pcairo_font_face_t; cdecl; external LIB_CAIRO;
  416. procedure cairo_ft_font_options_substitute(options:Pcairo_font_options_t; pattern:PFcPattern); cdecl; external LIB_CAIRO;
  417. function cairo_ft_font_face_create_for_ft_face(face:TFT_Face; load_flags:longint):Pcairo_font_face_t; cdecl; external LIB_CAIRO;
  418. function cairo_ft_scaled_font_lock_face(scaled_font:Pcairo_scaled_font_t):TFT_Face; cdecl; external LIB_CAIRO;
  419. procedure cairo_ft_scaled_font_unlock_face(scaled_font:Pcairo_scaled_font_t); cdecl; external LIB_CAIRO;
  420. // These two functions renamed *_get_* to avoid collision...
  421. function cairo_get_version:longint; cdecl; external LIB_CAIRO name 'cairo_version';
  422. function cairo_get_version_string:Pchar; cdecl; external LIB_CAIRO name 'cairo_version_string';
  423. function CAIRO_VERSION : longint;
  424. function CAIRO_VERSION_ENCODE(major,minor,micro : longint) : longint;
  425. implementation
  426. function CAIRO_VERSION : longint;
  427. begin
  428. CAIRO_VERSION:=CAIRO_VERSION_ENCODE(CAIRO_VERSION_MAJOR,CAIRO_VERSION_MINOR,CAIRO_VERSION_MICRO);
  429. end;
  430. function CAIRO_VERSION_ENCODE(major,minor,micro : longint) : longint;
  431. begin
  432. CAIRO_VERSION_ENCODE:=((major * 10000) + (minor * 100)) + (micro * 1);
  433. end;
  434. end.