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,132 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <title>Error handling</title>
6
+ <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7
+ <link rel="home" href="index.html" title="Cairo: A Vector Graphics Library">
8
+ <link rel="up" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
9
+ <link rel="prev" href="bindings-streams.html" title="Streams and File I/O">
10
+ <link rel="next" href="bindings-patterns.html" title="Patterns">
11
+ <meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
+ <link rel="stylesheet" href="style.css" type="text/css">
13
+ <link rel="chapter" href="cairo-drawing.html" title="Drawing">
14
+ <link rel="chapter" href="cairo-fonts.html" title="Fonts">
15
+ <link rel="chapter" href="cairo-surfaces.html" title="Surfaces">
16
+ <link rel="chapter" href="cairo-support.html" title="Utilities">
17
+ <link rel="index" href="index-all.html" title="Index">
18
+ <link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
19
+ <link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
20
+ <link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
21
+ <link rel="index" href="index-1.8.html" title="Index of new symbols in 1.8">
22
+ <link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
23
+ </head>
24
+ <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
25
+ <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
26
+ <td><a accesskey="p" href="bindings-streams.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
27
+ <td><a accesskey="u" href="language-bindings.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
28
+ <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
29
+ <th width="100%" align="center">Cairo: A Vector Graphics Library</th>
30
+ <td><a accesskey="n" href="bindings-patterns.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
31
+ </tr></table>
32
+ <div class="sect1" title="Error handling">
33
+ <div class="titlepage"><div><div><h2 class="title" style="clear: both">
34
+ <a name="bindings-errors"></a>Error handling</h2></div></div></div>
35
+ <p>
36
+ The error handling approach in C for Cairo has multiple
37
+ elements:
38
+ </p>
39
+ <div class="itemizedlist"><ul class="itemizedlist" type="disc">
40
+ <li class="listitem"><p>
41
+ When a method on an object fails, the object is put into
42
+ an error state. Subsequent operations on the object do
43
+ nothing. The status of the object can be queried with
44
+ a function like <a class="link" href="cairo-context.html#cairo-status" title="cairo_status ()"><code class="function">status()</code></a>.
45
+ </p></li>
46
+ <li class="listitem">
47
+ <p>
48
+ Constructors, rather than
49
+ returning <code class="constant">NULL</code> on out-of-memory failure,
50
+ return a special singleton object on which all
51
+ operations do nothing. Retrieving the status of the
52
+ singleton object returns <code class="constant">CAIRO_STATUS_NO_MEMORY</code>
53
+ </p>
54
+ <p class="remark"><i><span class="remark">
55
+ Is this going to apply to
56
+ <span class="type">cairo_surface_t</span> as well?
57
+ </span></i></p>
58
+ <p class="remark"><i><span class="remark">
59
+ What about cairo_copy_path_data()? It's probably going to
60
+ have to return <code class="constant">NULL</code>.
61
+ </span></i></p>
62
+ </li>
63
+ <li class="listitem"><p>
64
+ Errors propagate from object to object. Setting a pattern
65
+ in an out-of-memory state as the source of a
66
+ <span class="type">cairo_t</span> puts the type into an error state.
67
+ </p></li>
68
+ </ul></div>
69
+ <p class="remark"><i><span class="remark">Much of the above is not yet implemented at the time of
70
+ this writing</span></i></p>
71
+ <p>
72
+ A language binding could copy the C approach, and for a
73
+ language without exceptions, this is likely the right thing
74
+ to do. However, for a language with exceptions, exposing
75
+ a completely different style of error handling for cairo
76
+ would be strange. So, instead, status should be checked
77
+ after every call to cairo, and exceptions thrown as necessary.
78
+ </p>
79
+ <p>
80
+ One problem that can arise with this, in languages
81
+ where handling exceptions is mandatory (like Java), is that almost
82
+ every cairo function can result in a status being set,
83
+ usually because of an out-of-memory condition. This could make
84
+ cairo hard to use. To resolve this problem, let's classify then
85
+ cairo status codes:
86
+ </p>
87
+ <pre class="programlisting">
88
+ /* Memory */
89
+ CAIRO_STATUS_NO_MEMORY,
90
+
91
+ /* Programmer error */
92
+ CAIRO_STATUS_INVALID_RESTORE
93
+ CAIRO_STATUS_INVALID_POP_GROUP
94
+ CAIRO_STATUS_NO_CURRENT_POINT
95
+ CAIRO_STATUS_INVALID_MATRIX
96
+ CAIRO_STATUS_NO_TARGET_SURFACE
97
+ CAIRO_STATUS_INVALID_STRING
98
+ CAIRO_STATUS_SURFACE_FINISHED
99
+ CAIRO_STATUS_BAD_NESTING
100
+
101
+ /* Language binding implementation */
102
+ CAIRO_STATUS_NULL_POINTER
103
+ CAIRO_STATUS_INVALID_PATH_DATA
104
+ CAIRO_STATUS_SURFACE_TYPE_MISMATCH
105
+
106
+ /* Other */
107
+ CAIRO_STATUS_READ_ERROR
108
+ CAIRO_STATUS_WRITE_ERROR
109
+ </pre>
110
+ <p>
111
+ If we look at these, the
112
+ <code class="constant">CAIRO_STATUS_NO_MEMORY</code>
113
+ should map to the native out-of-memory exception, which could
114
+ happen at any point in any case. Most of the others indicate
115
+ programmer error, and handling them in user code would be
116
+ silly. These should be mapped into whatever the language uses
117
+ for assertion failures, rather than errors that are normally
118
+ handled. (In Java, a subclass of Error rather than Exception,
119
+ perhaps.) And <code class="constant">CAIRO_STATUS_READ_ERROR</code>,
120
+ and <code class="constant">CAIRO_STATUS_WRITE_ERROR</code> can occur
121
+ only in very specific places. (In fact, as described
122
+ in <a class="xref" href="bindings-streams.html" title="Streams and File I/O">the section called “Streams and File I/O”</a>, these errors may be
123
+ mapped into the language's native I/O error types.)
124
+ So, there really aren't exceptions that the programmer must
125
+ handle at most points in the Cairo API.
126
+ </p>
127
+ </div>
128
+ <div class="footer">
129
+ <hr>
130
+ Generated by GTK-Doc V1.11</div>
131
+ </body>
132
+ </html>
@@ -0,0 +1,63 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <title>Fonts</title>
6
+ <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7
+ <link rel="home" href="index.html" title="Cairo: A Vector Graphics Library">
8
+ <link rel="up" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
9
+ <link rel="prev" href="bindings-surfaces.html" title="Surfaces">
10
+ <link rel="next" href="bindings-path.html" title="cairo_path_t">
11
+ <meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
+ <link rel="stylesheet" href="style.css" type="text/css">
13
+ <link rel="chapter" href="cairo-drawing.html" title="Drawing">
14
+ <link rel="chapter" href="cairo-fonts.html" title="Fonts">
15
+ <link rel="chapter" href="cairo-surfaces.html" title="Surfaces">
16
+ <link rel="chapter" href="cairo-support.html" title="Utilities">
17
+ <link rel="index" href="index-all.html" title="Index">
18
+ <link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
19
+ <link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
20
+ <link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
21
+ <link rel="index" href="index-1.8.html" title="Index of new symbols in 1.8">
22
+ <link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
23
+ </head>
24
+ <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
25
+ <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
26
+ <td><a accesskey="p" href="bindings-surfaces.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
27
+ <td><a accesskey="u" href="language-bindings.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
28
+ <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
29
+ <th width="100%" align="center">Cairo: A Vector Graphics Library</th>
30
+ <td><a accesskey="n" href="bindings-path.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
31
+ </tr></table>
32
+ <div class="sect1" title="Fonts">
33
+ <div class="titlepage"><div><div><h2 class="title" style="clear: both">
34
+ <a name="bindings-fonts"></a>Fonts</h2></div></div></div>
35
+ <p>
36
+ Fonts are once more an area where there is a hierarchy of types:
37
+ </p>
38
+ <pre class="programlisting">
39
+ cairo_font_face_t
40
+ cairo_ft_font_face_t
41
+ cairo_win32_font_face_t
42
+ cairo_scaled_font_t
43
+ cairo_ft_scaled_font_t
44
+ cairo_win32_scaled_font_t
45
+ </pre>
46
+ <p>
47
+ The methods on the subtypes are, however, not useful without
48
+ bindings for fontconfig and FreeType or for the Win32 GDI,
49
+ so most language bindings will choose not to bind these
50
+ types.
51
+ </p>
52
+ <p>
53
+ The <a class="link" href="cairo-font-face.html#cairo-font-face-set-user-data" title="cairo_font_face_set_user_data ()"><code class="function">cairo_font_face_set_user_data()</code></a>,
54
+ and <a class="link" href="cairo-font-face.html#cairo-font-face-get-user-data" title="cairo_font_face_get_user_data ()"><code class="function">cairo_font_face_get_user_data()</code></a>
55
+ methods are provided for use in language bindings, and should
56
+ not be directly exposed to applications.
57
+ </p>
58
+ </div>
59
+ <div class="footer">
60
+ <hr>
61
+ Generated by GTK-Doc V1.11</div>
62
+ </body>
63
+ </html>
@@ -0,0 +1,133 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <title>Memory management</title>
6
+ <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7
+ <link rel="home" href="index.html" title="Cairo: A Vector Graphics Library">
8
+ <link rel="up" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
9
+ <link rel="prev" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
10
+ <link rel="next" href="bindings-return-values.html" title="Multiple return values">
11
+ <meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
+ <link rel="stylesheet" href="style.css" type="text/css">
13
+ <link rel="chapter" href="cairo-drawing.html" title="Drawing">
14
+ <link rel="chapter" href="cairo-fonts.html" title="Fonts">
15
+ <link rel="chapter" href="cairo-surfaces.html" title="Surfaces">
16
+ <link rel="chapter" href="cairo-support.html" title="Utilities">
17
+ <link rel="index" href="index-all.html" title="Index">
18
+ <link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
19
+ <link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
20
+ <link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
21
+ <link rel="index" href="index-1.8.html" title="Index of new symbols in 1.8">
22
+ <link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
23
+ </head>
24
+ <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
25
+ <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
26
+ <td><a accesskey="p" href="language-bindings.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
27
+ <td><a accesskey="u" href="language-bindings.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
28
+ <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
29
+ <th width="100%" align="center">Cairo: A Vector Graphics Library</th>
30
+ <td><a accesskey="n" href="bindings-return-values.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
31
+ </tr></table>
32
+ <div class="sect1" title="Memory management">
33
+ <div class="titlepage"><div><div><h2 class="title" style="clear: both">
34
+ <a name="bindings-memory"></a>Memory management</h2></div></div></div>
35
+ <p>
36
+ The objects in cairo can roughly be divided into two types:
37
+ reference-counted, opaque types like
38
+ <a class="link" href="cairo-surface.html#cairo-surface-t" title="cairo_surface_t"><span class="type">cairo_surface_t</span></a>
39
+ and plain structures like
40
+ <a class="link" href="cairo-text.html#cairo-glyph-t" title="cairo_glyph_t"><span class="type">cairo_glyph_t</span></a>.
41
+ <a class="link" href="cairo-paths.html#cairo-path-t" title="cairo_path_t"><span class="type">cairo_path_t</span></a>
42
+ and
43
+ <a class="link" href="cairo-paths.html#cairo-path-data-t" title="union cairo_path_data_t"><span class="type">cairo_path_data_t</span></a>
44
+ are special cases and are treated separately in this appendix.
45
+ </p>
46
+ <p>
47
+ Refcounted opaque types all have a
48
+ <code class="function">..._reference()</code>
49
+ function to increase the refcount by one and a
50
+ <code class="function">..._destroy()</code> to decrease the refcount
51
+ by one. These should not be exposed to the user of the language
52
+ binding, but rather used to implement memory management within
53
+ the language binding. The simplest way to do memory management
54
+ for a language binding is to treat the language binding object
55
+ as a simple handle to the cairo object. The language binding
56
+ object references the cairo object, and unreferences it when
57
+ finalized. This is the recommended method, though there are
58
+ a couple of caveats to be noted:
59
+ </p>
60
+ <div class="itemizedlist"><ul class="itemizedlist" type="disc">
61
+ <li class="listitem"><p>
62
+ Equality won't work as expected. You can have two language
63
+ objects for the same cairo and they won't necessarily
64
+ compare equal. If the language allows customizing the
65
+ equality operation, then this is fixable by comparing
66
+ the underlying pointers. It also can be fixed by creating
67
+ at most one language object per cairo object, and
68
+ uniquifying via a <em class="firstterm">pin table</em> (a hash
69
+ table that goes from cairo object to language object).
70
+ For <span class="type">cairo_surface_t</span> you can use also
71
+ <a class="link" href="cairo-surface.html#cairo-surface-set-user-data" title="cairo_surface_set_user_data ()"><code class="function">cairo_surface_set_user_data()</code></a>
72
+ instead of a separate pin table.
73
+ </p></li>
74
+ <li class="listitem">
75
+ <p>
76
+ Derivation from the language object doesn't work because
77
+ you can lose the language object while keeping the Cairo
78
+ object. Code like:
79
+ </p>
80
+ <pre class="programlisting">
81
+ public class MySurface (ImageSurface) {
82
+ public MySurface (width, height) {
83
+ super (Format.ARGB32, width, height);
84
+ }
85
+ public int get42 () {
86
+ return 42;
87
+ }
88
+ }
89
+
90
+ cr = Cairo(MySurface(width, height));
91
+ surface = cr.getTarget();
92
+ </pre>
93
+ <p>
94
+ Can result in <code class="varname">surface</code> containing an
95
+ <code class="classname">ImageSurface</code> not a <code class="classname">MySurface</code>.
96
+ This is not easily fixable without creating memory leaks,
97
+ and it's probably best to simply forbid deriving from the
98
+ language objects.
99
+ </p>
100
+ </li>
101
+ </ul></div>
102
+ <p>
103
+ When a plain structure is used as a return value from cairo,
104
+ this is done by passing it as a “out parameter”.
105
+ </p>
106
+ <pre class="programlisting">
107
+ cairo_font_extents_t extents;
108
+
109
+ cairo_font_extents (cr, &amp;extents);</pre>
110
+ <p>
111
+ In a language binding, this should typically be treated
112
+ as a return value:
113
+ </p>
114
+ <pre class="programlisting">
115
+ FontExtents extents = cr.fontExtents ();</pre>
116
+ <p>
117
+ A language binding has a choice in how it implements the
118
+ language objects for plain structures. It can use a pure
119
+ language object with fields corresponding to those of the C
120
+ structure, and convert from and to the C structure when calling
121
+ cairo functions or converting cairo return values. Or it
122
+ can keep a pointer to the C structure internally and wrap
123
+ it inside a language object much like occurs for refcounted
124
+ objects. The choice should be invisible to the user: they should
125
+ be able to imagine that it is implemented as a pure language
126
+ object.
127
+ </p>
128
+ </div>
129
+ <div class="footer">
130
+ <hr>
131
+ Generated by GTK-Doc V1.11</div>
132
+ </body>
133
+ </html>
@@ -0,0 +1,131 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <title>Overloading and optional arguments</title>
6
+ <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7
+ <link rel="home" href="index.html" title="Cairo: A Vector Graphics Library">
8
+ <link rel="up" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
9
+ <link rel="prev" href="bindings-return-values.html" title="Multiple return values">
10
+ <link rel="next" href="bindings-streams.html" title="Streams and File I/O">
11
+ <meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
+ <link rel="stylesheet" href="style.css" type="text/css">
13
+ <link rel="chapter" href="cairo-drawing.html" title="Drawing">
14
+ <link rel="chapter" href="cairo-fonts.html" title="Fonts">
15
+ <link rel="chapter" href="cairo-surfaces.html" title="Surfaces">
16
+ <link rel="chapter" href="cairo-support.html" title="Utilities">
17
+ <link rel="index" href="index-all.html" title="Index">
18
+ <link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
19
+ <link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
20
+ <link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
21
+ <link rel="index" href="index-1.8.html" title="Index of new symbols in 1.8">
22
+ <link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
23
+ </head>
24
+ <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
25
+ <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
26
+ <td><a accesskey="p" href="bindings-return-values.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
27
+ <td><a accesskey="u" href="language-bindings.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
28
+ <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
29
+ <th width="100%" align="center">Cairo: A Vector Graphics Library</th>
30
+ <td><a accesskey="n" href="bindings-streams.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
31
+ </tr></table>
32
+ <div class="sect1" title="Overloading and optional arguments">
33
+ <div class="titlepage"><div><div><h2 class="title" style="clear: both">
34
+ <a name="bindings-overloading"></a>Overloading and optional arguments</h2></div></div></div>
35
+ <p>
36
+ Function overloading (having a several variants of a function
37
+ with the same name and different arguments) is a language
38
+ feature available in many languages but not in C.
39
+ </p>
40
+ <p>
41
+ In general, language binding authors should use restraint in
42
+ combining functions in the cairo API via function
43
+ overloading. What may seem like an obvious overload now may
44
+ turn out to be strange with future additions to cairo.
45
+ It might seem logical to make
46
+ <a class="link" href="cairo-context.html#cairo-set-source-rgb" title="cairo_set_source_rgb ()"><code class="function">cairo_set_source_rgb()</code></a>
47
+ an overload of <code class="function">cairo_set_source()</code>, but future plans to add
48
+ <code class="function">cairo_set_source_rgb_premultiplied()</code>,
49
+ which will also take three doubles make this a bad idea. For
50
+ this reason, only the following pairs of functions should
51
+ be combined via overloading
52
+ </p>
53
+ <pre class="programlisting">
54
+ void
55
+ cairo_set_source (cairo_t *cr, cairo_pattern_t *source);
56
+
57
+ void
58
+ cairo_set_source_surface (cairo_t *cr,
59
+ cairo_surface_t *source,
60
+ double surface_x,
61
+ double surface_y);
62
+
63
+ void
64
+ cairo_mask (cairo_t *cr,
65
+ cairo_pattern_t *pattern);
66
+
67
+ void
68
+ cairo_mask_surface (cairo_t *cr,
69
+ cairo_surface_t *surface,
70
+ double surface_x,
71
+ double surface_y);
72
+
73
+ cairo_surface_t *
74
+ cairo_image_surface_create (cairo_format_t format,
75
+ int width,
76
+ int height);
77
+ cairo_surface_t *
78
+ cairo_image_surface_create_for_data (unsigned char *data,
79
+ cairo_format_t format,
80
+ int width,
81
+ int height,
82
+ int stride);
83
+
84
+ cairo_status_t
85
+ cairo_surface_write_to_png (cairo_surface_t *surface,
86
+ const char *filename);
87
+
88
+ cairo_status_t
89
+ cairo_surface_write_to_png_stream (cairo_surface_t *surface,
90
+ cairo_write_func_t write_func,
91
+ void *closure);
92
+
93
+ cairo_surface_t *
94
+ cairo_image_surface_create_from_png (const char *filename);
95
+
96
+ cairo_surface_t *
97
+ cairo_image_surface_create_from_png_stream (cairo_read_func_t read_func,
98
+ void *closure);
99
+ </pre>
100
+ <p>
101
+ Note that there are cases where all constructors for a type
102
+ aren't overloaded together. For example
103
+ <a class="link" href="cairo-png-functions.html#cairo-image-surface-create-from-png" title="cairo_image_surface_create_from_png ()"><code class="function">cairo_image_surface_create_from_png()</code></a>
104
+ should <span class="emphasis"><em>not</em></span> be overloaded together with
105
+ <a class="link" href="cairo-image-surface.html#cairo-image-surface-create" title="cairo_image_surface_create ()"><code class="function">cairo_image_surface_create()</code></a>.
106
+ In such cases, the remaining constructors will typically need to
107
+ be bound as static methods. In Java, for example, we might have:
108
+ </p>
109
+ <pre class="programlisting">
110
+ Surface surface1 = ImageSurface(Format.RGB24, 100, 100);
111
+ Surface surface2 = ImageSurface.createFromPNG("camera.png");</pre>
112
+ <p>
113
+ Some other overloads that add combinations not found in C may be
114
+ convenient for users for language bindings that provide
115
+ <span class="type">cairo_point_t</span> and <span class="type">cairo_rectangle_t</span>
116
+ types, for example:
117
+ </p>
118
+ <pre class="programlisting">
119
+ void
120
+ cairo_move_to (cairo_t *cr,
121
+ cairo_point_t *point);
122
+ void
123
+ cairo_rectangle (cairo_t *cr,
124
+ cairo_rectangle_t *rectangle);
125
+ </pre>
126
+ </div>
127
+ <div class="footer">
128
+ <hr>
129
+ Generated by GTK-Doc V1.11</div>
130
+ </body>
131
+ </html>