1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
4 * (GLABELS) Label and Business Card Creation program for GNOME
6 * view.h: GLabels View module header file
8 * Copyright (C) 2001-2005 Jim Evins <evins@snaught.com>.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include <gtk/gtkvbox.h>
29 #include <libgnomecanvas/libgnomecanvas.h>
30 #include <libgnomeprint/gnome-font.h>
32 #include "label-object.h"
36 GL_VIEW_STATE_OBJECT_CREATE
39 #define GL_TYPE_VIEW (gl_view_get_type ())
40 #define GL_VIEW(obj) (GTK_CHECK_CAST((obj), GL_TYPE_VIEW, glView ))
41 #define GL_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW, glViewClass))
42 #define GL_IS_VIEW(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_VIEW))
43 #define GL_IS_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW))
45 typedef struct _glView glView;
46 typedef struct _glViewClass glViewClass;
48 #include "view-object.h"
52 GtkVBox parent_widget;
58 gboolean zoom_to_fit_flag;
61 GnomeCanvasGroup *bg_group; /* Background layer */
62 GnomeCanvasGroup *grid_group; /* Grid layer */
63 GnomeCanvasGroup *markup_group; /* Markup layer */
64 GnomeCanvasGroup *label_group; /* Label layer (user objects) */
65 GnomeCanvasGroup *fg_group; /* Foreground layer */
66 GnomeCanvasGroup *highlight_group; /* Highlight layer */
71 glLabelObjectType create_type;
73 GList *object_list; /* glViewObjects */
74 GList *selected_object_list; /* glViewObjects */
76 /* Clipboard selection stuff */
78 glLabel *selection_data;
81 /* Default object text properties */
82 gchar *default_font_family;
83 gdouble default_font_size;
84 GnomeFontWeight default_font_weight;
85 gboolean default_font_italic_flag;
86 guint default_text_color;
87 PangoAlignment default_text_alignment;
88 gdouble default_text_line_spacing;
90 /* Default object line properties */
91 gdouble default_line_width;
92 guint default_line_color;
94 /* Default object fill properties */
95 guint default_fill_color;
99 GtkVBoxClass parent_class;
101 /* Selection changed signal */
102 void (*selection_changed) (glView *view,
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_show_grid (glView *view);
134 void gl_view_hide_grid (glView *view);
136 void gl_view_set_grid_spacing (glView *view,
139 void gl_view_show_markup (glView *view);
141 void gl_view_hide_markup (glView *view);
143 void gl_view_arrow_mode (glView *view);
145 void gl_view_object_create_mode (glView *view,
146 glLabelObjectType type);
149 void gl_view_select_object (glView *view,
150 glViewObject *view_object);
152 void gl_view_unselect_object (glView *view,
153 glViewObject *view_object);
155 void gl_view_select_all (glView *view);
157 void gl_view_unselect_all (glView *view);
159 void gl_view_select_region (glView *view,
165 gboolean gl_view_is_object_selected (glView *view,
166 glViewObject *view_object);
168 gboolean gl_view_is_selection_empty (glView *view);
170 gboolean gl_view_is_selection_atomic (glView *view);
172 void gl_view_delete_selection (glView *view);
174 GtkWidget *gl_view_get_editor (glView *view);
176 void gl_view_raise_selection (glView *view);
178 void gl_view_lower_selection (glView *view);
180 void gl_view_rotate_selection (glView *view,
183 void gl_view_rotate_selection_left (glView *view);
185 void gl_view_rotate_selection_right (glView *view);
187 void gl_view_flip_selection_horiz (glView *view);
189 void gl_view_flip_selection_vert (glView *view);
191 void gl_view_align_selection_left (glView *view);
193 void gl_view_align_selection_right (glView *view);
195 void gl_view_align_selection_hcenter (glView *view);
197 void gl_view_align_selection_top (glView *view);
199 void gl_view_align_selection_bottom (glView *view);
201 void gl_view_align_selection_vcenter (glView *view);
203 void gl_view_center_selection_horiz (glView *view);
205 void gl_view_center_selection_vert (glView *view);
207 void gl_view_move_selection (glView *view,
211 gboolean gl_view_can_selection_text (glView *view);
213 void gl_view_set_selection_font_family (glView *view,
214 const gchar *font_family);
216 void gl_view_set_selection_font_size (glView *view,
219 void gl_view_set_selection_font_weight (glView *view,
220 GnomeFontWeight font_weight);
222 void gl_view_set_selection_text_line_spacing (glView *view,
223 gdouble text_line_spacing);
225 void gl_view_set_selection_font_italic_flag (glView *view,
226 gboolean font_italic_flag);
228 void gl_view_set_selection_text_alignment (glView *view,
229 PangoAlignment text_alignment);
231 void gl_view_set_selection_text_color (glView *view,
232 glColorNode *text_color_node);
234 gboolean gl_view_can_selection_fill (glView *view);
236 void gl_view_set_selection_fill_color (glView *view,
237 glColorNode *fill_color);
239 gboolean gl_view_can_selection_line_color (glView *view);
241 void gl_view_set_selection_line_color (glView *view,
242 glColorNode *line_color_node);
244 gboolean gl_view_can_selection_line_width (glView *view);
246 void gl_view_set_selection_line_width (glView *view,
250 void gl_view_cut (glView *view);
252 void gl_view_copy (glView *view);
254 void gl_view_paste (glView *view);
257 void gl_view_zoom_in (glView *view);
259 void gl_view_zoom_out (glView *view);
261 void gl_view_zoom_to_fit (glView *view);
263 void gl_view_set_zoom (glView *view,
266 gdouble gl_view_get_zoom (glView *view);
268 gboolean gl_view_is_zoom_max (glView *view);
270 gboolean gl_view_is_zoom_min (glView *view);
273 void gl_view_set_default_font_family (glView *view,
274 const gchar *font_family);
276 void gl_view_set_default_font_size (glView *view,
279 void gl_view_set_default_font_weight (glView *view,
280 GnomeFontWeight font_weight);
282 void gl_view_set_default_font_italic_flag (glView *view,
283 gboolean font_italic_flag);
285 void gl_view_set_default_text_color (glView *view,
288 void gl_view_set_default_text_alignment (glView *view,
289 PangoAlignment text_alignment);
291 void gl_view_set_default_line_width (glView *view,
294 void gl_view_set_default_line_color (glView *view,
297 void gl_view_set_default_fill_color (glView *view,
299 void gl_view_set_default_text_line_spacing (glView *view,
300 gdouble text_line_spacing);
304 gchar *gl_view_get_default_font_family (glView *view);
306 gdouble gl_view_get_default_font_size (glView *view);
308 GnomeFontWeight gl_view_get_default_font_weight (glView *view);
310 gboolean gl_view_get_default_font_italic_flag (glView *view);
312 guint gl_view_get_default_text_color (glView *view);
314 PangoAlignment gl_view_get_default_text_alignment (glView *view);
316 gdouble gl_view_get_default_text_line_spacing (glView *view);
318 gdouble gl_view_get_default_line_width (glView *view);
320 guint gl_view_get_default_line_color (glView *view);
322 guint gl_view_get_default_fill_color (glView *view);