3 * Copyright (C) 2001-2009 Jim Evins <evins@snaught.com>.
5 * This file is part of gLabels.
7 * gLabels is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * gLabels is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with gLabels. If not, see <http://www.gnu.org/licenses/>.
26 #include "label-object.h"
30 GL_VIEW_MODE_OBJECT_CREATE
35 GL_VIEW_ARROW_SELECT_REGION,
41 #define GL_TYPE_VIEW (gl_view_get_type ())
42 #define GL_VIEW(obj) \
43 (G_TYPE_CHECK_INSTANCE_CAST((obj), GL_TYPE_VIEW, glView ))
44 #define GL_VIEW_CLASS(klass) \
45 (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW, glViewClass))
46 #define GL_IS_VIEW(obj) \
47 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_VIEW))
48 #define GL_IS_VIEW_CLASS(klass) \
49 (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW))
51 typedef struct _glView glView;
52 typedef struct _glViewClass glViewClass;
57 GtkVBox parent_widget;
63 gboolean zoom_to_fit_flag;
68 gboolean update_scheduled_flag;
69 gboolean grid_visible;
72 gboolean markup_visible;
75 glLabelObjectType create_type;
77 gboolean grabbed_flag;
79 /* GL_VIEW_ARROW_MOVE state */
85 /* GL_VIEW_ARROW_SELECT_REGION state */
86 gboolean select_region_visible;
87 glLabelRegion select_region;
89 /* GL_VIEW_ARROW_RESIZE state */
90 glLabelObject *resize_object;
91 glLabelObjectHandle resize_handle;
96 /* GL_VIEW_CREATE_DRAG state */
97 glLabelObject *create_object;
102 struct _glViewClass {
103 GtkVBoxClass parent_class;
105 /* Signal to launch a context menu */
106 void (*context_menu_activate) (glView *view,
108 guint32 activate_time,
111 /* Signals to support a status bar */
112 void (*zoom_changed) (glView *view,
115 void (*pointer_moved) (glView *view,
119 void (*pointer_exit) (glView *view,
121 void (*mode_changed) (glView *view,
127 GType gl_view_get_type (void) G_GNUC_CONST;
129 GtkWidget *gl_view_new (glLabel *label);
132 void gl_view_update (glView *view);
134 void gl_view_update_region (glView *view,
136 glLabelRegion *region);
138 void gl_view_show_grid (glView *view);
140 void gl_view_hide_grid (glView *view);
142 void gl_view_show_markup (glView *view);
144 void gl_view_hide_markup (glView *view);
146 void gl_view_arrow_mode (glView *view);
148 void gl_view_object_create_mode (glView *view,
149 glLabelObjectType type);
152 void gl_view_zoom_in (glView *view);
154 void gl_view_zoom_out (glView *view);
156 void gl_view_zoom_to_fit (glView *view);
158 void gl_view_set_zoom (glView *view,
161 gdouble gl_view_get_zoom (glView *view);
163 gboolean gl_view_is_zoom_max (glView *view);
165 gboolean gl_view_is_zoom_min (glView *view);
177 * Local Variables: -- emacs
179 * c-basic-offset: 8 -- emacs
180 * tab-width: 8 -- emacs
181 * indent-tabs-mode: nil -- emacs