Ignore:
Timestamp:
Oct 31, 2006, 2:29:48 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Got rid of cucul_ansi_to_attr() and cucul_argb_to_attr() and restored cucul_set_color() and cucul_set_truecolor() under the new names cucul_set_color_ansi() and cucul_set_color_argb().
  • Renamed cucul_get_color_name() into cucul_ansi_to_str().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/test/unicode.c

    r1257 r1267  
    2525#include "caca.h"
    2626
    27 #define ATTR_WHITE_ON_BLUE cucul_ansi_to_attr(CUCUL_WHITE, CUCUL_BLUE)
    28 #define ATTR_DEFAULT cucul_ansi_to_attr(CUCUL_DEFAULT, CUCUL_TRANSPARENT)
    29 
    3027int main(int argc, char *argv[])
    3128{
     
    3633    dp = caca_create_display(cv);
    3734
    38     cucul_set_attr(cv, ATTR_WHITE_ON_BLUE);
     35    cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE);
    3936    cucul_putstr(cv, 1, 1, "Basic Unicode support");
    4037
    41     cucul_set_attr(cv, ATTR_DEFAULT);
     38    cucul_set_color_ansi(cv, CUCUL_DEFAULT, CUCUL_TRANSPARENT);
    4239    cucul_putstr(cv, 1, 2, "This is ASCII:    | abc DEF 123 !@# |");
    4340    cucul_putstr(cv, 1, 3, "This is Unicode:  | äßç δεφ ☺♥♀ ╞╬╗ |");
     
    4643    cucul_putstr(cv, 1, 5, "If the three lines do not have the same length, there is a bug somewhere.");
    4744
    48     cucul_set_attr(cv, ATTR_WHITE_ON_BLUE);
     45    cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE);
    4946    cucul_putstr(cv, 1, 7, "Gradient glyphs");
    5047
    51     cucul_set_attr(cv, ATTR_DEFAULT);
     48    cucul_set_color_ansi(cv, CUCUL_DEFAULT, CUCUL_TRANSPARENT);
    5249    cucul_putstr(cv, 31,  8, "  0%");
    5350    cucul_putstr(cv, 31,  9, " 25%");
     
    5653    cucul_putstr(cv, 31, 12, "100%");
    5754
    58     cucul_set_attr(cv, cucul_ansi_to_attr(CUCUL_LIGHTRED, CUCUL_LIGHTGREEN));
     55    cucul_set_color_ansi(cv, CUCUL_LIGHTRED, CUCUL_LIGHTGREEN);
    5956    cucul_putstr(cv, 1,  8, "                             ");
    6057    cucul_putstr(cv, 1,  9, "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░");
     
    6360    cucul_putstr(cv, 1, 12, "█████████████████████████████");
    6461
    65     cucul_set_attr(cv, cucul_ansi_to_attr(CUCUL_LIGHTGREEN, CUCUL_LIGHTRED));
     62    cucul_set_color_ansi(cv, CUCUL_LIGHTGREEN, CUCUL_LIGHTRED);
    6663    cucul_putstr(cv, 36,  8, "█████████████████████████████");
    6764    cucul_putstr(cv, 36,  9, "▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓");
     
    7067    cucul_putstr(cv, 36, 12, "                             ");
    7168
    72     cucul_set_attr(cv, ATTR_WHITE_ON_BLUE);
     69    cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE);
    7370    cucul_putstr(cv, 1, 14, "Double width characters");
    7471
    75     cucul_set_attr(cv, cucul_ansi_to_attr(CUCUL_LIGHTRED, CUCUL_TRANSPARENT));
     72    cucul_set_color_ansi(cv, CUCUL_LIGHTRED, CUCUL_TRANSPARENT);
    7673    cucul_putstr(cv, 1, 15, "| ドラゴン ボーレ |");
    77     cucul_set_attr(cv, ATTR_DEFAULT);
     74    cucul_set_color_ansi(cv, CUCUL_DEFAULT, CUCUL_TRANSPARENT);
    7875    cucul_putstr(cv, 1, 16, "| ()()()() ()()() |");
    79     cucul_set_attr(cv, cucul_ansi_to_attr(CUCUL_YELLOW, CUCUL_TRANSPARENT));
     76    cucul_set_color_ansi(cv, CUCUL_YELLOW, CUCUL_TRANSPARENT);
    8077    cucul_putstr(cv, 1, 17, "| ドラゴン");
    8178    cucul_putstr(cv, 12, 17, "ボーレ |");
    8279
    83     cucul_set_attr(cv, ATTR_DEFAULT);
     80    cucul_set_color_ansi(cv, CUCUL_DEFAULT, CUCUL_TRANSPARENT);
    8481    cucul_putstr(cv, 1, 18, "If the three lines do not have the same length, there is a bug somewhere.");
    8582
Note: See TracChangeset for help on using the changeset viewer.