Ignore:
Timestamp:
Mar 5, 2006, 7:43:13 PM (15 years ago)
Author:
Sam Hocevar
Message:

A new low-level text management library (canvas for ultrafast compositing

of unicode letters) is now separated from the higher level rendering and I/O
(that is, libcaca). This commit totally breaks the API, but once everything
is polished I will think about source-level backward compatibility. Most
drivers are broken, but X11 still sorta works.

The new design is much more object-oriented and allows having several

active renderers at the same time, changing renderers on the fly, and more
important, having no renderer at all (useful for converters, or when you
want to do your own renderer).

And in case you are still wondering, the libcucul acronym has "Unicode"

because I want to support at least a subset of Unicode. There are awesome
glyphs in it, including the ones inherited from Codepage 437 such as
"gray 25%" that are used in DOS and Win32 ANSI art.

Location:
libcaca/trunk/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/test

    • Property svn:ignore
      •  

        old new  
        55colors.exe
        66colors
         7demo.exe
         8demo
        79dithering.exe
        810dithering
  • libcaca/trunk/test/colors.c

    r522 r524  
    1616#include <stdio.h>
    1717
     18#include "cucul.h"
    1819#include "caca.h"
    1920
    2021int main(int argc, char **argv)
    2122{
     23    cucul_t *qq;
     24    caca_t *kk;
    2225    int i, j;
    2326
    24     if(caca_init())
     27    qq = cucul_init();
     28    if(!qq)
    2529        return 1;
    2630
    27     caca_clear();
     31    kk = caca_attach(qq);
     32    if(!kk)
     33        return 1;
     34
     35    cucul_clear(qq);
    2836    for(i = 0; i < 16; i++)
    2937    {
    30         caca_set_color(CACA_COLOR_LIGHTGRAY, CACA_COLOR_BLACK);
    31         caca_printf(4, i + (i >= 8 ? 4 : 3), "'%c': %i (%s)",
    32                     'a' + i, i, caca_get_color_name(i));
     38        cucul_set_color(qq, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     39        cucul_printf(qq, 4, i + (i >= 8 ? 4 : 3), "'%c': %i (%s)",
     40                     'a' + i, i, cucul_get_color_name(i));
    3341        for(j = 0; j < 16; j++)
    3442        {
    35             caca_set_color(i, j);
    36             caca_putstr((j >= 8 ? 41 : 40) + j * 2, i + (i >= 8 ? 4 : 3), "# ");
     43            cucul_set_color(qq, i, j);
     44            cucul_putstr(qq, (j >= 8 ? 41 : 40) + j * 2, i + (i >= 8 ? 4 : 3),
     45                         "# ");
    3746        }
    3847    }
    3948
    40     caca_refresh();
    41     caca_wait_event(CACA_EVENT_KEY_PRESS);
    42     caca_end();
     49    caca_refresh(kk);
     50    caca_wait_event(kk, CACA_EVENT_KEY_PRESS);
     51
     52    caca_detach(kk);
     53    cucul_end(qq);
    4354
    4455    return 0;
Note: See TracChangeset for help on using the changeset viewer.