Ignore:
Timestamp:
Sep 27, 2008, 3:12:46 PM (11 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/caca/caca0.h

    r1462 r2821  
    3636extern void __caca0_set_feature(int);
    3737extern char const *__caca0_get_feature_name(int);
    38 extern cucul_canvas_t *__caca0_load_sprite(char const *);
    39 extern cucul_dither_t *__caca0_create_bitmap(unsigned int, unsigned int,
     38extern caca_canvas_t *__caca0_load_sprite(char const *);
     39extern caca_dither_t *__caca0_create_bitmap(unsigned int, unsigned int,
    4040          unsigned int, unsigned int, unsigned long int, unsigned long int,
    4141          unsigned long int, unsigned long int);
    42 extern void __caca0_free_bitmap(cucul_dither_t *);
     42extern void __caca0_free_bitmap(caca_dither_t *);
    4343extern char const *__caca0_get_color_name(unsigned char);
    4444
    4545/* These variables are needed to emulate old non-thread safe behaviour */
    46 extern cucul_canvas_t *__caca0_cv;
     46extern caca_canvas_t *__caca0_cv;
    4747extern caca_display_t *__caca0_dp;
    4848extern unsigned char __caca0_fg;
     
    5252enum caca_color
    5353{
    54     CACA_COLOR_BLACK = CUCUL_BLACK,
    55     CACA_COLOR_BLUE = CUCUL_BLUE,
    56     CACA_COLOR_GREEN = CUCUL_GREEN,
    57     CACA_COLOR_CYAN = CUCUL_CYAN,
    58     CACA_COLOR_RED = CUCUL_RED,
    59     CACA_COLOR_MAGENTA = CUCUL_MAGENTA,
    60     CACA_COLOR_BROWN = CUCUL_BROWN,
    61     CACA_COLOR_LIGHTGRAY = CUCUL_LIGHTGRAY,
    62     CACA_COLOR_DARKGRAY = CUCUL_DARKGRAY,
    63     CACA_COLOR_LIGHTBLUE = CUCUL_LIGHTBLUE,
    64     CACA_COLOR_LIGHTGREEN = CUCUL_LIGHTGREEN,
    65     CACA_COLOR_LIGHTCYAN = CUCUL_LIGHTCYAN,
    66     CACA_COLOR_LIGHTRED = CUCUL_LIGHTRED,
    67     CACA_COLOR_LIGHTMAGENTA = CUCUL_LIGHTMAGENTA,
    68     CACA_COLOR_YELLOW = CUCUL_YELLOW,
    69     CACA_COLOR_WHITE = CUCUL_WHITE,
     54    CACA_COLOR_BLACK = CACA_BLACK,
     55    CACA_COLOR_BLUE = CACA_BLUE,
     56    CACA_COLOR_GREEN = CACA_GREEN,
     57    CACA_COLOR_CYAN = CACA_CYAN,
     58    CACA_COLOR_RED = CACA_RED,
     59    CACA_COLOR_MAGENTA = CACA_MAGENTA,
     60    CACA_COLOR_BROWN = CACA_BROWN,
     61    CACA_COLOR_LIGHTGRAY = CACA_LIGHTGRAY,
     62    CACA_COLOR_DARKGRAY = CACA_DARKGRAY,
     63    CACA_COLOR_LIGHTBLUE = CACA_LIGHTBLUE,
     64    CACA_COLOR_LIGHTGREEN = CACA_LIGHTGREEN,
     65    CACA_COLOR_LIGHTCYAN = CACA_LIGHTCYAN,
     66    CACA_COLOR_LIGHTRED = CACA_LIGHTRED,
     67    CACA_COLOR_LIGHTMAGENTA = CACA_LIGHTMAGENTA,
     68    CACA_COLOR_YELLOW = CACA_YELLOW,
     69    CACA_COLOR_WHITE = CACA_WHITE,
    7070};
    7171
     
    118118#define caca_get_feature_name __caca0_get_feature_name
    119119#define caca_get_rendertime() caca_get_display_time(__caca0_dp)
    120 #define caca_get_width() cucul_get_canvas_width(__caca0_cv)
    121 #define caca_get_height() cucul_get_canvas_height(__caca0_cv)
     120#define caca_get_width() caca_get_canvas_width(__caca0_cv)
     121#define caca_get_height() caca_get_canvas_height(__caca0_cv)
    122122#define caca_set_window_title(s) caca_set_display_title(__caca0_dp, s)
    123123#define caca_get_window_width() caca_get_display_width(__caca0_dp)
     
    132132
    133133#define caca_set_color(x, y) \
    134     (__caca0_fg = (x), __caca0_bg = (y), cucul_set_color_ansi(__caca0_cv, x, y))
     134    (__caca0_fg = (x), __caca0_bg = (y), caca_set_color_ansi(__caca0_cv, x, y))
    135135#define caca_get_fg_color() __caca0_fg
    136136#define caca_get_bg_color() __caca0_bg
    137137#define caca_get_color_name __caca0_get_color_name
    138 #define caca_putchar(x, y, c) cucul_put_char(__caca0_cv, x, y, c)
    139 #define caca_putstr(x, y, s) cucul_put_str(__caca0_cv, x, y, s)
    140 #define caca_printf(x, y, f, z...) cucul_printf(__caca0_cv, x, y, f, ##z)
    141 #define caca_clear() cucul_clear_canvas(__caca0_cv)
     138#define caca_putchar(x, y, c) caca_put_char(__caca0_cv, x, y, c)
     139#define caca_putstr(x, y, s) caca_put_str(__caca0_cv, x, y, s)
     140#define caca_printf(x, y, f, z...) caca_printf(__caca0_cv, x, y, f, ##z)
     141#define caca_clear() caca_clear_canvas(__caca0_cv)
    142142
    143143#define caca_draw_line(x, y, z, t, c) \
    144     cucul_draw_line(__caca0_cv, x, y, z, t, c)
     144    caca_draw_line(__caca0_cv, x, y, z, t, c)
    145145#define caca_draw_polyline(x, y, z, c) \
    146     cucul_draw_polyline(__caca0_cv, x, y, z, c)
     146    caca_draw_polyline(__caca0_cv, x, y, z, c)
    147147#define caca_draw_thin_line(x, y, z, t) \
    148     cucul_draw_thin_line(__caca0_cv, x, y, z, t)
     148    caca_draw_thin_line(__caca0_cv, x, y, z, t)
    149149#define caca_draw_thin_polyline(x, y, z) \
    150     cucul_draw_thin_polyline(__caca0_cv, x, y, z)
     150    caca_draw_thin_polyline(__caca0_cv, x, y, z)
    151151#define caca_draw_circle(x, y, z, c) \
    152     cucul_draw_circle(__caca0_cv, x, y, z, c)
     152    caca_draw_circle(__caca0_cv, x, y, z, c)
    153153#define caca_draw_ellipse(x, y, z, t, c) \
    154     cucul_draw_ellipse(__caca0_cv, x, y, z, t, c)
     154    caca_draw_ellipse(__caca0_cv, x, y, z, t, c)
    155155#define caca_draw_thin_ellipse(x, y, z, t) \
    156     cucul_draw_thin_ellipse(__caca0_cv, x, y, z, t)
     156    caca_draw_thin_ellipse(__caca0_cv, x, y, z, t)
    157157#define caca_fill_ellipse(x, y, z, t, c) \
    158     cucul_fill_ellipse(__caca0_cv, x, y, z, t, c)
     158    caca_fill_ellipse(__caca0_cv, x, y, z, t, c)
    159159#define caca_draw_box(x, y, z, t, c) \
    160     cucul_draw_box(__caca0_cv, x, y, z, t, c)
     160    caca_draw_box(__caca0_cv, x, y, z, t, c)
    161161#define caca_draw_thin_box(x, y, z, t) \
    162     cucul_draw_thin_box(__caca0_cv, x, y, z, t)
     162    caca_draw_thin_box(__caca0_cv, x, y, z, t)
    163163#define caca_fill_box(x, y, z, t, c) \
    164     cucul_fill_box(__caca0_cv, x, y, z, t, c)
     164    caca_fill_box(__caca0_cv, x, y, z, t, c)
    165165#define caca_draw_triangle(x, y, z, t, u, v, c) \
    166     cucul_draw_triangle(__caca0_cv, x, y, z, t, u, v, c)
     166    caca_draw_triangle(__caca0_cv, x, y, z, t, u, v, c)
    167167#define caca_draw_thin_triangle(x, y, z, t, u, v) \
    168     cucul_draw_thin_triangle(__caca0_cv, x, y, z, t, u, v)
     168    caca_draw_thin_triangle(__caca0_cv, x, y, z, t, u, v)
    169169#define caca_fill_triangle(x, y, z, t, u, v, c) \
    170     cucul_fill_triangle(__caca0_cv, x, y, z, t, u, v, c)
     170    caca_fill_triangle(__caca0_cv, x, y, z, t, u, v, c)
    171171
    172 #define caca_rand(a, b) cucul_rand(a, (b)+1)
     172#define caca_rand(a, b) caca_rand(a, (b)+1)
    173173#define caca_sqrt __caca0_sqrt
    174174
    175 #define caca_sprite cucul_canvas
     175#define caca_sprite caca_canvas
    176176#define caca_load_sprite __caca0_load_sprite
    177177#define caca_get_sprite_frames(c) 1
    178 #define caca_get_sprite_width(c, f) cucul_get_canvas_width(c)
    179 #define caca_get_sprite_height(c, f) cucul_get_canvas_height(c)
     178#define caca_get_sprite_width(c, f) caca_get_canvas_width(c)
     179#define caca_get_sprite_height(c, f) caca_get_canvas_height(c)
    180180#define caca_get_sprite_dx(c, f) 0
    181181#define caca_get_sprite_dx(c, f) 0
    182 #define caca_draw_sprite(x, y, c, f) cucul_blit(__caca0_cv, x, y, c, NULL)
    183 #define caca_free_sprite cucul_free_canvas
     182#define caca_draw_sprite(x, y, c, f) caca_blit(__caca0_cv, x, y, c, NULL)
     183#define caca_free_sprite caca_free_canvas
    184184
    185 #define caca_bitmap cucul_dither
     185#define caca_bitmap caca_dither
    186186#define caca_create_bitmap __caca0_create_bitmap
    187 #define caca_set_bitmap_palette cucul_set_dither_palette
     187#define caca_set_bitmap_palette caca_set_dither_palette
    188188#define caca_draw_bitmap(x, y, z, t, b, p) \
    189     cucul_dither_bitmap(__caca0_cv, x, y, z, t, b, p)
     189    caca_dither_bitmap(__caca0_cv, x, y, z, t, b, p)
    190190#define caca_free_bitmap __caca0_free_bitmap
    191191
Note: See TracChangeset for help on using the changeset viewer.