1 /*
2  * gog-marker.h
3  *
4  * Copyright (C) 2003-2007 Emmanuel Pacaud <emmanuel.pacaud@lapp.in2p3.fr>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) version 3.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
19  * USA
20  */
21 
22 #ifndef GO_MARKER_H
23 #define GO_MARKER_H
24 
25 #include <goffice/goffice.h>
26 
27 G_BEGIN_DECLS
28 
29 #define GO_TYPE_MARKER	  	(go_marker_get_type ())
30 #define GO_MARKER(o)		(G_TYPE_CHECK_INSTANCE_CAST((o), GO_TYPE_MARKER, GOMarker))
31 #define GO_IS_MARKER(o)		(G_TYPE_CHECK_INSTANCE_TYPE((o), GO_TYPE_MARKER))
32 
33 typedef enum {
34 	GO_MARKER_NONE,
35 	GO_MARKER_SQUARE,
36 	GO_MARKER_DIAMOND,
37 	GO_MARKER_TRIANGLE_DOWN,
38 	GO_MARKER_TRIANGLE_UP,
39 	GO_MARKER_TRIANGLE_RIGHT,
40 	GO_MARKER_TRIANGLE_LEFT,
41 	GO_MARKER_CIRCLE,
42 	GO_MARKER_X,
43 	GO_MARKER_CROSS,
44 	GO_MARKER_ASTERISK,
45 	GO_MARKER_BAR,
46 	GO_MARKER_HALF_BAR,
47 	GO_MARKER_BUTTERFLY,
48 	GO_MARKER_HOURGLASS,
49 	GO_MARKER_LEFT_HALF_BAR,
50 	GO_MARKER_MAX
51 } GOMarkerShape;
52 
53 GType go_marker_get_type (void);
54 
55 GOMarkerShape    go_marker_shape_from_str       (char const *name);
56 char const      *go_marker_shape_as_str         (GOMarkerShape shape);
57 GOMarkerShape 	 go_marker_get_shape		(GOMarker const *m);
58 void 		 go_marker_set_shape 		(GOMarker *m, GOMarkerShape shape);
59 gboolean	 go_marker_is_closed_shape		(GOMarker const *m);
60 GOColor 	 go_marker_get_outline_color	(GOMarker const *m);
61 void		 go_marker_set_outline_color	(GOMarker *m, GOColor color);
62 GOColor		 go_marker_get_fill_color	(GOMarker const *m);
63 void		 go_marker_set_fill_color	(GOMarker *m, GOColor color);
64 int		 go_marker_get_size		(GOMarker const *m);
65 void		 go_marker_set_size		(GOMarker *m, int size);
66 double		 go_marker_get_outline_width	(GOMarker const *m);
67 
68 void		 go_marker_assign 		(GOMarker *dst, GOMarker const *src);
69 GOMarker *	 go_marker_dup 			(GOMarker const *src);
70 GOMarker * 	 go_marker_new 			(void);
71 
72 void 		 go_marker_render 		(GOMarker const *marker, cairo_t *cr,
73 						 double x, double y, double scale);
74 cairo_surface_t *go_marker_create_cairo_surface (GOMarker const *marker, cairo_t *cr, double scale,
75 						 double *width, double *height);
76 
77 G_END_DECLS
78 
79 #endif /* GO_MARKER_H */
80