GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
driver.h
Go to the documentation of this file.
1 
2 #ifndef _DRIVER_H
3 #define _DRIVER_H
4 
5 #include <grass/fontcap.h>
6 
7 extern int screen_width;
8 extern int screen_height;
9 
10 extern double cur_x;
11 extern double cur_y;
12 
13 extern double text_size_x;
14 extern double text_size_y;
15 extern double text_rotation;
16 extern double text_sinrot;
17 extern double text_cosrot;
18 extern int matrix_valid;
19 
20 extern struct GFONT_CAP *ftcap;
21 
22 struct driver
23 {
24  char *name;
25 
26  void (*Box)(double, double, double, double);
27  void (*Erase)(void);
28  int (*Graph_set)(void);
29  void (*Graph_close)(void);
30  const char * (*Graph_get_file)(void);
31  void (*Line_width)(double);
32  void (*Set_window)(double, double, double, double);
33  void (*Begin_raster)(int, int[2][2], double[2][2]);
34  int (*Raster)(int, int,
35  const unsigned char *,
36  const unsigned char *,
37  const unsigned char *,
38  const unsigned char *);
39  void (*End_raster)(void);
40  void (*Begin)(void);
41  void (*Move)(double, double);
42  void (*Cont)(double, double);
43  void (*Close)(void);
44  void (*Stroke)(void);
45  void (*Fill)(void);
46  void (*Point)(double, double);
47 
48  void (*Color)(int, int, int);
49  void (*Bitmap)(int, int, int, const unsigned char *);
50  void (*Text)(const char *);
51  void (*Text_box)(const char *, double *, double *, double *, double *);
52  void (*Set_font)(const char *);
53  void (*Font_list)(char ***, int *);
54  void (*Font_info)(char ***, int *);
55 };
56 
57 /* Library Functions */
58 
59 /* init.c */
60 extern void LIB_init(const struct driver *drv);
61 
62 /* Commands */
63 
64 /* box.c */
65 extern void COM_Box_abs(double, double, double, double);
66 
67 /* color.c */
68 extern void COM_Color_RGB(unsigned char, unsigned char, unsigned char);
69 extern void COM_Standard_color(int);
70 
71 /* erase.c */
72 extern void COM_Erase(void);
73 
74 /* font.c */
75 extern void COM_Set_font(const char *);
76 extern void COM_Set_encoding(const char *);
77 extern void COM_Font_list(char ***, int *);
78 extern void COM_Font_info(char ***, int *);
79 
80 /* get_t_box.c */
81 extern void COM_Get_text_box(const char *, double *, double *, double *, double *);
82 
83 /* graph.c */
84 extern int COM_Graph_set(void);
85 extern void COM_Graph_close(void);
86 extern const char *COM_Graph_get_file(void);
87 
88 /* line_width.c */
89 extern void COM_Line_width(double);
90 
91 /* move.c */
92 extern void COM_Pos_abs(double, double);
93 
94 /* raster.c */
95 extern void COM_begin_raster(int, int[2][2], double[2][2]);
96 extern int COM_raster(int, int, const unsigned char *,
97  const unsigned char *, const unsigned char *,
98  const unsigned char *);
99 extern void COM_end_raster(void);
100 
101 /* set_window.c */
102 extern void COM_Set_window(double, double, double, double);
103 extern void COM_Get_window(double *, double *, double *, double *);
104 
105 /* text.c */
106 extern void COM_Text(const char *);
107 
108 /* text_size.c */
109 extern void COM_Text_size(double, double);
110 extern void COM_Text_rotation(double);
111 
112 /* Driver Operations */
113 
114 /* draw.c */
115 extern void COM_Bitmap(int, int, int, const unsigned char *);
116 extern void COM_Begin(void);
117 extern void COM_Move(double, double);
118 extern void COM_Cont(double, double);
119 extern void COM_Close(void);
120 extern void COM_Stroke(void);
121 extern void COM_Fill(void);
122 extern void COM_Point(double, double);
123 
124 #endif /* _DRIVER_H */
void(* Fill)(void)
Definition: driver.h:45
void COM_Line_width(double)
char * name
Definition: driver.h:24
double text_size_y
Definition: driver/init.c:36
void(* Stroke)(void)
Definition: driver.h:44
int(* Graph_set)(void)
Definition: driver.h:28
void(* Line_width)(double)
Definition: driver.h:31
int(* Raster)(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
Definition: driver.h:34
double cur_y
Definition: driver/init.c:33
void(* Begin_raster)(int, int[2][2], double[2][2])
Definition: driver.h:33
void COM_Graph_close(void)
Definition: driver/graph.c:12
const char * COM_Graph_get_file(void)
Definition: driver/graph.c:18
double cur_x
Definition: driver/init.c:32
void COM_Set_window(double, double, double, double)
void COM_Begin(void)
Definition: driver/draw.c:11
void COM_Fill(void)
Definition: driver/draw.c:41
void COM_Move(double, double)
Definition: driver/draw.c:17
int screen_width
Definition: driver/init.c:29
int screen_height
Definition: driver/init.c:30
void COM_Set_font(const char *)
Definition: font.c:85
double text_sinrot
Definition: driver/init.c:38
void(* Begin)(void)
Definition: driver.h:40
void(* Color)(int, int, int)
Definition: driver.h:48
void(* Set_window)(double, double, double, double)
Definition: driver.h:32
struct GFONT_CAP * ftcap
Definition: driver/init.c:27
void LIB_init(const struct driver *drv)
Initialize display driver.
Definition: driver/init.c:47
void COM_Stroke(void)
Definition: driver/draw.c:35
void(* Graph_close)(void)
Definition: driver.h:29
double text_rotation
Definition: driver/init.c:37
void(* Move)(double, double)
Definition: driver.h:41
void COM_Text(const char *)
Definition: driver/text.c:4
void COM_Point(double, double)
Definition: driver/draw.c:47
void COM_Box_abs(double, double, double, double)
Definition: driver/box.c:4
double text_size_x
Definition: driver/init.c:35
int COM_Graph_set(void)
Definition: driver/graph.c:5
void COM_Get_window(double *, double *, double *, double *)
void COM_begin_raster(int, int[2][2], double[2][2])
Definition: driver/raster.c:13
void(* Text)(const char *)
Definition: driver.h:50
void COM_Font_list(char ***, int *)
Definition: font.c:149
void COM_Set_encoding(const char *)
Definition: font.c:141
void COM_Text_rotation(double)
Definition: text_size.c:12
void COM_Text_size(double, double)
Definition: text_size.c:5
void COM_Cont(double, double)
Definition: driver/draw.c:23
int matrix_valid
Definition: driver/init.c:40
void COM_Bitmap(int, int, int, const unsigned char *)
Definition: driver/draw.c:4
void(* Box)(double, double, double, double)
Definition: driver.h:26
int COM_raster(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
Definition: driver/raster.c:19
void COM_Font_info(char ***, int *)
Definition: font.c:156
void(* Font_list)(char ***, int *)
Definition: driver.h:53
void(* End_raster)(void)
Definition: driver.h:39
void(* Text_box)(const char *, double *, double *, double *, double *)
Definition: driver.h:51
Definition: driver.h:22
void COM_Standard_color(int)
Definition: driver/color.c:11
void(* Font_info)(char ***, int *)
Definition: driver.h:54
void(* Close)(void)
Definition: driver.h:43
void COM_Color_RGB(unsigned char, unsigned char, unsigned char)
Definition: driver/color.c:5
Definition: lidar.h:77
void COM_Erase(void)
Definition: driver/erase.c:4
void COM_Close(void)
Definition: driver/draw.c:29
void COM_Pos_abs(double, double)
Definition: driver/move.c:4
void(* Bitmap)(int, int, int, const unsigned char *)
Definition: driver.h:49
void(* Set_font)(const char *)
Definition: driver.h:52
void(* Cont)(double, double)
Definition: driver.h:42
void COM_end_raster(void)
Definition: driver/raster.c:29
double text_cosrot
Definition: driver/init.c:39
void COM_Get_text_box(const char *, double *, double *, double *, double *)
Definition: get_t_box.c:4
void(* Erase)(void)
Definition: driver.h:27