Ignore:
Timestamp:
Sep 27, 2008, 3:12:46 PM (12 years ago)
Author:
Sam Hocevar
Message:

Starting refactoring to get rid of libcucul. The initial reason for the
split is rendered moot by the plugin system: when enabled, binaries do
not link directly with libX11 or libGL. I hope this is a step towards
more consisteny and clarity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/examples/colors.c

    r2299 r2821  
    1919#endif
    2020
    21 #include "cucul.h"
    2221#include "caca.h"
    2322
    2423int main(int argc, char **argv)
    2524{
    26     cucul_canvas_t *cv;
     25    caca_canvas_t *cv;
    2726    caca_display_t *dp;
    2827    int i, j;
    2928
    30     cv = cucul_create_canvas(80, 24);
     29    cv = caca_create_canvas(80, 24);
    3130    if(cv == NULL)
    3231    {
     
    4241    }
    4342
    44     cucul_set_color_ansi(cv, CUCUL_LIGHTGRAY, CUCUL_BLACK);
    45     cucul_clear_canvas(cv);
     43    caca_set_color_ansi(cv, CACA_LIGHTGRAY, CACA_BLACK);
     44    caca_clear_canvas(cv);
    4645    for(i = 0; i < 16; i++)
    4746    {
    48         cucul_set_color_ansi(cv, CUCUL_LIGHTGRAY, CUCUL_BLACK);
    49         cucul_printf(cv, 3, i + (i >= 8 ? 3 : 2), "ANSI %i", i);
     47        caca_set_color_ansi(cv, CACA_LIGHTGRAY, CACA_BLACK);
     48        caca_printf(cv, 3, i + (i >= 8 ? 3 : 2), "ANSI %i", i);
    5049        for(j = 0; j < 16; j++)
    5150        {
    52             cucul_set_color_ansi(cv, i, j);
    53             cucul_put_str(cv, (j >= 8 ? 13 : 12) + j * 4, i + (i >= 8 ? 3 : 2),
     51            caca_set_color_ansi(cv, i, j);
     52            caca_put_str(cv, (j >= 8 ? 13 : 12) + j * 4, i + (i >= 8 ? 3 : 2),
    5453                          "Aaホ");
    5554        }
    5655    }
    5756
    58     cucul_set_color_ansi(cv, CUCUL_LIGHTGRAY, CUCUL_BLACK);
    59     cucul_put_str(cv, 3, 20, "This is bold    This is blink    This is italics    This is underline");
    60     cucul_set_attr(cv, CUCUL_BOLD);
    61     cucul_put_str(cv, 3 + 8, 20, "bold");
    62     cucul_set_attr(cv, CUCUL_BLINK);
    63     cucul_put_str(cv, 3 + 24, 20, "blink");
    64     cucul_set_attr(cv, CUCUL_ITALICS);
    65     cucul_put_str(cv, 3 + 41, 20, "italics");
    66     cucul_set_attr(cv, CUCUL_UNDERLINE);
    67     cucul_put_str(cv, 3 + 60, 20, "underline");
     57    caca_set_color_ansi(cv, CACA_LIGHTGRAY, CACA_BLACK);
     58    caca_put_str(cv, 3, 20, "This is bold    This is blink    This is italics    This is underline");
     59    caca_set_attr(cv, CACA_BOLD);
     60    caca_put_str(cv, 3 + 8, 20, "bold");
     61    caca_set_attr(cv, CACA_BLINK);
     62    caca_put_str(cv, 3 + 24, 20, "blink");
     63    caca_set_attr(cv, CACA_ITALICS);
     64    caca_put_str(cv, 3 + 41, 20, "italics");
     65    caca_set_attr(cv, CACA_UNDERLINE);
     66    caca_put_str(cv, 3 + 60, 20, "underline");
    6867
    6968    caca_refresh_display(dp);
     
    7170
    7271    caca_free_display(dp);
    73     cucul_free_canvas(cv);
     72    caca_free_canvas(cv);
    7473
    7574    return 0;
Note: See TracChangeset for help on using the changeset viewer.