Changeset 3225 for libcaca/trunk
- Timestamp:
- Nov 2, 2008, 10:58:09 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca-php/caca.php
r3217 r3225 17 17 private $cv; 18 18 19 function putFigchar($char) { 20 return caca_put_figchar($this->cv, $char); 21 } 22 23 function setFigfont($path) { 24 return caca_canvas_set_figfont($this->cv, $path); 25 } 26 27 function getFrameCount() { 28 return caca_get_frame_count($this->cv); 29 } 30 31 function putAttr($attr) { 32 return caca_put_attr($this->cv, $attr); 33 } 34 35 function stretchRight() { 36 return caca_stretch_right($this->cv); 37 } 38 39 function stretchLeft() { 40 return caca_stretch_left($this->cv); 41 } 42 43 function setBoundaries($width, $height) { 44 return caca_set_canvas_boundaries($this->cv, $width, $height); 45 } 46 47 function setHandle($x, $y) { 48 return caca_set_canvas_handle($this->cv, $x, $y); 49 } 50 51 function getHandleX() { 52 return caca_get_canvas_handle_x($this->cv); 53 } 54 55 function getHandleY() { 56 return caca_get_canvas_handle_y($this->cv); 57 } 58 59 function getCursorX() { 60 return caca_get_cursor_x($this->cv); 61 } 62 63 function getCursorY() { 64 return caca_get_cursor_y($this->cv); 65 } 66 67 function getChars() { 68 return caca_get_canvas_chars($this->cv); 69 } 70 71 function getAttrs() { 72 return caca_get_canvas_attrs($this->cv); 73 } 74 19 75 function setSize($width, $height) { 20 return caca_set_canvas_ width($this->cv, $width, $height);76 return caca_set_canvas_size($this->cv, $width, $height); 21 77 } 22 78 … … 58 114 59 115 function Clear() { 60 return caca_c anvas_clear($this->cv);116 return caca_clear_canvas($this->cv); 61 117 } 62 118 … … 110 166 111 167 function drawEllipse($x1, $y1, $x2, $y2, $char) { 112 caca_draw_ellipse($this->cv, $x1, $y1, $x2, $y2, $char);168 return caca_draw_ellipse($this->cv, $x1, $y1, $x2, $y2, $char); 113 169 } 114 170 115 171 function drawThinEllipse($x1, $y1, $x2, $y2) { 116 caca_draw_ellipse($this->cv, $x1, $y1, $x2, $y2);172 return caca_draw_thin_ellipse($this->cv, $x1, $y1, $x2, $y2); 117 173 } 118 174 119 175 function fillEllipse($x1, $y1, $x2, $y2, $char) { 120 caca_fill_ellipse($this->cv, $x1, $y1, $x2, $y2, $char);176 return caca_fill_ellipse($this->cv, $x1, $y1, $x2, $y2, $char); 121 177 } 122 178 123 179 function drawBox($x1, $y1, $x2, $y2, $char) { 124 caca_draw_box($this->cv, $x1, $y1, $x2, $y2, $char);180 return caca_draw_box($this->cv, $x1, $y1, $x2, $y2, $char); 125 181 } 126 182 127 183 function drawThinBox($x1, $y1, $x2, $y2) { 128 caca_draw_thin_box($this->cv, $x1, $y1, $x2, $y2);184 return caca_draw_thin_box($this->cv, $x1, $y1, $x2, $y2); 129 185 } 130 186 131 187 function drawCP437Box($x1, $y1, $x2, $y2) { 132 caca_draw_cp437_box($this->cv, $x1, $y1, $x2, $y2);188 return caca_draw_cp437_box($this->cv, $x1, $y1, $x2, $y2); 133 189 } 134 190 135 191 function fillBox($x1, $y1, $x2, $y2, $char) { 136 caca_fill_box($this->cv, $x1, $y1, $x2, $y2, $char);192 return caca_fill_box($this->cv, $x1, $y1, $x2, $y2, $char); 137 193 } 138 194 139 195 function drawTriangle($x1, $y1, $x2, $y2, $x3, $y3, $char) { 140 caca_draw_triangle($this->cv, $x1, $y1, $x2, $y2, $x3, $y3, $char);196 return caca_draw_triangle($this->cv, $x1, $y1, $x2, $y2, $x3, $y3, $char); 141 197 } 142 198 143 199 function drawThinTriangle($x1, $y1, $x2, $y2, $x3, $y3) { 144 caca_draw_thin_triangle($this->cv, $x1, $y1, $x2, $y2, $x3, $y3);200 return caca_draw_thin_triangle($this->cv, $x1, $y1, $x2, $y2, $x3, $y3); 145 201 } 146 202 147 203 function fillTriangle($x1, $y1, $x2, $y2, $x3, $y3, $char) { 148 caca_fill_triangle($this->cv, $x1, $y1, $x2, $y2, $x3, $y3, $char);204 return caca_fill_triangle($this->cv, $x1, $y1, $x2, $y2, $x3, $y3, $char); 149 205 } 150 206 … … 161 217 private $dp; 162 218 219 function refresh() { 220 return caca_refresh_display($this->dp); 221 } 222 223 function getDriver() { 224 return caca_get_display_driver($this->dp); 225 } 226 227 function setDriver($name) { 228 return caca_set_display_driver($this->dp, $name); 229 } 230 163 231 function setDisplayTime($time) { 164 232 return caca_set_display_time($this->dp, $time); … … 181 249 } 182 250 251 function gotoXY($x, $y) { 252 return caca_gotoxy($this->dp, $x, $y); 253 } 254 183 255 function getMouseX() { 184 256 return caca_get_mouse_x($this->dp); … … 193 265 } 194 266 195 function __construct($canvas) { 196 $this->dp = caca_create_display($canvas->get_resource()); 267 function __construct($canvas, $driver = false) { 268 if ($driver) 269 $this->dp = caca_create_display_with_driver($canvas->get_resource(), $driver); 270 else 271 $this->dp = caca_create_display($canvas->get_resource()); 197 272 } 198 273
Note: See TracChangeset
for help on using the changeset viewer.