Ignore:
Timestamp:
11/02/08 00:43:00 (5 years ago)
Author:
nico
Message:
  • Improve php object layer "caca.php"
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca-php/caca.php

    r3193 r3195  
    1515 
    1616class Canvas { 
    17         private var cv; 
     17        private $cv; 
    1818 
    1919        function setSize($width, $height) { 
     
    150150 
    151151        function __construct($width = 0, $height = 0) { 
    152                 cv = caca_create_canvas($width, $height); 
     152                $this->cv = caca_create_canvas($width, $height); 
    153153        } 
    154154         
     
    157157        } 
    158158} 
     159 
     160class Display { 
     161        private $dp; 
     162 
     163        function setDisplayTime($time) { 
     164                return caca_set_display_time($this->dp, $time); 
     165        } 
     166 
     167        function getDisplayTime() { 
     168                return caca_get_display_time($this->dp); 
     169        } 
     170 
     171        function getWidth() { 
     172                return caca_get_display_width($this->dp); 
     173        } 
     174 
     175        function getHeight() { 
     176                return caca_get_display_height($this->dp); 
     177        } 
     178 
     179        function setTitle($title) { 
     180                return caca_set_display_title($this->dp, $title); 
     181        } 
     182 
     183        function getMouseX() { 
     184                return caca_get_mouse_x($this->dp); 
     185        } 
     186 
     187        function getMouseY() { 
     188                return caca_get_mouse_y($this->dp); 
     189        } 
     190 
     191        function setMouse($state) { 
     192                return caca_set_mouse($this->dp, $state); 
     193        } 
     194 
     195        function __construct($canvas) { 
     196                $this->dp = caca_create_display($canvas->get_resource()); 
     197        }  
     198 
     199        function get_resource() { 
     200                return $this->dp; 
     201        } 
     202} 
Note: See TracChangeset for help on using the changeset viewer.