2 +----------------------------------------------------------------------+
3 | This source file is subject to version 3.0 of the PHP license, |
4 | that is bundled with this package in the file LICENSE, and is |
5 | available through the world-wide-web at the following url: |
6 | http://www.php.net/license/3_0.txt. |
7 | If you did not receive a copy of the PHP license and are unable to |
8 | obtain it through the world-wide-web, please send a note to |
9 | license@php.net so we can mail you a copy immediately. |
10 +----------------------------------------------------------------------+
11 | Authors: Akshat Gupta <g.akshat@gmail.com> |
12 +----------------------------------------------------------------------+
17 #include "phpCairo_api.h"
18 #include "php_cairo.h"
19 #include "CairoExceptionMacro.c"
20 #include "CairoException.c"
21 #include "CairoFont.c"
22 #include "CairoMatrix.c"
23 #include "CairoPath.c"
24 #include "CairoSurface.c"
25 #include "CairoPattern.c"
26 #include "CairoContext.c"
29 /* {{{ Class definitions */
30 /* }}} Class definitions*/
32 /* {{{ cairo_functions[] */
33 function_entry cairo_functions
[] = {
34 PHP_FE(cairoVersion
, cairo_version_arg_info
)
35 PHP_FE(cairoVersionString
, cairo_version_string_arg_info
)
41 /* {{{ cairo_module_entry
43 zend_module_entry cairo_module_entry
= {
44 STANDARD_MODULE_HEADER
,
47 PHP_MINIT(cairo
), /* Replace with NULL if there is nothing to do at php startup */
48 PHP_MSHUTDOWN(cairo
), /* Replace with NULL if there is nothing to do at php shutdown */
49 PHP_RINIT(cairo
), /* Replace with NULL if there is nothing to do at request start */
50 PHP_RSHUTDOWN(cairo
), /* Replace with NULL if there is nothing to do at request end */
53 STANDARD_MODULE_PROPERTIES
57 #ifdef COMPILE_DL_CAIRO
58 ZEND_GET_MODULE(cairo
)
62 /* {{{ PHP_MINIT_FUNCTION */
63 PHP_MINIT_FUNCTION(cairo
)
65 class_init_CairoContext();
66 class_init_CairoFontFace();
67 class_init_CairoFontOptions();
68 class_init_CairoMatrix();
69 class_init_CairoPath();
70 class_init_CairoPattern();
71 class_init_CairoGradient();
72 class_init_CairoLinearGradient();
73 class_init_CairoRadialGradient();
74 class_init_CairoSolidPattern();
75 class_init_CairoSurfacePattern();
76 class_init_CairoScaledFont();
77 class_init_CairoSurface();
78 class_init_CairoImageSurface();
79 class_init_CairoPDFSurface();
80 class_init_CairoPSSurface();
81 class_init_CairoQuartzSurface();
82 class_init_CairoSVGSurface();
83 class_init_CairoWin32Surface();
84 class_init_CairoXlibSurface();
85 class_init_CairoException();
87 /* add your stuff here */
91 REGISTER_LONG_CONSTANT( "HAS_ATSUI_FONT", 1, CONST_CS
| CONST_PERSISTENT
);
93 REGISTER_LONG_CONSTANT( "HAS_ATSUI_FONT", 0, CONST_CS
| CONST_PERSISTENT
);
96 REGISTER_LONG_CONSTANT( "HAS_FT_FONT", 1, CONST_CS
| CONST_PERSISTENT
);
98 REGISTER_LONG_CONSTANT( "HAS_FT_FONT", 0, CONST_CS
| CONST_PERSISTENT
);
100 #if HAS_GLITZ_SURFACE
101 REGISTER_LONG_CONSTANT( "HAS_GLITZ_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
103 REGISTER_LONG_CONSTANT( "HAS_GLITZ_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
106 REGISTER_LONG_CONSTANT( "HAS_PDF_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
108 REGISTER_LONG_CONSTANT( "HAS_PDF_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
110 #if HAS_PNG_FUNCTIONS
111 REGISTER_LONG_CONSTANT( "HAS_PNG_FUNCTIONS", 1, CONST_CS
| CONST_PERSISTENT
);
113 REGISTER_LONG_CONSTANT( "HAS_PNG_FUNCTIONS", 0, CONST_CS
| CONST_PERSISTENT
);
116 REGISTER_LONG_CONSTANT( "HAS_PS_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
118 REGISTER_LONG_CONSTANT( "HAS_PS_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
121 REGISTER_LONG_CONSTANT( "HAS_SVG_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
123 REGISTER_LONG_CONSTANT( "HAS_SVG_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
125 #if HAS_QUARTZ_SURFACE
126 REGISTER_LONG_CONSTANT( "HAS_QUARTZ_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
128 REGISTER_LONG_CONSTANT( "HAS_QUARTZ_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
131 REGISTER_LONG_CONSTANT( "HAS_WIN32_FONT", 1, CONST_CS
| CONST_PERSISTENT
);
133 REGISTER_LONG_CONSTANT( "HAS_WIN32_FONT", 0, CONST_CS
| CONST_PERSISTENT
);
135 #if HAS_WIN32_SURFACE
136 REGISTER_LONG_CONSTANT( "HAS_WIN32_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
138 REGISTER_LONG_CONSTANT( "HAS_WIN32_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
141 REGISTER_LONG_CONSTANT( "HAS_XCB_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
143 REGISTER_LONG_CONSTANT( "HAS_XCB_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
146 REGISTER_LONG_CONSTANT( "HAS_XLIB_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
148 REGISTER_LONG_CONSTANT( "HAS_XLIB_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
151 #define CONSTANT(x) REGISTER_LONG_CONSTANT( #x, CAIRO_##x, CONST_CS | CONST_PERSISTENT)
152 CONSTANT(ANTIALIAS_DEFAULT
);
153 CONSTANT(ANTIALIAS_NONE
);
154 CONSTANT(ANTIALIAS_GRAY
);
155 CONSTANT(ANTIALIAS_SUBPIXEL
);
157 CONSTANT(CONTENT_COLOR
);
158 CONSTANT(CONTENT_ALPHA
);
159 CONSTANT(CONTENT_COLOR_ALPHA
);
161 CONSTANT(EXTEND_NONE
);
162 CONSTANT(EXTEND_REPEAT
);
163 CONSTANT(EXTEND_REFLECT
);
164 CONSTANT(EXTEND_PAD
);
166 CONSTANT(FILL_RULE_WINDING
);
167 CONSTANT(FILL_RULE_EVEN_ODD
);
169 CONSTANT(FILTER_FAST
);
170 CONSTANT(FILTER_GOOD
);
171 CONSTANT(FILTER_BEST
);
172 CONSTANT(FILTER_NEAREST
);
173 CONSTANT(FILTER_BILINEAR
);
174 CONSTANT(FILTER_GAUSSIAN
);
176 CONSTANT(FONT_WEIGHT_NORMAL
);
177 CONSTANT(FONT_WEIGHT_BOLD
);
179 CONSTANT(FONT_SLANT_NORMAL
);
180 CONSTANT(FONT_SLANT_ITALIC
);
181 CONSTANT(FONT_SLANT_OBLIQUE
);
183 CONSTANT(FORMAT_ARGB32
);
184 CONSTANT(FORMAT_RGB24
);
187 CONSTANT(FORMAT_RGB16_565
);
189 CONSTANT(HINT_METRICS_DEFAULT
);
190 CONSTANT(HINT_METRICS_OFF
);
191 CONSTANT(HINT_METRICS_ON
);
193 CONSTANT(HINT_STYLE_DEFAULT
);
194 CONSTANT(HINT_STYLE_NONE
);
195 CONSTANT(HINT_STYLE_SLIGHT
);
196 CONSTANT(HINT_STYLE_MEDIUM
);
197 CONSTANT(HINT_STYLE_FULL
);
199 CONSTANT(LINE_CAP_BUTT
);
200 CONSTANT(LINE_CAP_ROUND
);
201 CONSTANT(LINE_CAP_SQUARE
);
203 CONSTANT(LINE_JOIN_MITER
);
204 CONSTANT(LINE_JOIN_ROUND
);
205 CONSTANT(LINE_JOIN_BEVEL
);
207 CONSTANT(OPERATOR_CLEAR
);
209 CONSTANT(OPERATOR_SOURCE
);
210 CONSTANT(OPERATOR_OVER
);
211 CONSTANT(OPERATOR_IN
);
212 CONSTANT(OPERATOR_OUT
);
213 CONSTANT(OPERATOR_ATOP
);
215 CONSTANT(OPERATOR_DEST
);
216 CONSTANT(OPERATOR_DEST_OVER
);
217 CONSTANT(OPERATOR_DEST_IN
);
218 CONSTANT(OPERATOR_DEST_OUT
);
219 CONSTANT(OPERATOR_DEST_ATOP
);
221 CONSTANT(OPERATOR_XOR
);
222 CONSTANT(OPERATOR_ADD
);
223 CONSTANT(OPERATOR_SATURATE
);
225 CONSTANT(PATH_MOVE_TO
);
226 CONSTANT(PATH_LINE_TO
);
227 CONSTANT(PATH_CURVE_TO
);
228 CONSTANT(PATH_CLOSE_PATH
);
230 CONSTANT(SUBPIXEL_ORDER_DEFAULT
);
231 CONSTANT(SUBPIXEL_ORDER_RGB
);
232 CONSTANT(SUBPIXEL_ORDER_BGR
);
233 CONSTANT(SUBPIXEL_ORDER_VRGB
);
234 CONSTANT(SUBPIXEL_ORDER_VBGR
);
244 /* {{{ PHP_MSHUTDOWN_FUNCTION */
245 PHP_MSHUTDOWN_FUNCTION(cairo
)
248 /* add your stuff here */
255 /* {{{ PHP_RINIT_FUNCTION */
256 PHP_RINIT_FUNCTION(cairo
)
258 /* add your stuff here */
265 /* {{{ PHP_RSHUTDOWN_FUNCTION */
266 PHP_RSHUTDOWN_FUNCTION(cairo
)
268 /* add your stuff here */
275 /* {{{ PHP_MINFO_FUNCTION */
276 PHP_MINFO_FUNCTION(cairo
)
278 php_info_print_box_start(0);
279 php_printf("<p>PHP bindings for Cairo Graphic Library</p>\n");
280 php_printf("<p>Version 1.0.1devel (2008-05-22)</p>\n");
281 php_printf("<p><b>Authors:</b></p>\n");
282 php_printf("<p>Akshat Gupta <g.akshat@gmail.com> (lead)</p>\n");
283 php_info_print_box_end();
284 /* add your stuff here */
290 /* {{{ proto int cairoVersion()
292 PHP_FUNCTION(cairoVersion
)
297 if (ZEND_NUM_ARGS()>0) {
302 RETURN_LONG(cairo_version());
304 /* }}} cairo_version */
307 /* {{{ proto string cairVersionString()
309 PHP_FUNCTION(cairoVersionString
)
314 if (ZEND_NUM_ARGS()>0) {
318 RETURN_STRING(cairo_version_string(), 1);
320 /* }}} cairo_version_string */
322 #endif /* HAVE_CAIRO */
330 * vim600: noet sw=4 ts=4 fdm=marker
331 * vim<600: noet sw=4 ts=4