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 "php_cairo.h"
18 #include "CairoExceptionMacro.c"
19 #include "CairoException.c"
20 #include "CairoFont.c"
21 #include "CairoMatrix.c"
22 #include "CairoPath.c"
23 #include "CairoSurface.c"
24 #include "CairoPattern.c"
25 #include "CairoContext.c"
28 /* {{{ Class definitions */
29 /* }}} Class definitions*/
31 /* {{{ cairo_functions[] */
32 function_entry cairo_functions
[] = {
33 PHP_FE(cairoVersion
, cairo_version_arg_info
)
34 PHP_FE(cairoVersionString
, cairo_version_string_arg_info
)
40 /* {{{ cairo_module_entry
42 zend_module_entry cairo_module_entry
= {
43 STANDARD_MODULE_HEADER
,
46 PHP_MINIT(cairo
), /* Replace with NULL if there is nothing to do at php startup */
47 PHP_MSHUTDOWN(cairo
), /* Replace with NULL if there is nothing to do at php shutdown */
48 PHP_RINIT(cairo
), /* Replace with NULL if there is nothing to do at request start */
49 PHP_RSHUTDOWN(cairo
), /* Replace with NULL if there is nothing to do at request end */
52 STANDARD_MODULE_PROPERTIES
56 #ifdef COMPILE_DL_CAIRO
57 ZEND_GET_MODULE(cairo
)
61 /* {{{ PHP_MINIT_FUNCTION */
62 PHP_MINIT_FUNCTION(cairo
)
64 class_init_CairoContext();
65 class_init_CairoFontFace();
66 class_init_CairoFontOptions();
67 class_init_CairoMatrix();
68 class_init_CairoPath();
69 class_init_CairoPattern();
70 class_init_CairoGradient();
71 class_init_CairoLinearGradient();
72 class_init_CairoRadialGradient();
73 class_init_CairoSolidPattern();
74 class_init_CairoSurfacePattern();
75 class_init_CairoScaledFont();
76 class_init_CairoSurface();
77 class_init_CairoImageSurface();
78 class_init_CairoPDFSurface();
79 class_init_CairoPSSurface();
80 class_init_CairoQuartzSurface();
81 class_init_CairoSVGSurface();
82 class_init_CairoWin32Surface();
83 class_init_CairoXlibSurface();
84 class_init_CairoException();
86 /* add your stuff here */
90 REGISTER_LONG_CONSTANT( "HAS_ATSUI_FONT", 1, CONST_CS
| CONST_PERSISTENT
);
92 REGISTER_LONG_CONSTANT( "HAS_ATSUI_FONT", 0, CONST_CS
| CONST_PERSISTENT
);
95 REGISTER_LONG_CONSTANT( "HAS_FT_FONT", 1, CONST_CS
| CONST_PERSISTENT
);
97 REGISTER_LONG_CONSTANT( "HAS_FT_FONT", 0, CONST_CS
| CONST_PERSISTENT
);
100 REGISTER_LONG_CONSTANT( "HAS_GLITZ_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
102 REGISTER_LONG_CONSTANT( "HAS_GLITZ_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
105 REGISTER_LONG_CONSTANT( "HAS_PDF_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
107 REGISTER_LONG_CONSTANT( "HAS_PDF_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
109 #if HAS_PNG_FUNCTIONS
110 REGISTER_LONG_CONSTANT( "HAS_PNG_FUNCTIONS", 1, CONST_CS
| CONST_PERSISTENT
);
112 REGISTER_LONG_CONSTANT( "HAS_PNG_FUNCTIONS", 0, CONST_CS
| CONST_PERSISTENT
);
115 REGISTER_LONG_CONSTANT( "HAS_PS_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
117 REGISTER_LONG_CONSTANT( "HAS_PS_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
120 REGISTER_LONG_CONSTANT( "HAS_SVG_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
122 REGISTER_LONG_CONSTANT( "HAS_SVG_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
124 #if HAS_QUARTZ_SURFACE
125 REGISTER_LONG_CONSTANT( "HAS_QUARTZ_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
127 REGISTER_LONG_CONSTANT( "HAS_QUARTZ_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
130 REGISTER_LONG_CONSTANT( "HAS_WIN32_FONT", 1, CONST_CS
| CONST_PERSISTENT
);
132 REGISTER_LONG_CONSTANT( "HAS_WIN32_FONT", 0, CONST_CS
| CONST_PERSISTENT
);
134 #if HAS_WIN32_SURFACE
135 REGISTER_LONG_CONSTANT( "HAS_WIN32_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
137 REGISTER_LONG_CONSTANT( "HAS_WIN32_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
140 REGISTER_LONG_CONSTANT( "HAS_XCB_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
142 REGISTER_LONG_CONSTANT( "HAS_XCB_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
145 REGISTER_LONG_CONSTANT( "HAS_XLIB_SURFACE", 1, CONST_CS
| CONST_PERSISTENT
);
147 REGISTER_LONG_CONSTANT( "HAS_XLIB_SURFACE", 0, CONST_CS
| CONST_PERSISTENT
);
150 #define CONSTANT(x) REGISTER_LONG_CONSTANT( #x, CAIRO_##x, CONST_CS | CONST_PERSISTENT)
151 CONSTANT(ANTIALIAS_DEFAULT
);
152 CONSTANT(ANTIALIAS_NONE
);
153 CONSTANT(ANTIALIAS_GRAY
);
154 CONSTANT(ANTIALIAS_SUBPIXEL
);
156 CONSTANT(CONTENT_COLOR
);
157 CONSTANT(CONTENT_ALPHA
);
158 CONSTANT(CONTENT_COLOR_ALPHA
);
160 CONSTANT(EXTEND_NONE
);
161 CONSTANT(EXTEND_REPEAT
);
162 CONSTANT(EXTEND_REFLECT
);
163 CONSTANT(EXTEND_PAD
);
165 CONSTANT(FILL_RULE_WINDING
);
166 CONSTANT(FILL_RULE_EVEN_ODD
);
168 CONSTANT(FILTER_FAST
);
169 CONSTANT(FILTER_GOOD
);
170 CONSTANT(FILTER_BEST
);
171 CONSTANT(FILTER_NEAREST
);
172 CONSTANT(FILTER_BILINEAR
);
173 CONSTANT(FILTER_GAUSSIAN
);
175 CONSTANT(FONT_WEIGHT_NORMAL
);
176 CONSTANT(FONT_WEIGHT_BOLD
);
178 CONSTANT(FONT_SLANT_NORMAL
);
179 CONSTANT(FONT_SLANT_ITALIC
);
180 CONSTANT(FONT_SLANT_OBLIQUE
);
182 CONSTANT(FORMAT_ARGB32
);
183 CONSTANT(FORMAT_RGB24
);
186 CONSTANT(FORMAT_RGB16_565
);
188 CONSTANT(HINT_METRICS_DEFAULT
);
189 CONSTANT(HINT_METRICS_OFF
);
190 CONSTANT(HINT_METRICS_ON
);
192 CONSTANT(HINT_STYLE_DEFAULT
);
193 CONSTANT(HINT_STYLE_NONE
);
194 CONSTANT(HINT_STYLE_SLIGHT
);
195 CONSTANT(HINT_STYLE_MEDIUM
);
196 CONSTANT(HINT_STYLE_FULL
);
198 CONSTANT(LINE_CAP_BUTT
);
199 CONSTANT(LINE_CAP_ROUND
);
200 CONSTANT(LINE_CAP_SQUARE
);
202 CONSTANT(LINE_JOIN_MITER
);
203 CONSTANT(LINE_JOIN_ROUND
);
204 CONSTANT(LINE_JOIN_BEVEL
);
206 CONSTANT(OPERATOR_CLEAR
);
208 CONSTANT(OPERATOR_SOURCE
);
209 CONSTANT(OPERATOR_OVER
);
210 CONSTANT(OPERATOR_IN
);
211 CONSTANT(OPERATOR_OUT
);
212 CONSTANT(OPERATOR_ATOP
);
214 CONSTANT(OPERATOR_DEST
);
215 CONSTANT(OPERATOR_DEST_OVER
);
216 CONSTANT(OPERATOR_DEST_IN
);
217 CONSTANT(OPERATOR_DEST_OUT
);
218 CONSTANT(OPERATOR_DEST_ATOP
);
220 CONSTANT(OPERATOR_XOR
);
221 CONSTANT(OPERATOR_ADD
);
222 CONSTANT(OPERATOR_SATURATE
);
224 CONSTANT(PATH_MOVE_TO
);
225 CONSTANT(PATH_LINE_TO
);
226 CONSTANT(PATH_CURVE_TO
);
227 CONSTANT(PATH_CLOSE_PATH
);
229 CONSTANT(SUBPIXEL_ORDER_DEFAULT
);
230 CONSTANT(SUBPIXEL_ORDER_RGB
);
231 CONSTANT(SUBPIXEL_ORDER_BGR
);
232 CONSTANT(SUBPIXEL_ORDER_VRGB
);
233 CONSTANT(SUBPIXEL_ORDER_VBGR
);
243 /* {{{ PHP_MSHUTDOWN_FUNCTION */
244 PHP_MSHUTDOWN_FUNCTION(cairo
)
247 /* add your stuff here */
254 /* {{{ PHP_RINIT_FUNCTION */
255 PHP_RINIT_FUNCTION(cairo
)
257 /* add your stuff here */
264 /* {{{ PHP_RSHUTDOWN_FUNCTION */
265 PHP_RSHUTDOWN_FUNCTION(cairo
)
267 /* add your stuff here */
274 /* {{{ PHP_MINFO_FUNCTION */
275 PHP_MINFO_FUNCTION(cairo
)
277 php_info_print_box_start(0);
278 php_printf("<p>PHP bindings for Cairo Graphic Library</p>\n");
279 php_printf("<p>Version 1.0.1devel (2008-05-22)</p>\n");
280 php_printf("<p><b>Authors:</b></p>\n");
281 php_printf("<p>Akshat Gupta <g.akshat@gmail.com> (lead)</p>\n");
282 php_info_print_box_end();
283 /* add your stuff here */
289 /* {{{ proto int cairoVersion()
291 PHP_FUNCTION(cairoVersion
)
296 if (ZEND_NUM_ARGS()>0) {
301 RETURN_LONG(cairo_version());
303 /* }}} cairo_version */
306 /* {{{ proto string cairVersionString()
308 PHP_FUNCTION(cairoVersionString
)
313 if (ZEND_NUM_ARGS()>0) {
317 RETURN_STRING(cairo_version_string(), 1);
319 /* }}} cairo_version_string */
321 #endif /* HAVE_CAIRO */
329 * vim600: noet sw=4 ts=4 fdm=marker
330 * vim<600: noet sw=4 ts=4