Ignore:
Timestamp:
Nov 5, 2008, 1:39:18 AM (12 years ago)
Author:
bsittler
Message:

add AnsiColor?, EventType? and EventKey? constants parallel to the .NET ones

File:
1 edited

Legend:

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

    r3290 r3292  
    4242
    4343                $this->scroll = new Canvas(strlen($message), 1);
    44                 $this->scroll->setColorAnsi(CACA_WHITE, CACA_TRANSPARENT);
     44                $this->scroll->setColorAnsi(AnsiColor::WHITE, AnsiColor::TRANSPARENT);
    4545                $this->scroll->putStr(0, 0, $message);
    4646
     
    6565                $this->Clear();
    6666
    67                 $this->setColorAnsi(CACA_WHITE, CACA_BLACK);
     67                $this->setColorAnsi(AnsiColor::WHITE, AnsiColor::BLACK);
    6868                for($i = 0; $i < $barCount; $i++)
    6969                {
     
    7373                        $p2_x = $this->getWidth() - 1; $p2_y = intval($v);
    7474
    75                         $this->setColorAnsi(($i + 9), CACA_BLACK);
     75                        $this->setColorAnsi(($i + 9), AnsiColor::BLACK);
    7676                        /* drawLine is already clipped, we don't care about overflows */
    7777                        $this->drawLine($p1_x + 0, $p1_y - 2, $p2_x + 0, $p2_y - 2, ord('-'));
     
    8989                $this->d->bitmap($this, 12 * $w - $x, $h / 2 - $y, $w * 12, $y * 2);
    9090 
    91                 $this->setColorAnsi(CACA_WHITE, CACA_BLUE);
     91                $this->setColorAnsi(AnsiColor::WHITE, AnsiColor::BLUE);
    9292                $this->putStr($this->getWidth() - 30, $this->getHeight() - 2, " -=[ Powered by libcaca ]=- ");
    93                 $this->setColorAnsi(CACA_WHITE, CACA_BLACK);
     93                $this->setColorAnsi(AnsiColor::WHITE, AnsiColor::BLACK);
    9494        }
    9595}
     
    109109        function EventLoop()
    110110        {
    111                 while(! ($ev = $this->getEvent(CACA_EVENT_KEY_RELEASE, 10)))
     111                while(! ($ev = $this->getEvent(EventType::KEY_RELEASE, 10)))
    112112                {
    113113                        $this->cv->Draw();
Note: See TracChangeset for help on using the changeset viewer.