292 |
ira |
1 |
/*******************************************************************************
|
|
|
2 |
* draw.h - include file for libggi-based drawing on the GNU/Linux framebuffer.
|
|
|
3 |
*
|
|
|
4 |
* Copyright (c) 2006, Ira W. Snyder (devel@irasnyder.com)
|
317 |
ira |
5 |
*
|
|
|
6 |
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
7 |
* of this software and associated documentation files (the "Software"), to
|
|
|
8 |
* deal in the Software without restriction, including without limitation the
|
|
|
9 |
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
10 |
* sell copies of the Software, and to permit persons to whom the Software is
|
|
|
11 |
* furnished to do so, subject to the following conditions:
|
|
|
12 |
*
|
|
|
13 |
* The above copyright notice and this permission notice shall be included in
|
|
|
14 |
* all copies or substantial portions of the Software.
|
|
|
15 |
*
|
|
|
16 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
17 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
18 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
19 |
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
20 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
21 |
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
|
22 |
* IN THE SOFTWARE.
|
|
|
23 |
*
|
292 |
ira |
24 |
******************************************************************************/
|
|
|
25 |
|
|
|
26 |
#ifndef DRAW_H
|
|
|
27 |
#define DRAW_H
|
|
|
28 |
|
|
|
29 |
#include <ggi/ggi.h>
|
|
|
30 |
|
312 |
ira |
31 |
#ifdef __cplusplus
|
|
|
32 |
extern "C"
|
|
|
33 |
{
|
|
|
34 |
#endif
|
|
|
35 |
|
292 |
ira |
36 |
/* Colors */
|
311 |
ira |
37 |
#define BLACK 0
|
|
|
38 |
#define AQUA 1
|
296 |
ira |
39 |
#define BLUE 2
|
|
|
40 |
#define FUCHSIA 3
|
|
|
41 |
#define GRAY 4
|
|
|
42 |
#define GREEN 5
|
|
|
43 |
#define LIME 6
|
|
|
44 |
#define MAROON 7
|
|
|
45 |
#define NAVY 8
|
|
|
46 |
#define OLIVE 9
|
|
|
47 |
#define PURPLE 10
|
|
|
48 |
#define RED 11
|
|
|
49 |
#define SILVER 12
|
|
|
50 |
#define TEAL 13
|
|
|
51 |
#define WHITE 14
|
|
|
52 |
#define YELLOW 15
|
|
|
53 |
#define NUM_COLORS 16
|
292 |
ira |
54 |
|
|
|
55 |
static ggi_visual_t vis;
|
296 |
ira |
56 |
static ggi_color palette[NUM_COLORS];
|
292 |
ira |
57 |
|
|
|
58 |
/* Setup functions */
|
|
|
59 |
extern void draw_init ();
|
|
|
60 |
extern void draw_close ();
|
|
|
61 |
|
|
|
62 |
/* Drawing functions */
|
|
|
63 |
extern void draw_clearscreen ();
|
|
|
64 |
extern void draw_putpixel (int x, int y, int color);
|
|
|
65 |
extern void draw_box (int x, int y, int width, int height, int color);
|
|
|
66 |
extern void draw_line (int x1, int y1, int x2, int y2, int color);
|
295 |
ira |
67 |
extern void draw_putc (int x, int y, char c, int color);
|
|
|
68 |
extern void draw_puts (int x, int y, const char *str, int color);
|
292 |
ira |
69 |
|
312 |
ira |
70 |
#ifdef __cplusplus
|
|
|
71 |
}
|
292 |
ira |
72 |
#endif
|
|
|
73 |
|
312 |
ira |
74 |
#endif
|
|
|
75 |
|