You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

136 rivejä
2.3 KiB

  1. <?php
  2. /*
  3. * php-caca Php binding for Libcaca
  4. * caca.php object layer for caca-php
  5. * Copyright (c) 2008 Vion Nicolas <nico@picapo.net>
  6. *
  7. *
  8. * This library is free software. It comes without any warranty, to
  9. * the extent permitted by applicable law. You can redistribute it
  10. * and/or modify it under the terms of the Do What The Fuck You Want
  11. * To Public License, Version 2, as published by Sam Hocevar. See
  12. * http://sam.zoy.org/wtfpl/COPYING for more details.
  13. */
  14. class Canvas {
  15. private var cv;
  16. function setSize($width, $height) {
  17. return caca_set_canvas_width($this->cv, $width, $height);
  18. }
  19. function getWidth() {
  20. return caca_get_canvas_width($this->cv);
  21. }
  22. function getHeight() {
  23. return caca_get_canvas_height($this->cv);
  24. }
  25. function getAttr(, ) {
  26. }
  27. function setAttr() {
  28. }
  29. function setColorANSI($foreground, $background) {
  30. return caca_set_color_ansi($this->cv, $foreground, $background);
  31. }
  32. function setColorARGB($foreground, $background) {
  33. }
  34. function putChar($x, $y, $c) {
  35. return caca_put_char($this->cv, $x, $y, $c);
  36. }
  37. function getChar($x, $y) {
  38. return caca_get_char($this->cv, $x, $y);
  39. }
  40. function putStr($x, $y, $str) {
  41. return caca_put_str($this->cv, $x, $y, $str);
  42. }
  43. function Clear() {
  44. return caca_canvas_clear($this->cv);
  45. }
  46. function Blit(, , $c1, $c2) {
  47. }
  48. function Invert() {
  49. return caca_invert($this->cv);
  50. }
  51. function Flip() {
  52. return caca_flip($this->cv);
  53. }
  54. function Flop() {
  55. return caca_flop($this->cv);
  56. }
  57. function Rotate180() {
  58. return caca_rotate_180($this->cv);
  59. }
  60. function RotateLeft() {
  61. return caca_rotate_left($this->cv);
  62. }
  63. function RotateRight() {
  64. return caca_rotate_right($this->cv);
  65. }
  66. function drawLine(, , , , ) {
  67. }
  68. function drawPolyline() {
  69. }
  70. function drawThinLine(, , , ) {
  71. }
  72. function drawThinPolyline() {
  73. }
  74. function drawCircle(, , , ) {
  75. }
  76. function drawEllipse(, , , , ) {
  77. }
  78. function drawThinEllipse(, , , ) {
  79. }
  80. function fillEllipse(, , , , ) {
  81. }
  82. function drawBox(, , , , ) {
  83. }
  84. function drawThinBox(, , , ) {
  85. }
  86. function drawCP437Box(, , , ) {
  87. }
  88. function fillBox(, , , , ) {
  89. }
  90. function drawTriangle(, , , , , , ) {
  91. }
  92. function drawThriangle(, , , , , ) {
  93. }
  94. function fillTriangle(, , , , , , ) {
  95. }
  96. function __construct($width = 0, $height = 0) {
  97. cv = caca_create_canvas($width, $height);
  98. }
  99. }