GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-bea8435a9e
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 contributor)
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, x - half_point_size, y - half_point_size, point_size,
56  point_size);
57  cairo_fill(cairo);
58  ca.modified = 1;
59 }
void Cairo_Begin(void)
void Cairo_Close(void)
void Cairo_Stroke(void)
void Cairo_Cont(double x, double y)
void Cairo_Fill(void)
void Cairo_Move(double x, double y)
void Cairo_Point(double x, double y)
GRASS cairo display driver - header file.
struct cairo_state ca
cairo_t * cairo
#define x