GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
cairodriver/driver.c
Go to the documentation of this file.
1 /*!
2  \file lib/cairodriver/driver.c
3 
4  \brief GRASS cairo display driver - driver initialization
5 
6  (C) 2007-2014 by Lars Ahlzen and the GRASS Development Team
7 
8  This program is free software under the GNU General Public License
9  (>=v2). Read the file COPYING that comes with GRASS for details.
10 
11  \author Lars Ahlzen <lars ahlzen.com> (original contibutor)
12  \author Glynn Clements
13 */
14 
15 #include "cairodriver.h"
16 
17 /*!
18  \brief Initialize display driver
19 
20  \return pointer driver structure
21 */
22 const struct driver *Cairo_Driver(void)
23 {
24  static struct driver drv;
25  static int initialized;
26 
27  if (initialized)
28  return &drv;
29 
30  drv.name = "cairo";
31  drv.Box = Cairo_Box;
32  drv.Erase = Cairo_Erase;
39  drv.Raster = Cairo_raster;
41  drv.Begin = Cairo_Begin;
42  drv.Move = Cairo_Move;
43  drv.Cont = Cairo_Cont;
44  drv.Close = Cairo_Close;
45  drv.Stroke = Cairo_Stroke;
46  drv.Fill = Cairo_Fill;
47  drv.Point = Cairo_Point;
48  drv.Color = Cairo_Color;
49  drv.Bitmap = Cairo_Bitmap;
50  drv.Text = Cairo_Text;
55 
56  initialized = 1;
57 
58  return &drv;
59 }
void(* Fill)(void)
Definition: driver.h:45
char * name
Definition: driver.h:24
void Cairo_Color(int, int, int)
Set source color (opaque)
void(* Stroke)(void)
Definition: driver.h:44
int(* Graph_set)(void)
Definition: driver.h:28
void Cairo_begin_raster(int, int[2][2], double[2][2])
Start drawing raster.
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
void Cairo_Bitmap(int, int, int, const unsigned char *)
Draw bitmap.
const char * Cairo_Graph_get_file(void)
Get render file.
void(* Begin_raster)(int, int[2][2], double[2][2])
Definition: driver.h:33
void Cairo_Graph_close(void)
Close driver.
void Cairo_Text(const char *)
Draw text.
void(* Begin)(void)
Definition: driver.h:40
void Cairo_Box(double x1, double y1, double x2, double y2)
Draw a (filled) rectangle.
void(* Color)(int, int, int)
Definition: driver.h:48
void(* Set_window)(double, double, double, double)
Definition: driver.h:32
void Cairo_Set_window(double, double, double, double)
Set window.
void Cairo_Close(void)
void(* Graph_close)(void)
Definition: driver.h:29
void(* Move)(double, double)
Definition: driver.h:41
int Cairo_Graph_set(void)
Initialize driver.
void Cairo_Begin(void)
void Cairo_Fill(void)
void Cairo_font_info(char ***, int *)
Get fonts into.
void(* Text)(const char *)
Definition: driver.h:50
void Cairo_set_font(const char *)
Set font.
int Cairo_raster(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
Draw raster row.
GRASS cairo display driver - header file.
void(* Box)(double, double, double, double)
Definition: driver.h:26
void(* Font_list)(char ***, int *)
Definition: driver.h:53
const char *(* Graph_get_file)(void)
Definition: driver.h:30
void Cairo_font_list(char ***, int *)
Get list of fonts.
void(* End_raster)(void)
Definition: driver.h:39
void(* Text_box)(const char *, double *, double *, double *, double *)
Definition: driver.h:51
void Cairo_Line_width(double)
Set line width.
void(* Point)(double, double)
Definition: driver.h:46
Definition: driver.h:22
void(* Font_info)(char ***, int *)
Definition: driver.h:54
void(* Close)(void)
Definition: driver.h:43
void Cairo_end_raster(void)
Finish drawing raster.
void Cairo_Move(double, double)
void Cairo_Cont(double, double)
void Cairo_Erase(void)
Erase screen.
void(* Bitmap)(int, int, int, const unsigned char *)
Definition: driver.h:49
void(* Set_font)(const char *)
Definition: driver.h:52
void Cairo_Point(double, double)
void Cairo_Stroke(void)
void Cairo_text_box(const char *, double *, double *, double *, double *)
const struct driver * Cairo_Driver(void)
Initialize display driver.
void(* Cont)(double, double)
Definition: driver.h:42
void(* Erase)(void)
Definition: driver.h:27