]> Pileus Git - grits/blob - src/objects/grits-marker.h
41a2f39b3e780001f6375496afce7258b99aab0e
[grits] / src / objects / grits-marker.h
1 /*
2  * Copyright (C) 2009-2010 Andy Spencer <andy753421@gmail.com>
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program 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
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 #ifndef __GRITS_MARKER_H__
19 #define __GRITS_MARKER_H__
20
21 #include <glib.h>
22 #include <glib-object.h>
23 #include <cairo.h>
24 #include "grits-object.h"
25
26 /* GritsMarker */
27 #define GRITS_TYPE_MARKER            (grits_marker_get_type())
28 #define GRITS_MARKER(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),   GRITS_TYPE_MARKER, GritsMarker))
29 #define GRITS_IS_MARKER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),   GRITS_TYPE_MARKER))
30 #define GRITS_MARKER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST   ((klass), GRITS_TYPE_MARKER, GritsMarkerClass))
31 #define GRITS_IS_MARKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE   ((klass), GRITS_TYPE_MARKER))
32 #define GRITS_MARKER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),   GRITS_TYPE_MARKER, GritsMarkerClass))
33
34 typedef struct _GritsMarker      GritsMarker;
35 typedef struct _GritsMarkerClass GritsMarkerClass;
36
37 #define GRITS_MARKER_DMASK_NONE         (0x0001)
38 #define GRITS_MARKER_DMASK_LABEL        (0x0002)
39 #define GRITS_MARKER_DMASK_POINT        (0x0004)
40 #define GRITS_MARKER_DMASK_ICON         (0x0008)
41 #define GRITS_MARKER_DMASK_DIRECTIONAL  (0x0010)
42 #define GRITS_MARKER_DMASK_ALL          (0xffff)
43
44 struct _GritsMarker {
45         GritsObject  parent_instance;
46         gint       xoff, yoff;              /* center point offset */
47         gint       icon_width, icon_height; /* size of icon for offsets */
48         gchar     *label;
49         cairo_t   *cairo;
50         guint      tex;
51
52         cairo_surface_t *icon_img;
53
54         /* What object to display */
55         guint      display_mask;
56
57         /* icon data */
58         gint     angle;         /* rotation angle */
59         gboolean flip;          /* keep icon "rightside-up" after rotating? */
60
61         gdouble outline;
62         gdouble radius;
63         gdouble width;
64         gdouble height;
65 };
66
67 struct _GritsMarkerClass {
68         GritsObjectClass parent_class;
69 };
70
71 GType grits_marker_get_type(void);
72
73 GritsMarker *grits_marker_new(const gchar *label);
74 GritsMarker *grits_marker_icon_new(const gchar *label, const gchar *filename,
75     guint angle, gboolean flip, guint display_mask);
76
77 #endif