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