source: libcaca/trunk/caca-php/php_caca.c @ 3091

Last change on this file since 3091 was 3091, checked in by nico, 11 years ago
  • Add caca's php constants definition
  • Add php binding for 13 new functions
File size: 19.3 KB
Line 
1/*
2 *  php-caca      Php binding for Libcaca
3 *  Copyright (c) 2008 Vion Nicolas <nico@picapo.net>
4 *
5 *
6 *  This library is free software. It comes without any warranty, to
7 *  the extent permitted by applicable law. You can redistribute it
8 *  and/or modify it under the terms of the Do What The Fuck You Want
9 *  To Public License, Version 2, as published by Sam Hocevar. See
10 *  http://sam.zoy.org/wtfpl/COPYING for more details.
11 */
12
13#ifdef HAVE_CONFIG_H
14#include "config.h"
15#endif
16
17#include "php.h"
18#include "php_caca.h"
19
20static function_entry caca_functions[] = {
21        PHP_FE(caca_create_canvas, NULL)
22        PHP_FE(caca_manage_canvas, NULL)
23        PHP_FE(caca_unmanage_canvas, NULL)
24        PHP_FE(caca_set_canvas_size, NULL)
25        PHP_FE(caca_get_canvas_width, NULL)
26        PHP_FE(caca_get_canvas_height, NULL)
27        PHP_FE(caca_get_canvas_chars, NULL)
28        PHP_FE(caca_get_canvas_attrs, NULL)
29        PHP_FE(caca_rand, NULL)
30        PHP_FE(caca_get_version, NULL)
31        PHP_FE(caca_gotoxy, NULL)
32        PHP_FE(caca_get_cursor_x, NULL)
33        PHP_FE(caca_get_cursor_y, NULL)
34        PHP_FE(caca_put_char, NULL)
35        PHP_FE(caca_get_char, NULL)
36        PHP_FE(caca_put_str, NULL)
37        PHP_FE(caca_printf, NULL)
38        PHP_FE(caca_clear_canvas, NULL)
39        PHP_FE(caca_set_canvas_handle, NULL)
40        PHP_FE(caca_get_canvas_handle_x, NULL)
41        PHP_FE(caca_get_canvas_handle_y, NULL)
42        PHP_FE(caca_blit, NULL)
43        PHP_FE(caca_set_canvas_boundaries, NULL)
44        PHP_FE(caca_invert, NULL)
45        PHP_FE(caca_flip, NULL)
46        PHP_FE(caca_flop, NULL)
47        PHP_FE(caca_rotate_left, NULL)
48        PHP_FE(caca_rotate_right, NULL)
49        PHP_FE(caca_stretch_left, NULL)
50        PHP_FE(caca_stretch_right, NULL)
51        PHP_FE(caca_get_attr, NULL)
52        PHP_FE(caca_set_attr, NULL)
53        PHP_FE(caca_put_attr, NULL)
54        PHP_FE(caca_set_color_ansi, NULL)
55        PHP_FE(caca_set_color_argb, NULL)
56        PHP_FE(caca_draw_line, NULL)
57        PHP_FE(caca_draw_polyline, NULL)
58        PHP_FE(caca_draw_thin_line, NULL)
59        PHP_FE(caca_draw_thin_polyline, NULL)
60        PHP_FE(caca_draw_circle, NULL)
61        PHP_FE(caca_draw_ellipse, NULL)
62        PHP_FE(caca_draw_thin_ellipse, NULL)
63        PHP_FE(caca_fill_ellipse, NULL)
64        PHP_FE(caca_draw_box, NULL)
65        PHP_FE(caca_draw_thin_box, NULL)
66        PHP_FE(caca_fill_box, NULL)
67        PHP_FE(caca_draw_triangle, NULL)
68        PHP_FE(caca_draw_thin_triangle, NULL)
69        PHP_FE(caca_fill_triangle, NULL)
70        PHP_FE(caca_get_frame_count, NULL)
71        PHP_FE(caca_set_frame, NULL)
72        PHP_FE(caca_get_frame_name, NULL)
73        PHP_FE(caca_set_frame_name, NULL)
74        PHP_FE(caca_create_frame, NULL)
75        PHP_FE(caca_free_frame, NULL)
76        PHP_FE(caca_set_dither_palette, NULL)
77        PHP_FE(caca_set_dither_brightness, NULL)
78        PHP_FE(caca_get_dither_brightness, NULL)
79        PHP_FE(caca_set_dither_gamma, NULL)
80        PHP_FE(caca_get_dither_gamma, NULL)
81        PHP_FE(caca_set_dither_contrast, NULL)
82        PHP_FE(caca_get_dither_contrast, NULL)
83        PHP_FE(caca_set_dither_antialias, NULL)
84        PHP_FE(caca_get_dither_antialias_list, NULL)
85        PHP_FE(caca_get_dither_antialias, NULL)
86        PHP_FE(caca_set_dither_color, NULL)
87        PHP_FE(caca_get_dither_color_list, NULL)
88        PHP_FE(caca_get_dither_color, NULL)
89        PHP_FE(caca_set_dither_charset, NULL)
90        PHP_FE(caca_get_dither_charset_list, NULL)
91        PHP_FE(caca_get_dither_charset, NULL)
92        PHP_FE(caca_set_dither_algorithm, NULL)
93        PHP_FE(caca_get_dither_algorithm_list, NULL)
94        PHP_FE(caca_get_dither_algorithm, NULL)
95        PHP_FE(caca_dither_bitmap, NULL)
96        PHP_FE(caca_get_font_list, NULL)
97        PHP_FE(caca_get_font_width, NULL)
98        PHP_FE(caca_get_font_height, NULL)
99        PHP_FE(caca_render_canvas, NULL)
100        PHP_FE(caca_canvas_set_figfont, NULL)
101        PHP_FE(caca_put_figchar, NULL)
102        PHP_FE(caca_flush_figlet, NULL)
103        PHP_FE(caca_file_close, NULL)
104        PHP_FE(caca_file_gets, NULL)
105        PHP_FE(caca_file_eof, NULL)
106        PHP_FE(caca_get_import_list, NULL)
107        PHP_FE(caca_export_memory, NULL)
108        PHP_FE(caca_get_export_list, NULL)
109        PHP_FE(caca_get_display_driver_list, NULL)
110        PHP_FE(caca_get_display_driver, NULL)
111        PHP_FE(caca_set_display_driver, NULL)
112        PHP_FE(caca_refresh_display, NULL)
113        PHP_FE(caca_set_display_time, NULL)
114        PHP_FE(caca_get_display_time, NULL)
115        PHP_FE(caca_get_display_width, NULL)
116        PHP_FE(caca_get_display_height, NULL)
117        PHP_FE(caca_set_display_title, NULL)
118        PHP_FE(caca_set_mouse, NULL)
119        PHP_FE(caca_set_cursor, NULL)
120        PHP_FE(caca_get_event, NULL)
121        PHP_FE(caca_get_mouse_x, NULL)
122        PHP_FE(caca_get_mouse_y, NULL)
123        PHP_FE(caca_get_event_type, NULL)
124        PHP_FE(caca_get_event_key_ch, NULL)
125        PHP_FE(caca_get_event_mouse_button, NULL)
126        PHP_FE(caca_get_event_mouse_x, NULL)
127        PHP_FE(caca_get_event_mouse_y, NULL)
128        PHP_FE(caca_get_event_resize_width, NULL)
129        PHP_FE(caca_get_event_resize_height, NULL)
130
131        {NULL, NULL, NULL}
132};
133
134zend_module_entry caca_module_entry = {
135#if ZEND_MODULE_API_NO >= 20010901
136        STANDARD_MODULE_HEADER,
137#endif
138        PHP_CACA_EXTNAME,
139        caca_functions,
140        PHP_MINIT(caca),
141        NULL,
142        NULL,
143        NULL,
144        PHP_MINFO(caca),
145#if ZEND_MODULE_API_NO >= 20010901
146        PHP_CACA_VERSION,
147#endif
148        STANDARD_MODULE_PROPERTIES
149};
150
151#ifdef COMPILE_DL_CACA
152ZEND_GET_MODULE(caca)
153#endif
154
155PHP_MINFO_FUNCTION(caca) {
156        php_info_print_table_start();
157        php_info_print_table_row(2, "Caca library version", caca_get_version());
158        php_info_print_table_end();
159}
160
161//--------CACA'S RESSOURCES DESTRUCTORS-----------//
162
163static void php_caca_canvas_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) {
164        caca_free_canvas(rsrc->ptr);
165}
166
167static void php_caca_dither_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) {
168        caca_free_dither(rsrc->ptr);
169}
170
171static void php_caca_font_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) {
172        caca_free_font(rsrc->ptr);
173}
174
175static void php_caca_file_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) {
176}
177
178static void php_caca_display_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) {
179        caca_free_display(rsrc->ptr);
180}
181
182static void php_caca_event_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC) {
183}
184
185//--------INITIALIZATION---------//
186
187PHP_MINIT_FUNCTION(caca) {
188
189        le_caca_canvas = zend_register_list_destructors_ex(php_caca_canvas_dtor, NULL, PHP_CACA_CANVAS_RES_NAME, module_number);
190        le_caca_dither = zend_register_list_destructors_ex(php_caca_dither_dtor, NULL, PHP_CACA_DITHER_RES_NAME, module_number);
191        le_caca_font = zend_register_list_destructors_ex(php_caca_font_dtor, NULL, PHP_CACA_FONT_RES_NAME, module_number);
192        le_caca_file = zend_register_list_destructors_ex(php_caca_file_dtor, NULL, PHP_CACA_FILE_RES_NAME, module_number);
193        le_caca_display = zend_register_list_destructors_ex(php_caca_display_dtor, NULL, PHP_CACA_DISPLAY_RES_NAME, module_number);
194        le_caca_event = zend_register_list_destructors_ex(php_caca_event_dtor, NULL, PHP_CACA_EVENT_RES_NAME, module_number);
195       
196        REGISTER_LONG_CONSTANT("CACA_BLACK", CACA_BLACK, CONST_CS | CONST_PERSISTENT);
197        REGISTER_LONG_CONSTANT("CACA_BLUE", CACA_BLUE, CONST_CS | CONST_PERSISTENT);
198        REGISTER_LONG_CONSTANT("CACA_GREEN", CACA_GREEN, CONST_CS | CONST_PERSISTENT);
199        REGISTER_LONG_CONSTANT("CACA_CYAN", CACA_CYAN, CONST_CS | CONST_PERSISTENT);
200        REGISTER_LONG_CONSTANT("CACA_RED", CACA_RED, CONST_CS | CONST_PERSISTENT);
201        REGISTER_LONG_CONSTANT("CACA_MAGENTA", CACA_MAGENTA, CONST_CS | CONST_PERSISTENT);
202        REGISTER_LONG_CONSTANT("CACA_BROWN", CACA_BROWN, CONST_CS | CONST_PERSISTENT);
203        REGISTER_LONG_CONSTANT("CACA_LIGHTGRAY", CACA_LIGHTGRAY, CONST_CS | CONST_PERSISTENT);
204        REGISTER_LONG_CONSTANT("CACA_DARKGRAY", CACA_DARKGRAY, CONST_CS | CONST_PERSISTENT);
205        REGISTER_LONG_CONSTANT("CACA_LIGHTBLUE", CACA_LIGHTBLUE, CONST_CS | CONST_PERSISTENT);
206        REGISTER_LONG_CONSTANT("CACA_LIGHTGREEN", CACA_LIGHTGREEN, CONST_CS | CONST_PERSISTENT);
207        REGISTER_LONG_CONSTANT("CACA_LIGHTCYAN", CACA_LIGHTCYAN, CONST_CS | CONST_PERSISTENT);
208        REGISTER_LONG_CONSTANT("CACA_LIGHTRED", CACA_LIGHTRED, CONST_CS | CONST_PERSISTENT);
209        REGISTER_LONG_CONSTANT("CACA_LIGHTMAGENTA", CACA_LIGHTMAGENTA, CONST_CS | CONST_PERSISTENT);
210        REGISTER_LONG_CONSTANT("CACA_YELLOW", CACA_YELLOW, CONST_CS | CONST_PERSISTENT);
211        REGISTER_LONG_CONSTANT("CACA_WHITE", CACA_WHITE, CONST_CS | CONST_PERSISTENT);
212        REGISTER_LONG_CONSTANT("CACA_DEFAULT", CACA_DEFAULT, CONST_CS | CONST_PERSISTENT);
213        REGISTER_LONG_CONSTANT("CACA_TRANSPARENT", CACA_TRANSPARENT, CONST_CS | CONST_PERSISTENT);
214        REGISTER_LONG_CONSTANT("CACA_BOLD", CACA_BOLD, CONST_CS | CONST_PERSISTENT);
215        REGISTER_LONG_CONSTANT("CACA_ITALICS", CACA_ITALICS, CONST_CS | CONST_PERSISTENT);
216        REGISTER_LONG_CONSTANT("CACA_UNDERLINE", CACA_UNDERLINE, CONST_CS | CONST_PERSISTENT);
217        REGISTER_LONG_CONSTANT("CACA_BLINK", CACA_BLINK, CONST_CS | CONST_PERSISTENT);
218
219        REGISTER_LONG_CONSTANT("CACA_EVENT_NONE", CACA_EVENT_NONE, CONST_CS | CONST_PERSISTENT);
220        REGISTER_LONG_CONSTANT("CACA_EVENT_KEY_PRESS", CACA_EVENT_KEY_PRESS, CONST_CS | CONST_PERSISTENT);
221        REGISTER_LONG_CONSTANT("CACA_EVENT_KEY_RELEASE", CACA_EVENT_KEY_RELEASE, CONST_CS | CONST_PERSISTENT);
222        REGISTER_LONG_CONSTANT("CACA_EVENT_MOUSE_PRESS", CACA_EVENT_MOUSE_PRESS, CONST_CS | CONST_PERSISTENT);
223        REGISTER_LONG_CONSTANT("CACA_EVENT_MOUSE_RELEASE", CACA_EVENT_MOUSE_RELEASE, CONST_CS | CONST_PERSISTENT);
224        REGISTER_LONG_CONSTANT("CACA_EVENT_MOUSE_MOTION", CACA_EVENT_MOUSE_MOTION, CONST_CS | CONST_PERSISTENT);
225        REGISTER_LONG_CONSTANT("CACA_EVENT_RESIZE", CACA_EVENT_RESIZE, CONST_CS | CONST_PERSISTENT);
226        REGISTER_LONG_CONSTANT("CACA_EVENT_QUIT", CACA_EVENT_QUIT, CONST_CS | CONST_PERSISTENT);
227        REGISTER_LONG_CONSTANT("CACA_EVENT_ANY", CACA_EVENT_ANY, CONST_CS | CONST_PERSISTENT);
228
229        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_A", CACA_KEY_CTRL_A, CONST_CS | CONST_PERSISTENT);
230        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_B", CACA_KEY_CTRL_B, CONST_CS | CONST_PERSISTENT);
231        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_C", CACA_KEY_CTRL_C, CONST_CS | CONST_PERSISTENT);
232        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_D", CACA_KEY_CTRL_D, CONST_CS | CONST_PERSISTENT);
233        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_E", CACA_KEY_CTRL_E, CONST_CS | CONST_PERSISTENT);
234        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_F", CACA_KEY_CTRL_F, CONST_CS | CONST_PERSISTENT);
235        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_G", CACA_KEY_CTRL_G, CONST_CS | CONST_PERSISTENT);
236        REGISTER_LONG_CONSTANT("CACA_KEY_BACKSPACE", CACA_KEY_BACKSPACE, CONST_CS | CONST_PERSISTENT);
237        REGISTER_LONG_CONSTANT("CACA_KEY_TAB", CACA_KEY_TAB, CONST_CS | CONST_PERSISTENT);
238        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_J", CACA_KEY_CTRL_J, CONST_CS | CONST_PERSISTENT);
239        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_K", CACA_KEY_CTRL_K, CONST_CS | CONST_PERSISTENT);
240        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_L", CACA_KEY_CTRL_L, CONST_CS | CONST_PERSISTENT);
241        REGISTER_LONG_CONSTANT("CACA_KEY_RETURN", CACA_KEY_RETURN, CONST_CS | CONST_PERSISTENT);
242        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_N", CACA_KEY_CTRL_N, CONST_CS | CONST_PERSISTENT);
243        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_O", CACA_KEY_CTRL_O, CONST_CS | CONST_PERSISTENT);
244        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_P", CACA_KEY_CTRL_P, CONST_CS | CONST_PERSISTENT);
245        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_Q", CACA_KEY_CTRL_Q, CONST_CS | CONST_PERSISTENT);
246        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_R", CACA_KEY_CTRL_R, CONST_CS | CONST_PERSISTENT);
247        REGISTER_LONG_CONSTANT("CACA_KEY_PAUSE", CACA_KEY_PAUSE, CONST_CS | CONST_PERSISTENT);
248        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_T", CACA_KEY_CTRL_T, CONST_CS | CONST_PERSISTENT);
249        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_U", CACA_KEY_CTRL_U, CONST_CS | CONST_PERSISTENT);
250        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_V", CACA_KEY_CTRL_V, CONST_CS | CONST_PERSISTENT);
251        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_W", CACA_KEY_CTRL_W, CONST_CS | CONST_PERSISTENT);
252        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_X", CACA_KEY_CTRL_X, CONST_CS | CONST_PERSISTENT);
253        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_Y", CACA_KEY_CTRL_Y, CONST_CS | CONST_PERSISTENT);
254        REGISTER_LONG_CONSTANT("CACA_KEY_CTRL_Z", CACA_KEY_CTRL_Z, CONST_CS | CONST_PERSISTENT);
255        REGISTER_LONG_CONSTANT("CACA_KEY_ESCAPE", CACA_KEY_ESCAPE, CONST_CS | CONST_PERSISTENT);
256        REGISTER_LONG_CONSTANT("CACA_KEY_DELETE", CACA_KEY_DELETE, CONST_CS | CONST_PERSISTENT);
257        REGISTER_LONG_CONSTANT("CACA_KEY_UP", CACA_KEY_UP, CONST_CS | CONST_PERSISTENT);
258        REGISTER_LONG_CONSTANT("CACA_KEY_DOWN", CACA_KEY_DOWN, CONST_CS | CONST_PERSISTENT);
259        REGISTER_LONG_CONSTANT("CACA_KEY_LEFT", CACA_KEY_LEFT, CONST_CS | CONST_PERSISTENT);
260        REGISTER_LONG_CONSTANT("CACA_KEY_RIGHT", CACA_KEY_RIGHT, CONST_CS | CONST_PERSISTENT);
261        REGISTER_LONG_CONSTANT("CACA_KEY_INSERT", CACA_KEY_INSERT, CONST_CS | CONST_PERSISTENT);
262        REGISTER_LONG_CONSTANT("CACA_KEY_HOME", CACA_KEY_HOME, CONST_CS | CONST_PERSISTENT);
263        REGISTER_LONG_CONSTANT("CACA_KEY_END", CACA_KEY_END, CONST_CS | CONST_PERSISTENT);
264        REGISTER_LONG_CONSTANT("CACA_KEY_PAGEUP", CACA_KEY_PAGEUP, CONST_CS | CONST_PERSISTENT);
265        REGISTER_LONG_CONSTANT("CACA_KEY_PAGEDOWN", CACA_KEY_PAGEDOWN, CONST_CS | CONST_PERSISTENT);
266        REGISTER_LONG_CONSTANT("CACA_KEY_F1", CACA_KEY_F1, CONST_CS | CONST_PERSISTENT);
267        REGISTER_LONG_CONSTANT("CACA_KEY_F2", CACA_KEY_F2, CONST_CS | CONST_PERSISTENT);
268        REGISTER_LONG_CONSTANT("CACA_KEY_F3", CACA_KEY_F3, CONST_CS | CONST_PERSISTENT);
269        REGISTER_LONG_CONSTANT("CACA_KEY_F4", CACA_KEY_F4, CONST_CS | CONST_PERSISTENT);
270        REGISTER_LONG_CONSTANT("CACA_KEY_F5", CACA_KEY_F5, CONST_CS | CONST_PERSISTENT);
271        REGISTER_LONG_CONSTANT("CACA_KEY_F6", CACA_KEY_F6, CONST_CS | CONST_PERSISTENT);
272        REGISTER_LONG_CONSTANT("CACA_KEY_F7", CACA_KEY_F7, CONST_CS | CONST_PERSISTENT);
273        REGISTER_LONG_CONSTANT("CACA_KEY_F8", CACA_KEY_F8, CONST_CS | CONST_PERSISTENT);
274        REGISTER_LONG_CONSTANT("CACA_KEY_F9", CACA_KEY_F9, CONST_CS | CONST_PERSISTENT);
275        REGISTER_LONG_CONSTANT("CACA_KEY_F10", CACA_KEY_F10, CONST_CS | CONST_PERSISTENT);
276        REGISTER_LONG_CONSTANT("CACA_KEY_F11", CACA_KEY_F11, CONST_CS | CONST_PERSISTENT);
277        REGISTER_LONG_CONSTANT("CACA_KEY_F12", CACA_KEY_F12, CONST_CS | CONST_PERSISTENT);
278        REGISTER_LONG_CONSTANT("CACA_KEY_F13", CACA_KEY_F13, CONST_CS | CONST_PERSISTENT);
279        REGISTER_LONG_CONSTANT("CACA_KEY_F14", CACA_KEY_F14, CONST_CS | CONST_PERSISTENT);
280        REGISTER_LONG_CONSTANT("CACA_KEY_F15", CACA_KEY_F15, CONST_CS | CONST_PERSISTENT);
281
282        return SUCCESS;
283}
284
285//----------SOME USEFULL MACROS---------------//
286
287#define FETCH_CANVAS(canvas) \
288        zval *_zval; \
289        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &_zval) == FAILURE) { \
290                RETURN_FALSE; \
291        } \
292        ZEND_FETCH_RESOURCE(canvas, caca_canvas_t*, &_zval, -1, PHP_CACA_CANVAS_RES_NAME, le_caca_canvas);
293
294
295//-------CACA'S FUNCTIONS----------------//
296
297PHP_FUNCTION(caca_create_canvas) {
298}
299
300PHP_FUNCTION(caca_manage_canvas) {
301}
302
303PHP_FUNCTION(caca_unmanage_canvas) {
304}
305
306PHP_FUNCTION(caca_set_canvas_size) {
307}
308
309PHP_FUNCTION(caca_get_canvas_width) {
310}
311
312PHP_FUNCTION(caca_get_canvas_height) {
313}
314
315PHP_FUNCTION(caca_get_canvas_chars) {
316}
317
318PHP_FUNCTION(caca_get_canvas_attrs) {
319}
320
321PHP_FUNCTION(caca_rand) {
322}
323
324PHP_FUNCTION(caca_get_version) {
325        RETURN_STRING(estrdup(caca_get_version()), 0);
326}
327
328PHP_FUNCTION(caca_gotoxy) {
329}
330
331PHP_FUNCTION(caca_get_cursor_x) {
332        caca_canvas_t *canvas;
333        FETCH_CANVAS(canvas);
334        RETURN_LONG(caca_get_cursor_x(canvas));
335}
336
337PHP_FUNCTION(caca_get_cursor_y) {
338        caca_canvas_t *canvas;
339        FETCH_CANVAS(canvas);
340        RETURN_LONG(caca_get_cursor_y(canvas));
341}
342
343PHP_FUNCTION(caca_put_char) {
344}
345
346PHP_FUNCTION(caca_get_char) {
347}
348
349PHP_FUNCTION(caca_put_str) {
350}
351
352PHP_FUNCTION(caca_printf) {
353}
354
355PHP_FUNCTION(caca_clear_canvas) {
356        caca_canvas_t *canvas;
357        FETCH_CANVAS(canvas);
358        RETURN_BOOL(caca_clear_canvas(canvas) == 0);
359}
360
361PHP_FUNCTION(caca_set_canvas_handle) {
362}
363
364PHP_FUNCTION(caca_get_canvas_handle_x) {
365        caca_canvas_t *canvas;
366        FETCH_CANVAS(canvas);
367        RETURN_LONG(caca_get_canvas_handle_x(canvas));
368}
369
370PHP_FUNCTION(caca_get_canvas_handle_y) {
371        caca_canvas_t *canvas;
372        FETCH_CANVAS(canvas);
373        RETURN_LONG(caca_get_canvas_handle_y(canvas));
374}
375
376PHP_FUNCTION(caca_blit) {
377}
378
379PHP_FUNCTION(caca_set_canvas_boundaries) {
380}
381
382PHP_FUNCTION(caca_invert) {
383        caca_canvas_t *canvas;
384        FETCH_CANVAS(canvas);
385        RETURN_BOOL(caca_invert(canvas) == 0);
386}
387
388PHP_FUNCTION(caca_flip) {
389        caca_canvas_t *canvas;
390        FETCH_CANVAS(canvas);
391        RETURN_BOOL(caca_flip(canvas) == 0);
392}
393
394PHP_FUNCTION(caca_flop) {
395        caca_canvas_t *canvas;
396        FETCH_CANVAS(canvas);
397        RETURN_BOOL(caca_flop(canvas) == 0);
398}
399
400PHP_FUNCTION(caca_rotate_180) {
401        caca_canvas_t *canvas;
402        FETCH_CANVAS(canvas);
403        RETURN_BOOL(caca_rotate_180(canvas) == 0);
404}
405
406PHP_FUNCTION(caca_rotate_left) {
407        caca_canvas_t *canvas;
408        FETCH_CANVAS(canvas);
409        RETURN_BOOL(caca_rotate_left(canvas) == 0);
410}
411
412PHP_FUNCTION(caca_rotate_right) {
413        caca_canvas_t *canvas;
414        FETCH_CANVAS(canvas);
415        RETURN_BOOL(caca_rotate_right(canvas) == 0);
416}
417
418PHP_FUNCTION(caca_stretch_left) {
419        caca_canvas_t *canvas;
420        FETCH_CANVAS(canvas);
421        RETURN_BOOL(caca_stretch_left(canvas) == 0);
422}
423
424PHP_FUNCTION(caca_stretch_right) {
425        caca_canvas_t *canvas;
426        FETCH_CANVAS(canvas);
427        RETURN_BOOL(caca_stretch_right(canvas) == 0);
428}
429
430PHP_FUNCTION(caca_get_attr) {
431}
432
433PHP_FUNCTION(caca_set_attr) {
434}
435
436PHP_FUNCTION(caca_put_attr) {
437}
438
439PHP_FUNCTION(caca_set_color_ansi) {
440}
441
442PHP_FUNCTION(caca_set_color_argb) {
443}
444
445PHP_FUNCTION(caca_attr_to_argb64) {
446}
447
448PHP_FUNCTION(caca_utf32_to_ascii) {
449}
450
451PHP_FUNCTION(caca_utf32_is_fullwidth) {
452}
453
454PHP_FUNCTION(caca_draw_line) {
455}
456
457PHP_FUNCTION(caca_draw_polyline) {
458}
459
460PHP_FUNCTION(caca_draw_thin_line) {
461}
462
463PHP_FUNCTION(caca_draw_thin_polyline) {
464}
465
466PHP_FUNCTION(caca_draw_circle) {
467}
468
469PHP_FUNCTION(caca_draw_ellipse) {
470}
471
472PHP_FUNCTION(caca_draw_thin_ellipse) {
473}
474
475PHP_FUNCTION(caca_fill_ellipse) {
476}
477
478PHP_FUNCTION(caca_draw_box) {
479}
480
481PHP_FUNCTION(caca_draw_thin_box) {
482}
483
484PHP_FUNCTION(caca_draw_cp437_box) {
485}
486
487PHP_FUNCTION(caca_fill_box) {
488}
489
490PHP_FUNCTION(caca_draw_triangle) {
491}
492
493PHP_FUNCTION(caca_draw_thin_triangle) {
494}
495
496PHP_FUNCTION(caca_fill_triangle) {
497}
498
499PHP_FUNCTION(caca_get_frame_count) {
500}
501
502PHP_FUNCTION(caca_set_frame) {
503}
504
505PHP_FUNCTION(caca_get_frame_name) {
506}
507
508PHP_FUNCTION(caca_set_frame_name) {
509}
510
511PHP_FUNCTION(caca_create_frame) {
512}
513
514PHP_FUNCTION(caca_free_frame) {
515}
516
517PHP_FUNCTION(caca_set_dither_palette) {
518}
519
520PHP_FUNCTION(caca_set_dither_brightness) {
521}
522
523PHP_FUNCTION(caca_get_dither_brightness) {
524}
525
526PHP_FUNCTION(caca_set_dither_gamma) {
527}
528
529PHP_FUNCTION(caca_get_dither_gamma) {
530}
531
532PHP_FUNCTION(caca_set_dither_contrast) {
533}
534
535PHP_FUNCTION(caca_get_dither_contrast) {
536}
537
538PHP_FUNCTION(caca_set_dither_antialias) {
539}
540
541PHP_FUNCTION(caca_get_dither_antialias_list) {
542}
543
544PHP_FUNCTION(caca_get_dither_antialias) {
545}
546
547PHP_FUNCTION(caca_set_dither_color) {
548}
549
550PHP_FUNCTION(caca_get_dither_color_list) {
551}
552
553PHP_FUNCTION(caca_get_dither_color) {
554}
555
556PHP_FUNCTION(caca_set_dither_charset) {
557}
558
559PHP_FUNCTION(caca_get_dither_charset_list) {
560}
561
562PHP_FUNCTION(caca_get_dither_charset) {
563}
564
565PHP_FUNCTION(caca_set_dither_algorithm) {
566}
567
568PHP_FUNCTION(caca_get_dither_algorithm_list) {
569}
570
571PHP_FUNCTION(caca_get_dither_algorithm) {
572}
573
574PHP_FUNCTION(caca_dither_bitmap) {
575}
576
577PHP_FUNCTION(caca_get_font_list) {
578}
579
580PHP_FUNCTION(caca_get_font_width) {
581}
582
583PHP_FUNCTION(caca_get_font_height) {
584}
585
586PHP_FUNCTION(caca_render_canvas) {
587}
588
589PHP_FUNCTION(caca_canvas_set_figfont) {
590}
591
592PHP_FUNCTION(caca_put_figchar) {
593}
594
595PHP_FUNCTION(caca_flush_figlet) {
596}
597
598PHP_FUNCTION(caca_file_close) {
599}
600
601PHP_FUNCTION(caca_file_gets) {
602}
603
604PHP_FUNCTION(caca_file_eof) {
605}
606
607PHP_FUNCTION(caca_get_import_list) {
608}
609
610PHP_FUNCTION(caca_export_memory) {
611}
612
613PHP_FUNCTION(caca_get_export_list) {
614}
615
616PHP_FUNCTION(caca_get_display_driver_list) {
617}
618
619PHP_FUNCTION(caca_get_display_driver) {
620}
621
622PHP_FUNCTION(caca_set_display_driver) {
623}
624
625PHP_FUNCTION(caca_refresh_display) {
626}
627
628PHP_FUNCTION(caca_set_display_time) {
629}
630
631PHP_FUNCTION(caca_get_display_time) {
632}
633
634PHP_FUNCTION(caca_get_display_width) {
635}
636
637PHP_FUNCTION(caca_get_display_height) {
638}
639
640PHP_FUNCTION(caca_set_display_title) {
641}
642
643PHP_FUNCTION(caca_set_mouse) {
644}
645
646PHP_FUNCTION(caca_set_cursor) {
647}
648
649PHP_FUNCTION(caca_get_event) {
650}
651
652PHP_FUNCTION(caca_get_mouse_x) {
653}
654
655PHP_FUNCTION(caca_get_mouse_y) {
656}
657
658PHP_FUNCTION(caca_get_event_type) {
659}
660
661PHP_FUNCTION(caca_get_event_key_ch) {
662}
663
664PHP_FUNCTION(caca_get_event_key_utf8) {
665}
666
667PHP_FUNCTION(caca_get_event_mouse_button) {
668}
669
670PHP_FUNCTION(caca_get_event_mouse_x) {
671}
672
673PHP_FUNCTION(caca_get_event_mouse_y) {
674}
675
676PHP_FUNCTION(caca_get_event_resize_width) {
677}
678
679PHP_FUNCTION(caca_get_event_resize_height) {
680}
681
682
Note: See TracBrowser for help on using the repository browser.