Ignore:
Timestamp:
Oct 5, 2008, 2:56:17 AM (11 years ago)
Author:
Sam Hocevar
Message:

Split the C# bindings into separate files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/csharp/test.cs

    r2822 r2867  
    2121using Caca;
    2222
    23 class DemoCanvas : CacaCanvas
     23class DemoCanvas : Canvas
    2424{
    2525    private uint[,] image;
    2626
    2727    private DateTime startTime;
    28     private CacaDither d;
    29     private CacaCanvas scroll;
     28    private Dither d;
     29    private Canvas scroll;
    3030
    3131    public DemoCanvas()
     
    3535        string message = " --- POWERED BY LIBCACA --- OLDSCHOOL TEXT EFFECTS ARE 100% PURE WIN";
    3636
    37         scroll = new CacaCanvas(new Size(message.Length, 1));
    38         scroll.setColorAnsi(Libcaca.WHITE, Libcaca.TRANSPARENT);
     37        scroll = new Canvas(new Size(message.Length, 1));
     38        scroll.setColorAnsi(AnsiColor.WHITE, AnsiColor.TRANSPARENT);
    3939        scroll.putStr(new Point(0, 0), message);
    4040
    41         CacaFont f = new CacaFont(CacaFont.getList()[1]);
     41        Caca.Font f = new Caca.Font(Caca.Font.getList()[1]);
    4242        int w = f.Size.Width * message.Length;
    4343        int h = f.Size.Height;
    4444        image = new uint[w, h];
    45         d = new CacaDither(32, new Size(w, h), w * 4,
     45        d = new Dither(32, new Size(w, h), w * 4,
    4646                            0xff00, 0xff0000, 0xff000000, 0xff);
    4747        f.Render(scroll, image, image.GetLength(0) * 4);
     
    5555        Clear();
    5656
    57         setColorAnsi(Libcaca.WHITE, Libcaca.BLACK);
     57        setColorAnsi(AnsiColor.WHITE, AnsiColor.BLACK);
    5858        for(int i = 0; i < barCount; i++)
    5959        {
     
    6363            Point p2 = new Point(Size.Width - 1, (int)v);
    6464
    65             setColorAnsi((uint)(i + 9), Libcaca.BLACK);
     65            setColorAnsi((uint)(i + 9), AnsiColor.BLACK);
    6666            /* drawLine is already clipped, we don't care about overflows */
    6767            drawLine(p1 + new Size(0, -2), p2 + new Size(0, -2), '-');
     
    7979        ditherBitmap(new Rectangle(12 * w - x, h / 2 - y, w * 12, y * 2), d, image);
    8080
    81         setColorAnsi(Libcaca.WHITE, Libcaca.BLUE);
     81        setColorAnsi(AnsiColor.WHITE, AnsiColor.BLUE);
    8282        putStr(new Point(-30, -2) + Size, " -=[ Powered by libcaca ]=- ");
    83         setColorAnsi(Libcaca.WHITE, Libcaca.BLACK);
     83        setColorAnsi(AnsiColor.WHITE, AnsiColor.BLACK);
    8484    }
    8585}
    8686
    87 class DemoDisplay : CacaDisplay
     87class DemoDisplay : Display
    8888{
    8989    private DemoCanvas cv;
     
    9898    public void EventLoop()
    9999    {
    100         CacaEvent ev;
     100        Event ev;
    101101
    102         while((ev = getEvent(CacaEventType.KEY_RELEASE, 10)).Type == 0)
     102        while((ev = getEvent(EventType.KEY_RELEASE, 10)).Type == 0)
    103103        {
    104104            cv.Draw();
Note: See TracChangeset for help on using the changeset viewer.