GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-36359e2344
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 contributor)
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 Cairo_Box(double x1, double y1, double x2, double y2)
Draw a (filled) rectangle.
const struct driver * Cairo_Driver(void)
Initialize display driver.
GRASS cairo display driver - header file.
void Cairo_Point(double, double)
void Cairo_Color(int, int, int)
Set source color (opaque)
void Cairo_Begin(void)
void Cairo_Erase(void)
Erase screen.
void Cairo_Move(double, double)
void Cairo_Close(void)
void Cairo_Stroke(void)
int Cairo_raster(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
Draw raster row.
void Cairo_Fill(void)
void Cairo_font_info(char ***, int *)
Get fonts into.
void Cairo_Line_width(double)
Set line width.
void Cairo_font_list(char ***, int *)
Get list of fonts.
void Cairo_Cont(double, double)
void Cairo_end_raster(void)
Finish drawing raster.
const char * Cairo_Graph_get_file(void)
Get render file.
void Cairo_set_font(const char *)
Set font.
int Cairo_Graph_set(void)
Initialize driver.
void Cairo_Graph_close(void)
Close driver.
void Cairo_Text(const char *)
Draw text.
void Cairo_begin_raster(int, int[2][2], double[2][2])
Start drawing raster.
void Cairo_Bitmap(int, int, int, const unsigned char *)
Draw bitmap.
void Cairo_Set_window(double, double, double, double)
Set window.
void Cairo_text_box(const char *, double *, double *, double *, double *)
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(* Point)(double, double)
Definition: driver.h:41
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
const char *(* Graph_get_file)(void)
Definition: driver.h:28
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