Changeset 678 for libcaca/trunk/cucul/box.c
 Timestamp:
 Mar 23, 2006, 3:07:32 PM (14 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

libcaca/trunk/cucul/box.c
r672 r678 34 34 * \param x2 X coordinate of the lowerright corner of the box. 35 35 * \param y2 Y coordinate of the lowerright corner of the box. 36 * \param c Character to draw the box outline with.36 * \param str UTF8 string containing the character to use to draw the box. 37 37 * \return void 38 38 */ 39 void cucul_draw_box(cucul_t *qq, int x1, int y1, int x2, int y2, char c) 39 void cucul_draw_box(cucul_t *qq, int x1, int y1, int x2, int y2, 40 char const *str) 40 41 { 41 cucul_draw_line(qq, x1, y1, x1, y2, c);42 cucul_draw_line(qq, x1, y2, x2, y2, c);43 cucul_draw_line(qq, x2, y2, x2, y1, c);44 cucul_draw_line(qq, x2, y1, x1, y1, c);42 cucul_draw_line(qq, x1, y1, x1, y2, str); 43 cucul_draw_line(qq, x1, y2, x2, y2, str); 44 cucul_draw_line(qq, x2, y2, x2, y1, str); 45 cucul_draw_line(qq, x2, y1, x1, y1, str); 45 46 } 46 47 … … 79 80 if(y1 >= 0) 80 81 for(x = x1 < 0 ? 1 : x1 + 1; x < x2 && x < xmax; x++) 81 cucul_putchar(qq, x, y1,'');82 _cucul_putchar32(qq, x, y1, (uint32_t)''); 82 83 83 84 if(y2 <= ymax) 84 85 for(x = x1 < 0 ? 1 : x1 + 1; x < x2 && x < xmax; x++) 85 cucul_putchar(qq, x, y2,'');86 _cucul_putchar32(qq, x, y2, (uint32_t)''); 86 87 87 88 if(x1 >= 0) 88 89 for(y = y1 < 0 ? 1 : y1 + 1; y < y2 && y < ymax; y++) 89 cucul_putchar(qq, x1, y,'');90 _cucul_putchar32(qq, x1, y, (uint32_t)''); 90 91 91 92 if(x2 <= xmax) 92 93 for(y = y1 < 0 ? 1 : y1 + 1; y < y2 && y < ymax; y++) 93 cucul_putchar(qq, x2, y,'');94 _cucul_putchar32(qq, x2, y, (uint32_t)''); 94 95 95 96 /* Draw corners */ 96 97 if(x1 >= 0 && y1 >= 0) 97 cucul_putchar(qq, x1, y1,',');98 _cucul_putchar32(qq, x1, y1, (uint32_t)','); 98 99 99 100 if(x1 >= 0 && y2 <= ymax) 100 cucul_putchar(qq, x1, y2,'`');101 _cucul_putchar32(qq, x1, y2, (uint32_t)'`'); 101 102 102 103 if(x2 <= xmax && y1 >= 0) 103 cucul_putchar(qq, x2, y1,'.');104 _cucul_putchar32(qq, x2, y1, (uint32_t)'.'); 104 105 105 106 if(x2 <= xmax && y2 <= ymax) 106 cucul_putchar(qq, x2, y2,'\'');107 _cucul_putchar32(qq, x2, y2, (uint32_t)'\''); 107 108 } 108 109 … … 114 115 * \param x2 X coordinate of the lowerright corner of the box. 115 116 * \param y2 Y coordinate of the lowerright corner of the box. 116 * \param c Character to fill the box with.117 * \param str UTF8 string containing the character to fill the box with. 117 118 * \return void 118 119 */ 119 void cucul_fill_box(cucul_t *qq, int x1, int y1, int x2, int y2, char c) 120 void cucul_fill_box(cucul_t *qq, int x1, int y1, int x2, int y2, 121 char const *str) 120 122 { 121 123 int x, y, xmax, ymax; 124 uint32_t c; 122 125 123 126 if(x1 > x2) … … 144 147 if(y2 > ymax) y2 = ymax; 145 148 149 c = _cucul_utf8_to_utf32(str); 150 146 151 for(y = y1; y <= y2; y++) 147 152 for(x = x1; x <= x2; x++) 148 cucul_putchar(qq, x, y, c);153 _cucul_putchar32(qq, x, y, c); 149 154 } 150 155
Note: See TracChangeset
for help on using the changeset viewer.