]> git.sur5r.net Git - glabels/blob - glabels2/src/tools.c
Initial revision
[glabels] / glabels2 / src / tools.c
1 /*
2  *  (GLABELS) Label and Business Card Creation program for GNOME
3  *
4  *  tools.c:  toolbar module
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 #include <config.h>
24
25 #include "tools.h"
26 #include "glabels.h"
27 #include "merge-properties.h"
28
29 /*===========================================*/
30 /* Private types.                            */
31 /*===========================================*/
32
33 /*===========================================*/
34 /* Private globals.                          */
35 /*===========================================*/
36
37 /*===========================================*/
38 /* Private function prototypes.              */
39 /*===========================================*/
40
41
42 \f
43 /*****************************************************************************/
44 /* arrow callback.                                                           */
45 /*****************************************************************************/
46 void
47 gl_tools_arrow (BonoboUIComponent *uic,
48                 gpointer user_data,
49                 const gchar* verbname)
50 {
51         glView *view;
52
53         view = glabels_get_active_view ();
54         if (view != NULL) {
55                 gl_view_arrow_mode (view);
56         }
57 }
58
59 /*****************************************************************************/
60 /* text callback.                                                            */
61 /*****************************************************************************/
62 void
63 gl_tools_text (BonoboUIComponent *uic,
64                gpointer user_data,
65                const gchar* verbname)
66
67 {
68         glView *view;
69
70         view = glabels_get_active_view ();
71         if (view != NULL) {
72                 gl_view_object_create_mode (view, GL_LABEL_OBJECT_TEXT);
73         }
74 }
75
76 /*****************************************************************************/
77 /* box callback.                                                             */
78 /*****************************************************************************/
79 void
80 gl_tools_box (BonoboUIComponent *uic,
81               gpointer user_data,
82               const gchar* verbname)
83
84 {
85         glView *view;
86
87         view = glabels_get_active_view ();
88         if (view != NULL) {
89                 gl_view_object_create_mode (view, GL_LABEL_OBJECT_BOX);
90         }
91 }
92
93 /*****************************************************************************/
94 /* line callback.                                                            */
95 /*****************************************************************************/
96 void
97 gl_tools_line (BonoboUIComponent *uic,
98                gpointer user_data,
99                const gchar* verbname)
100
101 {
102         glView *view;
103
104         view = glabels_get_active_view ();
105         if (view != NULL) {
106                 gl_view_object_create_mode (view, GL_LABEL_OBJECT_LINE);
107         }
108 }
109
110 /*****************************************************************************/
111 /* ellipse callback.                                                         */
112 /*****************************************************************************/
113 void
114 gl_tools_ellipse (BonoboUIComponent *uic,
115                   gpointer user_data,
116                   const gchar* verbname)
117
118 {
119         glView *view;
120
121         view = glabels_get_active_view ();
122         if (view != NULL) {
123                 gl_view_object_create_mode (view,
124                                                GL_LABEL_OBJECT_ELLIPSE);
125         }
126 }
127
128 /*****************************************************************************/
129 /* image callback.                                                           */
130 /*****************************************************************************/
131 void
132 gl_tools_image (BonoboUIComponent *uic,
133                 gpointer user_data,
134                 const gchar* verbname)
135
136 {
137         glView *view;
138
139         view = glabels_get_active_view ();
140         if (view != NULL) {
141                 gl_view_object_create_mode (view, GL_LABEL_OBJECT_IMAGE);
142         }
143 }
144
145 /*****************************************************************************/
146 /* barcode callback.                                                         */
147 /*****************************************************************************/
148 void
149 gl_tools_barcode (BonoboUIComponent *uic,
150                   gpointer user_data,
151                   const gchar* verbname)
152
153 {
154         glView *view;
155
156         view = glabels_get_active_view ();
157         if (view != NULL) {
158                 gl_view_object_create_mode (view,
159                                                GL_LABEL_OBJECT_BARCODE);
160         }
161 }
162
163 /*****************************************************************************/
164 /* zoom in callback.                                                         */
165 /*****************************************************************************/
166 void
167 gl_tools_zoomin (BonoboUIComponent *uic,
168                  gpointer user_data,
169                  const gchar* verbname)
170
171 {
172         glView *view;
173
174         view = glabels_get_active_view ();
175         if (view != NULL) {
176                 gl_view_zoom_in (view);
177         }
178 }
179
180 /*****************************************************************************/
181 /* zoom out callback.                                                        */
182 /*****************************************************************************/
183 void
184 gl_tools_zoomout (BonoboUIComponent *uic,
185                   gpointer user_data,
186                   const gchar* verbname)
187
188 {
189         glView *view;
190
191         view = glabels_get_active_view ();
192         if (view != NULL) {
193                 gl_view_zoom_out (view);
194         }
195 }
196
197 /*****************************************************************************/
198 /* zoom 1:1 callback.                                                        */
199 /*****************************************************************************/
200 void
201 gl_tools_zoom1to1 (BonoboUIComponent *uic,
202                    gpointer user_data,
203                    const gchar* verbname)
204
205 {
206         glView *view;
207
208         view = glabels_get_active_view ();
209         if (view != NULL) {
210                 gl_view_set_zoom (view, 1.0);
211         }
212 }
213
214 /*****************************************************************************/
215 /* edit merge properties callback.                                           */
216 /*****************************************************************************/
217 void
218 gl_tools_merge_properties (BonoboUIComponent *uic,
219                            gpointer user_data,
220                            const gchar* verbname)
221
222 {
223         glView *view;
224
225         view = glabels_get_active_view ();
226         if (view != NULL) {
227                 gl_merge_properties_dialog (view);
228         }
229 }
230