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/swallow.c

    r2300 r2821  
    2121#endif
    2222
    23 #include "cucul.h"
    2423#include "caca.h"
    2524
     
    2726{
    2827    char cmd[BUFSIZ];
    29     static cucul_canvas_t *cv, *app;
     28    static caca_canvas_t *cv, *app;
    3029    static caca_display_t *dp;
    3130    uint8_t *buf[4];
     
    4039    }
    4140
    42     cv = cucul_create_canvas(0, 0);
    43     app = cucul_create_canvas(0, 0);
     41    cv = caca_create_canvas(0, 0);
     42    app = caca_create_canvas(0, 0);
    4443    dp = caca_create_display(cv);
    4544
     
    5554    }
    5655
    57     w = (cucul_get_canvas_width(cv) - 4) / 2;
    58     h = (cucul_get_canvas_height(cv) - 6) / 2;
     56    w = (caca_get_canvas_width(cv) - 4) / 2;
     57    h = (caca_get_canvas_height(cv) - 6) / 2;
    5958
    6059    if(w < 0 || h < 0)
    6160        return 1;
    6261
    63     cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE);
    64     cucul_draw_line(cv, 0, 0, cucul_get_canvas_width(cv) - 1, 0, ' ');
    65     cucul_printf(cv, cucul_get_canvas_width(cv) / 2 - 10, 0,
     62    caca_set_color_ansi(cv, CACA_WHITE, CACA_BLUE);
     63    caca_draw_line(cv, 0, 0, caca_get_canvas_width(cv) - 1, 0, ' ');
     64    caca_printf(cv, caca_get_canvas_width(cv) / 2 - 10, 0,
    6665                 "libcaca multiplexer");
    6766
     
    7574        if(!f[i])
    7675            return 1;
    77         cucul_printf(cv, (w + 2) * (i / 2) + 1,
     76        caca_printf(cv, (w + 2) * (i / 2) + 1,
    7877                         (h + 2) * ((i % 2) + 1), "%s", argv[i + 1]);
    7978    }
     
    8988        for(i = 0; i < 4; i++)
    9089        {
    91             bytes[i] = cucul_import_memory(app, buf[i], total[i], "caca");
     90            bytes[i] = caca_import_memory(app, buf[i], total[i], "caca");
    9291
    9392            if(bytes[i] > 0)
     
    9695                memmove(buf[i], buf[i] + bytes[i], total[i]);
    9796
    98                 cucul_blit(cv, (w + 2) * (i / 2) + 1,
     97                caca_blit(cv, (w + 2) * (i / 2) + 1,
    9998                               (h + 2) * (i % 2) + 2, app, NULL);
    10099                caca_refresh_display(dp);
     
    116115    /* Clean up */
    117116    caca_free_display(dp);
    118     cucul_free_canvas(cv);
    119     cucul_free_canvas(app);
     117    caca_free_canvas(cv);
     118    caca_free_canvas(app);
    120119
    121120    return 0;
Note: See TracChangeset for help on using the changeset viewer.