1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
#include "aconfig.h"
#ifdef TEMPLATE_DRIVER
/*includes */
#include <ui.h>
static int template_set_color(int r, int g, int b, int init)
{
return ( /*pixel value or -1 for full palette */ -1);
}
static void template_setpalette(ui_palette pal, int start, int end)
{
}
static void template_print(int x, int y, CONST char *text)
{
}
static void template_display()
{
}
static void template_flip_buffers()
{
}
void template_free_buffers(char *b1, char *b2)
{
}
int template_alloc_buffers(char **b1, char **b2)
{
return 1; /* bytes per scanline */
}
static void template_getsize(int *w, int *h)
{
}
static void
template_processevents(int wait, int *mx, int *my, int *mb, int *k)
{
}
static int template_init()
{
return ( /*1 for sucess 0 for fail */ 1);
}
static void template_uninitialise()
{
}
static void template_getmouse(int *x, int *y, int *b)
{
}
static void template_mousetype(int type)
{
}
static struct params params[] = {
{"", P_HELP, NULL, "Template driver options:"},
{"-flag", P_SWITCH, &variable, "Example flag..."},
{NULL, 0, NULL, NULL}
};
struct ui_driver template_driver = {
"Template",
template_init,
template_getsize,
template_processevents,
template_getmouse,
template_uninitialise,
template_set_color, /*You should implement just one */
template_set_palette, /*of these and add NULL as second */
template_print,
template_display,
template_alloc_buffers,
template_free_buffers,
template_flip_buffers,
template_mousetype, /*This should be NULL */
NULL, /*flush */
8, /*text width */
8, /*text height */
UGLYTEXTSIZE,
params,
0, /*flags...see ui.h */
0.0, 0.0, /*width/height of screen in centimeters */
0, 0, /*resolution of screen for windowed systems */
UI_C256, /*Image type */
0, 255, 255 /*start, end of palette and maximum allocatable */
/*entries */
};
/* DONT FORGET TO ADD DOCUMENTATION ABOUT YOUR DRIVER INTO xaos.hlp FILE!*/
#endif
|