Add an option to highligh points in Polygons
[libchamplain:potyl-perl.git] / champlain / champlain-polygon.h
1 /*
2  * Copyright (C) 2009 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17  */
18
19 #if !defined (__CHAMPLAIN_CHAMPLAIN_H_INSIDE__) && !defined (CHAMPLAIN_COMPILATION)
20 #error "Only <champlain/champlain.h> can be included directly."
21 #endif
22
23 #ifndef CHAMPLAIN_POLYGON_H
24 #define CHAMPLAIN_POLYGON_H
25
26 #include <champlain/champlain-point.h>
27
28 #include <glib-object.h>
29 #include <clutter/clutter.h>
30
31 G_BEGIN_DECLS
32
33 #define CHAMPLAIN_TYPE_POLYGON champlain_polygon_get_type()
34
35 #define CHAMPLAIN_POLYGON(obj) \
36   (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHAMPLAIN_TYPE_POLYGON, ChamplainPolygon))
37
38 #define CHAMPLAIN_POLYGON_CLASS(klass) \
39   (G_TYPE_CHECK_CLASS_CAST ((klass), CHAMPLAIN_TYPE_POLYGON, ChamplainPolygonClass))
40
41 #define CHAMPLAIN_IS_POLYGON(obj) \
42   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHAMPLAIN_TYPE_POLYGON))
43
44 #define CHAMPLAIN_IS_POLYGON_CLASS(klass) \
45   (G_TYPE_CHECK_CLASS_TYPE ((klass), CHAMPLAIN_TYPE_POLYGON))
46
47 #define CHAMPLAIN_POLYGON_GET_CLASS(obj) \
48   (G_TYPE_INSTANCE_GET_CLASS ((obj), CHAMPLAIN_TYPE_POLYGON, ChamplainPolygonClass))
49
50 typedef struct _ChamplainPolygonPrivate ChamplainPolygonPrivate;
51
52 typedef struct _ChamplainPolygon        ChamplainPolygon;
53 typedef struct _ChamplainPolygonClass   ChamplainPolygonClass;
54
55 struct _ChamplainPolygon {
56   GInitiallyUnowned parent;
57   ChamplainPolygonPrivate *priv;
58 };
59
60 struct _ChamplainPolygonClass {
61   GInitiallyUnownedClass parent_class;
62 };
63
64 GType champlain_polygon_get_type (void);
65
66 ChamplainPolygon * champlain_polygon_new (void);
67
68 ChamplainPoint * champlain_polygon_append_point (ChamplainPolygon *polygon,
69     gdouble lat,
70     gdouble lon);
71 ChamplainPoint * champlain_polygon_insert_point (ChamplainPolygon *polygon,
72     gdouble lat,
73     gdouble lon,
74     gint pos);
75 void champlain_polygon_remove_point (ChamplainPolygon *polygon,
76     ChamplainPoint *point);
77 void champlain_polygon_clear_points (ChamplainPolygon *polygon);
78 GList *champlain_polygon_get_points (ChamplainPolygon *polygon);
79
80 void champlain_polygon_set_fill_color (ChamplainPolygon *polygon,
81     const ClutterColor *color);
82 void champlain_polygon_set_stroke_color (ChamplainPolygon *polygon,
83     const ClutterColor *color);
84 ClutterColor * champlain_polygon_get_fill_color (ChamplainPolygon *polygon);
85 ClutterColor * champlain_polygon_get_stroke_color (ChamplainPolygon *polygon);
86
87 gboolean champlain_polygon_get_fill (ChamplainPolygon *polygon);
88 void champlain_polygon_set_fill (ChamplainPolygon *polygon,
89     gboolean value);
90 gboolean champlain_polygon_get_stroke (ChamplainPolygon *polygon);
91 void champlain_polygon_set_stroke (ChamplainPolygon *polygon,
92     gboolean value);
93 void champlain_polygon_set_stroke_width (ChamplainPolygon *polygon,
94     gdouble value);
95 gdouble champlain_polygon_get_stroke_width (ChamplainPolygon *polygon);
96 void champlain_polygon_set_mark_points (ChamplainPolygon *polygon,
97     gboolean value);
98 gboolean champlain_polygon_get_mark_points (ChamplainPolygon *polygon);
99
100 void champlain_polygon_show (ChamplainPolygon *polygon);
101 void champlain_polygon_hide (ChamplainPolygon *polygon);
102
103 G_END_DECLS
104
105 #endif