Ignore:
Timestamp:
Apr 18, 2006, 5:11:25 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Renamed caca_t into caca_display_t.
  • Renamed canvas handle variables from "c" to "cv". Eh ouais mon gros.
File:
1 edited

Legend:

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

    r810 r811  
    2828{
    2929    caca_event_t ev;
    30     cucul_canvas_t *c;
    31     caca_t *kk;
     30    cucul_canvas_t *cv;
     31    caca_display_t *dp;
    3232
    33     c = cucul_create(0, 0);
    34     kk = caca_attach(c);
     33    cv = cucul_create(0, 0);
     34    dp = caca_attach(cv);
    3535
    36     cucul_set_color(c, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
    37     cucul_putstr(c, 1, 1, "Basic Unicode support");
     36    cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     37    cucul_putstr(cv, 1, 1, "Basic Unicode support");
    3838
    39     cucul_set_color(c, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
    40     cucul_putstr(c, 1, 2, "This is ASCII:    | abc DEF 123 !@# |");
    41     cucul_putstr(c, 1, 3, "This is Unicode:  | äßç δεφ ☺♥♀ ╞╬╗ |");
    42     cucul_putstr(c, 1, 4, "And this is, too: | ἀβϛ ΔЗҒ ᚴᛒᛯ ♩♔✈ |");
     39    cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     40    cucul_putstr(cv, 1, 2, "This is ASCII:    | abc DEF 123 !@# |");
     41    cucul_putstr(cv, 1, 3, "This is Unicode:  | äßç δεφ ☺♥♀ ╞╬╗ |");
     42    cucul_putstr(cv, 1, 4, "And this is, too: | ἀβϛ ΔЗҒ ᚴᛒᛯ ♩♔✈ |");
    4343
    44     cucul_putstr(c, 1, 5, "If the three lines do not have the same length, there is a bug somewhere.");
     44    cucul_putstr(cv, 1, 5, "If the three lines do not have the same length, there is a bug somewhere.");
    4545
    46     cucul_set_color(c, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
    47     cucul_putstr(c, 1, 7, "Gradient glyphs");
     46    cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     47    cucul_putstr(cv, 1, 7, "Gradient glyphs");
    4848
    49     cucul_set_color(c, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
    50     cucul_putstr(c, 31,  8, "  0%");
    51     cucul_putstr(c, 31,  9, " 25%");
    52     cucul_putstr(c, 31, 10, " 50%");
    53     cucul_putstr(c, 31, 11, " 75%");
    54     cucul_putstr(c, 31, 12, "100%");
     49    cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     50    cucul_putstr(cv, 31,  8, "  0%");
     51    cucul_putstr(cv, 31,  9, " 25%");
     52    cucul_putstr(cv, 31, 10, " 50%");
     53    cucul_putstr(cv, 31, 11, " 75%");
     54    cucul_putstr(cv, 31, 12, "100%");
    5555
    56     cucul_set_color(c, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_LIGHTGREEN);
    57     cucul_putstr(c, 1,  8, "                             ");
    58     cucul_putstr(c, 1,  9, "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░");
    59     cucul_putstr(c, 1, 10, "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒");
    60     cucul_putstr(c, 1, 11, "▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓");
    61     cucul_putstr(c, 1, 12, "█████████████████████████████");
     56    cucul_set_color(cv, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_LIGHTGREEN);
     57    cucul_putstr(cv, 1,  8, "                             ");
     58    cucul_putstr(cv, 1,  9, "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░");
     59    cucul_putstr(cv, 1, 10, "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒");
     60    cucul_putstr(cv, 1, 11, "▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓");
     61    cucul_putstr(cv, 1, 12, "█████████████████████████████");
    6262
    63     cucul_set_color(c, CUCUL_COLOR_LIGHTGREEN, CUCUL_COLOR_LIGHTRED);
    64     cucul_putstr(c, 36,  8, "█████████████████████████████");
    65     cucul_putstr(c, 36,  9, "▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓");
    66     cucul_putstr(c, 36, 10, "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒");
    67     cucul_putstr(c, 36, 11, "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░");
    68     cucul_putstr(c, 36, 12, "                             ");
     63    cucul_set_color(cv, CUCUL_COLOR_LIGHTGREEN, CUCUL_COLOR_LIGHTRED);
     64    cucul_putstr(cv, 36,  8, "█████████████████████████████");
     65    cucul_putstr(cv, 36,  9, "▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓");
     66    cucul_putstr(cv, 36, 10, "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒");
     67    cucul_putstr(cv, 36, 11, "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░");
     68    cucul_putstr(cv, 36, 12, "                             ");
    6969
    70     cucul_set_color(c, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
    71     cucul_putstr(c, 1, 14, "Double width characters");
     70    cucul_set_color(cv, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
     71    cucul_putstr(cv, 1, 14, "Double width characters");
    7272
    73     cucul_set_color(c, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_BLACK);
    74     cucul_putstr(c, 1, 15, "| ドラゴン ボーレ |");
    75     cucul_set_color(c, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
    76     cucul_putstr(c, 1, 16, "| ()()()() ()()() |");
    77     cucul_set_color(c, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
    78     cucul_putstr(c, 1, 17, "| ドラゴン");
    79     cucul_putstr(c, 10, 17, "ボーレ |");
     73    cucul_set_color(cv, CUCUL_COLOR_LIGHTRED, CUCUL_COLOR_BLACK);
     74    cucul_putstr(cv, 1, 15, "| ドラゴン ボーレ |");
     75    cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     76    cucul_putstr(cv, 1, 16, "| ()()()() ()()() |");
     77    cucul_set_color(cv, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
     78    cucul_putstr(cv, 1, 17, "| ドラゴン");
     79    cucul_putstr(cv, 10, 17, "ボーレ |");
    8080
    81     cucul_set_color(c, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
    82     cucul_putstr(c, 1, 18, "If the three lines do not have the same length, there is a bug somewhere.");
     81    cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     82    cucul_putstr(cv, 1, 18, "If the three lines do not have the same length, there is a bug somewhere.");
    8383
    84     cucul_putstr(c, 1, 20, "CP437 glyphs: ☺ ☻ ♥ ♦ ♣ ♠ • ◘ ○ ◙ ♂ ♀ ♪ ♫ ☼ ► ◄ ↕ ‼ ¶ § ▬ ↨ ↑ ↓ → ← ∟ ↔ ▲ ▼");
    85     cucul_putstr(c, 1, 21, "more CP437: α ß Γ π Σ σ µ τ Φ Θ Ω δ ∞ φ ε ∩ ≡ ± ≥ ≤ ⌠ ⌡ ÷ ≈ ° ∙ · √ ⁿ ² ■");
    86     cucul_putstr(c, 1, 22, "drawing blocks: ███ ▓▓▓ ▒▒▒ ░░░ ▀ ▄ ▌ ▐ █ ▖ ▗ ▘ ▝ ▚ ▞ ▙ ▛ ▜ ▟");
     84    cucul_putstr(cv, 1, 20, "CP437 glyphs: ☺ ☻ ♥ ♦ ♣ ♠ • ◘ ○ ◙ ♂ ♀ ♪ ♫ ☼ ► ◄ ↕ ‼ ¶ § ▬ ↨ ↑ ↓ → ← ∟ ↔ ▲ ▼");
     85    cucul_putstr(cv, 1, 21, "more CP437: α ß Γ π Σ σ µ τ Φ Θ Ω δ ∞ φ ε ∩ ≡ ± ≥ ≤ ⌠ ⌡ ÷ ≈ ° ∙ · √ ⁿ ² ■");
     86    cucul_putstr(cv, 1, 22, "drawing blocks: ███ ▓▓▓ ▒▒▒ ░░░ ▀ ▄ ▌ ▐ █ ▖ ▗ ▘ ▝ ▚ ▞ ▙ ▛ ▜ ▟");
    8787
    88     caca_display(kk);
     88    caca_display(dp);
    8989
    90     caca_get_event(kk, CACA_EVENT_KEY_PRESS, &ev, -1);
     90    caca_get_event(dp, CACA_EVENT_KEY_PRESS, &ev, -1);
    9191
    92     caca_detach(kk);
    93     cucul_free(c);
     92    caca_detach(dp);
     93    cucul_free(cv);
    9494
    9595    return 0;
Note: See TracChangeset for help on using the changeset viewer.