-
Notifications
You must be signed in to change notification settings - Fork 19
/
cairo_font_options.c
487 lines (412 loc) · 19 KB
/
cairo_font_options.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: Elizabeth Smith <[email protected]> |
| Michael Maclean <[email protected]> |
+----------------------------------------------------------------------+
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "php.h"
#include "zend_exceptions.h"
#include "php_cairo.h"
zend_class_entry *cairo_ce_cairofontoptions;
zend_class_entry *cairo_ce_subpixelorder;
zend_class_entry *cairo_ce_hintstyle;
zend_class_entry *cairo_ce_hintmetrics;
ZEND_BEGIN_ARG_INFO(CairoFontOptions_fontoptions_args, ZEND_SEND_BY_VAL)
/* ZEND_ARG_OBJ_INFO(0, other, CairoFontOptions, 0) - dang E_RECOVERABLE_ERROR */
ZEND_ARG_INFO(0, other)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(CairoFontOptions_setAntialias_args, ZEND_SEND_BY_VAL)
ZEND_ARG_INFO(0, antialias)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(CairoFontOptions_setSubpixelOrder_args, ZEND_SEND_BY_VAL)
ZEND_ARG_INFO(0, subpixel_order)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(CairoFontOptions_setHintStyle_args, ZEND_SEND_BY_VAL)
ZEND_ARG_INFO(0, hint_style)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(CairoFontOptions_setHintMetrics_args, ZEND_SEND_BY_VAL)
ZEND_ARG_INFO(0, hint_metrics)
ZEND_END_ARG_INFO()
/* {{{ cairo_font_options_object_destroy
*/
static void cairo_font_options_object_destroy(void *object TSRMLS_DC)
{
cairo_font_options_object *font_options = (cairo_font_options_object *)object;
zend_hash_destroy(font_options->std.properties);
FREE_HASHTABLE(font_options->std.properties);
if(font_options->font_options) {
cairo_font_options_destroy(font_options->font_options);
}
efree(object);
}
/* }}} */
/* {{{ cairo_font_options_object_new
*/
static zend_object_value cairo_font_options_object_new(zend_class_entry *ce TSRMLS_DC)
{
zend_object_value retval;
cairo_font_options_object *font_options;
#if PHP_VERSION_ID < 50399
zval *temp;
#endif
font_options = ecalloc(1, sizeof(cairo_font_options_object));
font_options->font_options = NULL;
font_options->std.ce = ce;
ALLOC_HASHTABLE(font_options->std.properties);
zend_hash_init(font_options->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
#if PHP_VERSION_ID < 50399
zend_hash_copy(font_options->std.properties, &ce->default_properties, (copy_ctor_func_t) zval_add_ref,(void *) &temp, sizeof(zval *));
#else
object_properties_init(&font_options->std, ce);
#endif
retval.handle = zend_objects_store_put(font_options, NULL, (zend_objects_free_object_storage_t)cairo_font_options_object_destroy, NULL TSRMLS_CC);
retval.handlers = zend_get_std_object_handlers();
return retval;
}
/* }}} */
/* {{{ proto void __contruct(void)
Creates a new CairoFontOptions object with all options initialized to default values.
*/
PHP_METHOD(CairoFontOptions, __construct)
{
cairo_font_options_object *font_options_object;
PHP_CAIRO_ERROR_HANDLING(TRUE)
if (zend_parse_parameters_none() == FAILURE) {
PHP_CAIRO_RESTORE_ERRORS(TRUE)
return;
}
PHP_CAIRO_RESTORE_ERRORS(TRUE)
font_options_object = (cairo_font_options_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
font_options_object->font_options = cairo_font_options_create();
php_cairo_throw_exception(cairo_font_options_status(font_options_object->font_options) TSRMLS_CC);
}
/* }}} */
/* {{{ proto void cairo_font_options_create(void)
Creates a new CairoFontOptions object with all options initialized to default values.
*/
PHP_FUNCTION(cairo_font_options_create)
{
cairo_font_options_object *fontoptions_object;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
object_init_ex(return_value, cairo_ce_cairofontoptions);
fontoptions_object = (cairo_font_options_object *)zend_object_store_get_object(return_value TSRMLS_CC);
fontoptions_object->font_options = cairo_font_options_create();
php_cairo_trigger_error(cairo_font_options_status(fontoptions_object->font_options) TSRMLS_CC);
}
/* }}} */
/* {{{ proto void cairo_font_options_status(CairoFontOptions options)
proto void CairoFontOptions->status(void)
Checks whether an error has previously occurred for this font options object
*/
PHP_FUNCTION(cairo_font_options_status)
{
zval *font_options_zval = NULL;
cairo_font_options_object *font_options_object;
PHP_CAIRO_ERROR_HANDLING(FALSE)
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &font_options_zval, cairo_ce_cairofontoptions) == FAILURE) {
PHP_CAIRO_RESTORE_ERRORS(FALSE)
return;
}
PHP_CAIRO_RESTORE_ERRORS(FALSE)
font_options_object = (cairo_font_options_object *) cairo_font_options_object_get(font_options_zval TSRMLS_CC);
RETURN_LONG(cairo_font_options_status(font_options_object->font_options));
}
/* }}} */
/* {{{ proto void cairo_font_options_merge(CairoFontOptions options, CairoFontOptions other)
proto void CairoFontOptions->merge(CairoFontOptions other)
Merges non-default options from other into options, replacing existing values.
*/
PHP_FUNCTION(cairo_font_options_merge)
{
zval *options_zval = NULL, *other_zval = NULL;
cairo_font_options_object *options_object, *other_object;
PHP_CAIRO_ERROR_HANDLING(FALSE)
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO",
&options_zval, cairo_ce_cairofontoptions, &other_zval, cairo_ce_cairofontoptions) == FAILURE) {
PHP_CAIRO_RESTORE_ERRORS(FALSE)
return;
}
PHP_CAIRO_RESTORE_ERRORS(FALSE)
options_object = (cairo_font_options_object *) cairo_font_options_object_get(options_zval TSRMLS_CC);
other_object = (cairo_font_options_object *) cairo_font_options_object_get(options_zval TSRMLS_CC);
cairo_font_options_merge(options_object->font_options, other_object->font_options);
PHP_CAIRO_ERROR(cairo_font_options_status(options_object->font_options));
}
/* }}} */
/* {{{ proto long cairo_font_options_hash(CairoFontOptions options)
proto long CairoFontOptions->hash(void)
Compute a hash for the font options object
*/
PHP_FUNCTION(cairo_font_options_hash)
{
zval *font_options_zval = NULL;
cairo_font_options_object *font_options_object;
PHP_CAIRO_ERROR_HANDLING(FALSE)
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &font_options_zval, cairo_ce_cairofontoptions) == FAILURE) {
PHP_CAIRO_RESTORE_ERRORS(FALSE)
return;
}
PHP_CAIRO_RESTORE_ERRORS(FALSE)
font_options_object = (cairo_font_options_object *) cairo_font_options_object_get(font_options_zval TSRMLS_CC);
RETURN_LONG(cairo_font_options_hash(font_options_object->font_options));
}
/* }}} */
/* {{{ proto boolean cairo_font_options_equal(CairoFontOptions options, CairoFontOptions other)
proto boolean CairoFontOptions->equal(CairoFontOptions other)
Compares two font options objects for equality.
*/
PHP_FUNCTION(cairo_font_options_equal)
{
zval *options_zval = NULL, *other_zval = NULL;
cairo_font_options_object *options_object, *other_object;
PHP_CAIRO_ERROR_HANDLING(FALSE)
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO",
&options_zval, cairo_ce_cairofontoptions, &other_zval, cairo_ce_cairofontoptions) == FAILURE) {
PHP_CAIRO_RESTORE_ERRORS(FALSE)
return;
}
PHP_CAIRO_RESTORE_ERRORS(FALSE)
options_object = (cairo_font_options_object *) cairo_font_options_object_get(options_zval TSRMLS_CC);
other_object = (cairo_font_options_object *) cairo_font_options_object_get(options_zval TSRMLS_CC);
RETURN_BOOL(cairo_font_options_equal(options_object->font_options, other_object->font_options));
}
/* }}} */
/* {{{ proto void cairo_font_options_set_antialias(CairoFontOptions options)
proto void CairoFontOptions->setAntialias(void)
Sets the antialiasing mode for the font options object.
*/
PHP_FUNCTION(cairo_font_options_set_antialias)
{
long antialias = 0;
zval *font_options_zval = NULL;
cairo_font_options_object *font_options_object;
PHP_CAIRO_ERROR_HANDLING(FALSE)
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &font_options_zval, cairo_ce_cairofontoptions, &antialias) == FAILURE) {
PHP_CAIRO_RESTORE_ERRORS(FALSE)
return;
}
PHP_CAIRO_RESTORE_ERRORS(FALSE)
font_options_object = (cairo_font_options_object *) cairo_font_options_object_get(font_options_zval TSRMLS_CC);
cairo_font_options_set_antialias(font_options_object->font_options, antialias);
PHP_CAIRO_ERROR(cairo_font_options_status(font_options_object->font_options));
}
/* }}} */
/* {{{ proto int cairo_font_options_get_antialias(CairoFontOptions options)
proto int CairoFontOptions->getAntialias(void)
Gets the antialiasing mode for the font options object.
*/
PHP_FUNCTION(cairo_font_options_get_antialias)
{
zval *font_options_zval = NULL;
cairo_font_options_object *font_options_object;
PHP_CAIRO_ERROR_HANDLING(FALSE)
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &font_options_zval, cairo_ce_cairofontoptions) == FAILURE) {
PHP_CAIRO_RESTORE_ERRORS(FALSE)
return;
}
PHP_CAIRO_RESTORE_ERRORS(FALSE)
font_options_object = (cairo_font_options_object *) cairo_font_options_object_get(font_options_zval TSRMLS_CC);
RETURN_LONG(cairo_font_options_get_antialias(font_options_object->font_options));
}
/* }}} */
/* {{{ proto void cairo_font_options_set_subpixel_order(CairoFontOptions options)
proto void CairoFontOptions->setSubpixelOrder(void)
Sets the subpixel order for the font options object.
*/
PHP_FUNCTION(cairo_font_options_set_subpixel_order)
{
long subpixel_order = 0;
zval *font_options_zval = NULL;
cairo_font_options_object *font_options_object;
PHP_CAIRO_ERROR_HANDLING(FALSE)
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &font_options_zval, cairo_ce_cairofontoptions, &subpixel_order) == FAILURE) {
PHP_CAIRO_RESTORE_ERRORS(FALSE)
return;
}
PHP_CAIRO_RESTORE_ERRORS(FALSE)
font_options_object = (cairo_font_options_object *) cairo_font_options_object_get(font_options_zval TSRMLS_CC);
cairo_font_options_set_subpixel_order(font_options_object->font_options, subpixel_order);
PHP_CAIRO_ERROR(cairo_font_options_status(font_options_object->font_options));
}
/* }}} */
/* {{{ proto int cairo_font_options_get_subpixel_order(CairoFontOptions options)
proto int CairoFontOptions->getSubpixelOrder(void)
Gets the subpixel order for the font options object.
*/
PHP_FUNCTION(cairo_font_options_get_subpixel_order)
{
zval *font_options_zval = NULL;
cairo_font_options_object *font_options_object;
PHP_CAIRO_ERROR_HANDLING(FALSE)
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &font_options_zval, cairo_ce_cairofontoptions) == FAILURE) {
PHP_CAIRO_RESTORE_ERRORS(FALSE)
return;
}
PHP_CAIRO_RESTORE_ERRORS(FALSE)
font_options_object = (cairo_font_options_object *) cairo_font_options_object_get(font_options_zval TSRMLS_CC);
RETURN_LONG(cairo_font_options_get_subpixel_order(font_options_object->font_options));
}
/* }}} */
/* {{{ proto void cairo_font_options_set_hint_style(CairoFontOptions options)
proto void CairoFontOptions->setHintStyle(void)
Sets the hint style for font outlines for the font options object.
*/
PHP_FUNCTION(cairo_font_options_set_hint_style)
{
long hint_style = 0;
zval *font_options_zval = NULL;
cairo_font_options_object *font_options_object;
PHP_CAIRO_ERROR_HANDLING(FALSE)
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &font_options_zval, cairo_ce_cairofontoptions, &hint_style) == FAILURE) {
PHP_CAIRO_RESTORE_ERRORS(FALSE)
return;
}
PHP_CAIRO_RESTORE_ERRORS(FALSE)
font_options_object = (cairo_font_options_object *) cairo_font_options_object_get(font_options_zval TSRMLS_CC);
cairo_font_options_set_hint_style(font_options_object->font_options, hint_style);
PHP_CAIRO_ERROR(cairo_font_options_status(font_options_object->font_options));
}
/* }}} */
/* {{{ proto int cairo_font_options_get_hint_style(CairoFontOptions options)
proto int CairoFontOptions->getHintStyle(void)
Gets the hint style for font outlines for the font options object.
*/
PHP_FUNCTION(cairo_font_options_get_hint_style)
{
zval *font_options_zval = NULL;
cairo_font_options_object *font_options_object;
PHP_CAIRO_ERROR_HANDLING(FALSE)
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &font_options_zval, cairo_ce_cairofontoptions) == FAILURE) {
PHP_CAIRO_RESTORE_ERRORS(FALSE)
return;
}
PHP_CAIRO_RESTORE_ERRORS(FALSE)
font_options_object = (cairo_font_options_object *) cairo_font_options_object_get(font_options_zval TSRMLS_CC);
RETURN_LONG(cairo_font_options_get_hint_style(font_options_object->font_options));
}
/* }}} */
/* {{{ proto void cairo_font_options_set_hint_metrics(CairoFontOptions options)
proto void CairoFontOptions->setHintMetrics(void)
Sets the metrics hinting mode for the font options object.
*/
PHP_FUNCTION(cairo_font_options_set_hint_metrics)
{
long hint_metrics = 0;
zval *font_options_zval = NULL;
cairo_font_options_object *font_options_object;
PHP_CAIRO_ERROR_HANDLING(FALSE)
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "Ol", &font_options_zval, cairo_ce_cairofontoptions, &hint_metrics) == FAILURE) {
PHP_CAIRO_RESTORE_ERRORS(FALSE)
return;
}
PHP_CAIRO_RESTORE_ERRORS(FALSE)
font_options_object = (cairo_font_options_object *) cairo_font_options_object_get(font_options_zval TSRMLS_CC);
cairo_font_options_set_hint_metrics(font_options_object->font_options, hint_metrics);
PHP_CAIRO_ERROR(cairo_font_options_status(font_options_object->font_options));
}
/* }}} */
/* {{{ proto int cairo_font_options_get_hint_metrics(CairoFontOptions options)
proto int CairoFontOptions->getHintMetrics(void)
Gets the metrics hinting mode for the font options object.
*/
PHP_FUNCTION(cairo_font_options_get_hint_metrics)
{
zval *font_options_zval = NULL;
cairo_font_options_object *font_options_object;
PHP_CAIRO_ERROR_HANDLING(FALSE)
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "O", &font_options_zval, cairo_ce_cairofontoptions) == FAILURE) {
PHP_CAIRO_RESTORE_ERRORS(FALSE)
return;
}
PHP_CAIRO_RESTORE_ERRORS(FALSE)
font_options_object = (cairo_font_options_object *) cairo_font_options_object_get(font_options_zval TSRMLS_CC);
RETURN_LONG(cairo_font_options_get_hint_metrics(font_options_object->font_options));
}
/* }}} */
const zend_function_entry cairo_font_options_methods[] = {
PHP_ME(CairoFontOptions, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_ME_MAPPING(status, cairo_font_options_status, NULL, ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(merge, cairo_font_options_merge, CairoFontOptions_fontoptions_args, ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(hash, cairo_font_options_hash, NULL, ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(equal, cairo_font_options_equal, CairoFontOptions_fontoptions_args, ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(setAntialias, cairo_font_options_set_antialias, CairoFontOptions_setAntialias_args, ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(getAntialias, cairo_font_options_get_antialias, NULL, ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(setSubpixelOrder, cairo_font_options_set_subpixel_order, CairoFontOptions_setSubpixelOrder_args, ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(getSubpixelOrder, cairo_font_options_get_subpixel_order, NULL, ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(setHintStyle, cairo_font_options_set_hint_style, CairoFontOptions_setHintStyle_args, ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(getHintStyle, cairo_font_options_get_hint_style, NULL, ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(setHintMetrics, cairo_font_options_set_hint_metrics, CairoFontOptions_setHintMetrics_args, ZEND_ACC_PUBLIC)
PHP_ME_MAPPING(getHintMetrics, cairo_font_options_get_hint_metrics, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
/* }}} */
/* Helper Functions */
PHP_CAIRO_API zend_class_entry * php_cairo_get_fontoptions_ce()
{
return cairo_ce_cairofontoptions;
}
/* }}} */
/* These is a wrapper around cairo_font_options_copy to "re-export" it out
so extensions using php cairo don't have to explicitly link against cairo */
PHP_CAIRO_API cairo_font_options_t * php_cairo_font_options_copy(const cairo_font_options_t *fo)
{
return cairo_font_options_copy(fo);
}
/* }}} */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(cairo_font_options)
{
zend_class_entry fontoptions_ce;
zend_class_entry hintstyle_ce;
zend_class_entry hintmetrics_ce;
INIT_CLASS_ENTRY(fontoptions_ce, "CairoFontOptions", cairo_font_options_methods);
cairo_ce_cairofontoptions = zend_register_internal_class(&fontoptions_ce TSRMLS_CC);
cairo_ce_cairofontoptions->create_object = cairo_font_options_object_new;
INIT_CLASS_ENTRY(hintstyle_ce, "CairoHintStyle", NULL);
cairo_ce_hintstyle = zend_register_internal_class(&hintstyle_ce TSRMLS_CC);
cairo_ce_hintstyle->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_ACC_FINAL_CLASS;
#define REGISTER_CAIRO_HINTSTYLE_LONG_CONST(const_name, value) \
zend_declare_class_constant_long(cairo_ce_hintstyle, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); \
REGISTER_LONG_CONSTANT(#value, value, CONST_CS | CONST_PERSISTENT);
REGISTER_CAIRO_HINTSTYLE_LONG_CONST("STYLE_DEFAULT", CAIRO_HINT_STYLE_DEFAULT);
REGISTER_CAIRO_HINTSTYLE_LONG_CONST("STYLE_NONE", CAIRO_HINT_STYLE_NONE);
REGISTER_CAIRO_HINTSTYLE_LONG_CONST("STYLE_SLIGHT", CAIRO_HINT_STYLE_SLIGHT);
REGISTER_CAIRO_HINTSTYLE_LONG_CONST("STYLE_MEDIUM", CAIRO_HINT_STYLE_MEDIUM);
REGISTER_CAIRO_HINTSTYLE_LONG_CONST("STYLE_FULL", CAIRO_HINT_STYLE_FULL);
INIT_CLASS_ENTRY(hintmetrics_ce, "CairoHintMetrics", NULL);
cairo_ce_hintmetrics = zend_register_internal_class(&hintmetrics_ce TSRMLS_CC);
cairo_ce_hintmetrics->ce_flags |= ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_ACC_FINAL_CLASS;
#define REGISTER_CAIRO_HINTMETRICS_LONG_CONST(const_name, value) \
zend_declare_class_constant_long(cairo_ce_hintmetrics, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); \
REGISTER_LONG_CONSTANT(#value, value, CONST_CS | CONST_PERSISTENT);
REGISTER_CAIRO_HINTMETRICS_LONG_CONST("METRICS_DEFAULT", CAIRO_HINT_METRICS_DEFAULT);
REGISTER_CAIRO_HINTMETRICS_LONG_CONST("METRICS_OFF", CAIRO_HINT_METRICS_OFF);
REGISTER_CAIRO_HINTMETRICS_LONG_CONST("METRICS_ON", CAIRO_HINT_METRICS_ON);
return SUCCESS;
}
/* }}} */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/