GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
driver.h
Go to the documentation of this file.
1 
2 #ifndef _DRIVER_H
3 #define _DRIVER_H
4 
5 #include <grass/freetypecap.h>
6 
7 extern int NCOLORS;
8 
9 extern int screen_left;
10 extern int screen_right;
11 extern int screen_bottom;
12 extern int screen_top;
13 
14 extern int cur_x;
15 extern int cur_y;
16 
17 extern double text_size_x;
18 extern double text_size_y;
19 extern double text_rotation;
20 
21 extern int mouse_button[];
22 
23 extern struct GFONT_CAP *ftcap;
24 
25 struct driver
26 {
27  void (*Box_abs) (int, int, int, int);
28  void (*Box_rel) (int, int);
29  void (*Client_Open) (void);
30  void (*Client_Close) (void);
31  void (*Erase) (void);
32  int (*Get_with_box) (int, int, int *, int *, int *);
33  int (*Get_with_line) (int, int, int *, int *, int *);
34  int (*Get_with_pointer) (int *, int *, int *);
35  int (*Graph_set) (int, char **);
36  void (*Graph_close) (void);
37  void (*Line_width) (int);
38  void (*Panel_save) (const char *, int, int, int, int);
39  void (*Panel_restore) (const char *);
40  void (*Panel_delete) (const char *);
41  void (*Polydots_abs) (const int *, const int *, int);
42  void (*Polydots_rel) (const int *, const int *, int);
43  void (*Polyline_abs) (const int *, const int *, int);
44  void (*Polyline_rel) (const int *, const int *, int);
45  void (*Polygon_abs) (const int *, const int *, int);
46  void (*Polygon_rel) (const int *, const int *, int);
47  void (*Set_window) (int, int, int, int);
48  void (*Begin_scaled_raster) (int, int[2][2], int[2][2]);
50  const unsigned char *,
51  const unsigned char *,
52  const unsigned char *, const unsigned char *);
53  void (*End_scaled_raster) (void);
54  void (*Respond) (void);
55  int (*Work_stream) (void);
56  void (*Do_work) (int);
57 
59  void (*color) (int);
60  void (*draw_line) (int, int, int, int);
61  void (*draw_point) (int, int);
62  void (*draw_bitmap) (int, int, int, const unsigned char *);
63  void (*draw_text) (const char *);
64 };
65 
66 /* Library Functions */
67 
68 /* command.c */
69 extern int LIB_command_get_input(void);
70 
71 /* init.c */
72 extern int LIB_init(const struct driver *drv, int argc, char **argv);
73 
74 /* main.c */
75 extern int LIB_main(int argc, char **argv);
76 
77 /* Commands */
78 
79 /* Bitmap.c */
80 extern void COM_Bitmap(int, int, int, const unsigned char *);
81 
82 /* Box.c */
83 extern void COM_Box_abs(int, int, int, int);
84 extern void COM_Box_rel(int, int);
85 
86 /* Client.c */
87 extern void COM_Client_Open(void);
88 extern void COM_Client_Close(void);
89 
90 /* Color.c */
91 extern void COM_Color_RGB(unsigned char, unsigned char, unsigned char);
92 extern void COM_Standard_color(int);
93 
94 /* Cont.c */
95 extern void COM_Cont_abs(int, int);
96 extern void COM_Cont_rel(int, int);
97 
98 /* Erase.c */
99 extern void COM_Erase(void);
100 
101 /* Font.c */
102 extern void COM_Font_get(const char *);
103 extern void COM_Font_init_charset(const char *);
104 extern void COM_Font_list(char ***, int *);
105 extern void COM_Font_info(char ***, int *);
106 
107 /* Get_location.c */
108 extern int COM_Get_location_with_box(int, int, int *, int *, int *);
109 extern int COM_Get_location_with_line(int, int, int *, int *, int *);
110 extern int COM_Get_location_with_pointer(int *, int *, int *);
111 
112 /* Get_t_box.c */
113 extern void COM_Get_text_box(const char *, int *, int *, int *, int *);
114 
115 /* Graph.c */
116 extern int COM_Graph_set(int, char **);
117 extern void COM_Graph_close(void);
118 
119 /* Line_width.c */
120 extern void COM_Line_width(int);
121 
122 /* Move.c */
123 extern void COM_Move_abs(int, int);
124 extern void COM_Move_rel(int, int);
125 
126 /* Panel.c */
127 extern void COM_Panel_save(const char *, int, int, int, int);
128 extern void COM_Panel_restore(const char *);
129 extern void COM_Panel_delete(const char *);
130 
131 /* Polydots.c */
132 extern void COM_Polydots_abs(const int *, const int *, int);
133 extern void COM_Polydots_rel(const int *, const int *, int);
134 
135 /* Polygon.c */
136 extern void COM_Polygon_abs(const int *, const int *, int);
137 extern void COM_Polygon_rel(const int *, const int *, int);
138 
139 /* Polyline.c */
140 extern void COM_Polyline_abs(const int *, const int *, int);
141 extern void COM_Polyline_rel(const int *, const int *, int);
142 
143 /* Raster.c */
144 extern void COM_begin_scaled_raster(int, int[2][2], int[2][2]);
145 extern int COM_scaled_raster(int, int, const unsigned char *,
146  const unsigned char *, const unsigned char *,
147  const unsigned char *);
148 extern void COM_end_scaled_raster(void);
149 
150 /* Respond.c */
151 extern void COM_Respond(void);
152 
153 /* Returns.c */
154 extern void COM_Screen_left(int *);
155 extern void COM_Screen_rite(int *);
156 extern void COM_Screen_bot(int *);
157 extern void COM_Screen_top(int *);
158 extern void COM_Number_of_colors(int *);
159 
160 /* Set_window.c */
161 extern void COM_Set_window(int, int, int, int);
162 
163 /* Text.c */
164 extern void COM_Text(const char *);
165 
166 /* Text_size.c */
167 extern void COM_Text_size(int, int);
168 extern void COM_Text_rotation(double);
169 
170 /* Work.c */
171 extern int COM_Has_work(void);
172 extern int COM_Work_stream(void);
173 extern void COM_Do_work(int);
174 
175 /* Driver Operations */
176 
177 /* Color.c */
178 extern int DRV_lookup_color(int, int, int);
179 extern void DRV_color(int);
180 
181 /* Draw.c */
182 extern void DRV_draw_bitmap(int, int, int, const unsigned char *);
183 extern void DRV_draw_line(int x0, int y0, int x1, int y1);
184 extern void DRV_draw_point(int x, int y);
185 
186 #endif /* _DRIVER_H */
int cur_y
Definition: driver/init.c:38
double text_size_y
Definition: driver/init.c:41
int LIB_init(const struct driver *drv, int argc, char **argv)
Definition: driver/init.c:46
int COM_Has_work(void)
Definition: Work.c:4
int mouse_button[]
Definition: driver/init.c:44
void COM_Move_abs(int, int)
Definition: Move.c:4
int COM_Work_stream(void)
Definition: Work.c:9
void COM_Client_Open(void)
Definition: driver/Client.c:4
int COM_Get_location_with_box(int, int, int *, int *, int *)
Definition: Get_location.c:30
void COM_Do_work(int)
Definition: Work.c:15
void(* Erase)(void)
Definition: driver.h:31
void(* draw_line)(int, int, int, int)
Definition: driver.h:60
void COM_Panel_restore(const char *)
Definition: Panel.c:11
void COM_Graph_close(void)
Definition: driver/Graph.c:11
int(* Get_with_box)(int, int, int *, int *, int *)
Definition: driver.h:32
void DRV_draw_bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
Definition: Draw.c:5
void COM_Client_Close(void)
Definition: driver/Client.c:10
int(* Work_stream)(void)
Definition: driver.h:55
void(* Client_Open)(void)
Definition: driver.h:29
int COM_Get_location_with_pointer(int *, int *, int *)
Definition: Get_location.c:4
void(* Do_work)(int)
Definition: driver.h:56
int screen_top
Definition: driver/init.c:35
void COM_Polygon_abs(const int *, const int *, int)
void(* Respond)(void)
Definition: driver.h:54
void(* Box_abs)(int, int, int, int)
Definition: driver.h:27
void COM_Screen_rite(int *)
Definition: Returns.c:9
int(* Get_with_line)(int, int, int *, int *, int *)
Definition: driver.h:33
void(* draw_text)(const char *)
Definition: driver.h:63
void COM_Cont_rel(int x, int y)
Definition: Cont.c:11
void(* Box_rel)(int, int)
Definition: driver.h:28
void COM_begin_scaled_raster(int, int[2][2], int[2][2])
Definition: driver/Raster.c:13
void COM_Panel_save(const char *, int, int, int, int)
Definition: Panel.c:4
void COM_Polydots_rel(const int *, const int *, int)
Definition: Polydots.c:19
int y
Definition: plot.c:34
void(* draw_bitmap)(int, int, int, const unsigned char *)
Definition: driver.h:62
void COM_Screen_top(int *)
Definition: Returns.c:19
void COM_Move_rel(int, int)
Definition: Move.c:10
struct GFONT_CAP * ftcap
Definition: driver/init.c:28
void(* Line_width)(int)
Definition: driver.h:37
void(* Polygon_abs)(const int *, const int *, int)
Definition: driver.h:45
void COM_Polyline_abs(const int *, const int *, int)
void COM_Font_init_charset(const char *)
Definition: Font.c:52
double text_rotation
Definition: driver/init.c:42
void COM_Standard_color(int number)
Definition: driver/Color.c:24
void(* Panel_delete)(const char *)
Definition: driver.h:40
int screen_left
Definition: driver/init.c:32
void COM_Text(const char *)
Definition: Text.c:4
void COM_Screen_left(int *)
Definition: Returns.c:4
void(* Polyline_rel)(const int *, const int *, int)
Definition: driver.h:44
void COM_end_scaled_raster(void)
Definition: driver/Raster.c:29
void(* Polyline_abs)(const int *, const int *, int)
Definition: driver.h:43
int DRV_lookup_color(int r, int g, int b)
Definition: driver/Color.c:5
double text_size_x
Definition: driver/init.c:40
int(* Graph_set)(int, char **)
Definition: driver.h:35
void COM_Font_list(char ***, int *)
Definition: Font.c:94
int NCOLORS
Definition: driver/init.c:30
void DRV_draw_point(int x, int y)
Definition: Draw.c:18
int screen_right
Definition: driver/init.c:33
void COM_Text_rotation(double)
Definition: Text_size.c:10
void COM_Screen_bot(int *)
Definition: Returns.c:14
void(* Client_Close)(void)
Definition: driver.h:30
void(* color)(int)
Definition: driver.h:59
int COM_Graph_set(int, char **)
Definition: driver/Graph.c:4
void COM_Box_abs(int x1, int y1, int x2, int y2)
Definition: driver/Box.c:4
void COM_Box_rel(int x, int y)
Definition: driver/Box.c:25
int
Definition: g3dcolor.c:48
void COM_Polygon_rel(const int *, const int *, int)
void(* Polygon_rel)(const int *, const int *, int)
Definition: driver.h:46
void(* Begin_scaled_raster)(int, int[2][2], int[2][2])
Definition: driver.h:48
void DRV_draw_line(int x0, int y0, int x1, int y1)
Definition: Draw.c:12
int LIB_command_get_input(void)
Definition: command.c:93
int(* Get_with_pointer)(int *, int *, int *)
Definition: driver.h:34
void COM_Text_size(int, int)
Definition: Text_size.c:4
void COM_Font_info(char ***, int *)
Definition: Font.c:99
void COM_Panel_delete(const char *)
Definition: Panel.c:17
void DRV_color(int number)
Definition: driver/Color.c:12
void COM_Respond(void)
Definition: driver/Respond.c:5
void COM_Polyline_rel(const int *, const int *, int)
void(* End_scaled_raster)(void)
Definition: driver.h:53
void COM_Bitmap(int ncols, int nrows, int threshold, const unsigned char *buf)
Definition: Bitmap.c:4
void COM_Get_text_box(const char *, int *, int *, int *, int *)
Definition: Get_t_box.c:4
void COM_Line_width(int)
int cur_x
Definition: driver/init.c:37
Definition: driver.h:25
int(* Scaled_raster)(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
Definition: driver.h:49
void(* Set_window)(int, int, int, int)
Definition: driver.h:47
void(* draw_point)(int, int)
Definition: driver.h:61
int(* lookup_color)(int, int, int)
Definition: driver.h:58
int LIB_main(int argc, char **argv)
void COM_Cont_abs(int x, int y)
Definition: Cont.c:4
void COM_Number_of_colors(int *)
Definition: Returns.c:24
void COM_Erase(void)
Definition: driver/Erase.c:4
void(* Panel_restore)(const char *)
Definition: driver.h:39
void(* Panel_save)(const char *, int, int, int, int)
Definition: driver.h:38
int screen_bottom
Definition: driver/init.c:34
int COM_scaled_raster(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
Definition: driver/Raster.c:19
void(* Polydots_rel)(const int *, const int *, int)
Definition: driver.h:42
int COM_Get_location_with_line(int, int, int *, int *, int *)
Definition: Get_location.c:17
void(* Polydots_abs)(const int *, const int *, int)
Definition: driver.h:41
void COM_Color_RGB(unsigned char r, unsigned char g, unsigned char b)
Definition: driver/Color.c:19
void COM_Font_get(const char *)
Definition: Font.c:22
void(* Graph_close)(void)
Definition: driver.h:36
void COM_Polydots_abs(const int *, const int *, int)
Definition: Polydots.c:4
void COM_Set_window(int, int, int, int)