Ignore:
Timestamp:
Oct 29, 2006, 9:54:51 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Get rid of cucul_set_attr_ansi() and cucul_set_attr_argb and merge the functionality into cucul_set_attr().
  • Add cucul_ansi_to_attr() and cucul_argb_to_attr().
  • Rename CUCUL_COLOR_* to CUCUL_*.
Location:
libcaca/trunk/caca
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca0.c

    r1015 r1257  
    3030cucul_canvas_t *__caca0_cv = NULL;
    3131caca_display_t *__caca0_dp = NULL;
    32 unsigned char __caca0_fg = CUCUL_COLOR_LIGHTGRAY;
    33 unsigned char __caca0_bg = CUCUL_COLOR_BLACK;
     32unsigned char __caca0_fg = CUCUL_LIGHTGRAY;
     33unsigned char __caca0_bg = CUCUL_BLACK;
    3434char __caca0_utf8[2] = " ";
    3535
     
    6161        return -1;
    6262    }
    63     __caca0_fg = CUCUL_COLOR_LIGHTGRAY;
    64     __caca0_bg = CUCUL_COLOR_BLACK;
     63    __caca0_fg = CUCUL_LIGHTGRAY;
     64    __caca0_bg = CUCUL_BLACK;
    6565    return 0;
    6666}
  • libcaca/trunk/caca/caca0.h

    r1254 r1257  
    5151enum caca_color
    5252{
    53     CACA_COLOR_BLACK = CUCUL_COLOR_BLACK,
    54     CACA_COLOR_BLUE = CUCUL_COLOR_BLUE,
    55     CACA_COLOR_GREEN = CUCUL_COLOR_GREEN,
    56     CACA_COLOR_CYAN = CUCUL_COLOR_CYAN,
    57     CACA_COLOR_RED = CUCUL_COLOR_RED,
    58     CACA_COLOR_MAGENTA = CUCUL_COLOR_MAGENTA,
    59     CACA_COLOR_BROWN = CUCUL_COLOR_BROWN,
    60     CACA_COLOR_LIGHTGRAY = CUCUL_COLOR_LIGHTGRAY,
    61     CACA_COLOR_DARKGRAY = CUCUL_COLOR_DARKGRAY,
    62     CACA_COLOR_LIGHTBLUE = CUCUL_COLOR_LIGHTBLUE,
    63     CACA_COLOR_LIGHTGREEN = CUCUL_COLOR_LIGHTGREEN,
    64     CACA_COLOR_LIGHTCYAN = CUCUL_COLOR_LIGHTCYAN,
    65     CACA_COLOR_LIGHTRED = CUCUL_COLOR_LIGHTRED,
    66     CACA_COLOR_LIGHTMAGENTA = CUCUL_COLOR_LIGHTMAGENTA,
    67     CACA_COLOR_YELLOW = CUCUL_COLOR_YELLOW,
    68     CACA_COLOR_WHITE = CUCUL_COLOR_WHITE,
     53    CACA_COLOR_BLACK = CUCUL_BLACK,
     54    CACA_COLOR_BLUE = CUCUL_BLUE,
     55    CACA_COLOR_GREEN = CUCUL_GREEN,
     56    CACA_COLOR_CYAN = CUCUL_CYAN,
     57    CACA_COLOR_RED = CUCUL_RED,
     58    CACA_COLOR_MAGENTA = CUCUL_MAGENTA,
     59    CACA_COLOR_BROWN = CUCUL_BROWN,
     60    CACA_COLOR_LIGHTGRAY = CUCUL_LIGHTGRAY,
     61    CACA_COLOR_DARKGRAY = CUCUL_DARKGRAY,
     62    CACA_COLOR_LIGHTBLUE = CUCUL_LIGHTBLUE,
     63    CACA_COLOR_LIGHTGREEN = CUCUL_LIGHTGREEN,
     64    CACA_COLOR_LIGHTCYAN = CUCUL_LIGHTCYAN,
     65    CACA_COLOR_LIGHTRED = CUCUL_LIGHTRED,
     66    CACA_COLOR_LIGHTMAGENTA = CUCUL_LIGHTMAGENTA,
     67    CACA_COLOR_YELLOW = CUCUL_YELLOW,
     68    CACA_COLOR_WHITE = CUCUL_WHITE,
    6969};
    7070
     
    132132#define caca_set_color(x, y) \
    133133    (__caca0_fg = (x), __caca0_bg = (y), \
    134      cucul_set_attr_ansi(__caca0_cv, x, y, 0))
     134     cucul_set_attr(__caca0_cv, cucul_ansi_to_attr(x, y)))
    135135#define caca_get_fg_color() __caca0_fg
    136136#define caca_get_bg_color() __caca0_bg
  • libcaca/trunk/caca/driver_gl.c

    r1256 r1257  
    513513    /* Allocate a libcucul canvas and print all the glyphs on it */
    514514    cv = cucul_create_canvas(1, b);
    515     cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK, 0);
     515    cucul_set_attr(cv, cucul_ansi_to_attr(CUCUL_WHITE, CUCUL_BLACK));
    516516
    517517    for(b = 0, i = 0; dp->drv.p->blocks[i + 1]; i += 2)
  • libcaca/trunk/caca/driver_slang.c

    r1254 r1257  
    223223            if(fgcolor == bgcolor)
    224224            {
    225                 if(fgcolor == CUCUL_COLOR_BLACK)
    226                     fgcolor = CUCUL_COLOR_WHITE;
    227                 else if(fgcolor == CUCUL_COLOR_WHITE
    228                          || fgcolor <= CUCUL_COLOR_LIGHTGRAY)
    229                     fgcolor = CUCUL_COLOR_BLACK;
     225                if(fgcolor == CUCUL_BLACK)
     226                    fgcolor = CUCUL_WHITE;
     227                else if(fgcolor == CUCUL_WHITE
     228                         || fgcolor <= CUCUL_LIGHTGRAY)
     229                    fgcolor = CUCUL_BLACK;
    230230                else
    231                     fgcolor = CUCUL_COLOR_WHITE;
     231                    fgcolor = CUCUL_WHITE;
    232232                SLsmg_set_color(slang_assoc[fgcolor + 16 * bgcolor]);
    233233                SLsmg_write_char(' ');
Note: See TracChangeset for help on using the changeset viewer.