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