cairo 1.8.3-x86-mingw32 → 1.8.4-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of cairo might be problematic. Click here for more details.

Files changed (126) hide show
  1. data/NEWS +14 -0
  2. data/Rakefile +2 -2
  3. data/ext/cairo/rb_cairo.c +1 -1
  4. data/extconf.rb +11 -11
  5. data/home/kou/work/ruby/rcairo.win32/vendor/local/bin/freetype6.dll +0 -0
  6. data/home/kou/work/ruby/rcairo.win32/vendor/local/bin/libcairo-2.dll +0 -0
  7. data/home/kou/work/ruby/rcairo.win32/vendor/local/bin/libfontconfig-1.dll +0 -0
  8. data/home/kou/work/ruby/rcairo.win32/vendor/local/bin/libpng14-14.dll +0 -0
  9. data/home/kou/work/ruby/rcairo.win32/vendor/local/bin/zlib1.dll +0 -0
  10. data/home/kou/work/ruby/rcairo.win32/vendor/local/etc/fonts/fonts.conf +151 -0
  11. data/home/kou/work/ruby/rcairo.win32/vendor/local/include/cairo/cairo-deprecated.h +138 -0
  12. data/home/kou/work/ruby/rcairo.win32/vendor/local/include/cairo/cairo-features.h +20 -0
  13. data/home/kou/work/ruby/rcairo.win32/vendor/local/include/cairo/cairo-ft.h +75 -0
  14. data/home/kou/work/ruby/rcairo.win32/vendor/local/include/cairo/cairo-pdf.h +68 -0
  15. data/home/kou/work/ruby/rcairo.win32/vendor/local/include/cairo/cairo-ps.h +114 -0
  16. data/home/kou/work/ruby/rcairo.win32/vendor/local/include/cairo/cairo-svg.h +82 -0
  17. data/home/kou/work/ruby/rcairo.win32/vendor/local/include/cairo/cairo-version.h +8 -0
  18. data/home/kou/work/ruby/rcairo.win32/vendor/local/include/cairo/cairo-win32.h +112 -0
  19. data/home/kou/work/ruby/rcairo.win32/vendor/local/include/cairo/cairo.h +2328 -0
  20. data/home/kou/work/ruby/rcairo.win32/vendor/local/include/libpng14/png.h +2701 -0
  21. data/home/kou/work/ruby/rcairo.win32/vendor/local/include/libpng14/pngconf.h +1525 -0
  22. data/home/kou/work/ruby/rcairo.win32/vendor/local/include/png.h +2701 -0
  23. data/home/kou/work/ruby/rcairo.win32/vendor/local/include/pngconf.h +1525 -0
  24. data/home/kou/work/ruby/rcairo.win32/vendor/local/include/zconf.h +461 -0
  25. data/home/kou/work/ruby/rcairo.win32/vendor/local/include/zlib.h +1589 -0
  26. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/cairo.def +278 -0
  27. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/cairo.lib +0 -0
  28. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/libcairo.dll.a +0 -0
  29. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/libpng.def +192 -0
  30. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/libpng.lib +0 -0
  31. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/libpng14.dll.a +0 -0
  32. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/libz.dll.a +0 -0
  33. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/pkgconfig/cairo-ft.pc +12 -0
  34. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/pkgconfig/cairo-pdf.pc +12 -0
  35. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/pkgconfig/cairo-png.pc +12 -0
  36. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/pkgconfig/cairo-ps.pc +12 -0
  37. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/pkgconfig/cairo-svg.pc +12 -0
  38. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/pkgconfig/cairo-win32-font.pc +12 -0
  39. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/pkgconfig/cairo-win32.pc +12 -0
  40. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/pkgconfig/cairo.pc +13 -0
  41. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/pkgconfig/libpng.pc +11 -0
  42. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/pkgconfig/libpng14.pc +11 -0
  43. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/zdll.lib +0 -0
  44. data/home/kou/work/ruby/rcairo.win32/vendor/local/lib/zlib.def +67 -0
  45. data/home/kou/work/ruby/rcairo.win32/vendor/local/manifest/cairo-dev_1.8.10-4_win32.mft +76 -0
  46. data/home/kou/work/ruby/rcairo.win32/vendor/local/manifest/cairo_1.8.10-4_win32.mft +5 -0
  47. data/home/kou/work/ruby/rcairo.win32/vendor/local/manifest/fontconfig_2.8.0-2_win32.mft +3 -0
  48. data/home/kou/work/ruby/rcairo.win32/vendor/local/manifest/freetype_2.4.2-1_win32.mft +2 -0
  49. data/home/kou/work/ruby/rcairo.win32/vendor/local/manifest/libpng-dev_1.4.3-1_win32.mft +15 -0
  50. data/home/kou/work/ruby/rcairo.win32/vendor/local/manifest/libpng_1.4.3-1_win32.mft +2 -0
  51. data/home/kou/work/ruby/rcairo.win32/vendor/local/manifest/zlib-dev_1.2.5-2_win32.mft +8 -0
  52. data/home/kou/work/ruby/rcairo.win32/vendor/local/manifest/zlib_1.2.5-2_win32.mft +2 -0
  53. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/doc/cairo_1.8.10-4_win32/COPYING +32 -0
  54. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/doc/cairo_1.8.10-4_win32/COPYING-LGPL-2.1 +510 -0
  55. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/doc/cairo_1.8.10-4_win32/COPYING-MPL-1.1 +470 -0
  56. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/bindings-errors.html +132 -0
  57. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/bindings-fonts.html +63 -0
  58. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/bindings-memory.html +133 -0
  59. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/bindings-overloading.html +131 -0
  60. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/bindings-path.html +127 -0
  61. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/bindings-patterns.html +67 -0
  62. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/bindings-return-values.html +130 -0
  63. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/bindings-streams.html +102 -0
  64. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/bindings-surfaces.html +103 -0
  65. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-context.html +2643 -0
  66. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-drawing.html +57 -0
  67. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-error-status.html +360 -0
  68. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-font-face.html +408 -0
  69. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-font-options.html +678 -0
  70. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-fonts.html +63 -0
  71. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-ft-font.html +319 -0
  72. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-image-surface.html +473 -0
  73. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-matrix.html +596 -0
  74. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-paths.html +1274 -0
  75. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-pattern.html +1485 -0
  76. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-pdf-surface.html +238 -0
  77. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-png-functions.html +341 -0
  78. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-ps-surface.html +622 -0
  79. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-quartz-font.html +151 -0
  80. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-quartz-surface.html +219 -0
  81. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-scaled-font.html +1023 -0
  82. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-support.html +54 -0
  83. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-surface.html +1026 -0
  84. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-surfaces.html +69 -0
  85. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-svg-surface.html +321 -0
  86. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-text.html +1222 -0
  87. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-transformations.html +436 -0
  88. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-types.html +133 -0
  89. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-user-font.html +735 -0
  90. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-version-info.html +345 -0
  91. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-win32-font.html +358 -0
  92. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-win32-surface.html +312 -0
  93. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo-xlib-surface.html +492 -0
  94. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo.devhelp +417 -0
  95. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/cairo.devhelp2 +542 -0
  96. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/home.png +0 -0
  97. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/index-1.2.html +141 -0
  98. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/index-1.4.html +109 -0
  99. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/index-1.6.html +71 -0
  100. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/index-1.8.html +107 -0
  101. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/index-all.html +759 -0
  102. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/index.html +144 -0
  103. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/index.sgml +478 -0
  104. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/language-bindings.html +83 -0
  105. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/left.png +0 -0
  106. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/right.png +0 -0
  107. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/style.css +167 -0
  108. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/gtk-doc/html/cairo/up.png +0 -0
  109. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/man/man3/libpng.3 +4455 -0
  110. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/man/man3/libpngpf.3 +808 -0
  111. data/home/kou/work/ruby/rcairo.win32/vendor/local/share/man/man5/png.5 +74 -0
  112. data/home/kou/work/ruby/rcairo.win32/vendor/local/src/tml/packaging/cairo_1.8.10-4_win32.log +920 -0
  113. data/home/kou/work/ruby/rcairo.win32/vendor/local/src/tml/packaging/cairo_1.8.10-4_win32.sh +76 -0
  114. data/home/kou/work/ruby/rcairo.win32/vendor/local/src/tml/packaging/libpng_1.4.3-1_win32.log +272 -0
  115. data/home/kou/work/ruby/rcairo.win32/vendor/local/src/tml/packaging/libpng_1.4.3-1_win32.sh +71 -0
  116. data/home/kou/work/ruby/rcairo.win32/vendor/local/src/tml/packaging/zlib_1.2.5-2_win32.log +42 -0
  117. data/home/kou/work/ruby/rcairo.win32/vendor/local/src/tml/packaging/zlib_1.2.5-2_win32.sh +189 -0
  118. data/lib/1.8/cairo.so +0 -0
  119. data/lib/1.9/cairo.so +0 -0
  120. data/tmp/{x86-mingw32 → i386-mingw32}/cairo/1.8.7/fake.rb +0 -0
  121. data/tmp/{x86-mingw32 → i386-mingw32}/cairo/1.8.7/mkmf.rb +0 -0
  122. data/tmp/{x86-mingw32 → i386-mingw32}/cairo/1.8.7/rbconfig.rb +0 -0
  123. data/tmp/{x86-mingw32 → i386-mingw32}/cairo/1.9.2/fake.rb +0 -0
  124. data/tmp/{x86-mingw32 → i386-mingw32}/cairo/1.9.2/mkmf.rb +0 -0
  125. data/tmp/{x86-mingw32 → i386-mingw32}/cairo/1.9.2/rbconfig.rb +1 -1
  126. metadata +126 -40
