1 /*
2  * go-line.h :
3  *
4  * Copyright (C) 2004-2006 Emmanuel Pacaud (emmanuel.pacaud@univ-poitiers.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_LINE_H
23 #define GO_LINE_H
24 
25 #include <goffice/goffice.h>
26 
27 G_BEGIN_DECLS
28 
29 typedef struct {
30 	double		 offset;
31 	unsigned int	 n_dash;
32 	double		*dash;
33 	/* <private> */
34 	unsigned int ref_count;
35 } GOLineDashSequence;
36 GType go_line_dash_sequence_get_type (void);
37 
38 GOLineDashType		 go_line_dash_from_str		(char const *name);
39 char const 		*go_line_dash_as_str		(GOLineDashType type);
40 char const 		*go_line_dash_as_label 		(GOLineDashType type);
41 double			 go_line_dash_get_length	(GOLineDashType type);
42 GOLineDashSequence	*go_line_dash_get_sequence 	(GOLineDashType type, double scale);
43 void 		  	 go_line_dash_sequence_free	(GOLineDashSequence *sequence);
44 
45 GOLineInterpolation	 go_line_interpolation_from_str		(char const *name);
46 char const 		*go_line_interpolation_as_str		(GOLineInterpolation type);
47 char const 		*go_line_interpolation_as_label		(GOLineInterpolation type);
48 gboolean		 go_line_interpolation_supports_radial  (GOLineInterpolation type);
49 gboolean		 go_line_interpolation_auto_skip	(GOLineInterpolation type);
50 
51 
52 typedef enum {
53 	GO_ARROW_NONE,
54 	GO_ARROW_KITE,
55 	GO_ARROW_OVAL
56 	/* GO_ARROW_STEALTH */
57 	/* GO_ARROW_DIAMOND */
58 	/* GO_ARROW_OPEN */
59 } GOArrowType;
60 
61 typedef struct {
62 	GOArrowType typ;
63 	double a, b, c;
64 } GOArrow;
65 
66 GType go_arrow_get_type (void);
67 #define GO_ARROW_TYPE (go_arrow_get_type())
68 
69 char const *go_arrow_type_as_str (GOArrowType typ);
70 GOArrowType go_arrow_type_from_str (const char *name);
71 
72 GOArrow *go_arrow_dup (GOArrow *src);
73 void go_arrow_init (GOArrow *res, GOArrowType typ,
74 		    double a, double b, double c);
75 void go_arrow_clear (GOArrow *dst);
76 void go_arrow_init_kite (GOArrow *dst, double a, double b, double c);
77 void go_arrow_init_oval (GOArrow *dst, double ra, double rb);
78 
79 gboolean go_arrow_equal (const GOArrow *a, const GOArrow *b);
80 
81 void go_arrow_draw (const GOArrow *arrow, cairo_t *cr,
82 		    double *dx, double *dy, double phi);
83 
84 G_END_DECLS
85 
86 #endif /* GO_LINE_H */
87