GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r73120
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
struct cairo_state ca
void Cairo_Close(void)
#define x
void Cairo_Begin(void)
void Cairo_Fill(void)
cairo_t * cairo
GRASS cairo display driver - header file.
void Cairo_Move(double, double)
void Cairo_Cont(double, double)
void Cairo_Point(double, double)
void Cairo_Stroke(void)