@@ -0,0 +1,68 @@
1
+ /* cairo - a vector graphics library with display and print output
2
+ *
3
+ * Copyright © 2002 University of Southern California
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it either under the terms of the GNU Lesser General Public
7
+ * License version 2.1 as published by the Free Software Foundation
8
+ * (the "LGPL") or, at your option, under the terms of the Mozilla
9
+ * Public License Version 1.1 (the "MPL"). If you do not alter this
10
+ * notice, a recipient may use your version of this file under either
11
+ * the MPL or the LGPL.
12
+ *
13
+ * You should have received a copy of the LGPL along with this library
14
+ * in the file COPYING-LGPL-2.1; if not, write to the Free Software
15
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
+ * You should have received a copy of the MPL along with this library
17
+ * in the file COPYING-MPL-1.1
18
+ *
19
+ * The contents of this file are subject to the Mozilla Public License
20
+ * Version 1.1 (the "License"); you may not use this file except in
21
+ * compliance with the License. You may obtain a copy of the License at
22
+ * http://www.mozilla.org/MPL/
23
+ *
24
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
25
+ * OF ANY KIND, either express or implied. See the LGPL or the MPL for
26
+ * the specific language governing rights and limitations.
27
+ *
28
+ * The Original Code is the cairo graphics library.
29
+ *
30
+ * The Initial Developer of the Original Code is University of Southern
31
+ * California.
32
+ *
33
+ * Contributor(s):
34
+ * Carl D. Worth <cworth@cworth.org>
35
+ */
36
+
37
+ #ifndef CAIRO_PDF_H
38
+ #define CAIRO_PDF_H
39
+
40
+ #include "cairo.h"
41
+
42
+ #if CAIRO_HAS_PDF_SURFACE
43
+
44
+ CAIRO_BEGIN_DECLS
45
+
46
+ cairo_public cairo_surface_t *
47
+ cairo_pdf_surface_create (const char *filename,
48
+ double width_in_points,
49
+ double height_in_points);
50
+
51
+ cairo_public cairo_surface_t *
52
+ cairo_pdf_surface_create_for_stream (cairo_write_func_t write_func,
53
+ void *closure,
54
+ double width_in_points,
55
+ double height_in_points);
56
+
57
+ cairo_public void
58
+ cairo_pdf_surface_set_size (cairo_surface_t *surface,
59
+ double width_in_points,
60
+ double height_in_points);
61
+
62
+ CAIRO_END_DECLS
63
+
64
+ #else /* CAIRO_HAS_PDF_SURFACE */
65
+ # error Cairo was not compiled with support for the pdf backend
66
+ #endif /* CAIRO_HAS_PDF_SURFACE */
67
+
68
+ #endif /* CAIRO_PDF_H */
@@ -0,0 +1,114 @@
1
+ /* cairo - a vector graphics library with display and print output
2
+ *
3
+ * Copyright © 2002 University of Southern California
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it either under the terms of the GNU Lesser General Public
7
+ * License version 2.1 as published by the Free Software Foundation
8
+ * (the "LGPL") or, at your option, under the terms of the Mozilla
9
+ * Public License Version 1.1 (the "MPL"). If you do not alter this
10
+ * notice, a recipient may use your version of this file under either
11
+ * the MPL or the LGPL.
12
+ *
13
+ * You should have received a copy of the LGPL along with this library
14
+ * in the file COPYING-LGPL-2.1; if not, write to the Free Software
15
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
+ * You should have received a copy of the MPL along with this library
17
+ * in the file COPYING-MPL-1.1
18
+ *
19
+ * The contents of this file are subject to the Mozilla Public License
20
+ * Version 1.1 (the "License"); you may not use this file except in
21
+ * compliance with the License. You may obtain a copy of the License at
22
+ * http://www.mozilla.org/MPL/
23
+ *
24
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
25
+ * OF ANY KIND, either express or implied. See the LGPL or the MPL for
26
+ * the specific language governing rights and limitations.
27
+ *
28
+ * The Original Code is the cairo graphics library.
29
+ *
30
+ * The Initial Developer of the Original Code is University of Southern
31
+ * California.
32
+ *
33
+ * Contributor(s):
34
+ * Carl D. Worth <cworth@cworth.org>
35
+ */
36
+
37
+ #ifndef CAIRO_PS_H
38
+ #define CAIRO_PS_H
39
+
40
+ #include "cairo.h"
41
+
42
+ #if CAIRO_HAS_PS_SURFACE
43
+
44
+ #include <stdio.h>
45
+
46
+ CAIRO_BEGIN_DECLS
47
+
48
+ /* PS-surface functions */
49
+
50
+ /**
51
+ * cairo_ps_level_t:
52
+ * @CAIRO_PS_LEVEL_2: The language level 2 of the PostScript specification.
53
+ * @CAIRO_PS_LEVEL_3: The language level 3 of the PostScript specification.
54
+ *
55
+ * #cairo_ps_level_t is used to describe the language level of the
56
+ * PostScript Language Reference that a generated PostScript file will
57
+ * conform to.
58
+ */
59
+ typedef enum _cairo_ps_level {
60
+ CAIRO_PS_LEVEL_2,
61
+ CAIRO_PS_LEVEL_3
62
+ } cairo_ps_level_t;
63
+
64
+ cairo_public cairo_surface_t *
65
+ cairo_ps_surface_create (const char *filename,
66
+ double width_in_points,
67
+ double height_in_points);
68
+
69
+ cairo_public cairo_surface_t *
70
+ cairo_ps_surface_create_for_stream (cairo_write_func_t write_func,
71
+ void *closure,
72
+ double width_in_points,
73
+ double height_in_points);
74
+
75
+ cairo_public void
76
+ cairo_ps_surface_restrict_to_level (cairo_surface_t *surface,
77
+ cairo_ps_level_t level);
78
+
79
+ cairo_public void
80
+ cairo_ps_get_levels (cairo_ps_level_t const **levels,
81
+ int *num_levels);
82
+
83
+ cairo_public const char *
84
+ cairo_ps_level_to_string (cairo_ps_level_t level);
85
+
86
+ cairo_public void
87
+ cairo_ps_surface_set_eps (cairo_surface_t *surface,
88
+ cairo_bool_t eps);
89
+
90
+ cairo_public cairo_bool_t
91
+ cairo_ps_surface_get_eps (cairo_surface_t *surface);
92
+
93
+ cairo_public void
94
+ cairo_ps_surface_set_size (cairo_surface_t *surface,
95
+ double width_in_points,
96
+ double height_in_points);
97
+
98
+ cairo_public void
99
+ cairo_ps_surface_dsc_comment (cairo_surface_t *surface,
100
+ const char *comment);
101
+
102
+ cairo_public void
103
+ cairo_ps_surface_dsc_begin_setup (cairo_surface_t *surface);
104
+
105
+ cairo_public void
106
+ cairo_ps_surface_dsc_begin_page_setup (cairo_surface_t *surface);
107
+
108
+ CAIRO_END_DECLS
109
+
110
+ #else /* CAIRO_HAS_PS_SURFACE */
111
+ # error Cairo was not compiled with support for the ps backend
112
+ #endif /* CAIRO_HAS_PS_SURFACE */
113
+
114
+ #endif /* CAIRO_PS_H */
@@ -0,0 +1,82 @@
1
+ /* cairo - a vector graphics library with display and print output
2
+ *
3
+ * cairo-svg.h
4
+ *
5
+ * Copyright © 2005 Emmanuel Pacaud <emmanuel.pacaud@univ-poitiers.fr>
6
+ *
7
+ * This library is free software; you can redistribute it and/or
8
+ * modify it either under the terms of the GNU Lesser General Public
9
+ * License version 2.1 as published by the Free Software Foundation
10
+ * (the "LGPL") or, at your option, under the terms of the Mozilla
11
+ * Public License Version 1.1 (the "MPL"). If you do not alter this
12
+ * notice, a recipient may use your version of this file under either
13
+ * the MPL or the LGPL.
14
+ *
15
+ * You should have received a copy of the LGPL along with this library
16
+ * in the file COPYING-LGPL-2.1; if not, write to the Free Software
17
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
+ * You should have received a copy of the MPL along with this library
19
+ * in the file COPYING-MPL-1.1
20
+ *
21
+ * The contents of this file are subject to the Mozilla Public License
22
+ * Version 1.1 (the "License"); you may not use this file except in
23
+ * compliance with the License. You may obtain a copy of the License at
24
+ * http://www.mozilla.org/MPL/
25
+ *
26
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
27
+ * OF ANY KIND, either express or implied. See the LGPL or the MPL for
28
+ * the specific language governing rights and limitations.
29
+ *
30
+ */
31
+
32
+ #ifndef CAIRO_SVG_H
33
+ #define CAIRO_SVG_H
34
+
35
+ #include "cairo.h"
36
+
37
+ #if CAIRO_HAS_SVG_SURFACE
38
+
39
+ CAIRO_BEGIN_DECLS
40
+
41
+ /**
42
+ * cairo_svg_version_t:
43
+ * @CAIRO_SVG_VERSION_1_1: The version 1.1 of the SVG specification.
44
+ * @CAIRO_SVG_VERSION_1_2: The version 1.2 of the SVG specification.
45
+ *
46
+ * #cairo_svg_version_t is used to describe the version number of the SVG
47
+ * specification that a generated SVG file will conform to.
48
+ */
49
+ typedef enum _cairo_svg_version {
50
+ CAIRO_SVG_VERSION_1_1,
51
+ CAIRO_SVG_VERSION_1_2
52
+ } cairo_svg_version_t;
53
+
54
+ cairo_public cairo_surface_t *
55
+ cairo_svg_surface_create (const char *filename,
56
+ double width_in_points,
57
+ double height_in_points);
58
+
59
+ cairo_public cairo_surface_t *
60
+ cairo_svg_surface_create_for_stream (cairo_write_func_t write_func,
61
+ void *closure,
62
+ double width_in_points,
63
+ double height_in_points);
64
+
65
+ cairo_public void
66
+ cairo_svg_surface_restrict_to_version (cairo_surface_t *surface,
67
+ cairo_svg_version_t version);
68
+
69
+ cairo_public void
70
+ cairo_svg_get_versions (cairo_svg_version_t const **versions,
71
+ int *num_versions);
72
+
73
+ cairo_public const char *
74
+ cairo_svg_version_to_string (cairo_svg_version_t version);
75
+
76
+ CAIRO_END_DECLS
77
+
78
+ #else /* CAIRO_HAS_SVG_SURFACE */
79
+ # error Cairo was not compiled with support for the svg backend
80
+ #endif /* CAIRO_HAS_SVG_SURFACE */
81
+
82
+ #endif /* CAIRO_SVG_H */
@@ -0,0 +1,8 @@
1
+ #ifndef CAIRO_VERSION_H
2
+ #define CAIRO_VERSION_H
3
+
4
+ #define CAIRO_VERSION_MAJOR 1
5
+ #define CAIRO_VERSION_MINOR 8
6
+ #define CAIRO_VERSION_MICRO 10
7
+
8
+ #endif
@@ -0,0 +1,112 @@
1
+ /* -*- Mode: c; tab-width: 8; c-basic-offset: 4; indent-tabs-mode: t; -*- */
2
+ /* cairo - a vector graphics library with display and print output
3
+ *
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 Red Hat, Inc.
32
+ *
33
+ * Contributor(s):
34
+ * Owen Taylor <otaylor@redhat.com>
35
+ */
36
+
37
+ #ifndef _CAIRO_WIN32_H_
38
+ #define _CAIRO_WIN32_H_
39
+
40
+ #include "cairo.h"
41
+
42
+ #if CAIRO_HAS_WIN32_SURFACE
43
+
44
+ #include <windows.h>
45
+
46
+ CAIRO_BEGIN_DECLS
47
+
48
+ cairo_public cairo_surface_t *
49
+ cairo_win32_surface_create (HDC hdc);
50
+
51
+ cairo_public cairo_surface_t *
52
+ cairo_win32_printing_surface_create (HDC hdc);
53
+
54
+ cairo_public cairo_surface_t *
55
+ cairo_win32_surface_create_with_ddb (HDC hdc,
56
+ cairo_format_t format,
57
+ int width,
58
+ int height);
59
+
60
+ cairo_public cairo_surface_t *
61
+ cairo_win32_surface_create_with_dib (cairo_format_t format,
62
+ int width,
63
+ int height);
64
+
65
+ cairo_public HDC
66
+ cairo_win32_surface_get_dc (cairo_surface_t *surface);
67
+
68
+ cairo_public cairo_surface_t *
69
+ cairo_win32_surface_get_image (cairo_surface_t *surface);
70
+
71
+ #if CAIRO_HAS_WIN32_FONT
72
+
73
+ /*
74
+ * Win32 font support
75
+ */
76
+
77
+ cairo_public cairo_font_face_t *
78
+ cairo_win32_font_face_create_for_logfontw (LOGFONTW *logfont);
79
+
80
+ cairo_public cairo_font_face_t *
81
+ cairo_win32_font_face_create_for_hfont (HFONT font);
82
+
83
+ cairo_public cairo_font_face_t *
84
+ cairo_win32_font_face_create_for_logfontw_hfont (LOGFONTW *logfont, HFONT font);
85
+
86
+ cairo_public cairo_status_t
87
+ cairo_win32_scaled_font_select_font (cairo_scaled_font_t *scaled_font,
88
+ HDC hdc);
89
+
90
+ cairo_public void
91
+ cairo_win32_scaled_font_done_font (cairo_scaled_font_t *scaled_font);
92
+
93
+ cairo_public double
94
+ cairo_win32_scaled_font_get_metrics_factor (cairo_scaled_font_t *scaled_font);
95
+
96
+ cairo_public void
97
+ cairo_win32_scaled_font_get_logical_to_device (cairo_scaled_font_t *scaled_font,
98
+ cairo_matrix_t *logical_to_device);
99
+
100
+ cairo_public void
101
+ cairo_win32_scaled_font_get_device_to_logical (cairo_scaled_font_t *scaled_font,
102
+ cairo_matrix_t *device_to_logical);
103
+
104
+ #endif /* CAIRO_HAS_WIN32_FONT */
105
+
106
+ CAIRO_END_DECLS
107
+
108
+ #else /* CAIRO_HAS_WIN32_SURFACE */
109
+ # error Cairo was not compiled with support for the win32 backend
110
+ #endif /* CAIRO_HAS_WIN32_SURFACE */
111
+
112
+ #endif /* _CAIRO_WIN32_H_ */
@@ -0,0 +1,2328 @@
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 <cworth@cworth.org>
36
+ */
37
+
38
+ #ifndef CAIRO_H
39
+ #define CAIRO_H
40
+
41
+ #include "cairo-version.h"
42
+ #include "cairo-features.h"
43
+ #include "cairo-deprecated.h"
44
+
45
+ #ifdef __cplusplus
46
+ # define CAIRO_BEGIN_DECLS extern "C" {
47
+ # define CAIRO_END_DECLS }
48
+ #else
49
+ # define CAIRO_BEGIN_DECLS
50
+ # define CAIRO_END_DECLS
51
+ #endif
52
+
53
+ #ifndef cairo_public
54
+ # if defined (_MSC_VER) && ! defined (CAIRO_WIN32_STATIC_BUILD)
55
+ # define cairo_public __declspec(dllimport)
56
+ # else
57
+ # define cairo_public
58
+ # endif
59
+ #endif
60
+
61
+ CAIRO_BEGIN_DECLS
62
+
63
+ #define CAIRO_VERSION_ENCODE(major, minor, micro) ( \
64
+ ((major) * 10000) \
65
+ + ((minor) * 100) \
66
+ + ((micro) * 1))
67
+
68
+ #define CAIRO_VERSION CAIRO_VERSION_ENCODE( \
69
+ CAIRO_VERSION_MAJOR, \
70
+ CAIRO_VERSION_MINOR, \
71
+ CAIRO_VERSION_MICRO)
72
+
73
+
74
+ #define CAIRO_VERSION_STRINGIZE_(major, minor, micro) \
75
+ #major"."#minor"."#micro
76
+ #define CAIRO_VERSION_STRINGIZE(major, minor, micro) \
77
+ CAIRO_VERSION_STRINGIZE_(major, minor, micro)
78
+
79
+ #define CAIRO_VERSION_STRING CAIRO_VERSION_STRINGIZE( \
80
+ CAIRO_VERSION_MAJOR, \
81
+ CAIRO_VERSION_MINOR, \
82
+ CAIRO_VERSION_MICRO)
83
+
84
+
85
+ cairo_public int
86
+ cairo_version (void);
87
+
88
+ cairo_public const char*
89
+ cairo_version_string (void);
90
+
91
+ /**
92
+ * cairo_bool_t:
93
+ *
94
+ * #cairo_bool_t is used for boolean values. Returns of type
95
+ * #cairo_bool_t will always be either 0 or 1, but testing against
96
+ * these values explicitly is not encouraged; just use the
97
+ * value as a boolean condition.
98
+ *
99
+ * <informalexample><programlisting>
100
+ * if (cairo_in_stroke (cr, x, y)) {
101
+ * /<!-- -->* do something *<!-- -->/
102
+ * }
103
+ * </programlisting></informalexample>
104
+ **/
105
+ typedef int cairo_bool_t;
106
+
107
+ /**
108
+ * cairo_t:
109
+ *
110
+ * A #cairo_t contains the current state of the rendering device,
111
+ * including coordinates of yet to be drawn shapes.
112
+ *
113
+ * Cairo contexts, as #cairo_t objects are named, are central to
114
+ * cairo and all drawing with cairo is always done to a #cairo_t
115
+ * object.
116
+ *
117
+ * Memory management of #cairo_t is done with
118
+ * cairo_reference() and cairo_destroy().
119
+ **/
120
+ typedef struct _cairo cairo_t;
121
+
122
+ /**
123
+ * cairo_surface_t:
124
+ *
125
+ * A #cairo_surface_t represents an image, either as the destination
126
+ * of a drawing operation or as source when drawing onto another
127
+ * surface. To draw to a #cairo_surface_t, create a cairo context
128
+ * with the surface as the target, using cairo_create().
129
+ *
130
+ * There are different subtypes of #cairo_surface_t for
131
+ * different drawing backends; for example, cairo_image_surface_create()
132
+ * creates a bitmap image in memory.
133
+ * The type of a surface can be queried with cairo_surface_get_type().
134
+ *
135
+ * Memory management of #cairo_surface_t is done with
136
+ * cairo_surface_reference() and cairo_surface_destroy().
137
+ **/
138
+ typedef struct _cairo_surface cairo_surface_t;
139
+
140
+ /**
141
+ * cairo_matrix_t:
142
+ * @xx: xx component of the affine transformation
143
+ * @yx: yx component of the affine transformation
144
+ * @xy: xy component of the affine transformation
145
+ * @yy: yy component of the affine transformation
146
+ * @x0: X translation component of the affine transformation
147
+ * @y0: Y translation component of the affine transformation
148
+ *
149
+ * A #cairo_matrix_t holds an affine transformation, such as a scale,
150
+ * rotation, shear, or a combination of those. The transformation of
151
+ * a point (x, y) is given by:
152
+ * <programlisting>
153
+ * x_new = xx * x + xy * y + x0;
154
+ * y_new = yx * x + yy * y + y0;
155
+ * </programlisting>
156
+ **/
157
+ typedef struct _cairo_matrix {
158
+ double xx; double yx;
159
+ double xy; double yy;
160
+ double x0; double y0;
161
+ } cairo_matrix_t;
162
+
163
+ /**
164
+ * cairo_pattern_t:
165
+ *
166
+ * A #cairo_pattern_t represents a source when drawing onto a
167
+ * surface. There are different subtypes of #cairo_pattern_t,
168
+ * for different types of sources; for example,
169
+ * cairo_pattern_create_rgb() creates a pattern for a solid
170
+ * opaque color.
171
+ *
172
+ * Other than various cairo_pattern_create_<emphasis>type</emphasis>()
173
+ * functions, some of the pattern types can be implicitly created
174
+ * using various cairo_set_source_<emphasis>type</emphasis>() functions;
175
+ * for example cairo_set_source_rgb().
176
+ *
177
+ * The type of a pattern can be queried with cairo_pattern_get_type().
178
+ *
179
+ * Memory management of #cairo_pattern_t is done with
180
+ * cairo_pattern_reference() and cairo_pattern_destroy().
181
+ **/
182
+ typedef struct _cairo_pattern cairo_pattern_t;
183
+
184
+ /**
185
+ * cairo_destroy_func_t:
186
+ * @data: The data element being destroyed.
187
+ *
188
+ * #cairo_destroy_func_t the type of function which is called when a
189
+ * data element is destroyed. It is passed the pointer to the data
190
+ * element and should free any memory and resources allocated for it.
191
+ **/
192
+ typedef void (*cairo_destroy_func_t) (void *data);
193
+
194
+ /**
195
+ * cairo_user_data_key_t:
196
+ * @unused: not used; ignore.
197
+ *
198
+ * #cairo_user_data_key_t is used for attaching user data to cairo
199
+ * data structures. The actual contents of the struct is never used,
200
+ * and there is no need to initialize the object; only the unique
201
+ * address of a #cairo_data_key_t object is used. Typically, you
202
+ * would just use the address of a static #cairo_data_key_t object.
203
+ **/
204
+ typedef struct _cairo_user_data_key {
205
+ int unused;
206
+ } cairo_user_data_key_t;
207
+
208
+ /**
209
+ * cairo_status_t:
210
+ * @CAIRO_STATUS_SUCCESS: no error has occurred
211
+ * @CAIRO_STATUS_NO_MEMORY: out of memory
212
+ * @CAIRO_STATUS_INVALID_RESTORE: cairo_restore() called without matching cairo_save()
213
+ * @CAIRO_STATUS_INVALID_POP_GROUP: no saved group to pop
214
+ * @CAIRO_STATUS_NO_CURRENT_POINT: no current point defined
215
+ * @CAIRO_STATUS_INVALID_MATRIX: invalid matrix (not invertible)
216
+ * @CAIRO_STATUS_INVALID_STATUS: invalid value for an input #cairo_status_t
217
+ * @CAIRO_STATUS_NULL_POINTER: %NULL pointer
218
+ * @CAIRO_STATUS_INVALID_STRING: input string not valid UTF-8
219
+ * @CAIRO_STATUS_INVALID_PATH_DATA: input path data not valid
220
+ * @CAIRO_STATUS_READ_ERROR: error while reading from input stream
221
+ * @CAIRO_STATUS_WRITE_ERROR: error while writing to output stream
222
+ * @CAIRO_STATUS_SURFACE_FINISHED: target surface has been finished
223
+ * @CAIRO_STATUS_SURFACE_TYPE_MISMATCH: the surface type is not appropriate for the operation
224
+ * @CAIRO_STATUS_PATTERN_TYPE_MISMATCH: the pattern type is not appropriate for the operation
225
+ * @CAIRO_STATUS_INVALID_CONTENT: invalid value for an input #cairo_content_t
226
+ * @CAIRO_STATUS_INVALID_FORMAT: invalid value for an input #cairo_format_t
227
+ * @CAIRO_STATUS_INVALID_VISUAL: invalid value for an input Visual*
228
+ * @CAIRO_STATUS_FILE_NOT_FOUND: file not found
229
+ * @CAIRO_STATUS_INVALID_DASH: invalid value for a dash setting
230
+ * @CAIRO_STATUS_INVALID_DSC_COMMENT: invalid value for a DSC comment (Since 1.2)
231
+ * @CAIRO_STATUS_INVALID_INDEX: invalid index passed to getter (Since 1.4)
232
+ * @CAIRO_STATUS_CLIP_NOT_REPRESENTABLE: clip region not representable in desired format (Since 1.4)
233
+ * @CAIRO_STATUS_TEMP_FILE_ERROR: error creating or writing to a temporary file (Since 1.6)
234
+ * @CAIRO_STATUS_INVALID_STRIDE: invalid value for stride (Since 1.6)
235
+ * @CAIRO_STATUS_FONT_TYPE_MISMATCH: the font type is not appropriate for the operation (Since 1.8)
236
+ * @CAIRO_STATUS_USER_FONT_IMMUTABLE: the user-font is immutable (Since 1.8)
237
+ * @CAIRO_STATUS_USER_FONT_ERROR: error occurred in a user-font callback function (Since 1.8)
238
+ * @CAIRO_STATUS_NEGATIVE_COUNT: negative number used where it is not allowed (Since 1.8)
239
+ * @CAIRO_STATUS_INVALID_CLUSTERS: input clusters do not represent the accompanying text and glyph array (Since 1.8)
240
+ * @CAIRO_STATUS_INVALID_SLANT: invalid value for an input #cairo_font_slant_t (Since 1.8)
241
+ * @CAIRO_STATUS_INVALID_WEIGHT: invalid value for an input #cairo_font_weight_t (Since 1.8)
242
+ *
243
+ * #cairo_status_t is used to indicate errors that can occur when
244
+ * using Cairo. In some cases it is returned directly by functions.
245
+ * but when using #cairo_t, the last error, if any, is stored in
246
+ * the context and can be retrieved with cairo_status().
247
+ *
248
+ * New entries may be added in future versions. Use cairo_status_to_string()
249
+ * to get a human-readable representation of an error message.
250
+ **/
251
+ typedef enum _cairo_status {
252
+ CAIRO_STATUS_SUCCESS = 0,
253
+ CAIRO_STATUS_NO_MEMORY,
254
+ CAIRO_STATUS_INVALID_RESTORE,
255
+ CAIRO_STATUS_INVALID_POP_GROUP,
256
+ CAIRO_STATUS_NO_CURRENT_POINT,
257
+ CAIRO_STATUS_INVALID_MATRIX,
258
+ CAIRO_STATUS_INVALID_STATUS,
259
+ CAIRO_STATUS_NULL_POINTER,
260
+ CAIRO_STATUS_INVALID_STRING,
261
+ CAIRO_STATUS_INVALID_PATH_DATA,
262
+ CAIRO_STATUS_READ_ERROR,
263
+ CAIRO_STATUS_WRITE_ERROR,
264
+ CAIRO_STATUS_SURFACE_FINISHED,
265
+ CAIRO_STATUS_SURFACE_TYPE_MISMATCH,
266
+ CAIRO_STATUS_PATTERN_TYPE_MISMATCH,
267
+ CAIRO_STATUS_INVALID_CONTENT,
268
+ CAIRO_STATUS_INVALID_FORMAT,
269
+ CAIRO_STATUS_INVALID_VISUAL,
270
+ CAIRO_STATUS_FILE_NOT_FOUND,
271
+ CAIRO_STATUS_INVALID_DASH,
272
+ CAIRO_STATUS_INVALID_DSC_COMMENT,
273
+ CAIRO_STATUS_INVALID_INDEX,
274
+ CAIRO_STATUS_CLIP_NOT_REPRESENTABLE,
275
+ CAIRO_STATUS_TEMP_FILE_ERROR,
276
+ CAIRO_STATUS_INVALID_STRIDE,
277
+ CAIRO_STATUS_FONT_TYPE_MISMATCH,
278
+ CAIRO_STATUS_USER_FONT_IMMUTABLE,
279
+ CAIRO_STATUS_USER_FONT_ERROR,
280
+ CAIRO_STATUS_NEGATIVE_COUNT,
281
+ CAIRO_STATUS_INVALID_CLUSTERS,
282
+ CAIRO_STATUS_INVALID_SLANT,
283
+ CAIRO_STATUS_INVALID_WEIGHT
284
+ /* after adding a new error: update CAIRO_STATUS_LAST_STATUS in cairoint.h */
285
+ } cairo_status_t;
286
+
287
+ /**
288
+ * cairo_content_t:
289
+ * @CAIRO_CONTENT_COLOR: The surface will hold color content only.
290
+ * @CAIRO_CONTENT_ALPHA: The surface will hold alpha content only.
291
+ * @CAIRO_CONTENT_COLOR_ALPHA: The surface will hold color and alpha content.
292
+ *
293
+ * #cairo_content_t is used to describe the content that a surface will
294
+ * contain, whether color information, alpha information (translucence
295
+ * vs. opacity), or both.
296
+ *
297
+ * Note: The large values here are designed to keep #cairo_content_t
298
+ * values distinct from #cairo_format_t values so that the
299
+ * implementation can detect the error if users confuse the two types.
300
+ **/
301
+ typedef enum _cairo_content {
302
+ CAIRO_CONTENT_COLOR = 0x1000,
303
+ CAIRO_CONTENT_ALPHA = 0x2000,
304
+ CAIRO_CONTENT_COLOR_ALPHA = 0x3000
305
+ } cairo_content_t;
306
+
307
+ /**
308
+ * cairo_write_func_t:
309
+ * @closure: the output closure
310
+ * @data: the buffer containing the data to write
311
+ * @length: the amount of data to write
312
+ *
313
+ * #cairo_write_func_t is the type of function which is called when a
314
+ * backend needs to write data to an output stream. It is passed the
315
+ * closure which was specified by the user at the time the write
316
+ * function was registered, the data to write and the length of the
317
+ * data in bytes. The write function should return
318
+ * %CAIRO_STATUS_SUCCESS if all the data was successfully written,
319
+ * %CAIRO_STATUS_WRITE_ERROR otherwise.
320
+ *
321
+ * Returns: the status code of the write operation
322
+ **/
323
+ typedef cairo_status_t (*cairo_write_func_t) (void *closure,
324
+ const unsigned char *data,
325
+ unsigned int length);
326
+
327
+ /**
328
+ * cairo_read_func_t:
329
+ * @closure: the input closure
330
+ * @data: the buffer into which to read the data
331
+ * @length: the amount of data to read
332
+ *
333
+ * #cairo_read_func_t is the type of function which is called when a
334
+ * backend needs to read data from an input stream. It is passed the
335
+ * closure which was specified by the user at the time the read
336
+ * function was registered, the buffer to read the data into and the
337
+ * length of the data in bytes. The read function should return
338
+ * %CAIRO_STATUS_SUCCESS if all the data was successfully read,
339
+ * %CAIRO_STATUS_READ_ERROR otherwise.
340
+ *
341
+ * Returns: the status code of the read operation
342
+ **/
343
+ typedef cairo_status_t (*cairo_read_func_t) (void *closure,
344
+ unsigned char *data,
345
+ unsigned int length);
346
+
347
+ /* Functions for manipulating state objects */
348
+ cairo_public cairo_t *
349
+ cairo_create (cairo_surface_t *target);
350
+
351
+ cairo_public cairo_t *
352
+ cairo_reference (cairo_t *cr);
353
+
354
+ cairo_public void
355
+ cairo_destroy (cairo_t *cr);
356
+
357
+ cairo_public unsigned int
358
+ cairo_get_reference_count (cairo_t *cr);
359
+
360
+ cairo_public void *
361
+ cairo_get_user_data (cairo_t *cr,
362
+ const cairo_user_data_key_t *key);
363
+
364
+ cairo_public cairo_status_t
365
+ cairo_set_user_data (cairo_t *cr,
366
+ const cairo_user_data_key_t *key,
367
+ void *user_data,
368
+ cairo_destroy_func_t destroy);
369
+
370
+ cairo_public void
371
+ cairo_save (cairo_t *cr);
372
+
373
+ cairo_public void
374
+ cairo_restore (cairo_t *cr);
375
+
376
+ cairo_public void
377
+ cairo_push_group (cairo_t *cr);
378
+
379
+ cairo_public void
380
+ cairo_push_group_with_content (cairo_t *cr, cairo_content_t content);
381
+
382
+ cairo_public cairo_pattern_t *
383
+ cairo_pop_group (cairo_t *cr);
384
+
385
+ cairo_public void
386
+ cairo_pop_group_to_source (cairo_t *cr);
387
+
388
+ /* Modify state */
389
+
390
+ /**
391
+ * cairo_operator_t:
392
+ * @CAIRO_OPERATOR_CLEAR: clear destination layer (bounded)
393
+ * @CAIRO_OPERATOR_SOURCE: replace destination layer (bounded)
394
+ * @CAIRO_OPERATOR_OVER: draw source layer on top of destination layer
395
+ * (bounded)
396
+ * @CAIRO_OPERATOR_IN: draw source where there was destination content
397
+ * (unbounded)
398
+ * @CAIRO_OPERATOR_OUT: draw source where there was no destination
399
+ * content (unbounded)
400
+ * @CAIRO_OPERATOR_ATOP: draw source on top of destination content and
401
+ * only there
402
+ * @CAIRO_OPERATOR_DEST: ignore the source
403
+ * @CAIRO_OPERATOR_DEST_OVER: draw destination on top of source
404
+ * @CAIRO_OPERATOR_DEST_IN: leave destination only where there was
405
+ * source content (unbounded)
406
+ * @CAIRO_OPERATOR_DEST_OUT: leave destination only where there was no
407
+ * source content
408
+ * @CAIRO_OPERATOR_DEST_ATOP: leave destination on top of source content
409
+ * and only there (unbounded)
410
+ * @CAIRO_OPERATOR_XOR: source and destination are shown where there is only
411
+ * one of them
412
+ * @CAIRO_OPERATOR_ADD: source and destination layers are accumulated
413
+ * @CAIRO_OPERATOR_SATURATE: like over, but assuming source and dest are
414
+ * disjoint geometries
415
+ *
416
+ * #cairo_operator_t is used to set the compositing operator for all cairo
417
+ * drawing operations.
418
+ *
419
+ * The default operator is %CAIRO_OPERATOR_OVER.
420
+ *
421
+ * The operators marked as <firstterm>unbounded</firstterm> modify their
422
+ * destination even outside of the mask layer (that is, their effect is not
423
+ * bound by the mask layer). However, their effect can still be limited by
424
+ * way of clipping.
425
+ *
426
+ * To keep things simple, the operator descriptions here
427
+ * document the behavior for when both source and destination are either fully
428
+ * transparent or fully opaque. The actual implementation works for
429
+ * translucent layers too.
430
+ * For a more detailed explanation of the effects of each operator, including
431
+ * the mathematical definitions, see
432
+ * <ulink url="http://cairographics.org/operators/">http://cairographics.org/operators/</ulink>.
433
+ **/
434
+ typedef enum _cairo_operator {
435
+ CAIRO_OPERATOR_CLEAR,
436
+
437
+ CAIRO_OPERATOR_SOURCE,
438
+ CAIRO_OPERATOR_OVER,
439
+ CAIRO_OPERATOR_IN,
440
+ CAIRO_OPERATOR_OUT,
441
+ CAIRO_OPERATOR_ATOP,
442
+
443
+ CAIRO_OPERATOR_DEST,
444
+ CAIRO_OPERATOR_DEST_OVER,
445
+ CAIRO_OPERATOR_DEST_IN,
446
+ CAIRO_OPERATOR_DEST_OUT,
447
+ CAIRO_OPERATOR_DEST_ATOP,
448
+
449
+ CAIRO_OPERATOR_XOR,
450
+ CAIRO_OPERATOR_ADD,
451
+ CAIRO_OPERATOR_SATURATE
452
+ } cairo_operator_t;
453
+
454
+ cairo_public void
455
+ cairo_set_operator (cairo_t *cr, cairo_operator_t op);
456
+
457
+ cairo_public void
458
+ cairo_set_source (cairo_t *cr, cairo_pattern_t *source);
459
+
460
+ cairo_public void
461
+ cairo_set_source_rgb (cairo_t *cr, double red, double green, double blue);
462
+
463
+ cairo_public void
464
+ cairo_set_source_rgba (cairo_t *cr,
465
+ double red, double green, double blue,
466
+ double alpha);
467
+
468
+ cairo_public void
469
+ cairo_set_source_surface (cairo_t *cr,
470
+ cairo_surface_t *surface,
471
+ double x,
472
+ double y);
473
+
474
+ cairo_public void
475
+ cairo_set_tolerance (cairo_t *cr, double tolerance);
476
+
477
+ /**
478
+ * cairo_antialias_t:
479
+ * @CAIRO_ANTIALIAS_DEFAULT: Use the default antialiasing for
480
+ * the subsystem and target device
481
+ * @CAIRO_ANTIALIAS_NONE: Use a bilevel alpha mask
482
+ * @CAIRO_ANTIALIAS_GRAY: Perform single-color antialiasing (using
483
+ * shades of gray for black text on a white background, for example).
484
+ * @CAIRO_ANTIALIAS_SUBPIXEL: Perform antialiasing by taking
485
+ * advantage of the order of subpixel elements on devices
486
+ * such as LCD panels
487
+ *
488
+ * Specifies the type of antialiasing to do when rendering text or shapes.
489
+ **/
490
+ typedef enum _cairo_antialias {
491
+ CAIRO_ANTIALIAS_DEFAULT,
492
+ CAIRO_ANTIALIAS_NONE,
493
+ CAIRO_ANTIALIAS_GRAY,
494
+ CAIRO_ANTIALIAS_SUBPIXEL
495
+ } cairo_antialias_t;
496
+
497
+ cairo_public void
498
+ cairo_set_antialias (cairo_t *cr, cairo_antialias_t antialias);
499
+
500
+ /**
501
+ * cairo_fill_rule_t:
502
+ * @CAIRO_FILL_RULE_WINDING: If the path crosses the ray from
503
+ * left-to-right, counts +1. If the path crosses the ray
504
+ * from right to left, counts -1. (Left and right are determined
505
+ * from the perspective of looking along the ray from the starting
506
+ * point.) If the total count is non-zero, the point will be filled.
507
+ * @CAIRO_FILL_RULE_EVEN_ODD: Counts the total number of
508
+ * intersections, without regard to the orientation of the contour. If
509
+ * the total number of intersections is odd, the point will be
510
+ * filled.
511
+ *
512
+ * #cairo_fill_rule_t is used to select how paths are filled. For both
513
+ * fill rules, whether or not a point is included in the fill is
514
+ * determined by taking a ray from that point to infinity and looking
515
+ * at intersections with the path. The ray can be in any direction,
516
+ * as long as it doesn't pass through the end point of a segment
517
+ * or have a tricky intersection such as intersecting tangent to the path.
518
+ * (Note that filling is not actually implemented in this way. This
519
+ * is just a description of the rule that is applied.)
520
+ *
521
+ * The default fill rule is %CAIRO_FILL_RULE_WINDING.
522
+ *
523
+ * New entries may be added in future versions.
524
+ **/
525
+ typedef enum _cairo_fill_rule {
526
+ CAIRO_FILL_RULE_WINDING,
527
+ CAIRO_FILL_RULE_EVEN_ODD
528
+ } cairo_fill_rule_t;
529
+
530
+ cairo_public void
531
+ cairo_set_fill_rule (cairo_t *cr, cairo_fill_rule_t fill_rule);
532
+
533
+ cairo_public void
534
+ cairo_set_line_width (cairo_t *cr, double width);
535
+
536
+ /**
537
+ * cairo_line_cap_t:
538
+ * @CAIRO_LINE_CAP_BUTT: start(stop) the line exactly at the start(end) point
539
+ * @CAIRO_LINE_CAP_ROUND: use a round ending, the center of the circle is the end point
540
+ * @CAIRO_LINE_CAP_SQUARE: use squared ending, the center of the square is the end point
541
+ *
542
+ * Specifies how to render the endpoints of the path when stroking.
543
+ *
544
+ * The default line cap style is %CAIRO_LINE_CAP_BUTT.
545
+ **/
546
+ typedef enum _cairo_line_cap {
547
+ CAIRO_LINE_CAP_BUTT,
548
+ CAIRO_LINE_CAP_ROUND,
549
+ CAIRO_LINE_CAP_SQUARE
550
+ } cairo_line_cap_t;
551
+
552
+ cairo_public void
553
+ cairo_set_line_cap (cairo_t *cr, cairo_line_cap_t line_cap);
554
+
555
+ /**
556
+ * cairo_line_join_t:
557
+ * @CAIRO_LINE_JOIN_MITER: use a sharp (angled) corner, see
558
+ * cairo_set_miter_limit()
559
+ * @CAIRO_LINE_JOIN_ROUND: use a rounded join, the center of the circle is the
560
+ * joint point
561
+ * @CAIRO_LINE_JOIN_BEVEL: use a cut-off join, the join is cut off at half
562
+ * the line width from the joint point
563
+ *
564
+ * Specifies how to render the junction of two lines when stroking.
565
+ *
566
+ * The default line join style is %CAIRO_LINE_JOIN_MITER.
567
+ **/
568
+ typedef enum _cairo_line_join {
569
+ CAIRO_LINE_JOIN_MITER,
570
+ CAIRO_LINE_JOIN_ROUND,
571
+ CAIRO_LINE_JOIN_BEVEL
572
+ } cairo_line_join_t;
573
+
574
+ cairo_public void
575
+ cairo_set_line_join (cairo_t *cr, cairo_line_join_t line_join);
576
+
577
+ cairo_public void
578
+ cairo_set_dash (cairo_t *cr,
579
+ const double *dashes,
580
+ int num_dashes,
581
+ double offset);
582
+
583
+ cairo_public void
584
+ cairo_set_miter_limit (cairo_t *cr, double limit);
585
+
586
+ cairo_public void
587
+ cairo_translate (cairo_t *cr, double tx, double ty);
588
+
589
+ cairo_public void
590
+ cairo_scale (cairo_t *cr, double sx, double sy);
591
+
592
+ cairo_public void
593
+ cairo_rotate (cairo_t *cr, double angle);
594
+
595
+ cairo_public void
596
+ cairo_transform (cairo_t *cr,
597
+ const cairo_matrix_t *matrix);
598
+
599
+ cairo_public void
600
+ cairo_set_matrix (cairo_t *cr,
601
+ const cairo_matrix_t *matrix);
602
+
603
+ cairo_public void
604
+ cairo_identity_matrix (cairo_t *cr);
605
+
606
+ cairo_public void
607
+ cairo_user_to_device (cairo_t *cr, double *x, double *y);
608
+
609
+ cairo_public void
610
+ cairo_user_to_device_distance (cairo_t *cr, double *dx, double *dy);
611
+
612
+ cairo_public void
613
+ cairo_device_to_user (cairo_t *cr, double *x, double *y);
614
+
615
+ cairo_public void
616
+ cairo_device_to_user_distance (cairo_t *cr, double *dx, double *dy);
617
+
618
+ /* Path creation functions */
619
+ cairo_public void
620
+ cairo_new_path (cairo_t *cr);
621
+
622
+ cairo_public void
623
+ cairo_move_to (cairo_t *cr, double x, double y);
624
+
625
+ cairo_public void
626
+ cairo_new_sub_path (cairo_t *cr);
627
+
628
+ cairo_public void
629
+ cairo_line_to (cairo_t *cr, double x, double y);
630
+
631
+ cairo_public void
632
+ cairo_curve_to (cairo_t *cr,
633
+ double x1, double y1,
634
+ double x2, double y2,
635
+ double x3, double y3);
636
+
637
+ cairo_public void
638
+ cairo_arc (cairo_t *cr,
639
+ double xc, double yc,
640
+ double radius,
641
+ double angle1, double angle2);
642
+
643
+ cairo_public void
644
+ cairo_arc_negative (cairo_t *cr,
645
+ double xc, double yc,
646
+ double radius,
647
+ double angle1, double angle2);
648
+
649
+ /* XXX: NYI
650
+ cairo_public void
651
+ cairo_arc_to (cairo_t *cr,
652
+ double x1, double y1,
653
+ double x2, double y2,
654
+ double radius);
655
+ */
656
+
657
+ cairo_public void
658
+ cairo_rel_move_to (cairo_t *cr, double dx, double dy);
659
+
660
+ cairo_public void
661
+ cairo_rel_line_to (cairo_t *cr, double dx, double dy);
662
+
663
+ cairo_public void
664
+ cairo_rel_curve_to (cairo_t *cr,
665
+ double dx1, double dy1,
666
+ double dx2, double dy2,
667
+ double dx3, double dy3);
668
+
669
+ cairo_public void
670
+ cairo_rectangle (cairo_t *cr,
671
+ double x, double y,
672
+ double width, double height);
673
+
674
+ /* XXX: NYI
675
+ cairo_public void
676
+ cairo_stroke_to_path (cairo_t *cr);
677
+ */
678
+
679
+ cairo_public void
680
+ cairo_close_path (cairo_t *cr);
681
+
682
+ cairo_public void
683
+ cairo_path_extents (cairo_t *cr,
684
+ double *x1, double *y1,
685
+ double *x2, double *y2);
686
+
687
+ /* Painting functions */
688
+ cairo_public void
689
+ cairo_paint (cairo_t *cr);
690
+
691
+ cairo_public void
692
+ cairo_paint_with_alpha (cairo_t *cr,
693
+ double alpha);
694
+
695
+ cairo_public void
696
+ cairo_mask (cairo_t *cr,
697
+ cairo_pattern_t *pattern);
698
+
699
+ cairo_public void
700
+ cairo_mask_surface (cairo_t *cr,
701
+ cairo_surface_t *surface,
702
+ double surface_x,
703
+ double surface_y);
704
+
705
+ cairo_public void
706
+ cairo_stroke (cairo_t *cr);
707
+
708
+ cairo_public void
709
+ cairo_stroke_preserve (cairo_t *cr);
710
+
711
+ cairo_public void
712
+ cairo_fill (cairo_t *cr);
713
+
714
+ cairo_public void
715
+ cairo_fill_preserve (cairo_t *cr);
716
+
717
+ cairo_public void
718
+ cairo_copy_page (cairo_t *cr);
719
+
720
+ cairo_public void
721
+ cairo_show_page (cairo_t *cr);
722
+
723
+ /* Insideness testing */
724
+ cairo_public cairo_bool_t
725
+ cairo_in_stroke (cairo_t *cr, double x, double y);
726
+
727
+ cairo_public cairo_bool_t
728
+ cairo_in_fill (cairo_t *cr, double x, double y);
729
+
730
+ /* Rectangular extents */
731
+ cairo_public void
732
+ cairo_stroke_extents (cairo_t *cr,
733
+ double *x1, double *y1,
734
+ double *x2, double *y2);
735
+
736
+ cairo_public void
737
+ cairo_fill_extents (cairo_t *cr,
738
+ double *x1, double *y1,
739
+ double *x2, double *y2);
740
+
741
+ /* Clipping */
742
+ cairo_public void
743
+ cairo_reset_clip (cairo_t *cr);
744
+
745
+ cairo_public void
746
+ cairo_clip (cairo_t *cr);
747
+
748
+ cairo_public void
749
+ cairo_clip_preserve (cairo_t *cr);
750
+
751
+ cairo_public void
752
+ cairo_clip_extents (cairo_t *cr,
753
+ double *x1, double *y1,
754
+ double *x2, double *y2);
755
+
756
+ /**
757
+ * cairo_rectangle_t:
758
+ * @x: X coordinate of the left side of the rectangle
759
+ * @y: Y coordinate of the the top side of the rectangle
760
+ * @width: width of the rectangle
761
+ * @height: height of the rectangle
762
+ *
763
+ * A data structure for holding a rectangle.
764
+ *
765
+ * Since: 1.4
766
+ **/
767
+ typedef struct _cairo_rectangle {
768
+ double x, y, width, height;
769
+ } cairo_rectangle_t;
770
+
771
+ /**
772
+ * cairo_rectangle_list_t:
773
+ * @status: Error status of the rectangle list
774
+ * @rectangles: Array containing the rectangles
775
+ * @num_rectangles: Number of rectangles in this list
776
+ *
777
+ * A data structure for holding a dynamically allocated
778
+ * array of rectangles.
779
+ *
780
+ * Since: 1.4
781
+ **/
782
+ typedef struct _cairo_rectangle_list {
783
+ cairo_status_t status;
784
+ cairo_rectangle_t *rectangles;
785
+ int num_rectangles;
786
+ } cairo_rectangle_list_t;
787
+
788
+ cairo_public cairo_rectangle_list_t *
789
+ cairo_copy_clip_rectangle_list (cairo_t *cr);
790
+
791
+ cairo_public void
792
+ cairo_rectangle_list_destroy (cairo_rectangle_list_t *rectangle_list);
793
+
794
+ /* Font/Text functions */
795
+
796
+ /**
797
+ * cairo_scaled_font_t:
798
+ *
799
+ * A #cairo_scaled_font_t is a font scaled to a particular size and device
800
+ * resolution. A #cairo_scaled_font_t is most useful for low-level font
801
+ * usage where a library or application wants to cache a reference
802
+ * to a scaled font to speed up the computation of metrics.
803
+ *
804
+ * There are various types of scaled fonts, depending on the
805
+ * <firstterm>font backend</firstterm> they use. The type of a
806
+ * scaled font can be queried using cairo_scaled_font_get_type().
807
+ *
808
+ * Memory management of #cairo_scaled_font_t is done with
809
+ * cairo_scaled_font_reference() and cairo_scaled_font_destroy().
810
+ **/
811
+ typedef struct _cairo_scaled_font cairo_scaled_font_t;
812
+
813
+ /**
814
+ * cairo_font_face_t:
815
+ *
816
+ * A #cairo_font_face_t specifies all aspects of a font other
817
+ * than the size or font matrix (a font matrix is used to distort
818
+ * a font by sheering it or scaling it unequally in the two
819
+ * directions) . A font face can be set on a #cairo_t by using
820
+ * cairo_set_font_face(); the size and font matrix are set with
821
+ * cairo_set_font_size() and cairo_set_font_matrix().
822
+ *
823
+ * There are various types of font faces, depending on the
824
+ * <firstterm>font backend</firstterm> they use. The type of a
825
+ * font face can be queried using cairo_font_face_get_type().
826
+ *
827
+ * Memory management of #cairo_font_face_t is done with
828
+ * cairo_font_face_reference() and cairo_font_face_destroy().
829
+ **/
830
+ typedef struct _cairo_font_face cairo_font_face_t;
831
+
832
+ /**
833
+ * cairo_glyph_t:
834
+ * @index: glyph index in the font. The exact interpretation of the
835
+ * glyph index depends on the font technology being used.
836
+ * @x: the offset in the X direction between the origin used for
837
+ * drawing or measuring the string and the origin of this glyph.
838
+ * @y: the offset in the Y direction between the origin used for
839
+ * drawing or measuring the string and the origin of this glyph.
840
+ *
841
+ * The #cairo_glyph_t structure holds information about a single glyph
842
+ * when drawing or measuring text. A font is (in simple terms) a
843
+ * collection of shapes used to draw text. A glyph is one of these
844
+ * shapes. There can be multiple glyphs for a single character
845
+ * (alternates to be used in different contexts, for example), or a
846
+ * glyph can be a <firstterm>ligature</firstterm> of multiple
847
+ * characters. Cairo doesn't expose any way of converting input text
848
+ * into glyphs, so in order to use the Cairo interfaces that take
849
+ * arrays of glyphs, you must directly access the appropriate
850
+ * underlying font system.
851
+ *
852
+ * Note that the offsets given by @x and @y are not cumulative. When
853
+ * drawing or measuring text, each glyph is individually positioned
854
+ * with respect to the overall origin
855
+ **/
856
+ typedef struct {
857
+ unsigned long index;
858
+ double x;
859
+ double y;
860
+ } cairo_glyph_t;
861
+
862
+ cairo_public cairo_glyph_t *
863
+ cairo_glyph_allocate (int num_glyphs);
864
+
865
+ cairo_public void
866
+ cairo_glyph_free (cairo_glyph_t *glyphs);
867
+
868
+ /**
869
+ * cairo_text_cluster_t:
870
+ * @num_bytes: the number of bytes of UTF-8 text covered by cluster
871
+ * @num_glyphs: the number of glyphs covered by cluster
872
+ *
873
+ * The #cairo_text_cluster_t structure holds information about a single
874
+ * <firstterm>text cluster</firstterm>. A text cluster is a minimal
875
+ * mapping of some glyphs corresponding to some UTF-8 text.
876
+ *
877
+ * For a cluster to be valid, both @num_bytes and @num_glyphs should
878
+ * be non-negative, and at least one should be non-zero.
879
+ * Note that clusters with zero glyphs are not as well supported as
880
+ * normal clusters. For example, PDF rendering applications typically
881
+ * ignore those clusters when PDF text is being selected.
882
+ *
883
+ * See cairo_show_text_glyphs() for how clusters are used in advanced
884
+ * text operations.
885
+ *
886
+ * Since: 1.8
887
+ **/
888
+ typedef struct {
889
+ int num_bytes;
890
+ int num_glyphs;
891
+ } cairo_text_cluster_t;
892
+
893
+ cairo_public cairo_text_cluster_t *
894
+ cairo_text_cluster_allocate (int num_clusters);
895
+
896
+ cairo_public void
897
+ cairo_text_cluster_free (cairo_text_cluster_t *clusters);
898
+
899
+ /**
900
+ * cairo_text_cluster_flags_t:
901
+ * @CAIRO_TEXT_CLUSTER_FLAG_BACKWARD: The clusters in the cluster array
902
+ * map to glyphs in the glyph array from end to start.
903
+ *
904
+ * Specifies properties of a text cluster mapping.
905
+ *
906
+ * Since: 1.8
907
+ **/
908
+ typedef enum _cairo_text_cluster_flags {
909
+ CAIRO_TEXT_CLUSTER_FLAG_BACKWARD = 0x00000001
910
+ } cairo_text_cluster_flags_t;
911
+
912
+ /**
913
+ * cairo_text_extents_t:
914
+ * @x_bearing: the horizontal distance from the origin to the
915
+ * leftmost part of the glyphs as drawn. Positive if the
916
+ * glyphs lie entirely to the right of the origin.
917
+ * @y_bearing: the vertical distance from the origin to the
918
+ * topmost part of the glyphs as drawn. Positive only if the
919
+ * glyphs lie completely below the origin; will usually be
920
+ * negative.
921
+ * @width: width of the glyphs as drawn
922
+ * @height: height of the glyphs as drawn
923
+ * @x_advance:distance to advance in the X direction
924
+ * after drawing these glyphs
925
+ * @y_advance: distance to advance in the Y direction
926
+ * after drawing these glyphs. Will typically be zero except
927
+ * for vertical text layout as found in East-Asian languages.
928
+ *
929
+ * The #cairo_text_extents_t structure stores the extents of a single
930
+ * glyph or a string of glyphs in user-space coordinates. Because text
931
+ * extents are in user-space coordinates, they are mostly, but not
932
+ * entirely, independent of the current transformation matrix. If you call
933
+ * <literal>cairo_scale(cr, 2.0, 2.0)</literal>, text will
934
+ * be drawn twice as big, but the reported text extents will not be
935
+ * doubled. They will change slightly due to hinting (so you can't
936
+ * assume that metrics are independent of the transformation matrix),
937
+ * but otherwise will remain unchanged.
938
+ **/
939
+ typedef struct {
940
+ double x_bearing;
941
+ double y_bearing;
942
+ double width;
943
+ double height;
944
+ double x_advance;
945
+ double y_advance;
946
+ } cairo_text_extents_t;
947
+
948
+ /**
949
+ * cairo_font_extents_t:
950
+ * @ascent: the distance that the font extends above the baseline.
951
+ * Note that this is not always exactly equal to the maximum
952
+ * of the extents of all the glyphs in the font, but rather
953
+ * is picked to express the font designer's intent as to
954
+ * how the font should align with elements above it.
955
+ * @descent: the distance that the font extends below the baseline.
956
+ * This value is positive for typical fonts that include
957
+ * portions below the baseline. Note that this is not always
958
+ * exactly equal to the maximum of the extents of all the
959
+ * glyphs in the font, but rather is picked to express the
960
+ * font designer's intent as to how the the font should
961
+ * align with elements below it.
962
+ * @height: the recommended vertical distance between baselines when
963
+ * setting consecutive lines of text with the font. This
964
+ * is greater than @ascent+@descent by a
965
+ * quantity known as the <firstterm>line spacing</firstterm>
966
+ * or <firstterm>external leading</firstterm>. When space
967
+ * is at a premium, most fonts can be set with only
968
+ * a distance of @ascent+@descent between lines.
969
+ * @max_x_advance: the maximum distance in the X direction that
970
+ * the the origin is advanced for any glyph in the font.
971
+ * @max_y_advance: the maximum distance in the Y direction that
972
+ * the the origin is advanced for any glyph in the font.
973
+ * this will be zero for normal fonts used for horizontal
974
+ * writing. (The scripts of East Asia are sometimes written
975
+ * vertically.)
976
+ *
977
+ * The #cairo_font_extents_t structure stores metric information for
978
+ * a font. Values are given in the current user-space coordinate
979
+ * system.
980
+ *
981
+ * Because font metrics are in user-space coordinates, they are
982
+ * mostly, but not entirely, independent of the current transformation
983
+ * matrix. If you call <literal>cairo_scale(cr, 2.0, 2.0)</literal>,
984
+ * text will be drawn twice as big, but the reported text extents will
985
+ * not be doubled. They will change slightly due to hinting (so you
986
+ * can't assume that metrics are independent of the transformation
987
+ * matrix), but otherwise will remain unchanged.
988
+ **/
989
+ typedef struct {
990
+ double ascent;
991
+ double descent;
992
+ double height;
993
+ double max_x_advance;
994
+ double max_y_advance;
995
+ } cairo_font_extents_t;
996
+
997
+ /**
998
+ * cairo_font_slant_t:
999
+ * @CAIRO_FONT_SLANT_NORMAL: Upright font style
1000
+ * @CAIRO_FONT_SLANT_ITALIC: Italic font style
1001
+ * @CAIRO_FONT_SLANT_OBLIQUE: Oblique font style
1002
+ *
1003
+ * Specifies variants of a font face based on their slant.
1004
+ **/
1005
+ typedef enum _cairo_font_slant {
1006
+ CAIRO_FONT_SLANT_NORMAL,
1007
+ CAIRO_FONT_SLANT_ITALIC,
1008
+ CAIRO_FONT_SLANT_OBLIQUE
1009
+ } cairo_font_slant_t;
1010
+
1011
+ /**
1012
+ * cairo_font_weight_t:
1013
+ * @CAIRO_FONT_WEIGHT_NORMAL: Normal font weight
1014
+ * @CAIRO_FONT_WEIGHT_BOLD: Bold font weight
1015
+ *
1016
+ * Specifies variants of a font face based on their weight.
1017
+ **/
1018
+ typedef enum _cairo_font_weight {
1019
+ CAIRO_FONT_WEIGHT_NORMAL,
1020
+ CAIRO_FONT_WEIGHT_BOLD
1021
+ } cairo_font_weight_t;
1022
+
1023
+ /**
1024
+ * cairo_subpixel_order_t:
1025
+ * @CAIRO_SUBPIXEL_ORDER_DEFAULT: Use the default subpixel order for
1026
+ * for the target device
1027
+ * @CAIRO_SUBPIXEL_ORDER_RGB: Subpixel elements are arranged horizontally
1028
+ * with red at the left
1029
+ * @CAIRO_SUBPIXEL_ORDER_BGR: Subpixel elements are arranged horizontally
1030
+ * with blue at the left
1031
+ * @CAIRO_SUBPIXEL_ORDER_VRGB: Subpixel elements are arranged vertically
1032
+ * with red at the top
1033
+ * @CAIRO_SUBPIXEL_ORDER_VBGR: Subpixel elements are arranged vertically
1034
+ * with blue at the top
1035
+ *
1036
+ * The subpixel order specifies the order of color elements within
1037
+ * each pixel on the display device when rendering with an
1038
+ * antialiasing mode of %CAIRO_ANTIALIAS_SUBPIXEL.
1039
+ **/
1040
+ typedef enum _cairo_subpixel_order {
1041
+ CAIRO_SUBPIXEL_ORDER_DEFAULT,
1042
+ CAIRO_SUBPIXEL_ORDER_RGB,
1043
+ CAIRO_SUBPIXEL_ORDER_BGR,
1044
+ CAIRO_SUBPIXEL_ORDER_VRGB,
1045
+ CAIRO_SUBPIXEL_ORDER_VBGR
1046
+ } cairo_subpixel_order_t;
1047
+
1048
+ /**
1049
+ * cairo_hint_style_t:
1050
+ * @CAIRO_HINT_STYLE_DEFAULT: Use the default hint style for
1051
+ * font backend and target device
1052
+ * @CAIRO_HINT_STYLE_NONE: Do not hint outlines
1053
+ * @CAIRO_HINT_STYLE_SLIGHT: Hint outlines slightly to improve
1054
+ * contrast while retaining good fidelity to the original
1055
+ * shapes.
1056
+ * @CAIRO_HINT_STYLE_MEDIUM: Hint outlines with medium strength
1057
+ * giving a compromise between fidelity to the original shapes
1058
+ * and contrast
1059
+ * @CAIRO_HINT_STYLE_FULL: Hint outlines to maximize contrast
1060
+ *
1061
+ * Specifies the type of hinting to do on font outlines. Hinting
1062
+ * is the process of fitting outlines to the pixel grid in order
1063
+ * to improve the appearance of the result. Since hinting outlines
1064
+ * involves distorting them, it also reduces the faithfulness
1065
+ * to the original outline shapes. Not all of the outline hinting
1066
+ * styles are supported by all font backends.
1067
+ *
1068
+ * New entries may be added in future versions.
1069
+ **/
1070
+ typedef enum _cairo_hint_style {
1071
+ CAIRO_HINT_STYLE_DEFAULT,
1072
+ CAIRO_HINT_STYLE_NONE,
1073
+ CAIRO_HINT_STYLE_SLIGHT,
1074
+ CAIRO_HINT_STYLE_MEDIUM,
1075
+ CAIRO_HINT_STYLE_FULL
1076
+ } cairo_hint_style_t;
1077
+
1078
+ /**
1079
+ * cairo_hint_metrics_t:
1080
+ * @CAIRO_HINT_METRICS_DEFAULT: Hint metrics in the default
1081
+ * manner for the font backend and target device
1082
+ * @CAIRO_HINT_METRICS_OFF: Do not hint font metrics
1083
+ * @CAIRO_HINT_METRICS_ON: Hint font metrics
1084
+ *
1085
+ * Specifies whether to hint font metrics; hinting font metrics
1086
+ * means quantizing them so that they are integer values in
1087
+ * device space. Doing this improves the consistency of
1088
+ * letter and line spacing, however it also means that text
1089
+ * will be laid out differently at different zoom factors.
1090
+ **/
1091
+ typedef enum _cairo_hint_metrics {
1092
+ CAIRO_HINT_METRICS_DEFAULT,
1093
+ CAIRO_HINT_METRICS_OFF,
1094
+ CAIRO_HINT_METRICS_ON
1095
+ } cairo_hint_metrics_t;
1096
+
1097
+ /**
1098
+ * cairo_font_options_t:
1099
+ *
1100
+ * An opaque structure holding all options that are used when
1101
+ * rendering fonts.
1102
+ *
1103
+ * Individual features of a #cairo_font_options_t can be set or
1104
+ * accessed using functions named
1105
+ * cairo_font_options_set_<emphasis>feature_name</emphasis> and
1106
+ * cairo_font_options_get_<emphasis>feature_name</emphasis>, like
1107
+ * cairo_font_options_set_antialias() and
1108
+ * cairo_font_options_get_antialias().
1109
+ *
1110
+ * New features may be added to a #cairo_font_options_t in the
1111
+ * future. For this reason, cairo_font_options_copy(),
1112
+ * cairo_font_options_equal(), cairo_font_options_merge(), and
1113
+ * cairo_font_options_hash() should be used to copy, check
1114
+ * for equality, merge, or compute a hash value of
1115
+ * #cairo_font_options_t objects.
1116
+ **/
1117
+ typedef struct _cairo_font_options cairo_font_options_t;
1118
+
1119
+ cairo_public cairo_font_options_t *
1120
+ cairo_font_options_create (void);
1121
+
1122
+ cairo_public cairo_font_options_t *
1123
+ cairo_font_options_copy (const cairo_font_options_t *original);
1124
+
1125
+ cairo_public void
1126
+ cairo_font_options_destroy (cairo_font_options_t *options);
1127
+
1128
+ cairo_public cairo_status_t
1129
+ cairo_font_options_status (cairo_font_options_t *options);
1130
+
1131
+ cairo_public void
1132
+ cairo_font_options_merge (cairo_font_options_t *options,
1133
+ const cairo_font_options_t *other);
1134
+ cairo_public cairo_bool_t
1135
+ cairo_font_options_equal (const cairo_font_options_t *options,
1136
+ const cairo_font_options_t *other);
1137
+
1138
+ cairo_public unsigned long
1139
+ cairo_font_options_hash (const cairo_font_options_t *options);
1140
+
1141
+ cairo_public void
1142
+ cairo_font_options_set_antialias (cairo_font_options_t *options,
1143
+ cairo_antialias_t antialias);
1144
+ cairo_public cairo_antialias_t
1145
+ cairo_font_options_get_antialias (const cairo_font_options_t *options);
1146
+
1147
+ cairo_public void
1148
+ cairo_font_options_set_subpixel_order (cairo_font_options_t *options,
1149
+ cairo_subpixel_order_t subpixel_order);
1150
+ cairo_public cairo_subpixel_order_t
1151
+ cairo_font_options_get_subpixel_order (const cairo_font_options_t *options);
1152
+
1153
+ cairo_public void
1154
+ cairo_font_options_set_hint_style (cairo_font_options_t *options,
1155
+ cairo_hint_style_t hint_style);
1156
+ cairo_public cairo_hint_style_t
1157
+ cairo_font_options_get_hint_style (const cairo_font_options_t *options);
1158
+
1159
+ cairo_public void
1160
+ cairo_font_options_set_hint_metrics (cairo_font_options_t *options,
1161
+ cairo_hint_metrics_t hint_metrics);
1162
+ cairo_public cairo_hint_metrics_t
1163
+ cairo_font_options_get_hint_metrics (const cairo_font_options_t *options);
1164
+
1165
+ /* This interface is for dealing with text as text, not caring about the
1166
+ font object inside the the cairo_t. */
1167
+
1168
+ cairo_public void
1169
+ cairo_select_font_face (cairo_t *cr,
1170
+ const char *family,
1171
+ cairo_font_slant_t slant,
1172
+ cairo_font_weight_t weight);
1173
+
1174
+ cairo_public void
1175
+ cairo_set_font_size (cairo_t *cr, double size);
1176
+
1177
+ cairo_public void
1178
+ cairo_set_font_matrix (cairo_t *cr,
1179
+ const cairo_matrix_t *matrix);
1180
+
1181
+ cairo_public void
1182
+ cairo_get_font_matrix (cairo_t *cr,
1183
+ cairo_matrix_t *matrix);
1184
+
1185
+ cairo_public void
1186
+ cairo_set_font_options (cairo_t *cr,
1187
+ const cairo_font_options_t *options);
1188
+
1189
+ cairo_public void
1190
+ cairo_get_font_options (cairo_t *cr,
1191
+ cairo_font_options_t *options);
1192
+
1193
+ cairo_public void
1194
+ cairo_set_font_face (cairo_t *cr, cairo_font_face_t *font_face);
1195
+
1196
+ cairo_public cairo_font_face_t *
1197
+ cairo_get_font_face (cairo_t *cr);
1198
+
1199
+ cairo_public void
1200
+ cairo_set_scaled_font (cairo_t *cr,
1201
+ const cairo_scaled_font_t *scaled_font);
1202
+
1203
+ cairo_public cairo_scaled_font_t *
1204
+ cairo_get_scaled_font (cairo_t *cr);
1205
+
1206
+ cairo_public void
1207
+ cairo_show_text (cairo_t *cr, const char *utf8);
1208
+
1209
+ cairo_public void
1210
+ cairo_show_glyphs (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs);
1211
+
1212
+ cairo_public void
1213
+ cairo_show_text_glyphs (cairo_t *cr,
1214
+ const char *utf8,
1215
+ int utf8_len,
1216
+ const cairo_glyph_t *glyphs,
1217
+ int num_glyphs,
1218
+ const cairo_text_cluster_t *clusters,
1219
+ int num_clusters,
1220
+ cairo_text_cluster_flags_t cluster_flags);
1221
+
1222
+ cairo_public void
1223
+ cairo_text_path (cairo_t *cr, const char *utf8);
1224
+
1225
+ cairo_public void
1226
+ cairo_glyph_path (cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs);
1227
+
1228
+ cairo_public void
1229
+ cairo_text_extents (cairo_t *cr,
1230
+ const char *utf8,
1231
+ cairo_text_extents_t *extents);
1232
+
1233
+ cairo_public void
1234
+ cairo_glyph_extents (cairo_t *cr,
1235
+ const cairo_glyph_t *glyphs,
1236
+ int num_glyphs,
1237
+ cairo_text_extents_t *extents);
1238
+
1239
+ cairo_public void
1240
+ cairo_font_extents (cairo_t *cr,
1241
+ cairo_font_extents_t *extents);
1242
+
1243
+ /* Generic identifier for a font style */
1244
+
1245
+ cairo_public cairo_font_face_t *
1246
+ cairo_font_face_reference (cairo_font_face_t *font_face);
1247
+
1248
+ cairo_public void
1249
+ cairo_font_face_destroy (cairo_font_face_t *font_face);
1250
+
1251
+ cairo_public unsigned int
1252
+ cairo_font_face_get_reference_count (cairo_font_face_t *font_face);
1253
+
1254
+ cairo_public cairo_status_t
1255
+ cairo_font_face_status (cairo_font_face_t *font_face);
1256
+
1257
+
1258
+ /**
1259
+ * cairo_font_type_t:
1260
+ * @CAIRO_FONT_TYPE_TOY: The font was created using cairo's toy font api
1261
+ * @CAIRO_FONT_TYPE_FT: The font is of type FreeType
1262
+ * @CAIRO_FONT_TYPE_WIN32: The font is of type Win32
1263
+ * @CAIRO_FONT_TYPE_QUARTZ: The font is of type Quartz (Since: 1.6)
1264
+ * @CAIRO_FONT_TYPE_USER: The font was create using cairo's user font api (Since: 1.8)
1265
+ *
1266
+ * #cairo_font_type_t is used to describe the type of a given font
1267
+ * face or scaled font. The font types are also known as "font
1268
+ * backends" within cairo.
1269
+ *
1270
+ * The type of a font face is determined by the function used to
1271
+ * create it, which will generally be of the form
1272
+ * cairo_<emphasis>type</emphasis>_font_face_create(). The font face type can be queried
1273
+ * with cairo_font_face_get_type()
1274
+ *
1275
+ * The various #cairo_font_face_t functions can be used with a font face
1276
+ * of any type.
1277
+ *
1278
+ * The type of a scaled font is determined by the type of the font
1279
+ * face passed to cairo_scaled_font_create(). The scaled font type can
1280
+ * be queried with cairo_scaled_font_get_type()
1281
+ *
1282
+ * The various #cairo_scaled_font_t functions can be used with scaled
1283
+ * fonts of any type, but some font backends also provide
1284
+ * type-specific functions that must only be called with a scaled font
1285
+ * of the appropriate type. These functions have names that begin with
1286
+ * cairo_<emphasis>type</emphasis>_scaled_font() such as cairo_ft_scaled_font_lock_face().
1287
+ *
1288
+ * The behavior of calling a type-specific function with a scaled font
1289
+ * of the wrong type is undefined.
1290
+ *
1291
+ * New entries may be added in future versions.
1292
+ *
1293
+ * Since: 1.2
1294
+ **/
1295
+ typedef enum _cairo_font_type {
1296
+ CAIRO_FONT_TYPE_TOY,
1297
+ CAIRO_FONT_TYPE_FT,
1298
+ CAIRO_FONT_TYPE_WIN32,
1299
+ CAIRO_FONT_TYPE_QUARTZ,
1300
+ CAIRO_FONT_TYPE_USER
1301
+ } cairo_font_type_t;
1302
+
1303
+ cairo_public cairo_font_type_t
1304
+ cairo_font_face_get_type (cairo_font_face_t *font_face);
1305
+
1306
+ cairo_public void *
1307
+ cairo_font_face_get_user_data (cairo_font_face_t *font_face,
1308
+ const cairo_user_data_key_t *key);
1309
+
1310
+ cairo_public cairo_status_t
1311
+ cairo_font_face_set_user_data (cairo_font_face_t *font_face,
1312
+ const cairo_user_data_key_t *key,
1313
+ void *user_data,
1314
+ cairo_destroy_func_t destroy);
1315
+
1316
+ /* Portable interface to general font features. */
1317
+
1318
+ cairo_public cairo_scaled_font_t *
1319
+ cairo_scaled_font_create (cairo_font_face_t *font_face,
1320
+ const cairo_matrix_t *font_matrix,
1321
+ const cairo_matrix_t *ctm,
1322
+ const cairo_font_options_t *options);
1323
+
1324
+ cairo_public cairo_scaled_font_t *
1325
+ cairo_scaled_font_reference (cairo_scaled_font_t *scaled_font);
1326
+
1327
+ cairo_public void
1328
+ cairo_scaled_font_destroy (cairo_scaled_font_t *scaled_font);
1329
+
1330
+ cairo_public unsigned int
1331
+ cairo_scaled_font_get_reference_count (cairo_scaled_font_t *scaled_font);
1332
+
1333
+ cairo_public cairo_status_t
1334
+ cairo_scaled_font_status (cairo_scaled_font_t *scaled_font);
1335
+
1336
+ cairo_public cairo_font_type_t
1337
+ cairo_scaled_font_get_type (cairo_scaled_font_t *scaled_font);
1338
+
1339
+ cairo_public void *
1340
+ cairo_scaled_font_get_user_data (cairo_scaled_font_t *scaled_font,
1341
+ const cairo_user_data_key_t *key);
1342
+
1343
+ cairo_public cairo_status_t
1344
+ cairo_scaled_font_set_user_data (cairo_scaled_font_t *scaled_font,
1345
+ const cairo_user_data_key_t *key,
1346
+ void *user_data,
1347
+ cairo_destroy_func_t destroy);
1348
+
1349
+ cairo_public void
1350
+ cairo_scaled_font_extents (cairo_scaled_font_t *scaled_font,
1351
+ cairo_font_extents_t *extents);
1352
+
1353
+ cairo_public void
1354
+ cairo_scaled_font_text_extents (cairo_scaled_font_t *scaled_font,
1355
+ const char *utf8,
1356
+ cairo_text_extents_t *extents);
1357
+
1358
+ cairo_public void
1359
+ cairo_scaled_font_glyph_extents (cairo_scaled_font_t *scaled_font,
1360
+ const cairo_glyph_t *glyphs,
1361
+ int num_glyphs,
1362
+ cairo_text_extents_t *extents);
1363
+
1364
+ cairo_public cairo_status_t
1365
+ cairo_scaled_font_text_to_glyphs (cairo_scaled_font_t *scaled_font,
1366
+ double x,
1367
+ double y,
1368
+ const char *utf8,
1369
+ int utf8_len,
1370
+ cairo_glyph_t **glyphs,
1371
+ int *num_glyphs,
1372
+ cairo_text_cluster_t **clusters,
1373
+ int *num_clusters,
1374
+ cairo_text_cluster_flags_t *cluster_flags);
1375
+
1376
+ cairo_public cairo_font_face_t *
1377
+ cairo_scaled_font_get_font_face (cairo_scaled_font_t *scaled_font);
1378
+
1379
+ cairo_public void
1380
+ cairo_scaled_font_get_font_matrix (cairo_scaled_font_t *scaled_font,
1381
+ cairo_matrix_t *font_matrix);
1382
+
1383
+ cairo_public void
1384
+ cairo_scaled_font_get_ctm (cairo_scaled_font_t *scaled_font,
1385
+ cairo_matrix_t *ctm);
1386
+
1387
+ cairo_public void
1388
+ cairo_scaled_font_get_scale_matrix (cairo_scaled_font_t *scaled_font,
1389
+ cairo_matrix_t *scale_matrix);
1390
+
1391
+ cairo_public void
1392
+ cairo_scaled_font_get_font_options (cairo_scaled_font_t *scaled_font,
1393
+ cairo_font_options_t *options);
1394
+
1395
+
1396
+ /* Toy fonts */
1397
+
1398
+ cairo_public cairo_font_face_t *
1399
+ cairo_toy_font_face_create (const char *family,
1400
+ cairo_font_slant_t slant,
1401
+ cairo_font_weight_t weight);
1402
+
1403
+ cairo_public const char *
1404
+ cairo_toy_font_face_get_family (cairo_font_face_t *font_face);
1405
+
1406
+ cairo_public cairo_font_slant_t
1407
+ cairo_toy_font_face_get_slant (cairo_font_face_t *font_face);
1408
+
1409
+ cairo_public cairo_font_weight_t
1410
+ cairo_toy_font_face_get_weight (cairo_font_face_t *font_face);
1411
+
1412
+
1413
+ /* User fonts */
1414
+
1415
+ cairo_public cairo_font_face_t *
1416
+ cairo_user_font_face_create (void);
1417
+
1418
+ /* User-font method signatures */
1419
+
1420
+ /**
1421
+ * cairo_user_scaled_font_init_func_t:
1422
+ * @scaled_font: the scaled-font being created
1423
+ * @cr: a cairo context, in font space
1424
+ * @extents: font extents to fill in, in font space
1425
+ *
1426
+ * #cairo_user_scaled_font_init_func_t is the type of function which is
1427
+ * called when a scaled-font needs to be created for a user font-face.
1428
+ *
1429
+ * The cairo context @cr is not used by the caller, but is prepared in font
1430
+ * space, similar to what the cairo contexts passed to the render_glyph
1431
+ * method will look like. The callback can use this context for extents
1432
+ * computation for example. After the callback is called, @cr is checked
1433
+ * for any error status.
1434
+ *
1435
+ * The @extents argument is where the user font sets the font extents for
1436
+ * @scaled_font. It is in font space, which means that for most cases its
1437
+ * ascent and descent members should add to 1.0. @extents is preset to
1438
+ * hold a value of 1.0 for ascent, height, and max_x_advance, and 0.0 for
1439
+ * descent and max_y_advance members.
1440
+ *
1441
+ * The callback is optional. If not set, default font extents as described
1442
+ * in the previous paragraph will be used.
1443
+ *
1444
+ * Note that @scaled_font is not fully initialized at this
1445
+ * point and trying to use it for text operations in the callback will result
1446
+ * in deadlock.
1447
+ *
1448
+ * Returns: %CAIRO_STATUS_SUCCESS upon success, or
1449
+ * %CAIRO_STATUS_USER_FONT_ERROR or any other error status on error.
1450
+ *
1451
+ * Since: 1.8
1452
+ **/
1453
+ typedef cairo_status_t (*cairo_user_scaled_font_init_func_t) (cairo_scaled_font_t *scaled_font,
1454
+ cairo_t *cr,
1455
+ cairo_font_extents_t *extents);
1456
+
1457
+ /**
1458
+ * cairo_user_scaled_font_render_glyph_func_t:
1459
+ * @scaled_font: user scaled-font
1460
+ * @glyph: glyph code to render
1461
+ * @cr: cairo context to draw to, in font space
1462
+ * @extents: glyph extents to fill in, in font space
1463
+ *
1464
+ * #cairo_user_scaled_font_render_glyph_func_t is the type of function which
1465
+ * is called when a user scaled-font needs to render a glyph.
1466
+ *
1467
+ * The callback is mandatory, and expected to draw the glyph with code @glyph to
1468
+ * the cairo context @cr. @cr is prepared such that the glyph drawing is done in
1469
+ * font space. That is, the matrix set on @cr is the scale matrix of @scaled_font,
1470
+ * The @extents argument is where the user font sets the font extents for
1471
+ * @scaled_font. However, if user prefers to draw in user space, they can
1472
+ * achieve that by changing the matrix on @cr. All cairo rendering operations
1473
+ * to @cr are permitted, however, the result is undefined if any source other
1474
+ * than the default source on @cr is used. That means, glyph bitmaps should
1475
+ * be rendered using cairo_mask() instead of cairo_paint().
1476
+ *
1477
+ * Other non-default settings on @cr include a font size of 1.0 (given that
1478
+ * it is set up to be in font space), and font options corresponding to
1479
+ * @scaled_font.
1480
+ *
1481
+ * The @extents argument is preset to have <literal>x_bearing</literal>,
1482
+ * <literal>width</literal>, and <literal>y_advance</literal> of zero,
1483
+ * <literal>y_bearing</literal> set to <literal>-font_extents.ascent</literal>,
1484
+ * <literal>height</literal> to <literal>font_extents.ascent+font_extents.descent</literal>,
1485
+ * and <literal>x_advance</literal> to <literal>font_extents.max_x_advance</literal>.
1486
+ * The only field user needs to set in majority of cases is
1487
+ * <literal>x_advance</literal>.
1488
+ * If the <literal>width</literal> field is zero upon the callback returning
1489
+ * (which is its preset value), the glyph extents are automatically computed
1490
+ * based on the drawings done to @cr. This is in most cases exactly what the
1491
+ * desired behavior is. However, if for any reason the callback sets the
1492
+ * extents, it must be ink extents, and include the extents of all drawing
1493
+ * done to @cr in the callback.
1494
+ *
1495
+ * Returns: %CAIRO_STATUS_SUCCESS upon success, or
1496
+ * %CAIRO_STATUS_USER_FONT_ERROR or any other error status on error.
1497
+ *
1498
+ * Since: 1.8
1499
+ **/
1500
+ typedef cairo_status_t (*cairo_user_scaled_font_render_glyph_func_t) (cairo_scaled_font_t *scaled_font,
1501
+ unsigned long glyph,
1502
+ cairo_t *cr,
1503
+ cairo_text_extents_t *extents);
1504
+
1505
+ /**
1506
+ * cairo_user_scaled_font_text_to_glyphs_func_t:
1507
+ * @scaled_font: the scaled-font being created
1508
+ * @utf8: a string of text encoded in UTF-8
1509
+ * @utf8_len: length of @utf8 in bytes
1510
+ * @glyphs: pointer to array of glyphs to fill, in font space
1511
+ * @num_glyphs: pointer to number of glyphs
1512
+ * @clusters: pointer to array of cluster mapping information to fill, or %NULL
1513
+ * @num_clusters: pointer to number of clusters
1514
+ * @cluster_flags: pointer to location to store cluster flags corresponding to the
1515
+ * output @clusters
1516
+ *
1517
+ * #cairo_user_scaled_font_text_to_glyphs_func_t is the type of function which
1518
+ * is called to convert input text to an array of glyphs. This is used by the
1519
+ * cairo_show_text() operation.
1520
+ *
1521
+ * Using this callback the user-font has full control on glyphs and their
1522
+ * positions. That means, it allows for features like ligatures and kerning,
1523
+ * as well as complex <firstterm>shaping</firstterm> required for scripts like
1524
+ * Arabic and Indic.
1525
+ *
1526
+ * The @num_glyphs argument is preset to the number of glyph entries available
1527
+ * in the @glyphs buffer. If the @glyphs buffer is %NULL, the value of
1528
+ * @num_glyphs will be zero. If the provided glyph array is too short for
1529
+ * the conversion (or for convenience), a new glyph array may be allocated
1530
+ * using cairo_glyph_allocate() and placed in @glyphs. Upon return,
1531
+ * @num_glyphs should contain the number of generated glyphs. If the value
1532
+ * @glyphs points at has changed after the call, the caller will free the
1533
+ * allocated glyph array using cairo_glyph_free().
1534
+ * The callback should populate the glyph indices and positions (in font space)
1535
+ * assuming that the text is to be shown at the origin.
1536
+ *
1537
+ * If @clusters is not %NULL, @num_clusters and @cluster_flags are also
1538
+ * non-%NULL, and cluster mapping should be computed. The semantics of how
1539
+ * cluster array allocation works is similar to the glyph array. That is,
1540
+ * if @clusters initially points to a non-%NULL value, that array may be used
1541
+ * as a cluster buffer, and @num_clusters points to the number of cluster
1542
+ * entries available there. If the provided cluster array is too short for
1543
+ * the conversion (or for convenience), a new cluster array may be allocated
1544
+ * using cairo_text_cluster_allocate() and placed in @clusters. Upon return,
1545
+ * @num_clusters should contain the number of generated clusters.
1546
+ * If the value @clusters points at has changed after the call, the caller
1547
+ * will free the allocated cluster array using cairo_text_cluster_free().
1548
+ *
1549
+ * The callback is optional. If @num_glyphs is negative upon
1550
+ * the callback returning, the unicode_to_glyph callback
1551
+ * is tried. See #cairo_user_scaled_font_unicode_to_glyph_func_t.
1552
+ *
1553
+ * Note: While cairo does not impose any limitation on glyph indices,
1554
+ * some applications may assume that a glyph index fits in a 16-bit
1555
+ * unsigned integer. As such, it is advised that user-fonts keep their
1556
+ * glyphs in the 0 to 65535 range. Furthermore, some applications may
1557
+ * assume that glyph 0 is a special glyph-not-found glyph. User-fonts
1558
+ * are advised to use glyph 0 for such purposes and do not use that
1559
+ * glyph value for other purposes.
1560
+ *
1561
+ * Returns: %CAIRO_STATUS_SUCCESS upon success, or
1562
+ * %CAIRO_STATUS_USER_FONT_ERROR or any other error status on error.
1563
+ *
1564
+ * Since: 1.8
1565
+ **/
1566
+ typedef cairo_status_t (*cairo_user_scaled_font_text_to_glyphs_func_t) (cairo_scaled_font_t *scaled_font,
1567
+ const char *utf8,
1568
+ int utf8_len,
1569
+ cairo_glyph_t **glyphs,
1570
+ int *num_glyphs,
1571
+ cairo_text_cluster_t **clusters,
1572
+ int *num_clusters,
1573
+ cairo_text_cluster_flags_t *cluster_flags);
1574
+
1575
+ /**
1576
+ * cairo_user_scaled_font_unicode_to_glyph_func_t:
1577
+ * @scaled_font: the scaled-font being created
1578
+ * @unicode: input unicode character code-point
1579
+ * @glyph_index: output glyph index
1580
+ *
1581
+ * #cairo_user_scaled_font_unicode_to_glyph_func_t is the type of function which
1582
+ * is called to convert an input Unicode character to a single glyph.
1583
+ * This is used by the cairo_show_text() operation.
1584
+ *
1585
+ * This callback is used to provide the same functionality as the
1586
+ * text_to_glyphs callback does (see #cairo_user_scaled_font_text_to_glyphs_func_t)
1587
+ * but has much less control on the output,
1588
+ * in exchange for increased ease of use. The inherent assumption to using
1589
+ * this callback is that each character maps to one glyph, and that the
1590
+ * mapping is context independent. It also assumes that glyphs are positioned
1591
+ * according to their advance width. These mean no ligatures, kerning, or
1592
+ * complex scripts can be implemented using this callback.
1593
+ *
1594
+ * The callback is optional, and only used if text_to_glyphs callback is not
1595
+ * set or fails to return glyphs. If this callback is not set, an identity
1596
+ * mapping from Unicode code-points to glyph indices is assumed.
1597
+ *
1598
+ * Note: While cairo does not impose any limitation on glyph indices,
1599
+ * some applications may assume that a glyph index fits in a 16-bit
1600
+ * unsigned integer. As such, it is advised that user-fonts keep their
1601
+ * glyphs in the 0 to 65535 range. Furthermore, some applications may
1602
+ * assume that glyph 0 is a special glyph-not-found glyph. User-fonts
1603
+ * are advised to use glyph 0 for such purposes and do not use that
1604
+ * glyph value for other purposes.
1605
+ *
1606
+ * Returns: %CAIRO_STATUS_SUCCESS upon success, or
1607
+ * %CAIRO_STATUS_USER_FONT_ERROR or any other error status on error.
1608
+ *
1609
+ * Since: 1.8
1610
+ **/
1611
+ typedef cairo_status_t (*cairo_user_scaled_font_unicode_to_glyph_func_t) (cairo_scaled_font_t *scaled_font,
1612
+ unsigned long unicode,
1613
+ unsigned long *glyph_index);
1614
+
1615
+ /* User-font method setters */
1616
+
1617
+ cairo_public void
1618
+ cairo_user_font_face_set_init_func (cairo_font_face_t *font_face,
1619
+ cairo_user_scaled_font_init_func_t init_func);
1620
+
1621
+ cairo_public void
1622
+ cairo_user_font_face_set_render_glyph_func (cairo_font_face_t *font_face,
1623
+ cairo_user_scaled_font_render_glyph_func_t render_glyph_func);
1624
+
1625
+ cairo_public void
1626
+ cairo_user_font_face_set_text_to_glyphs_func (cairo_font_face_t *font_face,
1627
+ cairo_user_scaled_font_text_to_glyphs_func_t text_to_glyphs_func);
1628
+
1629
+ cairo_public void
1630
+ cairo_user_font_face_set_unicode_to_glyph_func (cairo_font_face_t *font_face,
1631
+ cairo_user_scaled_font_unicode_to_glyph_func_t unicode_to_glyph_func);
1632
+
1633
+ /* User-font method getters */
1634
+
1635
+ cairo_public cairo_user_scaled_font_init_func_t
1636
+ cairo_user_font_face_get_init_func (cairo_font_face_t *font_face);
1637
+
1638
+ cairo_public cairo_user_scaled_font_render_glyph_func_t
1639
+ cairo_user_font_face_get_render_glyph_func (cairo_font_face_t *font_face);
1640
+
1641
+ cairo_public cairo_user_scaled_font_text_to_glyphs_func_t
1642
+ cairo_user_font_face_get_text_to_glyphs_func (cairo_font_face_t *font_face);
1643
+
1644
+ cairo_public cairo_user_scaled_font_unicode_to_glyph_func_t
1645
+ cairo_user_font_face_get_unicode_to_glyph_func (cairo_font_face_t *font_face);
1646
+
1647
+
1648
+ /* Query functions */
1649
+
1650
+ cairo_public cairo_operator_t
1651
+ cairo_get_operator (cairo_t *cr);
1652
+
1653
+ cairo_public cairo_pattern_t *
1654
+ cairo_get_source (cairo_t *cr);
1655
+
1656
+ cairo_public double
1657
+ cairo_get_tolerance (cairo_t *cr);
1658
+
1659
+ cairo_public cairo_antialias_t
1660
+ cairo_get_antialias (cairo_t *cr);
1661
+
1662
+ cairo_public cairo_bool_t
1663
+ cairo_has_current_point (cairo_t *cr);
1664
+
1665
+ cairo_public void
1666
+ cairo_get_current_point (cairo_t *cr, double *x, double *y);
1667
+
1668
+ cairo_public cairo_fill_rule_t
1669
+ cairo_get_fill_rule (cairo_t *cr);
1670
+
1671
+ cairo_public double
1672
+ cairo_get_line_width (cairo_t *cr);
1673
+
1674
+ cairo_public cairo_line_cap_t
1675
+ cairo_get_line_cap (cairo_t *cr);
1676
+
1677
+ cairo_public cairo_line_join_t
1678
+ cairo_get_line_join (cairo_t *cr);
1679
+
1680
+ cairo_public double
1681
+ cairo_get_miter_limit (cairo_t *cr);
1682
+
1683
+ cairo_public int
1684
+ cairo_get_dash_count (cairo_t *cr);
1685
+
1686
+ cairo_public void
1687
+ cairo_get_dash (cairo_t *cr, double *dashes, double *offset);
1688
+
1689
+ cairo_public void
1690
+ cairo_get_matrix (cairo_t *cr, cairo_matrix_t *matrix);
1691
+
1692
+ cairo_public cairo_surface_t *
1693
+ cairo_get_target (cairo_t *cr);
1694
+
1695
+ cairo_public cairo_surface_t *
1696
+ cairo_get_group_target (cairo_t *cr);
1697
+
1698
+ /**
1699
+ * cairo_path_data_type_t:
1700
+ * @CAIRO_PATH_MOVE_TO: A move-to operation
1701
+ * @CAIRO_PATH_LINE_TO: A line-to operation
1702
+ * @CAIRO_PATH_CURVE_TO: A curve-to operation
1703
+ * @CAIRO_PATH_CLOSE_PATH: A close-path operation
1704
+ *
1705
+ * #cairo_path_data_t is used to describe the type of one portion
1706
+ * of a path when represented as a #cairo_path_t.
1707
+ * See #cairo_path_data_t for details.
1708
+ **/
1709
+ typedef enum _cairo_path_data_type {
1710
+ CAIRO_PATH_MOVE_TO,
1711
+ CAIRO_PATH_LINE_TO,
1712
+ CAIRO_PATH_CURVE_TO,
1713
+ CAIRO_PATH_CLOSE_PATH
1714
+ } cairo_path_data_type_t;
1715
+
1716
+ /**
1717
+ * cairo_path_data_t:
1718
+ *
1719
+ * #cairo_path_data_t is used to represent the path data inside a
1720
+ * #cairo_path_t.
1721
+ *
1722
+ * The data structure is designed to try to balance the demands of
1723
+ * efficiency and ease-of-use. A path is represented as an array of
1724
+ * #cairo_path_data_t, which is a union of headers and points.
1725
+ *
1726
+ * Each portion of the path is represented by one or more elements in
1727
+ * the array, (one header followed by 0 or more points). The length
1728
+ * value of the header is the number of array elements for the current
1729
+ * portion including the header, (ie. length == 1 + # of points), and
1730
+ * where the number of points for each element type is as follows:
1731
+ *
1732
+ * <programlisting>
1733
+ * %CAIRO_PATH_MOVE_TO: 1 point
1734
+ * %CAIRO_PATH_LINE_TO: 1 point
1735
+ * %CAIRO_PATH_CURVE_TO: 3 points
1736
+ * %CAIRO_PATH_CLOSE_PATH: 0 points
1737
+ * </programlisting>
1738
+ *
1739
+ * The semantics and ordering of the coordinate values are consistent
1740
+ * with cairo_move_to(), cairo_line_to(), cairo_curve_to(), and
1741
+ * cairo_close_path().
1742
+ *
1743
+ * Here is sample code for iterating through a #cairo_path_t:
1744
+ *
1745
+ * <informalexample><programlisting>
1746
+ * int i;
1747
+ * cairo_path_t *path;
1748
+ * cairo_path_data_t *data;
1749
+ * &nbsp;
1750
+ * path = cairo_copy_path (cr);
1751
+ * &nbsp;
1752
+ * for (i=0; i < path->num_data; i += path->data[i].header.length) {
1753
+ * data = &amp;path->data[i];
1754
+ * switch (data->header.type) {
1755
+ * case CAIRO_PATH_MOVE_TO:
1756
+ * do_move_to_things (data[1].point.x, data[1].point.y);
1757
+ * break;
1758
+ * case CAIRO_PATH_LINE_TO:
1759
+ * do_line_to_things (data[1].point.x, data[1].point.y);
1760
+ * break;
1761
+ * case CAIRO_PATH_CURVE_TO:
1762
+ * do_curve_to_things (data[1].point.x, data[1].point.y,
1763
+ * data[2].point.x, data[2].point.y,
1764
+ * data[3].point.x, data[3].point.y);
1765
+ * break;
1766
+ * case CAIRO_PATH_CLOSE_PATH:
1767
+ * do_close_path_things ();
1768
+ * break;
1769
+ * }
1770
+ * }
1771
+ * cairo_path_destroy (path);
1772
+ * </programlisting></informalexample>
1773
+ *
1774
+ * As of cairo 1.4, cairo does not mind if there are more elements in
1775
+ * a portion of the path than needed. Such elements can be used by
1776
+ * users of the cairo API to hold extra values in the path data
1777
+ * structure. For this reason, it is recommended that applications
1778
+ * always use <literal>data->header.length</literal> to
1779
+ * iterate over the path data, instead of hardcoding the number of
1780
+ * elements for each element type.
1781
+ **/
1782
+ typedef union _cairo_path_data_t cairo_path_data_t;
1783
+ union _cairo_path_data_t {
1784
+ struct {
1785
+ cairo_path_data_type_t type;
1786
+ int length;
1787
+ } header;
1788
+ struct {
1789
+ double x, y;
1790
+ } point;
1791
+ };
1792
+
1793
+ /**
1794
+ * cairo_path_t:
1795
+ * @status: the current error status
1796
+ * @data: the elements in the path
1797
+ * @num_data: the number of elements in the data array
1798
+ *
1799
+ * A data structure for holding a path. This data structure serves as
1800
+ * the return value for cairo_copy_path() and
1801
+ * cairo_copy_path_flat() as well the input value for
1802
+ * cairo_append_path().
1803
+ *
1804
+ * See #cairo_path_data_t for hints on how to iterate over the
1805
+ * actual data within the path.
1806
+ *
1807
+ * The num_data member gives the number of elements in the data
1808
+ * array. This number is larger than the number of independent path
1809
+ * portions (defined in #cairo_path_data_type_t), since the data
1810
+ * includes both headers and coordinates for each portion.
1811
+ **/
1812
+ typedef struct cairo_path {
1813
+ cairo_status_t status;
1814
+ cairo_path_data_t *data;
1815
+ int num_data;
1816
+ } cairo_path_t;
1817
+
1818
+ cairo_public cairo_path_t *
1819
+ cairo_copy_path (cairo_t *cr);
1820
+
1821
+ cairo_public cairo_path_t *
1822
+ cairo_copy_path_flat (cairo_t *cr);
1823
+
1824
+ cairo_public void
1825
+ cairo_append_path (cairo_t *cr,
1826
+ const cairo_path_t *path);
1827
+
1828
+ cairo_public void
1829
+ cairo_path_destroy (cairo_path_t *path);
1830
+
1831
+ /* Error status queries */
1832
+
1833
+ cairo_public cairo_status_t
1834
+ cairo_status (cairo_t *cr);
1835
+
1836
+ cairo_public const char *
1837
+ cairo_status_to_string (cairo_status_t status);
1838
+
1839
+ /* Surface manipulation */
1840
+
1841
+ cairo_public cairo_surface_t *
1842
+ cairo_surface_create_similar (cairo_surface_t *other,
1843
+ cairo_content_t content,
1844
+ int width,
1845
+ int height);
1846
+
1847
+ cairo_public cairo_surface_t *
1848
+ cairo_surface_reference (cairo_surface_t *surface);
1849
+
1850
+ cairo_public void
1851
+ cairo_surface_finish (cairo_surface_t *surface);
1852
+
1853
+ cairo_public void
1854
+ cairo_surface_destroy (cairo_surface_t *surface);
1855
+
1856
+ cairo_public unsigned int
1857
+ cairo_surface_get_reference_count (cairo_surface_t *surface);
1858
+
1859
+ cairo_public cairo_status_t
1860
+ cairo_surface_status (cairo_surface_t *surface);
1861
+
1862
+ /**
1863
+ * cairo_surface_type_t:
1864
+ * @CAIRO_SURFACE_TYPE_IMAGE: The surface is of type image
1865
+ * @CAIRO_SURFACE_TYPE_PDF: The surface is of type pdf
1866
+ * @CAIRO_SURFACE_TYPE_PS: The surface is of type ps
1867
+ * @CAIRO_SURFACE_TYPE_XLIB: The surface is of type xlib
1868
+ * @CAIRO_SURFACE_TYPE_XCB: The surface is of type xcb
1869
+ * @CAIRO_SURFACE_TYPE_GLITZ: The surface is of type glitz
1870
+ * @CAIRO_SURFACE_TYPE_QUARTZ: The surface is of type quartz
1871
+ * @CAIRO_SURFACE_TYPE_WIN32: The surface is of type win32
1872
+ * @CAIRO_SURFACE_TYPE_BEOS: The surface is of type beos
1873
+ * @CAIRO_SURFACE_TYPE_DIRECTFB: The surface is of type directfb
1874
+ * @CAIRO_SURFACE_TYPE_SVG: The surface is of type svg
1875
+ * @CAIRO_SURFACE_TYPE_OS2: The surface is of type os2
1876
+ * @CAIRO_SURFACE_TYPE_WIN32_PRINTING: The surface is a win32 printing surface
1877
+ * @CAIRO_SURFACE_TYPE_QUARTZ_IMAGE: The surface is of type quartz_image
1878
+ *
1879
+ * #cairo_surface_type_t is used to describe the type of a given
1880
+ * surface. The surface types are also known as "backends" or "surface
1881
+ * backends" within cairo.
1882
+ *
1883
+ * The type of a surface is determined by the function used to create
1884
+ * it, which will generally be of the form cairo_<emphasis>type</emphasis>_surface_create(),
1885
+ * (though see cairo_surface_create_similar() as well).
1886
+ *
1887
+ * The surface type can be queried with cairo_surface_get_type()
1888
+ *
1889
+ * The various #cairo_surface_t functions can be used with surfaces of
1890
+ * any type, but some backends also provide type-specific functions
1891
+ * that must only be called with a surface of the appropriate
1892
+ * type. These functions have names that begin with
1893
+ * cairo_<emphasis>type</emphasis>_surface<!-- --> such as cairo_image_surface_get_width().
1894
+ *
1895
+ * The behavior of calling a type-specific function with a surface of
1896
+ * the wrong type is undefined.
1897
+ *
1898
+ * New entries may be added in future versions.
1899
+ *
1900
+ * Since: 1.2
1901
+ **/
1902
+ typedef enum _cairo_surface_type {
1903
+ CAIRO_SURFACE_TYPE_IMAGE,
1904
+ CAIRO_SURFACE_TYPE_PDF,
1905
+ CAIRO_SURFACE_TYPE_PS,
1906
+ CAIRO_SURFACE_TYPE_XLIB,
1907
+ CAIRO_SURFACE_TYPE_XCB,
1908
+ CAIRO_SURFACE_TYPE_GLITZ,
1909
+ CAIRO_SURFACE_TYPE_QUARTZ,
1910
+ CAIRO_SURFACE_TYPE_WIN32,
1911
+ CAIRO_SURFACE_TYPE_BEOS,
1912
+ CAIRO_SURFACE_TYPE_DIRECTFB,
1913
+ CAIRO_SURFACE_TYPE_SVG,
1914
+ CAIRO_SURFACE_TYPE_OS2,
1915
+ CAIRO_SURFACE_TYPE_WIN32_PRINTING,
1916
+ CAIRO_SURFACE_TYPE_QUARTZ_IMAGE
1917
+ } cairo_surface_type_t;
1918
+
1919
+ cairo_public cairo_surface_type_t
1920
+ cairo_surface_get_type (cairo_surface_t *surface);
1921
+
1922
+ cairo_public cairo_content_t
1923
+ cairo_surface_get_content (cairo_surface_t *surface);
1924
+
1925
+ #if CAIRO_HAS_PNG_FUNCTIONS
1926
+
1927
+ cairo_public cairo_status_t
1928
+ cairo_surface_write_to_png (cairo_surface_t *surface,
1929
+ const char *filename);
1930
+
1931
+ cairo_public cairo_status_t
1932
+ cairo_surface_write_to_png_stream (cairo_surface_t *surface,
1933
+ cairo_write_func_t write_func,
1934
+ void *closure);
1935
+
1936
+ #endif
1937
+
1938
+ cairo_public void *
1939
+ cairo_surface_get_user_data (cairo_surface_t *surface,
1940
+ const cairo_user_data_key_t *key);
1941
+
1942
+ cairo_public cairo_status_t
1943
+ cairo_surface_set_user_data (cairo_surface_t *surface,
1944
+ const cairo_user_data_key_t *key,
1945
+ void *user_data,
1946
+ cairo_destroy_func_t destroy);
1947
+
1948
+ cairo_public void
1949
+ cairo_surface_get_font_options (cairo_surface_t *surface,
1950
+ cairo_font_options_t *options);
1951
+
1952
+ cairo_public void
1953
+ cairo_surface_flush (cairo_surface_t *surface);
1954
+
1955
+ cairo_public void
1956
+ cairo_surface_mark_dirty (cairo_surface_t *surface);
1957
+
1958
+ cairo_public void
1959
+ cairo_surface_mark_dirty_rectangle (cairo_surface_t *surface,
1960
+ int x,
1961
+ int y,
1962
+ int width,
1963
+ int height);
1964
+
1965
+ cairo_public void
1966
+ cairo_surface_set_device_offset (cairo_surface_t *surface,
1967
+ double x_offset,
1968
+ double y_offset);
1969
+
1970
+ cairo_public void
1971
+ cairo_surface_get_device_offset (cairo_surface_t *surface,
1972
+ double *x_offset,
1973
+ double *y_offset);
1974
+
1975
+ cairo_public void
1976
+ cairo_surface_set_fallback_resolution (cairo_surface_t *surface,
1977
+ double x_pixels_per_inch,
1978
+ double y_pixels_per_inch);
1979
+
1980
+ cairo_public void
1981
+ cairo_surface_get_fallback_resolution (cairo_surface_t *surface,
1982
+ double *x_pixels_per_inch,
1983
+ double *y_pixels_per_inch);
1984
+
1985
+ cairo_public void
1986
+ cairo_surface_copy_page (cairo_surface_t *surface);
1987
+
1988
+ cairo_public void
1989
+ cairo_surface_show_page (cairo_surface_t *surface);
1990
+
1991
+ cairo_public cairo_bool_t
1992
+ cairo_surface_has_show_text_glyphs (cairo_surface_t *surface);
1993
+
1994
+ /* Image-surface functions */
1995
+
1996
+ /**
1997
+ * cairo_format_t:
1998
+ * @CAIRO_FORMAT_ARGB32: each pixel is a 32-bit quantity, with
1999
+ * alpha in the upper 8 bits, then red, then green, then blue.
2000
+ * The 32-bit quantities are stored native-endian. Pre-multiplied
2001
+ * alpha is used. (That is, 50% transparent red is 0x80800000,
2002
+ * not 0x80ff0000.)
2003
+ * @CAIRO_FORMAT_RGB24: each pixel is a 32-bit quantity, with
2004
+ * the upper 8 bits unused. Red, Green, and Blue are stored
2005
+ * in the remaining 24 bits in that order.
2006
+ * @CAIRO_FORMAT_A8: each pixel is a 8-bit quantity holding
2007
+ * an alpha value.
2008
+ * @CAIRO_FORMAT_A1: each pixel is a 1-bit quantity holding
2009
+ * an alpha value. Pixels are packed together into 32-bit
2010
+ * quantities. The ordering of the bits matches the
2011
+ * endianess of the platform. On a big-endian machine, the
2012
+ * first pixel is in the uppermost bit, on a little-endian
2013
+ * machine the first pixel is in the least-significant bit.
2014
+ * @CAIRO_FORMAT_RGB16_565: This format value is deprecated. It has
2015
+ * never been properly implemented in cairo and should not be used
2016
+ * by applications. (since 1.2)
2017
+ *
2018
+ * #cairo_format_t is used to identify the memory format of
2019
+ * image data.
2020
+ *
2021
+ * New entries may be added in future versions.
2022
+ **/
2023
+ typedef enum _cairo_format {
2024
+ CAIRO_FORMAT_ARGB32,
2025
+ CAIRO_FORMAT_RGB24,
2026
+ CAIRO_FORMAT_A8,
2027
+ CAIRO_FORMAT_A1
2028
+ /* The value of 4 is reserved by a deprecated enum value.
2029
+ * The next format added must have an explicit value of 5.
2030
+ CAIRO_FORMAT_RGB16_565 = 4,
2031
+ */
2032
+ } cairo_format_t;
2033
+
2034
+ cairo_public cairo_surface_t *
2035
+ cairo_image_surface_create (cairo_format_t format,
2036
+ int width,
2037
+ int height);
2038
+
2039
+ cairo_public int
2040
+ cairo_format_stride_for_width (cairo_format_t format,
2041
+ int width);
2042
+
2043
+ cairo_public cairo_surface_t *
2044
+ cairo_image_surface_create_for_data (unsigned char *data,
2045
+ cairo_format_t format,
2046
+ int width,
2047
+ int height,
2048
+ int stride);
2049
+
2050
+ cairo_public unsigned char *
2051
+ cairo_image_surface_get_data (cairo_surface_t *surface);
2052
+
2053
+ cairo_public cairo_format_t
2054
+ cairo_image_surface_get_format (cairo_surface_t *surface);
2055
+
2056
+ cairo_public int
2057
+ cairo_image_surface_get_width (cairo_surface_t *surface);
2058
+
2059
+ cairo_public int
2060
+ cairo_image_surface_get_height (cairo_surface_t *surface);
2061
+
2062
+ cairo_public int
2063
+ cairo_image_surface_get_stride (cairo_surface_t *surface);
2064
+
2065
+ #if CAIRO_HAS_PNG_FUNCTIONS
2066
+
2067
+ cairo_public cairo_surface_t *
2068
+ cairo_image_surface_create_from_png (const char *filename);
2069
+
2070
+ cairo_public cairo_surface_t *
2071
+ cairo_image_surface_create_from_png_stream (cairo_read_func_t read_func,
2072
+ void *closure);
2073
+
2074
+ #endif
2075
+
2076
+ /* Pattern creation functions */
2077
+
2078
+ cairo_public cairo_pattern_t *
2079
+ cairo_pattern_create_rgb (double red, double green, double blue);
2080
+
2081
+ cairo_public cairo_pattern_t *
2082
+ cairo_pattern_create_rgba (double red, double green, double blue,
2083
+ double alpha);
2084
+
2085
+ cairo_public cairo_pattern_t *
2086
+ cairo_pattern_create_for_surface (cairo_surface_t *surface);
2087
+
2088
+ cairo_public cairo_pattern_t *
2089
+ cairo_pattern_create_linear (double x0, double y0,
2090
+ double x1, double y1);
2091
+
2092
+ cairo_public cairo_pattern_t *
2093
+ cairo_pattern_create_radial (double cx0, double cy0, double radius0,
2094
+ double cx1, double cy1, double radius1);
2095
+
2096
+ cairo_public cairo_pattern_t *
2097
+ cairo_pattern_reference (cairo_pattern_t *pattern);
2098
+
2099
+ cairo_public void
2100
+ cairo_pattern_destroy (cairo_pattern_t *pattern);
2101
+
2102
+ cairo_public unsigned int
2103
+ cairo_pattern_get_reference_count (cairo_pattern_t *pattern);
2104
+
2105
+ cairo_public cairo_status_t
2106
+ cairo_pattern_status (cairo_pattern_t *pattern);
2107
+
2108
+ cairo_public void *
2109
+ cairo_pattern_get_user_data (cairo_pattern_t *pattern,
2110
+ const cairo_user_data_key_t *key);
2111
+
2112
+ cairo_public cairo_status_t
2113
+ cairo_pattern_set_user_data (cairo_pattern_t *pattern,
2114
+ const cairo_user_data_key_t *key,
2115
+ void *user_data,
2116
+ cairo_destroy_func_t destroy);
2117
+
2118
+ /**
2119
+ * cairo_pattern_type_t:
2120
+ * @CAIRO_PATTERN_TYPE_SOLID: The pattern is a solid (uniform)
2121
+ * color. It may be opaque or translucent.
2122
+ * @CAIRO_PATTERN_TYPE_SURFACE: The pattern is a based on a surface (an image).
2123
+ * @CAIRO_PATTERN_TYPE_LINEAR: The pattern is a linear gradient.
2124
+ * @CAIRO_PATTERN_TYPE_RADIAL: The pattern is a radial gradient.
2125
+ *
2126
+ * #cairo_pattern_type_t is used to describe the type of a given pattern.
2127
+ *
2128
+ * The type of a pattern is determined by the function used to create
2129
+ * it. The cairo_pattern_create_rgb() and cairo_pattern_create_rgba()
2130
+ * functions create SOLID patterns. The remaining
2131
+ * cairo_pattern_create<!-- --> functions map to pattern types in obvious
2132
+ * ways.
2133
+ *
2134
+ * The pattern type can be queried with cairo_pattern_get_type()
2135
+ *
2136
+ * Most #cairo_pattern_t functions can be called with a pattern of any
2137
+ * type, (though trying to change the extend or filter for a solid
2138
+ * pattern will have no effect). A notable exception is
2139
+ * cairo_pattern_add_color_stop_rgb() and
2140
+ * cairo_pattern_add_color_stop_rgba() which must only be called with
2141
+ * gradient patterns (either LINEAR or RADIAL). Otherwise the pattern
2142
+ * will be shutdown and put into an error state.
2143
+ *
2144
+ * New entries may be added in future versions.
2145
+ *
2146
+ * Since: 1.2
2147
+ **/
2148
+ typedef enum _cairo_pattern_type {
2149
+ CAIRO_PATTERN_TYPE_SOLID,
2150
+ CAIRO_PATTERN_TYPE_SURFACE,
2151
+ CAIRO_PATTERN_TYPE_LINEAR,
2152
+ CAIRO_PATTERN_TYPE_RADIAL
2153
+ } cairo_pattern_type_t;
2154
+
2155
+ cairo_public cairo_pattern_type_t
2156
+ cairo_pattern_get_type (cairo_pattern_t *pattern);
2157
+
2158
+ cairo_public void
2159
+ cairo_pattern_add_color_stop_rgb (cairo_pattern_t *pattern,
2160
+ double offset,
2161
+ double red, double green, double blue);
2162
+
2163
+ cairo_public void
2164
+ cairo_pattern_add_color_stop_rgba (cairo_pattern_t *pattern,
2165
+ double offset,
2166
+ double red, double green, double blue,
2167
+ double alpha);
2168
+
2169
+ cairo_public void
2170
+ cairo_pattern_set_matrix (cairo_pattern_t *pattern,
2171
+ const cairo_matrix_t *matrix);
2172
+
2173
+ cairo_public void
2174
+ cairo_pattern_get_matrix (cairo_pattern_t *pattern,
2175
+ cairo_matrix_t *matrix);
2176
+
2177
+ /**
2178
+ * cairo_extend_t:
2179
+ * @CAIRO_EXTEND_NONE: pixels outside of the source pattern
2180
+ * are fully transparent
2181
+ * @CAIRO_EXTEND_REPEAT: the pattern is tiled by repeating
2182
+ * @CAIRO_EXTEND_REFLECT: the pattern is tiled by reflecting
2183
+ * at the edges (Implemented for surface patterns since 1.6)
2184
+ * @CAIRO_EXTEND_PAD: pixels outside of the pattern copy
2185
+ * the closest pixel from the source (Since 1.2; but only
2186
+ * implemented for surface patterns since 1.6)
2187
+ *
2188
+ * #cairo_extend_t is used to describe how pattern color/alpha will be
2189
+ * determined for areas "outside" the pattern's natural area, (for
2190
+ * example, outside the surface bounds or outside the gradient
2191
+ * geometry).
2192
+ *
2193
+ * The default extend mode is %CAIRO_EXTEND_NONE for surface patterns
2194
+ * and %CAIRO_EXTEND_PAD for gradient patterns.
2195
+ *
2196
+ * New entries may be added in future versions.
2197
+ **/
2198
+ typedef enum _cairo_extend {
2199
+ CAIRO_EXTEND_NONE,
2200
+ CAIRO_EXTEND_REPEAT,
2201
+ CAIRO_EXTEND_REFLECT,
2202
+ CAIRO_EXTEND_PAD
2203
+ } cairo_extend_t;
2204
+
2205
+ cairo_public void
2206
+ cairo_pattern_set_extend (cairo_pattern_t *pattern, cairo_extend_t extend);
2207
+
2208
+ cairo_public cairo_extend_t
2209
+ cairo_pattern_get_extend (cairo_pattern_t *pattern);
2210
+
2211
+ /**
2212
+ * cairo_filter_t:
2213
+ * @CAIRO_FILTER_FAST: A high-performance filter, with quality similar
2214
+ * to %CAIRO_FILTER_NEAREST
2215
+ * @CAIRO_FILTER_GOOD: A reasonable-performance filter, with quality
2216
+ * similar to %CAIRO_FILTER_BILINEAR
2217
+ * @CAIRO_FILTER_BEST: The highest-quality available, performance may
2218
+ * not be suitable for interactive use.
2219
+ * @CAIRO_FILTER_NEAREST: Nearest-neighbor filtering
2220
+ * @CAIRO_FILTER_BILINEAR: Linear interpolation in two dimensions
2221
+ * @CAIRO_FILTER_GAUSSIAN: This filter value is currently
2222
+ * unimplemented, and should not be used in current code.
2223
+ *
2224
+ * #cairo_filter_t is used to indicate what filtering should be
2225
+ * applied when reading pixel values from patterns. See
2226
+ * cairo_pattern_set_source() for indicating the desired filter to be
2227
+ * used with a particular pattern.
2228
+ */
2229
+ typedef enum _cairo_filter {
2230
+ CAIRO_FILTER_FAST,
2231
+ CAIRO_FILTER_GOOD,
2232
+ CAIRO_FILTER_BEST,
2233
+ CAIRO_FILTER_NEAREST,
2234
+ CAIRO_FILTER_BILINEAR,
2235
+ CAIRO_FILTER_GAUSSIAN
2236
+ } cairo_filter_t;
2237
+
2238
+ cairo_public void
2239
+ cairo_pattern_set_filter (cairo_pattern_t *pattern, cairo_filter_t filter);
2240
+
2241
+ cairo_public cairo_filter_t
2242
+ cairo_pattern_get_filter (cairo_pattern_t *pattern);
2243
+
2244
+ cairo_public cairo_status_t
2245
+ cairo_pattern_get_rgba (cairo_pattern_t *pattern,
2246
+ double *red, double *green,
2247
+ double *blue, double *alpha);
2248
+
2249
+ cairo_public cairo_status_t
2250
+ cairo_pattern_get_surface (cairo_pattern_t *pattern,
2251
+ cairo_surface_t **surface);
2252
+
2253
+
2254
+ cairo_public cairo_status_t
2255
+ cairo_pattern_get_color_stop_rgba (cairo_pattern_t *pattern,
2256
+ int index, double *offset,
2257
+ double *red, double *green,
2258
+ double *blue, double *alpha);
2259
+
2260
+ cairo_public cairo_status_t
2261
+ cairo_pattern_get_color_stop_count (cairo_pattern_t *pattern,
2262
+ int *count);
2263
+
2264
+ cairo_public cairo_status_t
2265
+ cairo_pattern_get_linear_points (cairo_pattern_t *pattern,
2266
+ double *x0, double *y0,
2267
+ double *x1, double *y1);
2268
+
2269
+ cairo_public cairo_status_t
2270
+ cairo_pattern_get_radial_circles (cairo_pattern_t *pattern,
2271
+ double *x0, double *y0, double *r0,
2272
+ double *x1, double *y1, double *r1);
2273
+
2274
+ /* Matrix functions */
2275
+
2276
+ cairo_public void
2277
+ cairo_matrix_init (cairo_matrix_t *matrix,
2278
+ double xx, double yx,
2279
+ double xy, double yy,
2280
+ double x0, double y0);
2281
+
2282
+ cairo_public void
2283
+ cairo_matrix_init_identity (cairo_matrix_t *matrix);
2284
+
2285
+ cairo_public void
2286
+ cairo_matrix_init_translate (cairo_matrix_t *matrix,
2287
+ double tx, double ty);
2288
+
2289
+ cairo_public void
2290
+ cairo_matrix_init_scale (cairo_matrix_t *matrix,
2291
+ double sx, double sy);
2292
+
2293
+ cairo_public void
2294
+ cairo_matrix_init_rotate (cairo_matrix_t *matrix,
2295
+ double radians);
2296
+
2297
+ cairo_public void
2298
+ cairo_matrix_translate (cairo_matrix_t *matrix, double tx, double ty);
2299
+
2300
+ cairo_public void
2301
+ cairo_matrix_scale (cairo_matrix_t *matrix, double sx, double sy);
2302
+
2303
+ cairo_public void
2304
+ cairo_matrix_rotate (cairo_matrix_t *matrix, double radians);
2305
+
2306
+ cairo_public cairo_status_t
2307
+ cairo_matrix_invert (cairo_matrix_t *matrix);
2308
+
2309
+ cairo_public void
2310
+ cairo_matrix_multiply (cairo_matrix_t *result,
2311
+ const cairo_matrix_t *a,
2312
+ const cairo_matrix_t *b);
2313
+
2314
+ cairo_public void
2315
+ cairo_matrix_transform_distance (const cairo_matrix_t *matrix,
2316
+ double *dx, double *dy);
2317
+
2318
+ cairo_public void
2319
+ cairo_matrix_transform_point (const cairo_matrix_t *matrix,
2320
+ double *x, double *y);
2321
+
2322
+ /* Functions to be used while debugging (not intended for use in production code) */
2323
+ cairo_public void
2324
+ cairo_debug_reset_static_data (void);
2325
+
2326
+ CAIRO_END_DECLS
2327
+
2328
+ #endif /* CAIRO_H */