GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r72990
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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(* Font_info)(char ***, int *)
Definition: driver.h:54
char * name
Definition: driver.h:24
void(* Fill)(void)
Definition: driver.h:45
void Cairo_Color(int, int, int)
Set source color (opaque)
void(* Move)(double, double)
Definition: driver.h:41
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.
const char * Cairo_Graph_get_file(void)
Get render file.
void(* Erase)(void)
Definition: driver.h:27
void Cairo_Graph_close(void)
Close driver.
void(* Font_list)(char ***, int *)
Definition: driver.h:53
void(* Stroke)(void)
Definition: driver.h:44
void(* Text_box)(const char *, double *, double *, double *, double *)
Definition: driver.h:51
void(* Color)(int, int, int)
Definition: driver.h:48
void(* Begin)(void)
Definition: driver.h:40
void Cairo_Text(const char *)
Draw text.
void Cairo_Box(double x1, double y1, double x2, double y2)
Draw a (filled) rectangle.
void Cairo_Set_window(double, double, double, double)
Set window.
void Cairo_Close(void)
void(* End_raster)(void)
Definition: driver.h:39
int Cairo_Graph_set(void)
Initialize driver.
void Cairo_Begin(void)
int(* Graph_set)(void)
Definition: driver.h:28
const char *(* Graph_get_file)(void)
Definition: driver.h:30
void Cairo_Fill(void)
void Cairo_font_info(char ***, int *)
Get fonts into.
void(* Point)(double, double)
Definition: driver.h:46
void(* Begin_raster)(int, int[2][2], double[2][2])
Definition: driver.h:33
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(* Set_font)(const char *)
Definition: driver.h:52
void(* Cont)(double, double)
Definition: driver.h:42
void(* Line_width)(double)
Definition: driver.h:31
void(* Set_window)(double, double, double, double)
Definition: driver.h:32
void Cairo_font_list(char ***, int *)
Get list of fonts.
void Cairo_Line_width(double)
Set line width.
int(* Raster)(int, int, const unsigned char *, const unsigned char *, const unsigned char *, const unsigned char *)
Definition: driver.h:34
void(* Text)(const char *)
Definition: driver.h:50
Definition: driver.h:22
void Cairo_end_raster(void)
Finish drawing raster.
void(* Box)(double, double, double, double)
Definition: driver.h:26
void Cairo_Move(double, double)
void(* Close)(void)
Definition: driver.h:43
void Cairo_Cont(double, double)
void Cairo_Erase(void)
Erase screen.
struct driver * Cairo_Driver(void)
Initialize display driver.
void Cairo_Point(double, double)
void Cairo_Stroke(void)
void Cairo_text_box(const char *, double *, double *, double *, double *)
void(* Bitmap)(int, int, int, const unsigned char *)
Definition: driver.h:49
void(* Graph_close)(void)
Definition: driver.h:29