oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2002, Adam Dunkels. |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 8 | * 1. Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * 2. Redistributions in binary form must reproduce the above |
| 11 | * copyright notice, this list of conditions and the following |
| 12 | * disclaimer in the documentation and/or other materials provided |
| 13 | * with the distribution. |
| 14 | * 3. The name of the author may not be used to endorse or promote |
| 15 | * products derived from this software without specific prior |
| 16 | * written permission. |
| 17 | * |
| 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS |
| 19 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY |
| 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
| 24 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 26 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 27 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | * |
| 30 | * This file is part of the "ctk" console GUI toolkit for cc65 |
| 31 | * |
oliverschmidt | 57d90a1 | 2004-07-29 11:50:24 +0000 | [diff] [blame^] | 32 | * $Id: ctk-mousetext.c,v 1.8 2004/07/29 11:50:24 oliverschmidt Exp $ |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 33 | * |
| 34 | */ |
| 35 | |
| 36 | #include <conio.h> |
| 37 | |
| 38 | #include "ctk.h" |
| 39 | #include "ctk-draw.h" |
| 40 | #include "config.h" |
| 41 | |
| 42 | #include "ctk-conio-conf.h" |
| 43 | #include <string.h> |
oliverschmidt | 9e652ff | 2004-07-11 12:24:52 +0000 | [diff] [blame] | 44 | #include <ctype.h> |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 45 | |
| 46 | #ifndef NULL |
| 47 | #define NULL (void *)0 |
| 48 | #endif /* NULL */ |
| 49 | |
oliverschmidt | 9e652ff | 2004-07-11 12:24:52 +0000 | [diff] [blame] | 50 | unsigned char ctk_draw_windowborder_height = 1; |
| 51 | unsigned char ctk_draw_windowborder_width = 1; |
| 52 | unsigned char ctk_draw_windowtitle_height = 1; |
| 53 | |
| 54 | |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 55 | /*-----------------------------------------------------------------------------------*/ |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 56 | static void |
| 57 | cputsn(char *str, unsigned char len) |
| 58 | { |
oliverschmidt | 280d131 | 2004-06-27 21:01:03 +0000 | [diff] [blame] | 59 | char c; |
| 60 | |
| 61 | while(len > 0) { |
| 62 | --len; |
| 63 | c = *str; |
| 64 | if(c == 0) { |
| 65 | break; |
| 66 | } |
| 67 | cputc(c); |
| 68 | ++str; |
| 69 | } |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 70 | } |
| 71 | /*-----------------------------------------------------------------------------------*/ |
| 72 | void |
| 73 | ctk_draw_init(void) |
| 74 | { |
oliverschmidt | 5867b67 | 2004-07-12 21:35:20 +0000 | [diff] [blame] | 75 | ctk_draw_clear(0, 24); |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 76 | } |
| 77 | /*-----------------------------------------------------------------------------------*/ |
| 78 | static void |
| 79 | draw_widget(struct ctk_widget *w, |
| 80 | unsigned char x, unsigned char y, |
| 81 | unsigned char clipx, |
| 82 | unsigned char clipy, |
| 83 | unsigned char clipy1, unsigned char clipy2, |
| 84 | unsigned char focus) |
| 85 | { |
| 86 | unsigned char xpos, ypos, xscroll; |
| 87 | unsigned char i, j; |
| 88 | char c, *text; |
| 89 | unsigned char len, wfocus; |
| 90 | |
| 91 | wfocus = 0; |
| 92 | if(focus & CTK_FOCUS_WINDOW) { |
| 93 | if(focus & CTK_FOCUS_WIDGET) { |
| 94 | wfocus = 1; |
| 95 | } |
| 96 | } else if(focus & CTK_FOCUS_DIALOG) { |
| 97 | if(focus & CTK_FOCUS_WIDGET) { |
| 98 | wfocus = 1; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | xpos = x + w->x; |
| 103 | ypos = y + w->y; |
| 104 | |
| 105 | switch(w->type) { |
| 106 | case CTK_WIDGET_SEPARATOR: |
| 107 | if(ypos >= clipy1 && ypos < clipy2) { |
| 108 | chlinexy(xpos, ypos, w->w); |
| 109 | } |
| 110 | break; |
| 111 | case CTK_WIDGET_LABEL: |
| 112 | text = w->widget.label.text; |
| 113 | for(i = 0; i < w->h; ++i) { |
| 114 | if(ypos >= clipy1 && ypos < clipy2) { |
| 115 | gotoxy(xpos, ypos); |
| 116 | cputsn(text, w->w); |
| 117 | if(w->w - (wherex() - xpos) > 0) { |
| 118 | cclear(w->w - (wherex() - xpos)); |
| 119 | } |
| 120 | } |
| 121 | ++ypos; |
| 122 | text += w->w; |
| 123 | } |
| 124 | break; |
| 125 | case CTK_WIDGET_BUTTON: |
| 126 | if(ypos >= clipy1 && ypos < clipy2) { |
| 127 | if(wfocus != 0) { |
| 128 | revers(1); |
| 129 | } else { |
| 130 | revers(0); |
| 131 | } |
| 132 | cputcxy(xpos, ypos, '['); |
| 133 | cputsn(w->widget.button.text, w->w); |
| 134 | cputc(']'); |
| 135 | revers(0); |
| 136 | } |
| 137 | break; |
| 138 | case CTK_WIDGET_HYPERLINK: |
| 139 | if(ypos >= clipy1 && ypos < clipy2) { |
| 140 | if(wfocus != 0) { |
| 141 | revers(0); |
| 142 | } else { |
| 143 | revers(1); |
| 144 | } |
| 145 | gotoxy(xpos, ypos); |
| 146 | cputsn(w->widget.button.text, w->w); |
| 147 | revers(0); |
| 148 | } |
| 149 | break; |
| 150 | case CTK_WIDGET_TEXTENTRY: |
| 151 | text = w->widget.textentry.text; |
| 152 | if(wfocus != 0) { |
| 153 | revers(1); |
| 154 | } else { |
| 155 | revers(0); |
| 156 | } |
| 157 | xscroll = 0; |
| 158 | if(w->widget.textentry.xpos >= w->w - 1) { |
| 159 | xscroll = w->widget.textentry.xpos - w->w + 1; |
| 160 | } |
| 161 | for(j = 0; j < w->h; ++j) { |
| 162 | if(ypos >= clipy1 && ypos < clipy2) { |
| 163 | if(w->widget.textentry.state == CTK_TEXTENTRY_EDIT && |
| 164 | w->widget.textentry.ypos == j) { |
| 165 | revers(0); |
| 166 | cputcxy(xpos, ypos, '>'); |
| 167 | for(i = 0; i < w->w; ++i) { |
| 168 | c = text[i + xscroll]; |
| 169 | if(i == w->widget.textentry.xpos - xscroll) { |
| 170 | revers(1); |
| 171 | } else { |
| 172 | revers(0); |
| 173 | } |
| 174 | if(c == 0) { |
| 175 | cputc(' '); |
| 176 | } else { |
| 177 | cputc(c); |
| 178 | } |
| 179 | revers(0); |
| 180 | } |
| 181 | cputc('<'); |
| 182 | } else { |
| 183 | cvlinexy(xpos, ypos, 1); |
| 184 | gotoxy(xpos + 1, ypos); |
| 185 | cputsn(text, w->w); |
| 186 | i = wherex(); |
| 187 | if(i - xpos - 1 < w->w) { |
| 188 | cclear(w->w - (i - xpos) + 1); |
| 189 | } |
| 190 | cvline(1); |
| 191 | } |
| 192 | } |
| 193 | ++ypos; |
| 194 | text += w->w; |
| 195 | } |
| 196 | revers(0); |
| 197 | break; |
oliverschmidt | f0d728a | 2004-06-27 18:32:39 +0000 | [diff] [blame] | 198 | #if CTK_CONF_ICONS |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 199 | case CTK_WIDGET_ICON: |
| 200 | if(ypos >= clipy1 && ypos < clipy2) { |
oliverschmidt | 10cb4f5 | 2004-06-27 15:05:13 +0000 | [diff] [blame] | 201 | if(wfocus != 0) { |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 202 | revers(1); |
| 203 | } else { |
| 204 | revers(0); |
| 205 | } |
oliverschmidt | f0d728a | 2004-06-27 18:32:39 +0000 | [diff] [blame] | 206 | #if CTK_CONF_ICON_TEXTMAPS |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 207 | if(w->widget.icon.textmap != NULL) { |
| 208 | for(i = 0; i < 3; ++i) { |
| 209 | gotoxy(xpos, ypos); |
| 210 | if(ypos >= clipy1 && ypos < clipy2) { |
| 211 | cputc(w->widget.icon.textmap[0 + 3 * i]); |
| 212 | cputc(w->widget.icon.textmap[1 + 3 * i]); |
| 213 | cputc(w->widget.icon.textmap[2 + 3 * i]); |
| 214 | } |
| 215 | ++ypos; |
| 216 | } |
| 217 | } |
oliverschmidt | f0d728a | 2004-06-27 18:32:39 +0000 | [diff] [blame] | 218 | #endif /* CTK_CONF_ICON_TEXTMAPS */ |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 219 | |
| 220 | len = strlen(w->widget.icon.title); |
oliverschmidt | 5867b67 | 2004-07-12 21:35:20 +0000 | [diff] [blame] | 221 | if(xpos + len >= 80) { |
| 222 | xpos = 80 - len; |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 223 | } |
| 224 | |
oliverschmidt | f0d728a | 2004-06-27 18:32:39 +0000 | [diff] [blame] | 225 | gotoxy(xpos, ypos); |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 226 | if(ypos >= clipy1 && ypos < clipy2) { |
| 227 | cputs(w->widget.icon.title); |
| 228 | } |
| 229 | revers(0); |
| 230 | } |
| 231 | break; |
oliverschmidt | f0d728a | 2004-06-27 18:32:39 +0000 | [diff] [blame] | 232 | #endif /* CTK_CONF_ICONS */ |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 233 | |
| 234 | default: |
| 235 | break; |
| 236 | } |
| 237 | } |
| 238 | /*-----------------------------------------------------------------------------------*/ |
| 239 | void |
| 240 | ctk_draw_widget(struct ctk_widget *w, |
| 241 | unsigned char focus, |
| 242 | unsigned char clipy1, |
| 243 | unsigned char clipy2) |
| 244 | { |
| 245 | struct ctk_window *win = w->window; |
| 246 | unsigned char posx, posy; |
| 247 | |
| 248 | posx = win->x + 1; |
| 249 | posy = win->y + 2; |
| 250 | |
| 251 | if(w == win->focused) { |
| 252 | focus |= CTK_FOCUS_WIDGET; |
| 253 | } |
| 254 | |
| 255 | draw_widget(w, posx, posy, |
| 256 | posx + win->w, |
| 257 | posy + win->h, |
| 258 | clipy1, clipy2, |
| 259 | focus); |
| 260 | } |
| 261 | /*-----------------------------------------------------------------------------------*/ |
| 262 | void |
| 263 | ctk_draw_clear_window(struct ctk_window *window, |
| 264 | unsigned char focus, |
| 265 | unsigned char clipy1, |
| 266 | unsigned char clipy2) |
| 267 | { |
| 268 | unsigned char i; |
| 269 | unsigned char h; |
| 270 | |
| 271 | h = window->y + 2 + window->h; |
| 272 | /* Clear window contents. */ |
| 273 | for(i = window->y + 2; i < h; ++i) { |
| 274 | if(i >= clipy1 && i < clipy2) { |
| 275 | cclearxy(window->x + 1, i, window->w); |
| 276 | } |
| 277 | } |
| 278 | } |
| 279 | /*-----------------------------------------------------------------------------------*/ |
| 280 | static void |
| 281 | draw_window_contents(struct ctk_window *window, unsigned char focus, |
| 282 | unsigned char clipy1, unsigned char clipy2, |
| 283 | unsigned char x1, unsigned char x2, |
| 284 | unsigned char y1, unsigned char y2) |
| 285 | { |
| 286 | struct ctk_widget *w; |
| 287 | unsigned char wfocus; |
| 288 | |
| 289 | /* Draw inactive widgets. */ |
| 290 | for(w = window->inactive; w != NULL; w = w->next) { |
| 291 | draw_widget(w, x1, y1, x2, y2, |
| 292 | clipy1, clipy2, |
| 293 | focus); |
| 294 | } |
| 295 | |
| 296 | /* Draw active widgets. */ |
| 297 | for(w = window->active; w != NULL; w = w->next) { |
| 298 | wfocus = focus; |
| 299 | if(w == window->focused) { |
| 300 | wfocus |= CTK_FOCUS_WIDGET; |
| 301 | } |
| 302 | |
| 303 | draw_widget(w, x1, y1, x2, y2, |
| 304 | clipy1, clipy2, |
| 305 | wfocus); |
| 306 | } |
| 307 | } |
| 308 | /*-----------------------------------------------------------------------------------*/ |
| 309 | void |
| 310 | ctk_draw_window(struct ctk_window *window, unsigned char focus, |
| 311 | unsigned char clipy1, unsigned char clipy2) |
| 312 | { |
| 313 | unsigned char x, y; |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 314 | unsigned char x1, y1, x2, y2; |
| 315 | |
| 316 | if(window->y + 1 >= clipy2) { |
| 317 | return; |
| 318 | } |
| 319 | |
| 320 | x = window->x; |
| 321 | y = window->y + 1; |
| 322 | |
| 323 | x1 = x + 1; |
| 324 | y1 = y + 1; |
| 325 | x2 = x1 + window->w; |
| 326 | y2 = y1 + window->h; |
| 327 | |
| 328 | /* Draw window frame. */ |
| 329 | _textframexy(x, y, window->w + 2, window->h + 2, _TEXTFRAME_TALL); |
| 330 | |
| 331 | draw_window_contents(window, focus & CTK_FOCUS_WINDOW, clipy1, clipy2, |
| 332 | x1, x2, y + 1, y2); |
| 333 | } |
| 334 | /*-----------------------------------------------------------------------------------*/ |
| 335 | void |
| 336 | ctk_draw_dialog(struct ctk_window *dialog) |
| 337 | { |
| 338 | unsigned char x, y; |
| 339 | unsigned char i; |
| 340 | unsigned char x1, y1, x2, y2; |
| 341 | |
| 342 | x = dialog->x; |
| 343 | y = dialog->y + 1; |
| 344 | |
| 345 | x1 = x + 1; |
| 346 | y1 = y + 1; |
| 347 | x2 = x1 + dialog->w; |
| 348 | y2 = y1 + dialog->h; |
| 349 | |
| 350 | /* Draw dialog frame. */ |
| 351 | _textframexy(x, y, dialog->w + 2, dialog->h + 2, _TEXTFRAME_WIDE); |
| 352 | |
| 353 | /* Clear dialog contents. */ |
| 354 | for(i = y1; i < y2; ++i) { |
| 355 | cclearxy(x1, i, dialog->w); |
| 356 | } |
| 357 | |
oliverschmidt | 5867b67 | 2004-07-12 21:35:20 +0000 | [diff] [blame] | 358 | draw_window_contents(dialog, CTK_FOCUS_DIALOG, 0, 24, |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 359 | x1, x2, y1, y2); |
| 360 | } |
| 361 | /*-----------------------------------------------------------------------------------*/ |
| 362 | void |
| 363 | ctk_draw_clear(unsigned char y1, unsigned char y2) |
| 364 | { |
oliverschmidt | 38e6633 | 2004-06-27 22:51:27 +0000 | [diff] [blame] | 365 | char c1, c2; |
| 366 | unsigned char i; |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 367 | |
| 368 | if(*config.bkgnd == 'x') { |
oliverschmidt | 38e6633 | 2004-06-27 22:51:27 +0000 | [diff] [blame] | 369 | c1 = 'V'; |
| 370 | c2 = 'W'; |
| 371 | } else { |
| 372 | c1 = ' ' | 0x80; |
| 373 | c2 = ' ' | 0x80; |
| 374 | } |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 375 | |
oliverschmidt | 38e6633 | 2004-06-27 22:51:27 +0000 | [diff] [blame] | 376 | for(i = y1; i < y2; ++i) { |
| 377 | gotoxy(0, i); |
oliverschmidt | 5867b67 | 2004-07-12 21:35:20 +0000 | [diff] [blame] | 378 | *(char *)0xC055 = 0; |
| 379 | memset(*(char **)0x28, c1, 40); |
| 380 | *(char *)0xC054 = 0; |
| 381 | memset(*(char **)0x28, c2, 40); |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 382 | } |
oliverschmidt | 38e6633 | 2004-06-27 22:51:27 +0000 | [diff] [blame] | 383 | |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 384 | } |
| 385 | /*-----------------------------------------------------------------------------------*/ |
| 386 | static void |
| 387 | draw_menu(struct ctk_menu *m) |
| 388 | { |
| 389 | unsigned char x, x2, y; |
| 390 | |
oliverschmidt | 57d90a1 | 2004-07-29 11:50:24 +0000 | [diff] [blame^] | 391 | revers(0); |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 392 | x = wherex(); |
| 393 | cputs(m->title); |
| 394 | cputc(' '); |
| 395 | x2 = wherex(); |
oliverschmidt | 5867b67 | 2004-07-12 21:35:20 +0000 | [diff] [blame] | 396 | if(x + CTK_CONF_MENUWIDTH > 80) { |
| 397 | x = 80 - CTK_CONF_MENUWIDTH; |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 398 | } |
| 399 | |
| 400 | for(y = 0; y < m->nitems; ++y) { |
| 401 | if(y == m->active) { |
| 402 | revers(0); |
oliverschmidt | 57d90a1 | 2004-07-29 11:50:24 +0000 | [diff] [blame^] | 403 | } else { |
| 404 | revers(1); |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 405 | } |
| 406 | gotoxy(x, y + 1); |
| 407 | if(m->items[y].title[0] == '-') { |
| 408 | chline(CTK_CONF_MENUWIDTH); |
| 409 | } else { |
| 410 | cputs(m->items[y].title); |
| 411 | } |
| 412 | if(x + CTK_CONF_MENUWIDTH > wherex()) { |
| 413 | cclear(x + CTK_CONF_MENUWIDTH - wherex()); |
| 414 | } |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 415 | } |
| 416 | gotoxy(x2, 0); |
oliverschmidt | 57d90a1 | 2004-07-29 11:50:24 +0000 | [diff] [blame^] | 417 | revers(1); |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 418 | } |
| 419 | /*-----------------------------------------------------------------------------------*/ |
| 420 | void |
| 421 | ctk_draw_menus(struct ctk_menus *menus) |
| 422 | { |
| 423 | struct ctk_menu *m; |
| 424 | |
| 425 | /* Draw menus */ |
| 426 | gotoxy(0, 0); |
| 427 | revers(1); |
| 428 | cputc(' '); |
| 429 | for(m = menus->menus->next; m != NULL; m = m->next) { |
| 430 | if(m != menus->open) { |
| 431 | cputs(m->title); |
| 432 | cputc(' '); |
| 433 | } else { |
| 434 | draw_menu(m); |
| 435 | } |
| 436 | } |
| 437 | |
oliverschmidt | 5867b67 | 2004-07-12 21:35:20 +0000 | [diff] [blame] | 438 | if(wherex() + strlen(menus->desktopmenu->title) + 1>= 80) { |
| 439 | gotoxy(80 - strlen(menus->desktopmenu->title) - 1, 0); |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 440 | } else { |
oliverschmidt | 5867b67 | 2004-07-12 21:35:20 +0000 | [diff] [blame] | 441 | cclear(80 - wherex() - |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 442 | strlen(menus->desktopmenu->title) - 1); |
| 443 | } |
| 444 | |
| 445 | /* Draw desktopmenu */ |
| 446 | if(menus->desktopmenu != menus->open) { |
| 447 | cputs(menus->desktopmenu->title); |
| 448 | cputc(' '); |
| 449 | } else { |
| 450 | draw_menu(menus->desktopmenu); |
| 451 | } |
| 452 | |
| 453 | revers(0); |
| 454 | } |
| 455 | /*-----------------------------------------------------------------------------------*/ |
| 456 | unsigned char |
| 457 | ctk_draw_height(void) |
| 458 | { |
oliverschmidt | 5867b67 | 2004-07-12 21:35:20 +0000 | [diff] [blame] | 459 | return 24; |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 460 | } |
| 461 | /*-----------------------------------------------------------------------------------*/ |
| 462 | unsigned char |
| 463 | ctk_draw_width(void) |
| 464 | { |
oliverschmidt | 5867b67 | 2004-07-12 21:35:20 +0000 | [diff] [blame] | 465 | return 80; |
oliverschmidt | 19032c6 | 2004-06-14 22:30:32 +0000 | [diff] [blame] | 466 | } |
| 467 | /*-----------------------------------------------------------------------------------*/ |
oliverschmidt | 9e652ff | 2004-07-11 12:24:52 +0000 | [diff] [blame] | 468 | int |
| 469 | ctk_arch_isprint(char c) |
| 470 | { |
| 471 | return isprint(c); |
| 472 | } |