2 * (GLABELS) Label and Business Card Creation program for GNOME
4 * tools.c: implementation of drawing toolbar verbs
6 * Copyright (C) 2001-2002 Jim Evins <evins@snaught.com>.
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.
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.
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
27 #include "merge-properties.h"
29 /*===========================================*/
31 /*===========================================*/
33 /*===========================================*/
34 /* Private globals. */
35 /*===========================================*/
37 /*===========================================*/
38 /* Private function prototypes. */
39 /*===========================================*/
43 /*****************************************************************************/
45 /*****************************************************************************/
47 gl_tools_arrow (BonoboUIComponent *uic,
49 const gchar *verbname)
53 window = GL_WINDOW (user_data);
55 if (window->view != NULL) {
56 gl_view_arrow_mode (GL_VIEW(window->view));
60 /*****************************************************************************/
62 /*****************************************************************************/
64 gl_tools_text (BonoboUIComponent *uic,
66 const gchar *verbname)
71 window = GL_WINDOW (user_data);
73 if (window->view != NULL) {
74 gl_view_object_create_mode (GL_VIEW(window->view),
75 GL_LABEL_OBJECT_TEXT);
79 /*****************************************************************************/
81 /*****************************************************************************/
83 gl_tools_box (BonoboUIComponent *uic,
85 const gchar *verbname)
90 window = GL_WINDOW (user_data);
92 if (window->view != NULL) {
93 gl_view_object_create_mode (GL_VIEW(window->view),
98 /*****************************************************************************/
100 /*****************************************************************************/
102 gl_tools_line (BonoboUIComponent *uic,
104 const gchar *verbname)
109 window = GL_WINDOW (user_data);
111 if (window->view != NULL) {
112 gl_view_object_create_mode (GL_VIEW(window->view),
113 GL_LABEL_OBJECT_LINE);
117 /*****************************************************************************/
118 /* ellipse callback. */
119 /*****************************************************************************/
121 gl_tools_ellipse (BonoboUIComponent *uic,
123 const gchar *verbname)
128 window = GL_WINDOW (user_data);
130 if (window->view != NULL) {
131 gl_view_object_create_mode (GL_VIEW(window->view),
132 GL_LABEL_OBJECT_ELLIPSE);
136 /*****************************************************************************/
137 /* image callback. */
138 /*****************************************************************************/
140 gl_tools_image (BonoboUIComponent *uic,
142 const gchar *verbname)
147 window = GL_WINDOW (user_data);
149 if (window->view != NULL) {
150 gl_view_object_create_mode (GL_VIEW(window->view),
151 GL_LABEL_OBJECT_IMAGE);
155 /*****************************************************************************/
156 /* barcode callback. */
157 /*****************************************************************************/
159 gl_tools_barcode (BonoboUIComponent *uic,
161 const gchar *verbname)
166 window = GL_WINDOW (user_data);
168 if (window->view != NULL) {
169 gl_view_object_create_mode (GL_VIEW(window->view),
170 GL_LABEL_OBJECT_BARCODE);
174 /*****************************************************************************/
175 /* zoom in callback. */
176 /*****************************************************************************/
178 gl_tools_zoomin (BonoboUIComponent *uic,
180 const gchar *verbname)
185 window = GL_WINDOW (user_data);
187 if (window->view != NULL) {
188 gl_view_zoom_in (GL_VIEW(window->view));
192 /*****************************************************************************/
193 /* zoom out callback. */
194 /*****************************************************************************/
196 gl_tools_zoomout (BonoboUIComponent *uic,
198 const gchar *verbname)
203 window = GL_WINDOW (user_data);
205 if (window->view != NULL) {
206 gl_view_zoom_out (GL_VIEW(window->view));
210 /*****************************************************************************/
211 /* zoom 1:1 callback. */
212 /*****************************************************************************/
214 gl_tools_zoom1to1 (BonoboUIComponent *uic,
216 const gchar *verbname)
221 window = GL_WINDOW (user_data);
223 if (window->view != NULL) {
224 gl_view_set_zoom (GL_VIEW(window->view), 1.0);
228 /*****************************************************************************/
229 /* edit merge properties callback. */
230 /*****************************************************************************/
232 gl_tools_merge_properties (BonoboUIComponent *uic,
234 const gchar *verbname)
239 window = GL_WINDOW (user_data);
241 if (window->view != NULL) {
242 gl_merge_properties_dialog (GL_VIEW(window->view));
246 /*****************************************************************************/
247 /* edit object properties callback. */
248 /*****************************************************************************/
250 gl_tools_object_properties (BonoboUIComponent *uic,
252 const gchar *verbname)
257 window = GL_WINDOW (user_data);
259 if (window->view != NULL) {
260 gl_view_edit_object_props (GL_VIEW(window->view));
264 /*****************************************************************************/
265 /* Raise objects to top callback. */
266 /*****************************************************************************/
268 gl_tools_raise_objects (BonoboUIComponent *uic,
270 const gchar *verbname)
275 window = GL_WINDOW (user_data);
277 if (window->view != NULL) {
278 gl_view_raise_selection (GL_VIEW(window->view));
282 /*****************************************************************************/
283 /* Lower objects to bottom callback. */
284 /*****************************************************************************/
286 gl_tools_lower_objects (BonoboUIComponent *uic,
288 const gchar *verbname)
293 window = GL_WINDOW (user_data);
295 if (window->view != NULL) {
296 gl_view_lower_selection (GL_VIEW(window->view));
300 /*****************************************************************************/
301 /* Rotate objects left 90 degrees. */
302 /*****************************************************************************/
304 gl_tools_rotate_objects_left (BonoboUIComponent *uic,
306 const gchar *verbname)
311 window = GL_WINDOW (user_data);
313 if (window->view != NULL) {
314 gl_view_rotate_selection_left (GL_VIEW(window->view));
318 /*****************************************************************************/
319 /* Rotate objects right 90 degrees. */
320 /*****************************************************************************/
322 gl_tools_rotate_objects_right (BonoboUIComponent *uic,
324 const gchar *verbname)
329 window = GL_WINDOW (user_data);
331 if (window->view != NULL) {
332 gl_view_rotate_selection_right (GL_VIEW(window->view));
336 /*****************************************************************************/
337 /* Flip objects horizontally callback. */
338 /*****************************************************************************/
340 gl_tools_flip_objects_horiz (BonoboUIComponent *uic,
342 const gchar *verbname)
347 window = GL_WINDOW (user_data);
349 if (window->view != NULL) {
350 gl_view_flip_selection_horiz (GL_VIEW(window->view));
354 /*****************************************************************************/
355 /* Flip objects vertically callback. */
356 /*****************************************************************************/
358 gl_tools_flip_objects_vert (BonoboUIComponent *uic,
360 const gchar *verbname)
365 window = GL_WINDOW (user_data);
367 if (window->view != NULL) {
368 gl_view_flip_selection_vert (GL_VIEW(window->view));
372 /*****************************************************************************/
373 /* Align objects left callback. */
374 /*****************************************************************************/
376 gl_tools_align_objects_left (BonoboUIComponent *uic,
378 const gchar *verbname)
383 window = GL_WINDOW (user_data);
385 if (window->view != NULL) {
386 gl_view_align_selection_left (GL_VIEW(window->view));
390 /*****************************************************************************/
391 /* Align objects right callback. */
392 /*****************************************************************************/
394 gl_tools_align_objects_right (BonoboUIComponent *uic,
396 const gchar *verbname)
401 window = GL_WINDOW (user_data);
403 if (window->view != NULL) {
404 gl_view_align_selection_right (GL_VIEW(window->view));
408 /*****************************************************************************/
409 /* Align objects horizontal center callback. */
410 /*****************************************************************************/
412 gl_tools_align_objects_hcenter (BonoboUIComponent *uic,
414 const gchar *verbname)
419 window = GL_WINDOW (user_data);
421 if (window->view != NULL) {
422 gl_view_align_selection_hcenter (GL_VIEW(window->view));
426 /*****************************************************************************/
427 /* Align objects top callback. */
428 /*****************************************************************************/
430 gl_tools_align_objects_top (BonoboUIComponent *uic,
432 const gchar *verbname)
437 window = GL_WINDOW (user_data);
439 if (window->view != NULL) {
440 gl_view_align_selection_top (GL_VIEW(window->view));
444 /*****************************************************************************/
445 /* Align objects bottom callback. */
446 /*****************************************************************************/
448 gl_tools_align_objects_bottom (BonoboUIComponent *uic,
450 const gchar *verbname)
455 window = GL_WINDOW (user_data);
457 if (window->view != NULL) {
458 gl_view_align_selection_bottom (GL_VIEW(window->view));
462 /*****************************************************************************/
463 /* Align objects vertical center callback. */
464 /*****************************************************************************/
466 gl_tools_align_objects_vcenter (BonoboUIComponent *uic,
468 const gchar *verbname)
473 window = GL_WINDOW (user_data);
475 if (window->view != NULL) {
476 gl_view_align_selection_vcenter (GL_VIEW(window->view));
480 /*****************************************************************************/
481 /* Center objects horizontally callback. */
482 /*****************************************************************************/
484 gl_tools_center_objects_horiz (BonoboUIComponent *uic,
486 const gchar *verbname)
491 window = GL_WINDOW (user_data);
493 if (window->view != NULL) {
494 gl_view_center_selection_horiz (GL_VIEW(window->view));
498 /*****************************************************************************/
499 /* Center objects vertically callback. */
500 /*****************************************************************************/
502 gl_tools_center_objects_vert (BonoboUIComponent *uic,
504 const gchar *verbname)
509 window = GL_WINDOW (user_data);
511 if (window->view != NULL) {
512 gl_view_center_selection_vert (GL_VIEW(window->view));