blob: cf9d4e3e1da6697957941c01472b4a121e47a99d [file] [log] [blame]
adamdunkelsca9ddcb2003-03-19 14:13:31 +00001/*
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.
adamdunkels06f897e2004-06-06 05:59:20 +000014 * 3. The name of the author may not be used to endorse or promote
adamdunkelsca9ddcb2003-03-19 14:13:31 +000015 * 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 *
adamdunkels06f897e2004-06-06 05:59:20 +000032 * $Id: libconio.h,v 1.5 2004/06/06 06:09:14 adamdunkels Exp $
adamdunkelsca9ddcb2003-03-19 14:13:31 +000033 *
34 */
35
36#ifndef __LIBCONIO_H__
37#define __LIBCONIO_H__
38
adamdunkelsa0de3282003-04-15 21:23:08 +000039#include "libconio-conf.h"
adamdunkelsca9ddcb2003-03-19 14:13:31 +000040
adamdunkelsfbdeea62003-07-04 12:18:08 +000041/* This function must be implemented specifically for the
42 architecure: */
adamdunkelsca9ddcb2003-03-19 14:13:31 +000043void ctk_arch_draw_char(char c,
44 unsigned char xpos,
45 unsigned char ypos,
adamdunkelsfbdeea62003-07-04 12:18:08 +000046 unsigned char reversedflag,
47 unsigned char color);
adamdunkelsca9ddcb2003-03-19 14:13:31 +000048
49/* Default definitions that should be overridden by calling module. */
adamdunkelsa0de3282003-04-15 21:23:08 +000050#ifndef LIBCONIO_CONF_SCREEN_WIDTH
adamdunkelsca9ddcb2003-03-19 14:13:31 +000051#define LIBCONIO_SCREEN_WIDTH 40
adamdunkelsa0de3282003-04-15 21:23:08 +000052#else
53#define LIBCONIO_SCREEN_WIDTH LIBCONIO_CONF_SCREEN_WIDTH
adamdunkelsca9ddcb2003-03-19 14:13:31 +000054#endif /* LIBCONIO_SCREEN_WIDTH */
55
adamdunkelsa0de3282003-04-15 21:23:08 +000056#ifndef LIBCONIO_CONF_SCREEN_HEIGHT
adamdunkelsca9ddcb2003-03-19 14:13:31 +000057#define LIBCONIO_SCREEN_HEIGHT 25
adamdunkelsa0de3282003-04-15 21:23:08 +000058#else
59#define LIBCONIO_SCREEN_HEIGHT LIBCONIO_CONF_SCREEN_HEIGHT
60#endif /* LIBCONIO_CONF_SCREEN_HEIGHT */
adamdunkelsca9ddcb2003-03-19 14:13:31 +000061
62
63
64/* These are function declarations for functions implemented in libconio.c */
65unsigned char wherex(void);
adamdunkelsb7326862003-04-05 12:21:13 +000066unsigned char wherey(void);
adamdunkelsca9ddcb2003-03-19 14:13:31 +000067void clrscr(void);
adamdunkelsb7326862003-04-05 12:21:13 +000068void bgcolor(unsigned char c);
69void bordercolor(unsigned char c);
70void screensize(unsigned char *x, unsigned char *y);
adamdunkelsca9ddcb2003-03-19 14:13:31 +000071void revers(unsigned char c);
72void cputc(char c);
73void cputs(char *str);
74void cclear(unsigned char length);
75void chline(unsigned char length);
76void cvline(unsigned char length);
77void gotoxy(unsigned char x, unsigned char y);
78void cclearxy(unsigned char x, unsigned char y, unsigned char length);
79void chlinexy(unsigned char x, unsigned char y, unsigned char length);
80void cvlinexy(unsigned char x, unsigned char y, unsigned char length);
81void cputsxy(unsigned char x, unsigned char y, char *str);
82void cputcxy(unsigned char x, unsigned char y, char c);
83void textcolor(unsigned char c);
84
85
86
87#endif /* __LIBCONIO_H__ */