Changeset 1256


Ignore:
Timestamp:
Oct 29, 2006, 9:35:46 AM (13 years ago)
Author:
Sam Hocevar
Message:
  • Remove cucul_set_color() from the exported API and replaced all calls with cucul_set_attr_ansi(). Old application will still compile (but issue a warning) and run, though.
Location:
libcaca/trunk
Files:
26 edited

Legend:

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

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

    r1254 r1256  
    2626#include "cucul.h"
    2727#include "cucul_internals.h"
     28
     29/* Legacy stuff from old versions */
     30int cucul_set_color(cucul_canvas_t *, unsigned char, unsigned char);
     31int cucul_set_truecolor(cucul_canvas_t *, unsigned int, unsigned int);
    2832
    2933/* RGB colours for the ANSI palette. There is no real standard, so we
  • libcaca/trunk/cucul/cucul.h

    r1254 r1256  
    121121int cucul_set_canvas_boundaries(cucul_canvas_t *, int, int,
    122122                                unsigned int, unsigned int);
    123 /* Legacy stuff */
    124 int cucul_set_color(cucul_canvas_t *, unsigned char, unsigned char);
    125 int cucul_set_truecolor(cucul_canvas_t *, unsigned int, unsigned int);
    126123/*  @} */
    127124
  • libcaca/trunk/cucul/dither.c

    r1104 r1256  
    10431043
    10441044        /* Now output the character */
    1045         cucul_set_color(cv, outfg, outbg);
     1045        cucul_set_attr_ansi(cv, outfg, outbg, 0);
    10461046        cucul_putchar(cv, x, y, outch);
    10471047
  • libcaca/trunk/cucul/import.c

    r1254 r1256  
    203203    }
    204204
    205     cucul_set_color(cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_TRANSPARENT);
     205    cucul_set_attr_ansi(cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_TRANSPARENT, 0);
    206206
    207207    for(i = 0; i < size; i++)
     
    385385            case 'K': /* EL - Erase In Line */
    386386                if(width < 80)
    387                     cucul_set_color(cv, CUCUL_COLOR_DEFAULT,
    388                                         CUCUL_COLOR_TRANSPARENT);
     387                    cucul_set_attr_ansi(cv, CUCUL_COLOR_DEFAULT,
     388                                        CUCUL_COLOR_TRANSPARENT, 0);
    389389                    cucul_set_canvas_size(cv, width = 80, height);
    390390                for(j = x; j < 80; j++)
     
    436436        if((unsigned int)x + wch > width)
    437437        {
    438             cucul_set_color(cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_TRANSPARENT);
     438            cucul_set_attr_ansi(cv, CUCUL_COLOR_DEFAULT,
     439                                CUCUL_COLOR_TRANSPARENT, 0);
    439440            cucul_set_canvas_size(cv, width = x + wch, height);
    440441        }
     
    442443        if((unsigned int)y >= height)
    443444        {
    444             cucul_set_color(cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_TRANSPARENT);
     445            cucul_set_attr_ansi(cv, CUCUL_COLOR_DEFAULT,
     446                                CUCUL_COLOR_TRANSPARENT, 0);
    445447            cucul_set_canvas_size(cv, width, height = y + 1);
    446448        }
    447449
    448450        /* Now paste our character */
    449         cucul_set_color(cv, grcm.efg, grcm.ebg);
     451        cucul_set_attr_ansi(cv, grcm.efg, grcm.ebg, 0);
    450452        cucul_putchar(cv, x, y, ch);
    451453        x += wch;
     
    454456    if((unsigned int)y > height)
    455457    {
    456         cucul_set_color(cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_TRANSPARENT);
     458        cucul_set_attr_ansi(cv, CUCUL_COLOR_DEFAULT,
     459                            CUCUL_COLOR_TRANSPARENT, 0);
    457460        cucul_set_canvas_size(cv, width, height = y);
    458461    }
  • libcaca/trunk/cucul/sprite.c

    r1254 r1256  
    4949 *  Set the active canvas frame. All subsequent drawing operations will
    5050 *  be performed on that frame. The current painting context set by
    51  *  cucul_set_color() or cucul_set_truecolor() is inherited.
     51 *  cucul_set_attr_ansi() or cucul_set_attr_argb() is inherited.
    5252 *
    5353 *  If the frame index is outside the canvas' frame range, nothing happens.
  • libcaca/trunk/src/aafire.c

    r1152 r1256  
    241241  cucul_dither_bitmap(cv, 0, 0, cucul_get_canvas_width(cv),
    242242                      cucul_get_canvas_height(cv), cucul_dither, bitmap);
    243   cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     243  cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    244244  if (sloop < 100)
    245245    cucul_putstr(cv, cucul_get_canvas_width(cv) - 30,
  • libcaca/trunk/src/cacademo.c

    r1226 r1256  
    162162        {
    163163            fn[next](RENDER, backcv);
    164             cucul_set_color(mask, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     164            cucul_set_attr_ansi(mask, CUCUL_COLOR_LIGHTGRAY,
     165                                      CUCUL_COLOR_BLACK, 0);
    165166            cucul_clear_canvas(mask);
    166             cucul_set_color(mask, CUCUL_COLOR_WHITE, CUCUL_COLOR_WHITE);
     167            cucul_set_attr_ansi(mask, CUCUL_COLOR_WHITE,
     168                                      CUCUL_COLOR_WHITE, 0);
    167169            transition(mask, tmode,
    168170                       100 * (frame - next_transition) / TRANSITION_FRAMES);
     
    170172        }
    171173
    172         cucul_set_color(frontcv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     174        cucul_set_attr_ansi(frontcv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    173175        if(frame < 100)
    174176            cucul_putstr(frontcv, cucul_get_canvas_width(frontcv) - 30,
     
    693695
    694696                if(p & 0x0f)
    695                     cucul_set_color(cv, CUCUL_COLOR_WHITE, p >> 4);
     697                    cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, p >> 4, 0);
    696698                else
    697                     cucul_set_color(cv, CUCUL_COLOR_BLACK, CUCUL_COLOR_BLACK);
     699                    cucul_set_attr_ansi(cv, CUCUL_COLOR_BLACK,
     700                                            CUCUL_COLOR_BLACK, 0);
    698701                cucul_putchar(cv, x, y, gradient[p & 0x0f]);
    699702            }
     
    759762        h = cucul_get_canvas_height(cv);
    760763
    761         cucul_set_color(cv, CUCUL_COLOR_BLACK, CUCUL_COLOR_BLACK);
     764        cucul_set_attr_ansi(cv, CUCUL_COLOR_BLACK, CUCUL_COLOR_BLACK, 0);
    762765        cucul_clear_canvas(cv);
    763766
     
    781784                else
    782785                    fg = CUCUL_COLOR_DARKGRAY;
    783                 cucul_set_color(cv, fg, CUCUL_COLOR_BLACK);
     786                cucul_set_attr_ansi(cv, fg, CUCUL_COLOR_BLACK, 0);
    784787
    785788                cucul_putchar(cv, x, y - j,
  • libcaca/trunk/src/cacadraw.c

    r1048 r1256  
    152152static int refresh_screen(void)
    153153{
    154     cucul_set_color(cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_DEFAULT);
     154    cucul_set_attr_ansi(cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_DEFAULT, 0);
    155155    cucul_clear_canvas(cv);
    156156
  • libcaca/trunk/src/cacaview.c

    r1255 r1256  
    305305            sprintf(buffer, " Loading `%s'... ", list[current]);
    306306            buffer[ww] = '\0';
    307             cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     307            cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    308308            cucul_putstr(cv, (ww - strlen(buffer)) / 2, wh / 2, buffer);
    309309            caca_refresh_display(dp);
     
    325325        }
    326326
    327         cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     327        cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK, 0);
    328328        cucul_clear_canvas(cv);
    329329
    330330        if(!items)
    331331        {
    332             cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     332            cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    333333            cucul_printf(cv, ww / 2 - 5, wh / 2, " No image. ");
    334334        }
     
    350350            sprintf(buffer, ERROR_STRING, list[current]);
    351351            buffer[ww] = '\0';
    352             cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     352            cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    353353            cucul_putstr(cv, (ww - strlen(buffer)) / 2, wh / 2, buffer);
    354354            free(buffer);
     
    380380
    381381#if 0 /* FIXME */
    382             cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     382            cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY,
     383                                    CUCUL_COLOR_BLACK, 0);
    383384            switch(status)
    384385            {
     
    419420static void print_status(void)
    420421{
    421     cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     422    cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    422423    cucul_draw_line(cv, 0, 0, ww - 1, 0, " ");
    423424    cucul_draw_line(cv, 0, wh - 2, ww - 1, wh - 2, "-");
     
    429430    cucul_printf(cv, ww - 14, wh - 2, "(zoom: %s%i)", zoom > 0 ? "+" : "", zoom);
    430431
    431     cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     432    cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK, 0);
    432433    cucul_draw_line(cv, 0, wh - 1, ww - 1, wh - 1, " ");
    433434}
     
    457458    int i;
    458459
    459     cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     460    cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    460461
    461462    for(i = 0; help[i]; i++)
     
    518519    {
    519520        if((((xn - x) / 5) ^ ((yn - y) / 3)) & 1)
    520             cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_DARKGRAY);
     521            cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY,
     522                                    CUCUL_COLOR_DARKGRAY, 0);
    521523        else
    522             cucul_set_color(cv, CUCUL_COLOR_DARKGRAY, CUCUL_COLOR_LIGHTGRAY);
     524            cucul_set_attr_ansi(cv, CUCUL_COLOR_DARKGRAY,
     525                                    CUCUL_COLOR_LIGHTGRAY, 0);
    523526        cucul_putchar(cv, xn, yn, ' ');
    524527    }
  • libcaca/trunk/src/img2irc.c

    r1049 r1256  
    5757
    5858    cucul_set_canvas_size(cv, cols, lines);
    59     cucul_set_color(cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_TRANSPARENT);
     59    cucul_set_attr_ansi(cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_TRANSPARENT, 0);
    6060    cucul_clear_canvas(cv);
    6161    cucul_dither_bitmap(cv, 0, 0, cols, lines, i->dither, i->pixels);
  • libcaca/trunk/test/colors.c

    r980 r1256  
    3636        return 1;
    3737
    38     cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     38    cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK, 0);
    3939    cucul_clear_canvas(cv);
    4040    for(i = 0; i < 16; i++)
    4141    {
    42         cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     42        cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK, 0);
    4343        cucul_printf(cv, 4, i + (i >= 8 ? 4 : 3), "'%cv': %i (%s)",
    4444                     'a' + i, i, cucul_get_color_name(i));
    4545        for(j = 0; j < 16; j++)
    4646        {
    47             cucul_set_color(cv, i, j);
     47            cucul_set_attr_ansi(cv, i, j, 0);
    4848            cucul_putstr(cv, (j >= 8 ? 41 : 40) + j * 2, i + (i >= 8 ? 4 : 3),
    4949                         "Aa");
  • libcaca/trunk/test/demo.c

    r1048 r1256  
    151151                if(demo)
    152152                {
    153                     cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     153                    cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY,
     154                                            CUCUL_COLOR_BLACK, 0);
    154155                    cucul_clear_canvas(cv);
    155156                }
     
    172173            if(mouse && !demo)
    173174            {
    174                 cucul_set_color(cv, CUCUL_COLOR_RED, CUCUL_COLOR_BLACK);
     175                cucul_set_attr_ansi(cv, CUCUL_COLOR_RED, CUCUL_COLOR_BLACK, 0);
    175176                cucul_putstr(cv, xmouse, ymouse,     ".");
    176177                cucul_putstr(cv, xmouse, ymouse + 1, "|\\");
     
    184185            demo();
    185186
    186             cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     187            cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY,
     188                                    CUCUL_COLOR_BLACK, 0);
    187189            cucul_draw_thin_box(cv, 1, 1, cucul_get_canvas_width(cv) - 2,
    188190                                          cucul_get_canvas_height(cv) - 2);
     
    209211    int yo = cucul_get_canvas_height(cv) - 2;
    210212
    211     cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     213    cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK, 0);
    212214    cucul_clear_canvas(cv);
    213215    cucul_draw_thin_box(cv, 1, 1, xo, yo);
     
    251253    i++;
    252254
    253     cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     255    cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK, 0);
    254256    cucul_clear_canvas(cv);
    255257
    256258    /* Draw the sun */
    257     cucul_set_color(cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
     259    cucul_set_attr_ansi(cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK, 0);
    258260    xo = cucul_get_canvas_width(cv) / 4;
    259261    yo = cucul_get_canvas_height(cv) / 4 + 5 * sin(0.03*i);
     
    267269
    268270    j = 15 + sin(0.03*i) * 8;
    269     cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     271    cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK, 0);
    270272    cucul_fill_ellipse(cv, xo, yo, j, j / 2, "#");
    271     cucul_set_color(cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
     273    cucul_set_attr_ansi(cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK, 0);
    272274    cucul_draw_ellipse(cv, xo, yo, j, j / 2, "#");
    273275
     
    285287    yc = cucul_get_canvas_height(cv) * 3 / 4 + cos(0.02*i) * 5;
    286288
    287     cucul_set_color(cv, CUCUL_COLOR_GREEN, CUCUL_COLOR_BLACK);
     289    cucul_set_attr_ansi(cv, CUCUL_COLOR_GREEN, CUCUL_COLOR_BLACK, 0);
    288290    cucul_fill_triangle(cv, xo, yo, xb, yb, xa, ya, "%");
    289     cucul_set_color(cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
     291    cucul_set_attr_ansi(cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK, 0);
    290292    cucul_draw_thin_triangle(cv, xo, yo, xb, yb, xa, ya);
    291293
    292     cucul_set_color(cv, CUCUL_COLOR_RED, CUCUL_COLOR_BLACK);
     294    cucul_set_attr_ansi(cv, CUCUL_COLOR_RED, CUCUL_COLOR_BLACK, 0);
    293295    cucul_fill_triangle(cv, xa, ya, xb, yb, xc, yc, "#");
    294     cucul_set_color(cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
     296    cucul_set_attr_ansi(cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK, 0);
    295297    cucul_draw_thin_triangle(cv, xa, ya, xb, yb, xc, yc);
    296298
    297     cucul_set_color(cv, CUCUL_COLOR_BLUE, CUCUL_COLOR_BLACK);
     299    cucul_set_attr_ansi(cv, CUCUL_COLOR_BLUE, CUCUL_COLOR_BLACK, 0);
    298300    cucul_fill_triangle(cv, xo, yo, xb, yb, xc, yc, "%");
    299     cucul_set_color(cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
     301    cucul_set_attr_ansi(cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK, 0);
    300302    cucul_draw_thin_triangle(cv, xo, yo, xb, yb, xc, yc);
    301303
     
    310312    yc = cucul_get_canvas_height(cv) - 3;
    311313
    312     cucul_set_color(cv, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK);
     314    cucul_set_attr_ansi(cv, CUCUL_COLOR_CYAN, CUCUL_COLOR_BLACK, 0);
    313315    cucul_draw_thin_triangle(cv, xa, ya, xb, yb, xc, yc);
    314316
     
    329331    {
    330332        int delta = cucul_rand(-5, 6);
    331         cucul_set_color(cv, cucul_rand(0, 16), cucul_rand(0, 16));
     333        cucul_set_attr_ansi(cv, cucul_rand(0, 16), cucul_rand(0, 16), 0);
    332334        cucul_putchar(cv, cucul_get_canvas_width(cv) / 2
    333335                    + cos(0.02*j) * (delta + cucul_get_canvas_width(cv) / 4),
     
    358360    {
    359361        /* Putpixel */
    360         cucul_set_color(cv, cucul_rand(0, 16), cucul_rand(0, 16));
     362        cucul_set_attr_ansi(cv, cucul_rand(0, 16), cucul_rand(0, 16), 0);
    361363        cucul_putchar(cv, cucul_rand(0, xmax), cucul_rand(0, ymax),
    362364                      chars[cucul_rand(0, 9)]);
     
    369371    char buf[BUFSIZ];
    370372
    371     cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     373    cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK, 0);
    372374    cucul_clear_canvas(cv);
    373375    for(i = 0; i < 16; i++)
    374376    {
    375377        sprintf(buf, "'%c': %i (%s)", 'a' + i, i, cucul_get_color_name(i));
    376         cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     378        cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK, 0);
    377379        cucul_putstr(cv, 4, i + (i >= 8 ? 4 : 3), buf);
    378380        for(j = 0; j < 16; j++)
    379381        {
    380             cucul_set_color(cv, i, j);
     382            cucul_set_attr_ansi(cv, i, j, 0);
    381383            cucul_putstr(cv, (j >= 8 ? 41 : 40) + j * 2, i + (i >= 8 ? 4 : 3), "# ");
    382384        }
     
    401403    }
    402404
    403     cucul_set_color(cv, cucul_rand(0, 16), CUCUL_COLOR_BLACK);
     405    cucul_set_attr_ansi(cv, cucul_rand(0, 16), CUCUL_COLOR_BLACK, 0);
    404406    if(outline > 1)
    405407        cucul_draw_thin_line(cv, xa, ya, xb, yb);
     
    425427    }
    426428
    427     cucul_set_color(cv, cucul_rand(0, 16), cucul_rand(0, 16));
     429    cucul_set_attr_ansi(cv, cucul_rand(0, 16), cucul_rand(0, 16), 0);
    428430    cucul_fill_box(cv, xa, ya, xb, yb, "#");
    429431
    430     cucul_set_color(cv, cucul_rand(0, 16), CUCUL_COLOR_BLACK);
     432    cucul_set_attr_ansi(cv, cucul_rand(0, 16), CUCUL_COLOR_BLACK, 0);
    431433    if(outline == 2)
    432434        cucul_draw_thin_box(cv, xa, ya, xb, yb);
     
    456458    }
    457459
    458     cucul_set_color(cv, cucul_rand(0, 16), cucul_rand(0, 16));
     460    cucul_set_attr_ansi(cv, cucul_rand(0, 16), cucul_rand(0, 16), 0);
    459461    cucul_fill_ellipse(cv, x, y, a, b, "#");
    460462
    461     cucul_set_color(cv, cucul_rand(0, 16), CUCUL_COLOR_BLACK);
     463    cucul_set_attr_ansi(cv, cucul_rand(0, 16), CUCUL_COLOR_BLACK, 0);
    462464    if(outline == 2)
    463465        cucul_draw_thin_ellipse(cv, x, y, a, b);
     
    486488    }
    487489
    488     cucul_set_color(cv, cucul_rand(0, 16), cucul_rand(0, 16));
     490    cucul_set_attr_ansi(cv, cucul_rand(0, 16), cucul_rand(0, 16), 0);
    489491    cucul_fill_triangle(cv, xa, ya, xb, yb, xc, yc, "#");
    490492
    491     cucul_set_color(cv, cucul_rand(0, 16), CUCUL_COLOR_BLACK);
     493    cucul_set_attr_ansi(cv, cucul_rand(0, 16), CUCUL_COLOR_BLACK, 0);
    492494    if(outline == 2)
    493495        cucul_draw_thin_triangle(cv, xa, ya, xb, yb, xc, yc);
  • libcaca/trunk/test/dithering.c

    r1048 r1256  
    121121        else
    122122            ch = density[dista * 2 * 13 / (dista + distb)];
    123         cucul_set_color(cv, points[nearb], points[neara]);
     123        cucul_set_attr_ansi(cv, points[nearb], points[neara], 0);
    124124
    125125        cucul_putchar(cv, x * cucul_get_canvas_width(cv) / 100,
  • libcaca/trunk/test/event.c

    r1048 r1256  
    4242    h = cucul_get_canvas_height(cv) - 1;
    4343
    44     cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     44    cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    4545    cucul_draw_line(cv, 0, 0, cucul_get_canvas_width(cv) - 1, 0, " ");
    4646
     
    8484        while(ret);
    8585
    86         cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     86        cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK, 0);
    8787        cucul_clear_canvas(cv);
    8888
    8989        /* Print current event */
    90         cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     90        cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    9191        cucul_draw_line(cv, 0, 0, cucul_get_canvas_width(cv) - 1, 0, " ");
    9292        print_event(0, 0, events);
     
    9696
    9797        /* Print previous events */
    98         cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     98        cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK, 0);
    9999        for(i = 1; i < h && events[i].type; i++)
    100100            print_event(0, i, events + i);
  • libcaca/trunk/test/export.c

    r1220 r1256  
    116116        cucul_free_dither(dither);
    117117
    118         cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     118        cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK, 0);
    119119        cucul_draw_thin_box(cv, 0, 0, WIDTH - 1, HEIGHT - 1);
    120120
    121         cucul_set_color(cv, CUCUL_COLOR_BLACK, CUCUL_COLOR_WHITE);
     121        cucul_set_attr_ansi(cv, CUCUL_COLOR_BLACK, CUCUL_COLOR_WHITE, 0);
    122122        cucul_fill_ellipse(cv, WIDTH / 2, HEIGHT / 2,
    123123                               WIDTH / 4, HEIGHT / 4, " ");
     
    127127        cucul_putstr(cv, WIDTH / 2 - 7, HEIGHT / 2 + 2, "äβç ░▒▓█▓▒░ ΔЗҒ");
    128128
    129         cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_LIGHTBLUE);
     129        cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_LIGHTBLUE, 0);
    130130        cucul_putstr(cv, WIDTH / 2 - 7, HEIGHT / 2, "    LIBCACA    ");
    131131
    132132        for(x = 0; x < 16; x++)
    133133        {
    134             cucul_set_truecolor(cv, 0xff00 | x, 0xf00f | (x << 4));
     134            cucul_set_attr_argb(cv, 0xff00 | x, 0xf00f | (x << 4), 0);
    135135            cucul_putstr(cv, WIDTH / 2 - 7 + x, HEIGHT / 2 + 5, "#");
    136136        }
  • libcaca/trunk/test/font.c

    r1048 r1256  
    4646
    4747    /* Draw stuff on our canvas */
    48     cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
     48    cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK, 0);
    4949    cucul_putstr(cv, 0, 0, "ABcde");
    50     cucul_set_color(cv, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_BLACK);
     50    cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_BLACK, 0);
    5151    cucul_putstr(cv, 5, 0, "\\o/");
    52     cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     52    cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    5353    cucul_putstr(cv, 0, 1, "&$âøÿØ?!");
    5454
  • libcaca/trunk/test/font2tga.c

    r1048 r1256  
    5959    /* Create a canvas */
    6060    cv = cucul_create_canvas(WIDTH, (glyphs + WIDTH - 1) / WIDTH);
    61     cucul_set_color(cv, CUCUL_COLOR_BLACK, CUCUL_COLOR_WHITE);
     61    cucul_set_attr_ansi(cv, CUCUL_COLOR_BLACK, CUCUL_COLOR_WHITE, 0);
    6262
    6363    /* Put all glyphs on the canvas */
  • libcaca/trunk/test/frames.c

    r1232 r1256  
    4949    {
    5050        cucul_set_canvas_frame(cv, frame);
    51         cucul_set_color(cv, CUCUL_COLOR_WHITE, frame);
     51        cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, frame, 0);
    5252        cucul_fill_box(cv, 0, 0, 40, 15, ":");
    53         cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     53        cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    5454        cucul_putstr(cv, frame * 5 / 2, frame, "カカ");
    5555    }
     
    6161            cucul_get_canvas_width(cv), cucul_get_canvas_height(cv));
    6262
    63     cucul_set_color(cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_TRANSPARENT);
     63    cucul_set_attr_ansi(cv, CUCUL_COLOR_DEFAULT, CUCUL_COLOR_TRANSPARENT, 0);
    6464    dp = caca_create_display(cv);
    6565    caca_set_display_time(dp, 50000);
  • libcaca/trunk/test/fullwidth.c

    r1224 r1256  
    4343    for(i = 0; i < 10; i++)
    4444    {
    45         cucul_set_color(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     45        cucul_set_attr_ansi(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    4646        cucul_putstr(caca, 0, i, CACA);
    47         cucul_set_color(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_RED);
     47        cucul_set_attr_ansi(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_RED, 0);
    4848        cucul_putchar(caca, i - 2, i, 'x');
    4949    }
     
    5454    for(i = 0; i < 10; i++)
    5555    {
    56         cucul_set_color(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     56        cucul_set_attr_ansi(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    5757        cucul_putstr(caca, 0, i, CACA);
    58         cucul_set_color(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_GREEN);
     58        cucul_set_attr_ansi(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_GREEN, 0);
    5959        cucul_putstr(caca, i - 2, i, "ホ");
    6060    }
     
    6363
    6464    /* Line of canvas */
    65     cucul_set_color(line, CUCUL_COLOR_WHITE, CUCUL_COLOR_MAGENTA);
     65    cucul_set_attr_ansi(line, CUCUL_COLOR_WHITE, CUCUL_COLOR_MAGENTA, 0);
    6666    cucul_putstr(line, 0, 0, "ほ");
    6767    for(i = 0; i < 10; i++)
    6868    {
    69         cucul_set_color(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     69        cucul_set_attr_ansi(caca, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    7070        cucul_putstr(caca, 0, i, CACA);
    7171        cucul_blit(caca, i - 2, i, line, NULL);
  • libcaca/trunk/test/gamma.c

    r1048 r1256  
    8787
    8888        /* Draw something on the mask */
    89         cucul_set_color(mask, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     89        cucul_set_attr_ansi(mask, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK, 0);
    9090        cucul_clear_canvas(mask);
    91         cucul_set_color(mask, CUCUL_COLOR_WHITE, CUCUL_COLOR_WHITE);
     91        cucul_set_attr_ansi(mask, CUCUL_COLOR_WHITE, CUCUL_COLOR_WHITE, 0);
    9292        cucul_fill_ellipse(mask, (1.0 + sin(0.05 * (float)x))
    9393                                   * 0.5 * cucul_get_canvas_width(mask),
     
    100100        cucul_blit(cv, 0, 0, cw, mask);
    101101
    102         cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     102        cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    103103        cucul_printf(cv, 2, 1,
    104104                     "gamma=%g - use arrows to change, Esc to quit", gam);
  • libcaca/trunk/test/input.c

    r1048 r1256  
    4444    dp = caca_create_display(cv);
    4545
    46     cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     46    cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    4747    cucul_putstr(cv, 1, 1, "Text entries - press tab to cycle");
    4848
     
    6262            unsigned int j, start, size;
    6363
    64             cucul_set_color(cv, CUCUL_COLOR_BLACK, CUCUL_COLOR_LIGHTGRAY);
     64            cucul_set_attr_ansi(cv, CUCUL_COLOR_BLACK,
     65                                    CUCUL_COLOR_LIGHTGRAY, 0);
    6566            cucul_fill_box(cv, 2, 3 * i + 4, 2 + BUFFER_SIZE, 3 * i + 4, " ");
    6667
     
    7677
    7778        /* Put the cursor on the active textentry */
    78         cucul_set_color(cv, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_LIGHTRED);
     79        cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_LIGHTRED, 0);
    7980        cucul_putchar(cv, 2 + entries[e].cursor, 3 * e + 4, ' ');
    8081
  • libcaca/trunk/test/spritedit.c

    r1048 r1256  
    103103
    104104
    105         cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     105        cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK, 0);
    106106        cucul_clear_canvas(cv);
    107107
     
    126126        xb = xa + 1 + cucul_get_sprite_width(sprite, frame);
    127127        yb = ya + 1 + cucul_get_sprite_height(sprite, frame);
    128         cucul_set_color(cv, CUCUL_COLOR_BLACK, CUCUL_COLOR_BLACK);
     128        cucul_set_attr_ansi(cv, CUCUL_COLOR_BLACK, CUCUL_COLOR_BLACK, 0);
    129129        cucul_fill_box(cv, 57 + xa, 10 + ya, 57 + xb, 10 + yb, " ");
    130         cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     130        cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK, 0);
    131131        cucul_draw_thin_box(cv, 57 + xa, 10 + ya, 57 + xb, 10 + yb);
    132132        cucul_draw_sprite(cv, 57, 10, sprite, frame);
  • libcaca/trunk/test/transform.c

    r1222 r1256  
    5959    rotate = cucul_create_canvas(70, 6);
    6060
    61     cucul_set_color(normal, CUCUL_COLOR_LIGHTMAGENTA, CUCUL_COLOR_BLACK);
     61    cucul_set_attr_ansi(normal, CUCUL_COLOR_LIGHTMAGENTA, CUCUL_COLOR_BLACK, 0);
    6262    for(i = 0; pig[i]; i++)
    6363        cucul_putstr(normal, 55, i, pig[i]);
    6464
    65     cucul_set_color(normal, CUCUL_COLOR_LIGHTGREEN, CUCUL_COLOR_BLACK);
     65    cucul_set_attr_ansi(normal, CUCUL_COLOR_LIGHTGREEN, CUCUL_COLOR_BLACK, 0);
    6666    for(i = 0; duck[i]; i++)
    6767        cucul_putstr(normal, 30, 1 + i, duck[i]);
    6868
    69     cucul_set_color(normal, CUCUL_COLOR_LIGHTCYAN, CUCUL_COLOR_BLACK);
     69    cucul_set_attr_ansi(normal, CUCUL_COLOR_LIGHTCYAN, CUCUL_COLOR_BLACK, 0);
    7070    cucul_putstr(normal, 1, 1, "hahaha mais vieux porc immonde !! [⽼ ⾗]");
    71     cucul_set_color(normal, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_BLACK);
     71    cucul_set_attr_ansi(normal, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_BLACK, 0);
    7272    cucul_putchar(normal, 38, 1, '|');
    7373
    74     cucul_set_color(normal, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
     74    cucul_set_attr_ansi(normal, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK, 0);
    7575    cucul_putstr(normal, 4, 2, "\\o\\ \\o| _o/ \\o_ |o/ /o/");
    7676
    77     cucul_set_color(normal, CUCUL_COLOR_WHITE, CUCUL_COLOR_LIGHTRED);
     77    cucul_set_attr_ansi(normal, CUCUL_COLOR_WHITE, CUCUL_COLOR_LIGHTRED, 0);
    7878    cucul_putstr(normal, 7, 3, "▙▘▌▙▘▞▖▞▖▌ ▞▖▌ ▌▌");
    7979    cucul_putstr(normal, 7, 4, "▛▖▌▛▖▚▘▚▘▚▖▚▘▚▖▖▖");
    80     cucul_set_color(normal, CUCUL_COLOR_BLACK, CUCUL_COLOR_LIGHTRED);
     80    cucul_set_attr_ansi(normal, CUCUL_COLOR_BLACK, CUCUL_COLOR_LIGHTRED, 0);
    8181    cucul_putstr(normal, 4, 3, "▓▒░");
    8282    cucul_putstr(normal, 4, 4, "▓▒░");
     
    9595
    9696    /* Blit the transformed canvas onto the main canvas */
    97     cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     97    cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    9898    cucul_putstr(cv, 0, 0, "normal");
    9999    cucul_blit(cv, 10, 0, normal, NULL);
  • libcaca/trunk/test/truecolor.c

    r1048 r1256  
    4141        uint16_t fgcolor = 0xf000 | ((15 - y) << 4) | ((15 - x) << 8);
    4242
    43         cucul_set_truecolor(cv, fgcolor, bgcolor);
     43        cucul_set_attr_argb(cv, fgcolor, bgcolor, 0);
    4444        cucul_putstr(cv, x * 2, y, "CA");
    4545    }
    4646
    47     cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_LIGHTBLUE);
     47    cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_LIGHTBLUE, 0);
    4848    cucul_putstr(cv, 2, 1, " truecolor libcaca ");
    4949
  • libcaca/trunk/test/unicode.c

    r1216 r1256  
    3333    dp = caca_create_display(cv);
    3434
    35     cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     35    cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    3636    cucul_putstr(cv, 1, 1, "Basic Unicode support");
    3737
    38     cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     38    cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK, 0);
    3939    cucul_putstr(cv, 1, 2, "This is ASCII:    | abc DEF 123 !@# |");
    4040    cucul_putstr(cv, 1, 3, "This is Unicode:  | äßç δεφ ☺♥♀ ╞╬╗ |");
     
    4343    cucul_putstr(cv, 1, 5, "If the three lines do not have the same length, there is a bug somewhere.");
    4444
    45     cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     45    cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    4646    cucul_putstr(cv, 1, 7, "Gradient glyphs");
    4747
    48     cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     48    cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK, 0);
    4949    cucul_putstr(cv, 31,  8, "  0%");
    5050    cucul_putstr(cv, 31,  9, " 25%");
     
    5353    cucul_putstr(cv, 31, 12, "100%");
    5454
    55     cucul_set_color(cv, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_LIGHTGREEN);
     55    cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_LIGHTGREEN, 0);
    5656    cucul_putstr(cv, 1,  8, "                             ");
    5757    cucul_putstr(cv, 1,  9, "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░");
     
    6060    cucul_putstr(cv, 1, 12, "█████████████████████████████");
    6161
    62     cucul_set_color(cv, CUCUL_COLOR_LIGHTGREEN, CUCUL_COLOR_LIGHTRED);
     62    cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGREEN, CUCUL_COLOR_LIGHTRED, 0);
    6363    cucul_putstr(cv, 36,  8, "█████████████████████████████");
    6464    cucul_putstr(cv, 36,  9, "▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓");
     
    6767    cucul_putstr(cv, 36, 12, "                             ");
    6868
    69     cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     69    cucul_set_attr_ansi(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE, 0);
    7070    cucul_putstr(cv, 1, 14, "Double width characters");
    7171
    72     cucul_set_color(cv, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_BLACK);
     72    cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_BLACK, 0);
    7373    cucul_putstr(cv, 1, 15, "| ドラゴン ボーレ |");
    74     cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     74    cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK, 0);
    7575    cucul_putstr(cv, 1, 16, "| ()()()() ()()() |");
    76     cucul_set_color(cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
     76    cucul_set_attr_ansi(cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK, 0);
    7777    cucul_putstr(cv, 1, 17, "| ドラゴン");
    7878    cucul_putstr(cv, 12, 17, "ボーレ |");
    7979
    80     cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     80    cucul_set_attr_ansi(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK, 0);
    8181    cucul_putstr(cv, 1, 18, "If the three lines do not have the same length, there is a bug somewhere.");
    8282
Note: See TracChangeset for help on using the changeset viewer.