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