1 | /* |
---|
2 | * libee ASCII-Art library |
---|
3 | * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org> |
---|
4 | * All Rights Reserved |
---|
5 | * |
---|
6 | * $Id: ee.h 104 2003-11-09 19:46:14Z sam $ |
---|
7 | * |
---|
8 | * This program is free software; you can redistribute it and/or modify |
---|
9 | * it under the terms of the GNU General Public License as published by |
---|
10 | * the Free Software Foundation; either version 2 of the License, or |
---|
11 | * (at your option) any later version. |
---|
12 | * |
---|
13 | * This program is distributed in the hope that it will be useful, |
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | * GNU General Public License for more details. |
---|
17 | * |
---|
18 | * You should have received a copy of the GNU General Public License |
---|
19 | * along with this program; if not, write to the Free Software |
---|
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
21 | */ |
---|
22 | |
---|
23 | /* |
---|
24 | * Graphics primitives |
---|
25 | */ |
---|
26 | #ifdef USE_SLANG |
---|
27 | # include <slang.h> |
---|
28 | # define ee_color(x) SLsmg_set_color(x) |
---|
29 | # define ee_goto(x,y) SLsmg_gotorc(y,x) |
---|
30 | # define ee_putchar(x) SLsmg_write_char(x) |
---|
31 | # define ee_putstr(x) SLsmg_write_string(x) |
---|
32 | #elif USE_NCURSES |
---|
33 | # define box box_divert |
---|
34 | # include <curses.h> |
---|
35 | # undef box |
---|
36 | # define ee_color(x) attrset(COLOR_PAIR(x)) |
---|
37 | # define ee_goto(x,y) move(y,x) |
---|
38 | # define ee_putchar(x) addch(x) |
---|
39 | # define ee_putstr(x) addstr(x) |
---|
40 | #else |
---|
41 | # define ee_color(x) (void)(x) |
---|
42 | # define ee_goto(x,y) do{ (void)(x); (void)(y); } while(0) |
---|
43 | # define ee_putchar(x) (void)(x) |
---|
44 | # define ee_putstr(x) (void)(x) |
---|
45 | #endif |
---|
46 | |
---|
47 | #define ee_putcharTO(x,y,c) do{ ee_goto(x,y); ee_putchar(c); }while(0) |
---|
48 | |
---|
49 | /* |
---|
50 | * Colours |
---|
51 | */ |
---|
52 | #define EE_BLACK 1 |
---|
53 | #define EE_GREEN 2 |
---|
54 | #define EE_YELLOW 3 |
---|
55 | #define EE_WHITE 4 |
---|
56 | #define EE_RED 5 |
---|
57 | #define EE_GRAY 6 |
---|
58 | #define EE_LIGHTGRAY 7 |
---|
59 | #define EE_BLUE 8 |
---|
60 | #define EE_CYAN 9 |
---|
61 | #define EE_MAGENTA 10 |
---|
62 | |
---|
63 | /* |
---|
64 | * Prototypes |
---|
65 | */ |
---|
66 | int ee_init(void); |
---|
67 | void ee_set_delay(int); |
---|
68 | int ee_get_width(void); |
---|
69 | int ee_get_height(void); |
---|
70 | void ee_clear(void); |
---|
71 | void ee_refresh(void); |
---|
72 | void ee_end(void); |
---|
73 | |
---|
74 | char ee_get_key(void); |
---|
75 | |
---|
76 | void ee_draw_circle(int, int, int, char); |
---|
77 | void ee_draw_line(int, int, int, int, char); |
---|
78 | void ee_draw_thin_line(int, int, int, int); |
---|
79 | |
---|
80 | int ee_rand(int, int); |
---|
81 | int ee_sqrt(int); |
---|
82 | |
---|