adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +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. |
adamdunkels | 06f897e | 2004-06-06 05:59:20 +0000 | [diff] [blame] | 14 | * 3. The name of the author may not be used to endorse or promote |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 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 Contiki desktop environment |
| 31 | * |
adamdunkels | 06f897e | 2004-06-06 05:59:20 +0000 | [diff] [blame] | 32 | * $Id: libconio.h,v 1.5 2004/06/06 06:09:14 adamdunkels Exp $ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 33 | * |
| 34 | */ |
| 35 | |
| 36 | #ifndef __LIBCONIO_H__ |
| 37 | #define __LIBCONIO_H__ |
| 38 | |
adamdunkels | a0de328 | 2003-04-15 21:23:08 +0000 | [diff] [blame] | 39 | #include "libconio-conf.h" |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 40 | |
adamdunkels | fbdeea6 | 2003-07-04 12:18:08 +0000 | [diff] [blame] | 41 | /* This function must be implemented specifically for the |
| 42 | architecure: */ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 43 | void ctk_arch_draw_char(char c, |
| 44 | unsigned char xpos, |
| 45 | unsigned char ypos, |
adamdunkels | fbdeea6 | 2003-07-04 12:18:08 +0000 | [diff] [blame] | 46 | unsigned char reversedflag, |
| 47 | unsigned char color); |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 48 | |
| 49 | /* Default definitions that should be overridden by calling module. */ |
adamdunkels | a0de328 | 2003-04-15 21:23:08 +0000 | [diff] [blame] | 50 | #ifndef LIBCONIO_CONF_SCREEN_WIDTH |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 51 | #define LIBCONIO_SCREEN_WIDTH 40 |
adamdunkels | a0de328 | 2003-04-15 21:23:08 +0000 | [diff] [blame] | 52 | #else |
| 53 | #define LIBCONIO_SCREEN_WIDTH LIBCONIO_CONF_SCREEN_WIDTH |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 54 | #endif /* LIBCONIO_SCREEN_WIDTH */ |
| 55 | |
adamdunkels | a0de328 | 2003-04-15 21:23:08 +0000 | [diff] [blame] | 56 | #ifndef LIBCONIO_CONF_SCREEN_HEIGHT |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 57 | #define LIBCONIO_SCREEN_HEIGHT 25 |
adamdunkels | a0de328 | 2003-04-15 21:23:08 +0000 | [diff] [blame] | 58 | #else |
| 59 | #define LIBCONIO_SCREEN_HEIGHT LIBCONIO_CONF_SCREEN_HEIGHT |
| 60 | #endif /* LIBCONIO_CONF_SCREEN_HEIGHT */ |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 61 | |
| 62 | |
| 63 | |
| 64 | /* These are function declarations for functions implemented in libconio.c */ |
| 65 | unsigned char wherex(void); |
adamdunkels | b732686 | 2003-04-05 12:21:13 +0000 | [diff] [blame] | 66 | unsigned char wherey(void); |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 67 | void clrscr(void); |
adamdunkels | b732686 | 2003-04-05 12:21:13 +0000 | [diff] [blame] | 68 | void bgcolor(unsigned char c); |
| 69 | void bordercolor(unsigned char c); |
| 70 | void screensize(unsigned char *x, unsigned char *y); |
adamdunkels | ca9ddcb | 2003-03-19 14:13:31 +0000 | [diff] [blame] | 71 | void revers(unsigned char c); |
| 72 | void cputc(char c); |
| 73 | void cputs(char *str); |
| 74 | void cclear(unsigned char length); |
| 75 | void chline(unsigned char length); |
| 76 | void cvline(unsigned char length); |
| 77 | void gotoxy(unsigned char x, unsigned char y); |
| 78 | void cclearxy(unsigned char x, unsigned char y, unsigned char length); |
| 79 | void chlinexy(unsigned char x, unsigned char y, unsigned char length); |
| 80 | void cvlinexy(unsigned char x, unsigned char y, unsigned char length); |
| 81 | void cputsxy(unsigned char x, unsigned char y, char *str); |
| 82 | void cputcxy(unsigned char x, unsigned char y, char c); |
| 83 | void textcolor(unsigned char c); |
| 84 | |
| 85 | |
| 86 | |
| 87 | #endif /* __LIBCONIO_H__ */ |