]> git.sur5r.net Git - glabels/blob - glabels2/src/view.h
Added foreground label outlines.
[glabels] / glabels2 / src / view.h
1 /*
2  *  (GLABELS) Label and Business Card Creation program for GNOME
3  *
4  *  view.h:  GLabels View module header file
5  *
6  *  Copyright (C) 2001-2002  Jim Evins <evins@snaught.com>.
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21  */
22
23 #ifndef __VIEW_H__
24 #define __VIEW_H__
25
26 #include <gtk/gtk.h>
27 #include <libgnomecanvas/libgnomecanvas.h>
28
29 #include "label-object.h"
30
31 typedef enum {
32         GL_VIEW_STATE_ARROW,
33         GL_VIEW_STATE_OBJECT_CREATE
34 } glViewState;
35
36 #define GL_TYPE_VIEW (gl_view_get_type ())
37 #define GL_VIEW(obj) (GTK_CHECK_CAST((obj), GL_TYPE_VIEW, glView ))
38 #define GL_VIEW_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_VIEW, glViewClass))
39 #define GL_IS_VIEW(obj) (GTK_CHECK_TYPE ((obj), GL_TYPE_VIEW))
40 #define GL_IS_VIEW_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_VIEW))
41
42 typedef struct _glView glView;
43 typedef struct _glViewClass glViewClass;
44
45 #include "view-object.h"
46
47 struct _glView {
48         GtkVBox parent_widget;
49
50         glLabel *label;
51
52         GtkWidget *canvas;
53         gdouble scale;
54         gint n_bg_items;
55         GList *bg_item_list;
56         gint n_fg_items;
57         GList *fg_item_list;
58
59         glViewState state;
60         glLabelObjectType create_type;
61
62         GList *object_list;
63         GList *selected_object_list;
64
65         gint have_selection;
66         glLabel *selection_data;
67         GtkWidget *invisible;
68
69         GtkWidget *menu;
70 };
71
72 struct _glViewClass {
73         GtkVBoxClass parent_class;
74 };
75
76 extern guint gl_view_get_type (void);
77
78 extern GtkWidget *gl_view_new (glLabel * label);
79
80 extern void gl_view_arrow_mode (glView * view);
81 extern void gl_view_object_create_mode (glView * view,
82                                         glLabelObjectType type);
83
84 extern void gl_view_select_object (glView *view, glViewObject *view_object);
85 extern void gl_view_select_all (glView *view);
86 extern void gl_view_unselect_all (glView *view);
87 extern void gl_view_delete_selection (glView *view);
88
89
90 extern int gl_view_item_event_handler (GnomeCanvasItem * item,
91                                        GdkEvent * event,
92                                        glViewObject *view_object);
93
94 extern void gl_view_cut (glView * view);
95 extern void gl_view_copy (glView * view);
96 extern void gl_view_paste (glView * view);
97
98 extern void gl_view_zoom_in (glView * view);
99 extern void gl_view_zoom_out (glView * view);
100 extern void gl_view_set_zoom (glView * view, gdouble scale);
101 extern gdouble gl_view_get_zoom (glView * view);
102
103 #endif