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/src/cacadraw.c

    r2299 r2821  
    2121#endif
    2222
    23 #include "cucul.h"
    2423#include "caca.h"
    2524
    2625static int refresh_screen(void);
    2726
    28 static cucul_canvas_t *cv, *image;
     27static caca_canvas_t *cv, *image;
    2928static caca_display_t *dp;
    3029static int x = 0, y = 0;
     
    4140    }
    4241
    43     cv = cucul_create_canvas(0, 0);
     42    cv = caca_create_canvas(0, 0);
    4443    if(!cv)
    4544        return 1;
     
    5655        if(!image)
    5756        {
    58             image = cucul_create_canvas(0, 0);
    59             if(cucul_import_file(image, argv[file], "ansi") < 0)
     57            image = caca_create_canvas(0, 0);
     58            if(caca_import_file(image, argv[file], "ansi") < 0)
    6059            {
    6160                fprintf(stderr, "%s: invalid file `%s'.\n", argv[0], argv[1]);
     
    6362            }
    6463
    65             ih = cucul_get_canvas_height(image);
    66             iw = cucul_get_canvas_width(image);
     64            ih = caca_get_canvas_height(image);
     65            iw = caca_get_canvas_width(image);
    6766            x = y = 0;
    6867
     
    9897                    case 'n':
    9998                        file = file + 1 < argc ? file + 1 : 1;
    100                         cucul_free_canvas(image);
     99                        caca_free_canvas(image);
    101100                        image = NULL;
    102101                        goto stopevents;
    103102                    case 'p':
    104103                        file = file > 1 ? file - 1 : argc - 1;
    105                         cucul_free_canvas(image);
     104                        caca_free_canvas(image);
    106105                        image = NULL;
    107106                        goto stopevents;
     
    118117stopevents:
    119118
    120         w = cucul_get_canvas_width(cv);
    121         h = cucul_get_canvas_height(cv);
     119        w = caca_get_canvas_width(cv);
     120        h = caca_get_canvas_height(cv);
    122121
    123122        if(dx | dy)
     
    135134    /* Clean up */
    136135    caca_free_display(dp);
    137     cucul_free_canvas(image);
    138     cucul_free_canvas(cv);
     136    caca_free_canvas(image);
     137    caca_free_canvas(cv);
    139138
    140139    return 0;
     
    143142static int refresh_screen(void)
    144143{
    145     cucul_set_color_ansi(cv, CUCUL_DEFAULT, CUCUL_DEFAULT);
    146     cucul_clear_canvas(cv);
     144    caca_set_color_ansi(cv, CACA_DEFAULT, CACA_DEFAULT);
     145    caca_clear_canvas(cv);
    147146
    148     cucul_blit(cv, - x, - y, image, NULL);
     147    caca_blit(cv, - x, - y, image, NULL);
    149148
    150149    caca_refresh_display(dp);
Note: See TracChangeset for help on using the changeset viewer.