GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
cairodriver/draw.c
Go to the documentation of this file.
1 /*!
2  \file lib/cairodriver/draw.c
3 
4  \brief GRASS cairo display driver
5 
6  (C) 2007-2008 by Lars Ahlzen, Glynn Clements 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 void Cairo_Begin(void)
18 {
19  cairo_new_path(cairo);
20 }
21 
22 void Cairo_Move(double x, double y)
23 {
24  cairo_move_to(cairo, x, y);
25 }
26 
27 void Cairo_Cont(double x, double y)
28 {
29  cairo_line_to(cairo, x, y);
30 }
31 
32 void Cairo_Close(void)
33 {
34  cairo_close_path(cairo);
35 }
36 
37 void Cairo_Stroke(void)
38 {
39  cairo_stroke(cairo);
40  ca.modified = 1;
41 }
42 
43 void Cairo_Fill(void)
44 {
45  cairo_fill(cairo);
46  ca.modified = 1;
47 }
48 
49 void Cairo_Point(double x, double y)
50 {
51  static double point_size = 1.0;
52  double half_point_size = point_size / 2;
53 
54  cairo_new_path(cairo);
55  cairo_rectangle(cairo,
56  x - half_point_size, y - half_point_size,
57  point_size, point_size);
58  cairo_fill(cairo);
59  ca.modified = 1;
60 }
61 
void Cairo_Begin(void)
void Cairo_Point(double x, double y)
struct cairo_state ca
#define x
void Cairo_Cont(double x, double y)
cairo_t * cairo
GRASS cairo display driver - header file.
void Cairo_Move(double x, double y)
void Cairo_Fill(void)
void Cairo_Close(void)
void Cairo_Stroke(void)