2 * Copyright (C) 2009-2010 Andy Spencer <andy753421@gmail.com>
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.
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.
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/>.
18 #ifndef __GRITS_MARKER_H__
19 #define __GRITS_MARKER_H__
22 #include <glib-object.h>
24 #include "grits-object.h"
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))
34 typedef struct _GritsMarker GritsMarker;
35 typedef struct _GritsMarkerClass GritsMarkerClass;
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)
45 GritsObject parent_instance;
46 gint xoff, yoff; /* center point offset */
47 gint icon_width, icon_height; /* size of icon for offsets */
54 cairo_surface_t *icon_img;
56 /* What object to display */
60 gint angle; /* rotation angle */
61 gboolean flip; /* keep icon "rightside-up" after rotating? */
69 struct _GritsMarkerClass {
70 GritsObjectClass parent_class;
73 GType grits_marker_get_type(void);
75 GritsMarker *grits_marker_new(const gchar *label);
76 GritsMarker *grits_marker_icon_new(const gchar *label, const gchar *filename,
77 guint angle, gboolean flip, guint display_mask);