- Timestamp:
- Nov 11, 2006, 5:29:39 PM (16 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/caca0.h
r1330 r1347 135 135 #define caca_get_bg_color() __caca0_bg 136 136 #define caca_get_color_name __caca0_get_color_name 137 #define caca_putchar(x, y, c) cucul_put char(__caca0_cv, x, y, c)138 #define caca_putstr(x, y, s) cucul_put str(__caca0_cv, x, y, s)137 #define caca_putchar(x, y, c) cucul_put_char(__caca0_cv, x, y, c) 138 #define caca_putstr(x, y, s) cucul_put_str(__caca0_cv, x, y, s) 139 139 #define caca_printf(x, y, f, z...) cucul_printf(__caca0_cv, x, y, f, ##z) 140 140 #define caca_clear() cucul_clear_canvas(__caca0_cv) -
libcaca/trunk/caca/driver_gl.c
r1267 r1347 520 520 521 521 for(j = 0; j < n; j++) 522 cucul_put char(cv, 0, b + j, dp->drv.p->blocks[i] + j);522 cucul_put_char(cv, 0, b + j, dp->drv.p->blocks[i] + j); 523 523 524 524 b += n; -
libcaca/trunk/cucul/attr.c
r1333 r1347 126 126 * \return 0 in case of success, -1 if an error occurred. 127 127 */ 128 int cucul_put attr(cucul_canvas_t *cv, int x, int y, unsigned long int attr)128 int cucul_put_attr(cucul_canvas_t *cv, int x, int y, unsigned long int attr) 129 129 { 130 130 uint32_t *curattr, *curchar; -
libcaca/trunk/cucul/box.c
r1330 r1347 85 85 if(y1 >= 0) 86 86 for(x = x1 < 0 ? 1 : x1 + 1; x < x2 && x < xmax; x++) 87 cucul_put char(cv, x, y1, '-');87 cucul_put_char(cv, x, y1, '-'); 88 88 89 89 if(y2 <= ymax) 90 90 for(x = x1 < 0 ? 1 : x1 + 1; x < x2 && x < xmax; x++) 91 cucul_put char(cv, x, y2, '-');91 cucul_put_char(cv, x, y2, '-'); 92 92 93 93 if(x1 >= 0) 94 94 for(y = y1 < 0 ? 1 : y1 + 1; y < y2 && y < ymax; y++) 95 cucul_put char(cv, x1, y, '|');95 cucul_put_char(cv, x1, y, '|'); 96 96 97 97 if(x2 <= xmax) 98 98 for(y = y1 < 0 ? 1 : y1 + 1; y < y2 && y < ymax; y++) 99 cucul_put char(cv, x2, y, '|');99 cucul_put_char(cv, x2, y, '|'); 100 100 101 101 /* Draw corners */ 102 cucul_put char(cv, x1, y1, ',');103 cucul_put char(cv, x1, y2, '`');104 cucul_put char(cv, x2, y1, '.');105 cucul_put char(cv, x2, y2, '\'');102 cucul_put_char(cv, x1, y1, ','); 103 cucul_put_char(cv, x1, y2, '`'); 104 cucul_put_char(cv, x2, y1, '.'); 105 cucul_put_char(cv, x2, y2, '\''); 106 106 107 107 return 0; … … 144 144 if(y1 >= 0) 145 145 for(x = x1 < 0 ? 1 : x1 + 1; x < x2 && x < xmax; x++) 146 cucul_put char(cv, x, y1, 0x2500); /* ─ */146 cucul_put_char(cv, x, y1, 0x2500); /* ─ */ 147 147 148 148 if(y2 <= ymax) 149 149 for(x = x1 < 0 ? 1 : x1 + 1; x < x2 && x < xmax; x++) 150 cucul_put char(cv, x, y2, 0x2500); /* ─ */150 cucul_put_char(cv, x, y2, 0x2500); /* ─ */ 151 151 152 152 if(x1 >= 0) 153 153 for(y = y1 < 0 ? 1 : y1 + 1; y < y2 && y < ymax; y++) 154 cucul_put char(cv, x1, y, 0x2502); /* │ */154 cucul_put_char(cv, x1, y, 0x2502); /* │ */ 155 155 156 156 if(x2 <= xmax) 157 157 for(y = y1 < 0 ? 1 : y1 + 1; y < y2 && y < ymax; y++) 158 cucul_put char(cv, x2, y, 0x2502); /* │ */158 cucul_put_char(cv, x2, y, 0x2502); /* │ */ 159 159 160 160 /* Draw corners */ 161 cucul_put char(cv, x1, y1, 0x250c); /* ┌ */162 cucul_put char(cv, x1, y2, 0x2514); /* └ */163 cucul_put char(cv, x2, y1, 0x2510); /* ┐ */164 cucul_put char(cv, x2, y2, 0x2518); /* ┘ */161 cucul_put_char(cv, x1, y1, 0x250c); /* ┌ */ 162 cucul_put_char(cv, x1, y2, 0x2514); /* └ */ 163 cucul_put_char(cv, x2, y1, 0x2510); /* ┐ */ 164 cucul_put_char(cv, x2, y2, 0x2518); /* ┘ */ 165 165 166 166 return 0; … … 209 209 for(y = y1; y <= y2; y++) 210 210 for(x = x1; x <= x2; x++) 211 cucul_put char(cv, x, y, ch);212 213 return 0; 214 } 215 211 cucul_put_char(cv, x, y, ch); 212 213 return 0; 214 } 215 -
libcaca/trunk/cucul/canvas.c
r1346 r1347 103 103 * The behaviour when printing non-printable characters or invalid UTF-32 104 104 * characters is undefined. To print a sequence of bytes forming an UTF-8 105 * character instead of an UTF-32 character, use the cucul_put str() function.105 * character instead of an UTF-32 character, use the cucul_put_str() function. 106 106 * 107 107 * This function never fails. … … 113 113 * \return This function always returns 0. 114 114 */ 115 int cucul_put char(cucul_canvas_t *cv, int x, int y, unsigned long int ch)115 int cucul_put_char(cucul_canvas_t *cv, int x, int y, unsigned long int ch) 116 116 { 117 117 uint32_t *curchar, *curattr, attr; … … 195 195 * \return This function always returns 0. 196 196 */ 197 unsigned long int cucul_get char(cucul_canvas_t *cv, int x, int y)197 unsigned long int cucul_get_char(cucul_canvas_t *cv, int x, int y) 198 198 { 199 199 if(x < 0 || x >= (int)cv->width || y < 0 || y >= (int)cv->height) … … 210 210 * be cropped accordingly if it is too long. 211 211 * 212 * See cucul_put char() for more information on how fullwidth characters212 * See cucul_put_char() for more information on how fullwidth characters 213 213 * are handled when overwriting each other or at the canvas' boundaries. 214 214 * … … 221 221 * \return This function always returns 0. 222 222 */ 223 int cucul_put str(cucul_canvas_t *cv, int x, int y, char const *s)223 int cucul_put_str(cucul_canvas_t *cv, int x, int y, char const *s) 224 224 { 225 225 unsigned int read; … … 237 237 { 238 238 uint32_t ch = cucul_utf8_to_utf32(s, &read); 239 cucul_put char(cv, x, y, ch);239 cucul_put_char(cv, x, y, ch); 240 240 x += cucul_utf32_is_fullwidth(ch) ? 2 : 1; 241 241 s += read; … … 283 283 va_end(args); 284 284 285 cucul_put str(cv, x, y, buf);285 cucul_put_str(cv, x, y, buf); 286 286 287 287 if(buf != tmp) -
libcaca/trunk/cucul/conic.c
r1330 r1347 245 245 246 246 if((b & (0x1|0x4)) == (0x1|0x4)) 247 cucul_put char(cv, xo + x, yo + y, ch);247 cucul_put_char(cv, xo + x, yo + y, ch); 248 248 249 249 if((b & (0x2|0x4)) == (0x2|0x4)) 250 cucul_put char(cv, xo - x, yo + y, ch);250 cucul_put_char(cv, xo - x, yo + y, ch); 251 251 252 252 if((b & (0x1|0x8)) == (0x1|0x8)) 253 cucul_put char(cv, xo + x, yo - y, ch);253 cucul_put_char(cv, xo + x, yo - y, ch); 254 254 255 255 if((b & (0x2|0x8)) == (0x2|0x8)) 256 cucul_put char(cv, xo - x, yo - y, ch);257 } 258 256 cucul_put_char(cv, xo - x, yo - y, ch); 257 } 258 -
libcaca/trunk/cucul/cucul.h
r1342 r1347 93 93 int cucul_get_cursor_x(cucul_canvas_t *); 94 94 int cucul_get_cursor_y(cucul_canvas_t *); 95 int cucul_put_char(cucul_canvas_t *, int, int, unsigned long int); 96 unsigned long int cucul_get_char(cucul_canvas_t *, int, int); 97 int cucul_put_str(cucul_canvas_t *, int, int, char const *); 95 98 unsigned long int cucul_get_attr(cucul_canvas_t *, int, int); 96 99 int cucul_set_attr(cucul_canvas_t *, unsigned long int); 97 int cucul_put attr(cucul_canvas_t *, int, int, unsigned long int);100 int cucul_put_attr(cucul_canvas_t *, int, int, unsigned long int); 98 101 int cucul_set_color_ansi(cucul_canvas_t *, unsigned char, unsigned char); 99 102 int cucul_set_color_argb(cucul_canvas_t *, unsigned int, unsigned int); 100 int cucul_putchar(cucul_canvas_t *, int, int, unsigned long int);101 unsigned long int cucul_getchar(cucul_canvas_t *, int, int);102 int cucul_putstr(cucul_canvas_t *, int, int, char const *);103 103 int cucul_printf(cucul_canvas_t *, int, int, char const *, ...); 104 104 int cucul_clear_canvas(cucul_canvas_t *); … … 255 255 # define CUCUL_DEPRECATED 256 256 # endif 257 int cucul_putchar(cucul_canvas_t *, int, int, 258 unsigned long int) CUCUL_DEPRECATED; 259 int cucul_putstr(cucul_canvas_t *, int, int, 260 char const *) CUCUL_DEPRECATED; 257 261 int cucul_set_color(cucul_canvas_t *, unsigned char, 258 262 unsigned char) CUCUL_DEPRECATED; 259 263 int cucul_set_truecolor(cucul_canvas_t *, unsigned int, 260 264 unsigned int) CUCUL_DEPRECATED; 261 265 cucul_buffer_t *cucul_load_memory(void *, 262 266 unsigned long int) CUCUL_DEPRECATED; -
libcaca/trunk/cucul/dither.c
r1334 r1347 1055 1055 /* Now output the character */ 1056 1056 cucul_set_color_ansi(cv, outfg, outbg); 1057 cucul_put char(cv, x, y, outch);1057 cucul_put_char(cv, x, y, outch); 1058 1058 1059 1059 d->increment_dither(); -
libcaca/trunk/cucul/import.c
r1343 r1347 333 333 } 334 334 335 cucul_put char(cv, x, y, ch);335 cucul_put_char(cv, x, y, ch); 336 336 x++; 337 337 } … … 482 482 cucul_set_canvas_size(cv, width = 80, height); 483 483 for(j = x; j < 80; j++) 484 cucul_put char(cv, j, y, ' ');484 cucul_put_char(cv, j, y, ' '); 485 485 x = 80; 486 486 break; … … 541 541 /* Now paste our character */ 542 542 cucul_set_color_ansi(cv, grcm.efg, grcm.ebg); 543 cucul_put char(cv, x, y, ch);543 cucul_put_char(cv, x, y, ch); 544 544 x += wch; 545 545 } -
libcaca/trunk/cucul/legacy.c
r1306 r1347 31 31 #include "cucul.h" 32 32 #include "cucul_internals.h" 33 34 /* 35 * Functions from canvas.c 36 */ 37 38 int cucul_putchar(cucul_canvas_t *cv, int x, int y, unsigned long int ch) 39 { 40 return cucul_put_char(cv, x, y, ch); 41 } 42 43 int cucul_putstr(cucul_canvas_t *cv, int x, int y, char const *s) 44 { 45 return cucul_put_str(cv, x, y, s); 46 } 33 47 34 48 /* -
libcaca/trunk/cucul/line.c
r1330 r1347 261 261 for(; dx>=0; dx--) 262 262 { 263 cucul_put char(cv, x1, y1, s->ch);263 cucul_put_char(cv, x1, y1, s->ch); 264 264 if(delta > 0) 265 265 { … … 283 283 for(; dy >= 0; dy--) 284 284 { 285 cucul_put char(cv, x1, y1, s->ch);285 cucul_put_char(cv, x1, y1, s->ch); 286 286 if(delta > 0) 287 287 { … … 348 348 if(delta > 0) 349 349 { 350 cucul_put char(cv, x1, y1, charmapy[1]);350 cucul_put_char(cv, x1, y1, charmapy[1]); 351 351 x1++; 352 352 y1 += yinc; … … 357 357 { 358 358 if(prev) 359 cucul_put char(cv, x1, y1, charmapy[0]);359 cucul_put_char(cv, x1, y1, charmapy[0]); 360 360 else 361 cucul_put char(cv, x1, y1, '-');361 cucul_put_char(cv, x1, y1, '-'); 362 362 x1++; 363 363 delta += dpr; … … 376 376 if(delta > 0) 377 377 { 378 cucul_put char(cv, x1, y1, charmapx[0]);379 cucul_put char(cv, x1 + 1, y1, charmapx[1]);378 cucul_put_char(cv, x1, y1, charmapx[0]); 379 cucul_put_char(cv, x1 + 1, y1, charmapx[1]); 380 380 x1++; 381 381 y1 += yinc; … … 384 384 else 385 385 { 386 cucul_put char(cv, x1, y1, '|');386 cucul_put_char(cv, x1, y1, '|'); 387 387 y1 += yinc; 388 388 delta += dpr; -
libcaca/trunk/cucul/triangle.c
r1330 r1347 147 147 148 148 for(x = xmin; x < xmax; x++) 149 cucul_put char(cv, x, y, ch);149 cucul_put_char(cv, x, y, ch); 150 150 151 151 xa += y < y2 ? sl21 : sl32; -
libcaca/trunk/src/aafire.c
r1267 r1347 243 243 cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE); 244 244 if (sloop < 100) 245 cucul_put str(cv, cucul_get_canvas_width(cv) - 30,246 247 245 cucul_put_str(cv, cucul_get_canvas_width(cv) - 30, 246 cucul_get_canvas_height(cv) - 2, 247 " -=[ Powered by libcaca ]=- "); 248 248 249 249 caca_refresh_display(dp); -
libcaca/trunk/src/cacademo.c
r1330 r1347 172 172 cucul_set_color_ansi(frontcv, CUCUL_WHITE, CUCUL_BLUE); 173 173 if(frame < 100) 174 cucul_put str(frontcv, cucul_get_canvas_width(frontcv) - 30,175 cucul_get_canvas_height(frontcv) - 2,176 " -=[ Powered by libcaca ]=- ");174 cucul_put_str(frontcv, cucul_get_canvas_width(frontcv) - 30, 175 cucul_get_canvas_height(frontcv) - 2, 176 " -=[ Powered by libcaca ]=- "); 177 177 caca_refresh_display(dp); 178 178 } … … 696 696 else 697 697 cucul_set_color_ansi(cv, CUCUL_BLACK, CUCUL_BLACK); 698 cucul_put char(cv, x, y, gradient[p & 0x0f]);698 cucul_put_char(cv, x, y, gradient[p & 0x0f]); 699 699 } 700 700 } … … 783 783 cucul_set_color_ansi(cv, fg, CUCUL_BLACK); 784 784 785 cucul_put char(cv, x, y - j,786 drop[i].str[(y - j) % drop[i].len]);785 cucul_put_char(cv, x, y - j, 786 drop[i].str[(y - j) % drop[i].len]); 787 787 } 788 788 } -
libcaca/trunk/src/cacaview.c
r1330 r1347 306 306 buffer[ww] = '\0'; 307 307 cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE); 308 cucul_put str(cv, (ww - strlen(buffer)) / 2, wh / 2, buffer);308 cucul_put_str(cv, (ww - strlen(buffer)) / 2, wh / 2, buffer); 309 309 caca_refresh_display(dp); 310 310 ww = cucul_get_canvas_width(cv); … … 351 351 buffer[ww] = '\0'; 352 352 cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE); 353 cucul_put str(cv, (ww - strlen(buffer)) / 2, wh / 2, buffer);353 cucul_put_str(cv, (ww - strlen(buffer)) / 2, wh / 2, buffer); 354 354 free(buffer); 355 355 } … … 422 422 cucul_draw_line(cv, 0, 0, ww - 1, 0, ' '); 423 423 cucul_draw_line(cv, 0, wh - 2, ww - 1, wh - 2, '-'); 424 cucul_put str(cv, 0, 0, "q:Quit np:Next/Prev +-x:Zoom gG:Gamma "425 "hjkl:Move d:Dither a:Antialias");426 cucul_put str(cv, ww - strlen("?:Help"), 0, "?:Help");424 cucul_put_str(cv, 0, 0, "q:Quit np:Next/Prev +-x:Zoom gG:Gamma " 425 "hjkl:Move d:Dither a:Antialias"); 426 cucul_put_str(cv, ww - strlen("?:Help"), 0, "?:Help"); 427 427 cucul_printf(cv, 3, wh - 2, "cacaview %s", VERSION); 428 428 cucul_printf(cv, ww - 30, wh - 2, "(gamma: %#.3g)", GAMMA(g)); … … 460 460 461 461 for(i = 0; help[i]; i++) 462 cucul_put str(cv, x, y + i, help[i]);462 cucul_put_str(cv, x, y + i, help[i]); 463 463 } 464 464 … … 521 521 else 522 522 cucul_set_color_ansi(cv, CUCUL_DARKGRAY, CUCUL_LIGHTGRAY); 523 cucul_put char(cv, xn, yn, ' ');523 cucul_put_char(cv, xn, yn, ' '); 524 524 } 525 525 } -
libcaca/trunk/test/blit.c
r1346 r1347 56 56 57 57 cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE); 58 cucul_put str(cv, 0, 0, "Centered sprite");58 cucul_put_str(cv, 0, 0, "Centered sprite"); 59 59 60 60 cucul_blit(cv, cucul_get_canvas_width(cv) / 2, -
libcaca/trunk/test/colors.c
r1269 r1347 45 45 { 46 46 cucul_set_color_ansi(cv, i, j); 47 cucul_put str(cv, (j >= 8 ? 13 : 12) + j * 4, i + (i >= 8 ? 3 : 2),48 "Aaホ");47 cucul_put_str(cv, (j >= 8 ? 13 : 12) + j * 4, i + (i >= 8 ? 3 : 2), 48 "Aaホ"); 49 49 } 50 50 } 51 51 52 52 cucul_set_color_ansi(cv, CUCUL_LIGHTGRAY, CUCUL_BLACK); 53 cucul_put str(cv, 3, 20, "This is bold This is blink This is italics This is underline");53 cucul_put_str(cv, 3, 20, "This is bold This is blink This is italics This is underline"); 54 54 cucul_set_attr(cv, CUCUL_BOLD); 55 cucul_put str(cv, 3 + 8, 20, "bold");55 cucul_put_str(cv, 3 + 8, 20, "bold"); 56 56 cucul_set_attr(cv, CUCUL_BLINK); 57 cucul_put str(cv, 3 + 24, 20, "blink");57 cucul_put_str(cv, 3 + 24, 20, "blink"); 58 58 cucul_set_attr(cv, CUCUL_ITALICS); 59 cucul_put str(cv, 3 + 41, 20, "italics");59 cucul_put_str(cv, 3 + 41, 20, "italics"); 60 60 cucul_set_attr(cv, CUCUL_UNDERLINE); 61 cucul_put str(cv, 3 + 60, 20, "underline");61 cucul_put_str(cv, 3 + 60, 20, "underline"); 62 62 63 63 caca_refresh_display(dp); -
libcaca/trunk/test/demo.c
r1330 r1347 169 169 { 170 170 cucul_set_color_ansi(cv, CUCUL_RED, CUCUL_BLACK); 171 cucul_put str(cv, xmouse, ymouse, ".");172 cucul_put str(cv, xmouse, ymouse + 1, "|\\");171 cucul_put_str(cv, xmouse, ymouse, "."); 172 cucul_put_str(cv, xmouse, ymouse + 1, "|\\"); 173 173 } 174 174 caca_refresh_display(dp); … … 209 209 cucul_draw_thin_box(cv, 1, 1, xo, yo); 210 210 211 cucul_put str(cv, (xo - strlen("libcaca demo")) / 2, 3, "libcaca demo");212 cucul_put str(cv, (xo - strlen("==============")) / 2, 4, "==============");213 214 cucul_put str(cv, 4, 6, "demos:");215 cucul_put str(cv, 4, 7, "'f': full");216 cucul_put str(cv, 4, 8, "'1': dots");217 cucul_put str(cv, 4, 9, "'2': lines");218 cucul_put str(cv, 4, 10, "'3': boxes");219 cucul_put str(cv, 4, 11, "'4': triangles");220 cucul_put str(cv, 4, 12, "'5': ellipses");221 cucul_put str(cv, 4, 13, "'c': colour");222 cucul_put str(cv, 4, 14, "'r': render");211 cucul_put_str(cv, (xo - strlen("libcaca demo")) / 2, 3, "libcaca demo"); 212 cucul_put_str(cv, (xo - strlen("==============")) / 2, 4, "=============="); 213 214 cucul_put_str(cv, 4, 6, "demos:"); 215 cucul_put_str(cv, 4, 7, "'f': full"); 216 cucul_put_str(cv, 4, 8, "'1': dots"); 217 cucul_put_str(cv, 4, 9, "'2': lines"); 218 cucul_put_str(cv, 4, 10, "'3': boxes"); 219 cucul_put_str(cv, 4, 11, "'4': triangles"); 220 cucul_put_str(cv, 4, 12, "'5': ellipses"); 221 cucul_put_str(cv, 4, 13, "'c': colour"); 222 cucul_put_str(cv, 4, 14, "'r': render"); 223 223 #if 0 224 224 if(sprite) 225 cucul_put str(cv, 4, 15, "'s': sprites");226 #endif 227 228 cucul_put str(cv, 4, 16, "settings:");225 cucul_put_str(cv, 4, 15, "'s': sprites"); 226 #endif 227 228 cucul_put_str(cv, 4, 16, "settings:"); 229 229 cucul_printf(cv, 4, 17, "'o': outline: %s", 230 230 outline == 0 ? "none" : outline == 1 ? "solid" : "thin"); … … 234 234 // cucul_get_feature_name(dithering)); 235 235 236 cucul_put str(cv, 4, yo - 2, "'q': quit");236 cucul_put_str(cv, 4, yo - 2, "'q': quit"); 237 237 238 238 caca_refresh_display(dp); … … 326 326 int delta = cucul_rand(-5, 6); 327 327 cucul_set_color_ansi(cv, cucul_rand(0, 16), cucul_rand(0, 16)); 328 cucul_put char(cv, cucul_get_canvas_width(cv) / 2328 cucul_put_char(cv, cucul_get_canvas_width(cv) / 2 329 329 + cos(0.02*j) * (delta + cucul_get_canvas_width(cv) / 4), 330 330 cucul_get_canvas_height(cv) / 2 … … 355 355 /* Putpixel */ 356 356 cucul_set_color_ansi(cv, cucul_rand(0, 16), cucul_rand(0, 16)); 357 cucul_put char(cv, cucul_rand(0, xmax), cucul_rand(0, ymax),357 cucul_put_char(cv, cucul_rand(0, xmax), cucul_rand(0, ymax), 358 358 chars[cucul_rand(0, 9)]); 359 359 } -
libcaca/trunk/test/dithering.c
r1267 r1347 119 119 cucul_set_color_ansi(cv, points[nearb], points[neara]); 120 120 121 cucul_put char(cv, x * cucul_get_canvas_width(cv) / 100,121 cucul_put_char(cv, x * cucul_get_canvas_width(cv) / 100, 122 122 (100 - y) * cucul_get_canvas_height(cv) / 100, ch); 123 123 } -
libcaca/trunk/test/event.c
r1330 r1347 46 46 47 47 cucul_draw_line(cv, 0, h, cucul_get_canvas_width(cv) - 1, h, ' '); 48 cucul_put str(cv, 0, h, "type \"quit\" to exit");48 cucul_put_str(cv, 0, h, "type \"quit\" to exit"); 49 49 50 50 caca_refresh_display(dp); -
libcaca/trunk/test/export.c
r1330 r1347 115 115 cucul_fill_ellipse(cv, WIDTH / 2, HEIGHT / 2, 116 116 WIDTH / 4, HEIGHT / 4, ' '); 117 cucul_put str(cv, WIDTH / 2 - 5, HEIGHT / 2 - 5, "(\") \\o/ <&>");118 cucul_put str(cv, WIDTH / 2 - 8, HEIGHT / 2 - 3, "[<><><><> <>--<>]");119 cucul_put str(cv, WIDTH / 2 - 8, HEIGHT / 2 - 2, "[ドラゴン ボーレ]");120 cucul_put str(cv, WIDTH / 2 - 7, HEIGHT / 2 + 2, "äβç ░▒▓█▓▒░ ΔЗҒ");117 cucul_put_str(cv, WIDTH / 2 - 5, HEIGHT / 2 - 5, "(\") \\o/ <&>"); 118 cucul_put_str(cv, WIDTH / 2 - 8, HEIGHT / 2 - 3, "[<><><><> <>--<>]"); 119 cucul_put_str(cv, WIDTH / 2 - 8, HEIGHT / 2 - 2, "[ドラゴン ボーレ]"); 120 cucul_put_str(cv, WIDTH / 2 - 7, HEIGHT / 2 + 2, "äβç ░▒▓█▓▒░ ΔЗҒ"); 121 121 122 122 cucul_set_attr(cv, CUCUL_BOLD); 123 cucul_put str(cv, WIDTH / 2 - 16, HEIGHT / 2 + 3, "Bold");123 cucul_put_str(cv, WIDTH / 2 - 16, HEIGHT / 2 + 3, "Bold"); 124 124 cucul_set_attr(cv, CUCUL_BLINK); 125 cucul_put str(cv, WIDTH / 2 - 9, HEIGHT / 2 + 3, "Blink");125 cucul_put_str(cv, WIDTH / 2 - 9, HEIGHT / 2 + 3, "Blink"); 126 126 cucul_set_attr(cv, CUCUL_ITALICS); 127 cucul_put str(cv, WIDTH / 2 - 1, HEIGHT / 2 + 3, "Italics");127 cucul_put_str(cv, WIDTH / 2 - 1, HEIGHT / 2 + 3, "Italics"); 128 128 cucul_set_attr(cv, CUCUL_UNDERLINE); 129 cucul_put str(cv, WIDTH / 2 + 8, HEIGHT / 2 + 3, "Underline");129 cucul_put_str(cv, WIDTH / 2 + 8, HEIGHT / 2 + 3, "Underline"); 130 130 cucul_set_attr(cv, 0); 131 131 132 132 cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_LIGHTBLUE); 133 cucul_put str(cv, WIDTH / 2 - 7, HEIGHT / 2, " LIBCACA ");133 cucul_put_str(cv, WIDTH / 2 - 7, HEIGHT / 2, " LIBCACA "); 134 134 135 135 for(x = 0; x < 16; x++) 136 136 { 137 137 cucul_set_color_argb(cv, 0xff00 | x, 0xf00f | (x << 4)); 138 cucul_put str(cv, WIDTH / 2 - 7 + x, HEIGHT / 2 + 5, "#");138 cucul_put_str(cv, WIDTH / 2 - 7 + x, HEIGHT / 2 + 5, "#"); 139 139 } 140 140 } -
libcaca/trunk/test/font.c
r1267 r1347 47 47 /* Draw stuff on our canvas */ 48 48 cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLACK); 49 cucul_put str(cv, 0, 0, "ABcde");49 cucul_put_str(cv, 0, 0, "ABcde"); 50 50 cucul_set_color_ansi(cv, CUCUL_LIGHTRED, CUCUL_BLACK); 51 cucul_put str(cv, 5, 0, "\\o/");51 cucul_put_str(cv, 5, 0, "\\o/"); 52 52 cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE); 53 cucul_put str(cv, 0, 1, "&$âøÿØ?!");53 cucul_put_str(cv, 0, 1, "&$âøÿØ?!"); 54 54 55 55 /* Load a libcucul internal font */ -
libcaca/trunk/test/font2tga.c
r1308 r1347 55 55 for(j = blocks[i]; j < blocks[i + 1]; j++) 56 56 { 57 cucul_put char(cv, x, y, j);57 cucul_put_char(cv, x, y, j); 58 58 59 59 if(++x == WIDTH) -
libcaca/trunk/test/frames.c
r1340 r1347 52 52 cucul_fill_box(cv, 0, 0, 40, 15, ':'); 53 53 cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE); 54 cucul_put str(cv, frame * 5 / 2, frame, "カカ");54 cucul_put_str(cv, frame * 5 / 2, frame, "カカ"); 55 55 cucul_set_color_ansi(cv, CUCUL_DEFAULT, CUCUL_TRANSPARENT); 56 56 } -
libcaca/trunk/test/fullwidth.c
r1267 r1347 44 44 { 45 45 cucul_set_color_ansi(caca, CUCUL_WHITE, CUCUL_BLUE); 46 cucul_put str(caca, 0, i, CACA);46 cucul_put_str(caca, 0, i, CACA); 47 47 cucul_set_color_ansi(caca, CUCUL_WHITE, CUCUL_RED); 48 cucul_put char(caca, i - 2, i, 'x');48 cucul_put_char(caca, i - 2, i, 'x'); 49 49 } 50 50 … … 55 55 { 56 56 cucul_set_color_ansi(caca, CUCUL_WHITE, CUCUL_BLUE); 57 cucul_put str(caca, 0, i, CACA);57 cucul_put_str(caca, 0, i, CACA); 58 58 cucul_set_color_ansi(caca, CUCUL_WHITE, CUCUL_GREEN); 59 cucul_put str(caca, i - 2, i, "ホ");59 cucul_put_str(caca, i - 2, i, "ホ"); 60 60 } 61 61 … … 64 64 /* Line of canvas */ 65 65 cucul_set_color_ansi(line, CUCUL_WHITE, CUCUL_MAGENTA); 66 cucul_put str(line, 0, 0, "ほ");66 cucul_put_str(line, 0, 0, "ほ"); 67 67 for(i = 0; i < 10; i++) 68 68 { 69 69 cucul_set_color_ansi(caca, CUCUL_WHITE, CUCUL_BLUE); 70 cucul_put str(caca, 0, i, CACA);70 cucul_put_str(caca, 0, i, CACA); 71 71 cucul_blit(caca, i - 2, i, line, NULL); 72 72 } -
libcaca/trunk/test/input.c
r1330 r1347 45 45 46 46 cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE); 47 cucul_put str(cv, 1, 1, "Text entries - press tab to cycle");47 cucul_put_str(cv, 1, 1, "Text entries - press tab to cycle"); 48 48 49 49 for(i = 0; i < TEXT_ENTRIES; i++) … … 70 70 for(j = 0; j < size; j++) 71 71 { 72 cucul_put char(cv, 2 + j, 3 * i + 4,72 cucul_put_char(cv, 2 + j, 3 * i + 4, 73 73 entries[i].buffer[start + j]); 74 74 } … … 77 77 /* Put the cursor on the active textentry */ 78 78 cucul_set_color_ansi(cv, CUCUL_LIGHTRED, CUCUL_LIGHTRED); 79 cucul_put char(cv, 2 + entries[e].cursor, 3 * e + 4, ' ');79 cucul_put_char(cv, 2 + entries[e].cursor, 3 * e + 4, ' '); 80 80 81 81 caca_refresh_display(dp); -
libcaca/trunk/test/spritedit.c
r1267 r1347 109 109 cucul_get_canvas_height(cv) - 1); 110 110 111 cucul_put str(cv, 3, 0, "[ Sprite editor for libcaca ]");111 cucul_put_str(cv, 3, 0, "[ Sprite editor for libcaca ]"); 112 112 113 113 sprintf(buf, "sprite `%s'", argv[1]); 114 cucul_put str(cv, 3, 2, buf);114 cucul_put_str(cv, 3, 2, buf); 115 115 sprintf(buf, "frame %i/%i", frame, cucul_get_sprite_frames(sprite) - 1); 116 cucul_put str(cv, 3, 3, buf);116 cucul_put_str(cv, 3, 3, buf); 117 117 118 118 /* Crosshair */ 119 119 cucul_draw_thin_line(cv, 57, 2, 57, 18); 120 120 cucul_draw_thin_line(cv, 37, 10, 77, 10); 121 cucul_put char(cv, 57, 10, '+');121 cucul_put_char(cv, 57, 10, '+'); 122 122 123 123 /* Boxed sprite */ -
libcaca/trunk/test/transform.c
r1345 r1347 61 61 62 62 cucul_set_color_ansi(image, CUCUL_LIGHTCYAN, CUCUL_BLACK); 63 cucul_put str(image, 1, 1, "hahaha mais vieux porc immonde !! [⽼ ⾗]");63 cucul_put_str(image, 1, 1, "hahaha mais vieux porc immonde !! [⽼ ⾗]"); 64 64 cucul_set_color_ansi(image, CUCUL_LIGHTRED, CUCUL_BLACK); 65 cucul_put char(image, 38, 1, '|');65 cucul_put_char(image, 38, 1, '|'); 66 66 67 67 cucul_set_color_ansi(image, CUCUL_YELLOW, CUCUL_BLACK); 68 cucul_put str(image, 4, 2, "\\o\\ \\o| _o/ \\o_ |o/ /o/");68 cucul_put_str(image, 4, 2, "\\o\\ \\o| _o/ \\o_ |o/ /o/"); 69 69 70 70 cucul_set_color_ansi(image, CUCUL_WHITE, CUCUL_LIGHTRED); 71 cucul_put str(image, 7, 3, "▙▘▌▙▘▞▖▞▖▌ ▞▖▌ ▌▌");72 cucul_put str(image, 7, 4, "▛▖▌▛▖▚▘▚▘▚▖▚▘▚▖▖▖");71 cucul_put_str(image, 7, 3, "▙▘▌▙▘▞▖▞▖▌ ▞▖▌ ▌▌"); 72 cucul_put_str(image, 7, 4, "▛▖▌▛▖▚▘▚▘▚▖▚▘▚▖▖▖"); 73 73 cucul_set_color_ansi(image, CUCUL_BLACK, CUCUL_LIGHTRED); 74 cucul_put str(image, 4, 3, "▓▒░");75 cucul_put str(image, 4, 4, "▓▒░");76 cucul_put str(image, 24, 3, "░▒▓");77 cucul_put str(image, 24, 4, "░▒▓");74 cucul_put_str(image, 4, 3, "▓▒░"); 75 cucul_put_str(image, 4, 4, "▓▒░"); 76 cucul_put_str(image, 24, 3, "░▒▓"); 77 cucul_put_str(image, 24, 4, "░▒▓"); 78 78 79 79 /* Blit the transformed canvas onto the main canvas */ 80 80 cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE); 81 cucul_put str(cv, 0, 0, "normal");81 cucul_put_str(cv, 0, 0, "normal"); 82 82 cucul_blit(cv, 10, 0, image, NULL); 83 83 84 cucul_put str(cv, 0, 6, "flip");84 cucul_put_str(cv, 0, 6, "flip"); 85 85 cucul_blit(tmp, 0, 0, image, NULL); 86 86 cucul_flip(tmp); 87 87 cucul_blit(cv, 10, 6, tmp, NULL); 88 88 89 cucul_put str(cv, 0, 12, "flop");89 cucul_put_str(cv, 0, 12, "flop"); 90 90 cucul_blit(tmp, 0, 0, image, NULL); 91 91 cucul_flop(tmp); 92 92 cucul_blit(cv, 10, 12, tmp, NULL); 93 93 94 cucul_put str(cv, 0, 18, "rotate");94 cucul_put_str(cv, 0, 18, "rotate"); 95 95 cucul_blit(tmp, 0, 0, image, NULL); 96 96 cucul_rotate(tmp); -
libcaca/trunk/test/truecolor.c
r1267 r1347 42 42 43 43 cucul_set_color_argb(cv, fgcolor, bgcolor); 44 cucul_put str(cv, x * 2, y, "CA");44 cucul_put_str(cv, x * 2, y, "CA"); 45 45 } 46 46 47 47 cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_LIGHTBLUE); 48 cucul_put str(cv, 2, 1, " truecolor libcaca ");48 cucul_put_str(cv, 2, 1, " truecolor libcaca "); 49 49 50 50 caca_refresh_display(dp); -
libcaca/trunk/test/unicode.c
r1267 r1347 34 34 35 35 cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE); 36 cucul_put str(cv, 1, 1, "Basic Unicode support");36 cucul_put_str(cv, 1, 1, "Basic Unicode support"); 37 37 38 38 cucul_set_color_ansi(cv, CUCUL_DEFAULT, CUCUL_TRANSPARENT); 39 cucul_put str(cv, 1, 2, "This is ASCII: | abc DEF 123 !@# |");40 cucul_put str(cv, 1, 3, "This is Unicode: | äßç δεφ ☺♥♀ ╞╬╗ |");41 cucul_put str(cv, 1, 4, "And this is, too: | ἀβϛ ΔЗҒ ᚴᛒᛯ ♩♔✈ |");39 cucul_put_str(cv, 1, 2, "This is ASCII: | abc DEF 123 !@# |"); 40 cucul_put_str(cv, 1, 3, "This is Unicode: | äßç δεφ ☺♥♀ ╞╬╗ |"); 41 cucul_put_str(cv, 1, 4, "And this is, too: | ἀβϛ ΔЗҒ ᚴᛒᛯ ♩♔✈ |"); 42 42 43 cucul_put str(cv, 1, 5, "If the three lines do not have the same length, there is a bug somewhere.");43 cucul_put_str(cv, 1, 5, "If the three lines do not have the same length, there is a bug somewhere."); 44 44 45 45 cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE); 46 cucul_put str(cv, 1, 7, "Gradient glyphs");46 cucul_put_str(cv, 1, 7, "Gradient glyphs"); 47 47 48 48 cucul_set_color_ansi(cv, CUCUL_DEFAULT, CUCUL_TRANSPARENT); 49 cucul_put str(cv, 31, 8, " 0%");50 cucul_put str(cv, 31, 9, " 25%");51 cucul_put str(cv, 31, 10, " 50%");52 cucul_put str(cv, 31, 11, " 75%");53 cucul_put str(cv, 31, 12, "100%");49 cucul_put_str(cv, 31, 8, " 0%"); 50 cucul_put_str(cv, 31, 9, " 25%"); 51 cucul_put_str(cv, 31, 10, " 50%"); 52 cucul_put_str(cv, 31, 11, " 75%"); 53 cucul_put_str(cv, 31, 12, "100%"); 54 54 55 55 cucul_set_color_ansi(cv, CUCUL_LIGHTRED, CUCUL_LIGHTGREEN); 56 cucul_put str(cv, 1, 8, " ");57 cucul_put str(cv, 1, 9, "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░");58 cucul_put str(cv, 1, 10, "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒");59 cucul_put str(cv, 1, 11, "▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓");60 cucul_put str(cv, 1, 12, "█████████████████████████████");56 cucul_put_str(cv, 1, 8, " "); 57 cucul_put_str(cv, 1, 9, "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░"); 58 cucul_put_str(cv, 1, 10, "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒"); 59 cucul_put_str(cv, 1, 11, "▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"); 60 cucul_put_str(cv, 1, 12, "█████████████████████████████"); 61 61 62 62 cucul_set_color_ansi(cv, CUCUL_LIGHTGREEN, CUCUL_LIGHTRED); 63 cucul_put str(cv, 36, 8, "█████████████████████████████");64 cucul_put str(cv, 36, 9, "▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓");65 cucul_put str(cv, 36, 10, "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒");66 cucul_put str(cv, 36, 11, "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░");67 cucul_put str(cv, 36, 12, " ");63 cucul_put_str(cv, 36, 8, "█████████████████████████████"); 64 cucul_put_str(cv, 36, 9, "▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓"); 65 cucul_put_str(cv, 36, 10, "▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒"); 66 cucul_put_str(cv, 36, 11, "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░"); 67 cucul_put_str(cv, 36, 12, " "); 68 68 69 69 cucul_set_color_ansi(cv, CUCUL_WHITE, CUCUL_BLUE); 70 cucul_put str(cv, 1, 14, "Double width characters");70 cucul_put_str(cv, 1, 14, "Double width characters"); 71 71 72 72 cucul_set_color_ansi(cv, CUCUL_LIGHTRED, CUCUL_TRANSPARENT); 73 cucul_put str(cv, 1, 15, "| ドラゴン ボーレ |");73 cucul_put_str(cv, 1, 15, "| ドラゴン ボーレ |"); 74 74 cucul_set_color_ansi(cv, CUCUL_DEFAULT, CUCUL_TRANSPARENT); 75 cucul_put str(cv, 1, 16, "| ()()()() ()()() |");75 cucul_put_str(cv, 1, 16, "| ()()()() ()()() |"); 76 76 cucul_set_color_ansi(cv, CUCUL_YELLOW, CUCUL_TRANSPARENT); 77 cucul_put str(cv, 1, 17, "| ドラゴン");78 cucul_put str(cv, 12, 17, "ボーレ |");77 cucul_put_str(cv, 1, 17, "| ドラゴン"); 78 cucul_put_str(cv, 12, 17, "ボーレ |"); 79 79 80 80 cucul_set_color_ansi(cv, CUCUL_DEFAULT, CUCUL_TRANSPARENT); 81 cucul_put str(cv, 1, 18, "If the three lines do not have the same length, there is a bug somewhere.");81 cucul_put_str(cv, 1, 18, "If the three lines do not have the same length, there is a bug somewhere."); 82 82 83 cucul_put str(cv, 1, 20, "CP437 glyphs: ☺ ☻ ♥ ♦ ♣ ♠ • ◘ ○ ◙ ♂ ♀ ♪ ♫ ☼ ► ◄ ↕ ‼ ¶ § ▬ ↨ ↑ ↓ → ← ∟ ↔ ▲ ▼");84 cucul_put str(cv, 1, 21, "more CP437: α ß Γ π Σ σ µ τ Φ Θ Ω δ ∞ φ ε ∩ ≡ ± ≥ ≤ ⌠ ⌡ ÷ ≈ ° ∙ · √ ⁿ ² ■");85 cucul_put str(cv, 1, 22, "drawing blocks: ███ ▓▓▓ ▒▒▒ ░░░ ▀ ▄ ▌ ▐ █ ▖ ▗ ▘ ▝ ▚ ▞ ▙ ▛ ▜ ▟");83 cucul_put_str(cv, 1, 20, "CP437 glyphs: ☺ ☻ ♥ ♦ ♣ ♠ • ◘ ○ ◙ ♂ ♀ ♪ ♫ ☼ ► ◄ ↕ ‼ ¶ § ▬ ↨ ↑ ↓ → ← ∟ ↔ ▲ ▼"); 84 cucul_put_str(cv, 1, 21, "more CP437: α ß Γ π Σ σ µ τ Φ Θ Ω δ ∞ φ ε ∩ ≡ ± ≥ ≤ ⌠ ⌡ ÷ ≈ ° ∙ · √ ⁿ ² ■"); 85 cucul_put_str(cv, 1, 22, "drawing blocks: ███ ▓▓▓ ▒▒▒ ░░░ ▀ ▄ ▌ ▐ █ ▖ ▗ ▘ ▝ ▚ ▞ ▙ ▛ ▜ ▟"); 86 86 87 87 caca_refresh_display(dp);
Note: See TracChangeset
for help on using the changeset viewer.