]> git.sur5r.net Git - glabels/blob - src/ui.c
a76b45ce21291d1325ef704b8d6434d8df6e2f86
[glabels] / src / ui.c
1 /*
2  *  ui.c
3  *  Copyright (C) 2001-2009  Jim Evins <evins@snaught.com>.
4  *
5  *  This file is part of gLabels.
6  *
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.
11  *
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.
16  *
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/>.
19  */
20
21 #include <config.h>
22
23 #include "ui.h"
24
25 #include <glib/gi18n.h>
26 #include <gconf/gconf-client.h>
27 #include <gtk/gtk.h>
28 #include <string.h>
29
30 #include "ui-util.h"
31 #include "ui-commands.h"
32 #include "file.h"
33 #include "prefs.h"
34 #include "stock.h"
35 #include "window.h"
36 #include "recent.h" 
37
38 #include "debug.h"
39
40
41 /*==========================================================================*/
42 /* Private macros and constants.                                            */
43 /*==========================================================================*/
44
45
46 /*==========================================================================*/
47 /* Private types.                                                           */
48 /*==========================================================================*/
49
50
51 /*==========================================================================*/
52 /* Local function prototypes                                                */
53 /*==========================================================================*/
54
55 static void view_ui_item_toggled_cb        (GtkToggleAction *action,
56                                             GtkUIManager    *ui);
57
58 static void set_app_main_toolbar_style     (GtkUIManager    *ui);
59
60 static void set_app_drawing_toolbar_style  (GtkUIManager    *ui);
61
62 static void set_view_style                 (GtkUIManager    *ui);
63
64 static void descend_menu_set_always_show_image (GtkMenu *menu);
65
66 static void set_additional_properties      (GtkUIManager    *ui);
67
68
69 static void connect_proxy_cb               (GtkUIManager    *ui,
70                                             GtkAction       *action,
71                                             GtkWidget       *proxy,
72                                             glWindow        *window);
73
74 static void disconnect_proxy_cb            (GtkUIManager    *ui,
75                                             GtkAction       *action,
76                                             GtkWidget       *proxy,
77                                             glWindow        *window);
78
79 static void menu_item_select_cb            (GtkMenuItem     *proxy,
80                                             glWindow        *window);
81
82 static void menu_item_deselect_cb          (GtkMenuItem     *proxy,
83                                             glWindow        *window);
84
85
86 /*==========================================================================*/
87 /* Private globals                                                          */
88 /*==========================================================================*/
89
90 static GtkActionEntry entries[] = {
91
92         /* Menu entries. */
93         { "FileMenu",                NULL, N_("_File") },
94         { "FileRecentsMenu",         NULL, N_("Open Recent _Files") },
95         { "EditMenu",                NULL, N_("_Edit") },
96         { "ViewMenu",                NULL, N_("_View") },
97         { "ViewMainToolBarMenu",     NULL, N_("Customize Main Toolbar") },
98         { "ViewDrawingToolBarMenu",  NULL, N_("Customize Drawing Toolbar") },
99         { "ViewPropertyToolBarMenu", NULL, N_("Customize Properties Toolbar") },
100         { "ObjectsMenu",             NULL, N_("_Objects") },
101         { "ObjectsCreateMenu",       NULL, N_("_Create") },
102         { "ObjectsOrderMenu",        NULL, N_("_Order") },
103         { "ObjectsRotateFlipMenu",   NULL, N_("_Rotate/Flip") },
104         { "ObjectsAlignHorizMenu",   NULL, N_("Align _Horizontal") },
105         { "ObjectsAlignVertMenu",    NULL, N_("Align _Vertical") },
106         { "HelpMenu",                NULL, N_("_Help") },
107
108         /* Popup entries. */
109         { "ContextMenu", NULL, N_("Context Menu") },
110         { "EmptySelectionContextMenu", NULL, N_("Context Menu") },
111
112         /* File action entries. */
113         { "FileNew",
114           GTK_STOCK_NEW,
115           N_("_New"),
116           "<control>N",
117           N_("Create a new file"),
118           G_CALLBACK (gl_ui_cmd_file_new) },
119
120         { "FileOpen",
121           GTK_STOCK_OPEN,
122           N_("_Open..."),
123           "<control>O",
124           N_("Open a file"),
125           G_CALLBACK (gl_ui_cmd_file_open) },
126
127         { "FileSave",
128           GTK_STOCK_SAVE,
129           N_("_Save"),
130           "<control>S",
131           N_("Save current file"),
132           G_CALLBACK (gl_ui_cmd_file_save) },
133
134         { "FileSaveAs",
135           GTK_STOCK_SAVE,
136           N_("Save _As..."),
137           "<shift><control>S",
138           N_("Save the current file to a different name"),
139           G_CALLBACK (gl_ui_cmd_file_save_as) },
140
141         { "FilePrint",
142           GTK_STOCK_PRINT,
143           N_("_Print..."),
144           "<control>P",
145           N_("Print the current file"),
146           G_CALLBACK (gl_ui_cmd_file_print) },
147
148         { "FileProperties",
149           GTK_STOCK_PROPERTIES,
150           N_("Properties..."),
151           NULL,
152           N_("Modify document properties"),
153           G_CALLBACK (gl_ui_cmd_file_properties) },
154
155         { "FileTemplateDesigner",
156           NULL,
157           N_("Template _Designer..."),
158           NULL,
159           N_("Create a custom template"),
160           G_CALLBACK (gl_ui_cmd_file_template_designer) },
161
162         { "FileClose",
163           GTK_STOCK_CLOSE,
164           N_("_Close"),
165           "<alt>F4",
166           N_("Close the current file"),
167           G_CALLBACK (gl_ui_cmd_file_close) },
168
169         { "FileQuit",
170           GTK_STOCK_QUIT,
171           N_("_Quit"),
172           "<control>Q",
173           N_("Quit the program"),
174           G_CALLBACK (gl_ui_cmd_file_quit) },
175
176
177         /* Edit action entries. */
178         { "EditCut",
179           GTK_STOCK_CUT,
180           N_("Cut"),
181           "<control>X",
182           N_("Cut the selection"),
183           G_CALLBACK (gl_ui_cmd_edit_cut) },
184
185         { "EditCopy",
186           GTK_STOCK_COPY,
187           N_("Copy"),
188           "<control>C",
189           N_("Copy the selection"),
190           G_CALLBACK (gl_ui_cmd_edit_copy) },
191
192         { "EditPaste",
193           GTK_STOCK_PASTE,
194           N_("Paste"),
195           "<control>V",
196           N_("Paste the clipboard"),
197           G_CALLBACK (gl_ui_cmd_edit_paste) },
198
199         { "EditDelete",
200           NULL,
201           N_("Delete"),
202           NULL,
203           N_("Delete the selected objects"),
204           G_CALLBACK (gl_ui_cmd_edit_delete) },
205
206         { "EditSelectAll",
207           NULL,
208           N_("Select All"),
209           "<control>A",
210           N_("Select all objects"),
211           G_CALLBACK (gl_ui_cmd_edit_select_all) },
212
213         { "EditUnSelectAll",
214           NULL,
215           N_("Un-select All"),
216           NULL,
217           N_("Remove all selections"),
218           G_CALLBACK (gl_ui_cmd_edit_unselect_all) },
219
220         { "EditPreferences",
221           GTK_STOCK_PREFERENCES,
222           N_("Preferences"),
223           NULL,
224           N_("Configure the application"),
225           G_CALLBACK (gl_ui_cmd_edit_preferences) },
226
227
228         /* View action entries. */
229         { "ViewZoomIn",
230           GTK_STOCK_ZOOM_IN,
231           N_("Zoom in"),
232           NULL,
233           N_("Increase magnification"),
234           G_CALLBACK (gl_ui_cmd_view_zoomin) },
235
236         { "ViewZoomOut",
237           GTK_STOCK_ZOOM_OUT,
238           N_("Zoom out"),
239           NULL,
240           N_("Decrease magnification"),
241           G_CALLBACK (gl_ui_cmd_view_zoomout) },
242
243         { "ViewZoom1to1",
244           GTK_STOCK_ZOOM_100,
245           N_("Zoom 1 to 1"),
246           NULL,
247           N_("Restore scale to 100%"),
248           G_CALLBACK (gl_ui_cmd_view_zoom1to1) },
249
250         { "ViewZoomToFit",
251           GTK_STOCK_ZOOM_FIT,
252           N_("Zoom to fit"),
253           NULL,
254           N_("Set scale to fit window"),
255           G_CALLBACK (gl_ui_cmd_view_zoom_to_fit) },
256
257
258         /* Objects action entries. */
259         { "ObjectsArrowMode",
260           GL_STOCK_ARROW,
261           N_("Select Mode"),
262           NULL,
263           N_("Select, move and modify objects"),
264           G_CALLBACK (gl_ui_cmd_objects_arrow_mode) },
265
266         { "ObjectsCreateText",
267           GL_STOCK_TEXT,
268           N_("Text"),
269           NULL,
270           N_("Create text object"),
271           G_CALLBACK (gl_ui_cmd_objects_create_text) },
272
273         { "ObjectsCreateBox",
274           GL_STOCK_BOX,
275           N_("Box"),
276           NULL,
277           N_("Create box/rectangle object"),
278           G_CALLBACK (gl_ui_cmd_objects_create_box) },
279
280         { "ObjectsCreateLine",
281           GL_STOCK_LINE,
282           N_("Line"),
283           NULL,
284           N_("Create line object"),
285           G_CALLBACK (gl_ui_cmd_objects_create_line) },
286
287         { "ObjectsCreateEllipse",
288           GL_STOCK_ELLIPSE,
289           N_("Ellipse"),
290           NULL,
291           N_("Create ellipse/circle object"),
292           G_CALLBACK (gl_ui_cmd_objects_create_ellipse) },
293
294         { "ObjectsCreateImage",
295           GL_STOCK_IMAGE,
296           N_("Image"),
297           NULL,
298           N_("Create image object"),
299           G_CALLBACK (gl_ui_cmd_objects_create_image) },
300
301         { "ObjectsCreateBarcode",
302           GL_STOCK_BARCODE,
303           N_("Barcode"),
304           NULL,
305           N_("Create barcode object"),
306           G_CALLBACK (gl_ui_cmd_objects_create_barcode) },
307         
308         { "ObjectsRaise",
309           GL_STOCK_ORDER_TOP,
310           N_("Bring to front"),
311           NULL,
312           N_("Raise object to top"),
313           G_CALLBACK (gl_ui_cmd_objects_raise) },
314
315         { "ObjectsLower",
316           GL_STOCK_ORDER_BOTTOM,
317           N_("Send to back"),
318           NULL,
319           N_("Lower object to bottom"),
320           G_CALLBACK (gl_ui_cmd_objects_lower) },
321
322         { "ObjectsRotateLeft",
323           GL_STOCK_ROTATE_LEFT,
324           N_("Rotate left"),
325           NULL,
326           N_("Rotate object 90 degrees counter-clockwise"),
327           G_CALLBACK (gl_ui_cmd_objects_rotate_left) },
328
329         { "ObjectsRotateRight",
330           GL_STOCK_ROTATE_RIGHT,
331           N_("Rotate right"),
332           NULL,
333           N_("Rotate object 90 degrees clockwise"),
334           G_CALLBACK (gl_ui_cmd_objects_rotate_right) },
335
336         { "ObjectsFlipHorizontal",
337           GL_STOCK_FLIP_HORIZ,
338           N_("Flip horizontally"),
339           NULL,
340           N_("Flip object horizontally"),
341           G_CALLBACK (gl_ui_cmd_objects_flip_horiz) },
342
343         { "ObjectsFlipVertical",
344           GL_STOCK_FLIP_VERT,
345           N_("Flip vertically"),
346           NULL,
347           N_("Flip object vertically"),
348           G_CALLBACK (gl_ui_cmd_objects_flip_vert) },
349
350         { "ObjectsAlignLeft",
351           GL_STOCK_ALIGN_LEFT,
352           N_("Align left"),
353           NULL,
354           N_("Align objects to left edges"),
355           G_CALLBACK (gl_ui_cmd_objects_align_left) },
356
357         { "ObjectsAlignRight",
358           GL_STOCK_ALIGN_RIGHT,
359           N_("Align right"),
360           NULL,
361           N_("Align objects to right edges"),
362           G_CALLBACK (gl_ui_cmd_objects_align_right) },
363
364         { "ObjectsAlignHCenter",
365           GL_STOCK_ALIGN_HCENTER,
366           N_("Align horizontal center"),
367           NULL,
368           N_("Align objects to horizontal centers"),
369           G_CALLBACK (gl_ui_cmd_objects_align_hcenter) },
370
371         { "ObjectsAlignTop",
372           GL_STOCK_ALIGN_TOP,
373           N_("Align tops"),
374           NULL,
375           N_("Align objects to top edges"),
376           G_CALLBACK (gl_ui_cmd_objects_align_top) },
377
378         { "ObjectsAlignBottom",
379           GL_STOCK_ALIGN_BOTTOM,
380           N_("Align bottoms"),
381           NULL,
382           N_("Align objects to bottom edges"),
383           G_CALLBACK (gl_ui_cmd_objects_align_bottom) },
384
385         { "ObjectsAlignVCenter",
386           GL_STOCK_ALIGN_VCENTER,
387           N_("Align vertical center"),
388           NULL,
389           N_("Align objects to vertical centers"),
390           G_CALLBACK (gl_ui_cmd_objects_align_vcenter) },
391
392         { "ObjectsCenterHorizontal",
393           GL_STOCK_CENTER_HORIZ,
394           N_("Center horizontally"),
395           NULL,
396           N_("Center objects to horizontal label center"),
397           G_CALLBACK (gl_ui_cmd_objects_center_horiz) },
398
399         { "ObjectsCenterVertical",
400           GL_STOCK_CENTER_VERT,
401           N_("Center vertically"),
402           NULL,
403           N_("Center objects to vertical label center"),
404           G_CALLBACK (gl_ui_cmd_objects_center_vert) },
405
406         { "ObjectsMergeProperties",
407           GL_STOCK_MERGE,
408           N_("Merge properties"),
409           NULL,
410           N_("Edit merge properties"),
411           G_CALLBACK (gl_ui_cmd_objects_merge_properties) },
412
413
414         /* Help actions entries. */
415         { "HelpContents",
416           GTK_STOCK_HELP,
417           N_("Contents"),
418           "F1",
419           N_("Open glabels manual"),
420           G_CALLBACK (gl_ui_cmd_help_contents) },
421
422         { "HelpAbout",
423           GTK_STOCK_ABOUT,
424           N_("About..."),
425           NULL,
426           N_("About glabels"),
427           G_CALLBACK (gl_ui_cmd_help_about) },
428
429 };
430 static guint n_entries = G_N_ELEMENTS (entries);
431
432 static GtkToggleActionEntry toggle_entries[] = {
433
434         { "ViewPropertyToolBar",
435           NULL,
436           N_("Property toolbar"),
437           NULL,
438           N_("Change the visibility of the property toolbar in the current window"),
439           G_CALLBACK (gl_ui_cmd_view_property_bar_toggle),
440           TRUE },
441
442         { "ViewGrid",
443           NULL,
444           N_("Grid"),
445           NULL,
446           N_("Change the visibility of the grid in the current window"),
447           G_CALLBACK (gl_ui_cmd_view_grid_toggle),
448           TRUE },
449
450         { "ViewMarkup",
451           NULL,
452           N_("Markup"),
453           NULL,
454           N_("Change the visibility of markup lines in the current window"),
455           G_CALLBACK (gl_ui_cmd_view_markup_toggle),
456           TRUE },
457
458 };
459 static guint n_toggle_entries = G_N_ELEMENTS (toggle_entries);
460
461 static GtkToggleActionEntry ui_toggle_entries[] = {
462
463         { "ViewMainToolBar",
464           NULL,
465           N_("Main toolbar"),
466           NULL,
467           N_("Change the visibility of the main toolbar in the current window"),
468           G_CALLBACK (view_ui_item_toggled_cb),
469           TRUE },
470
471         { "ViewDrawingToolBar",
472           NULL,
473           N_("Drawing toolbar"),
474           NULL,
475           N_("Change the visibility of the drawing toolbar in the current window"),
476           G_CALLBACK (view_ui_item_toggled_cb),
477           TRUE },
478
479 };
480 static guint n_ui_toggle_entries = G_N_ELEMENTS (ui_toggle_entries);
481
482 static const gchar *ui_info = 
483 "<ui>"
484 ""
485 "       <menubar name='MenuBar'>"
486 "               <menu action='FileMenu'>"
487 "                       <menuitem action='FileNew' />"
488 "                       <menuitem action='FileOpen' />"
489 "                       <menuitem action='FileRecentsMenu' />"
490 "                       <separator />"
491 "                       <menuitem action='FileSave' />"
492 "                       <menuitem action='FileSaveAs' />"
493 "                       <separator />"
494 "                       <menuitem action='FilePrint' />"
495 "                       <separator />"
496 "                       <menuitem action='FileProperties' />"
497 "                       <menuitem action='FileTemplateDesigner' />"
498 "                       <separator />"
499 "                       <menuitem action='FileClose' />"
500 "                       <menuitem action='FileQuit' />"
501 "               </menu>"
502 "               <menu action='EditMenu'>"
503 "                       <menuitem action='EditCut' />"
504 "                       <menuitem action='EditCopy' />"
505 "                       <menuitem action='EditPaste' />"
506 "                       <menuitem action='EditDelete' />"
507 "                       <separator />"
508 "                       <menuitem action='EditSelectAll' />"
509 "                       <menuitem action='EditUnSelectAll' />"
510 "                       <separator />"
511 "                       <menuitem action='EditPreferences' />"
512 "               </menu>"
513 "               <menu action='ViewMenu'>"
514 "                       <menuitem action='ViewMainToolBar' />"
515 "                       <menuitem action='ViewDrawingToolBar' />"
516 "                       <menuitem action='ViewPropertyToolBar' />"
517 "                       <separator />"
518 "                       <menuitem action='ViewGrid' />"
519 "                       <menuitem action='ViewMarkup' />"
520 "                       <separator />"
521 "                       <menuitem action='ViewZoomIn' />"
522 "                       <menuitem action='ViewZoomOut' />"
523 "                       <menuitem action='ViewZoom1to1' />"
524 "                       <menuitem action='ViewZoomToFit' />"
525 "               </menu>"
526 "               <menu action='ObjectsMenu'>"
527 "                       <menuitem action='ObjectsArrowMode' />"
528 "                       <menu action='ObjectsCreateMenu'>"
529 "                               <menuitem action='ObjectsCreateText' />"
530 "                               <menuitem action='ObjectsCreateBox' />"
531 "                               <menuitem action='ObjectsCreateLine' />"
532 "                               <menuitem action='ObjectsCreateEllipse' />"
533 "                               <menuitem action='ObjectsCreateImage' />"
534 "                               <menuitem action='ObjectsCreateBarcode' />"
535 "                       </menu>"
536 "                       <separator />"
537 "                       <menu action='ObjectsOrderMenu'>"
538 "                               <menuitem action='ObjectsRaise' />"
539 "                               <menuitem action='ObjectsLower' />"
540 "                       </menu>"
541 "                       <menu action='ObjectsRotateFlipMenu'>"
542 "                               <menuitem action='ObjectsRotateLeft' />"
543 "                               <menuitem action='ObjectsRotateRight' />"
544 "                               <menuitem action='ObjectsFlipHorizontal' />"
545 "                               <menuitem action='ObjectsFlipVertical' />"
546 "                       </menu>"
547 "                       <menu action='ObjectsAlignHorizMenu'>"
548 "                               <menuitem action='ObjectsAlignLeft' />"
549 "                               <menuitem action='ObjectsAlignHCenter' />"
550 "                               <menuitem action='ObjectsAlignRight' />"
551 "                               <menuitem action='ObjectsCenterHorizontal' />"
552 "                       </menu>"
553 "                       <menu action='ObjectsAlignVertMenu'>"
554 "                               <menuitem action='ObjectsAlignTop' />"
555 "                               <menuitem action='ObjectsAlignVCenter' />"
556 "                               <menuitem action='ObjectsAlignBottom' />"
557 "                               <menuitem action='ObjectsCenterVertical' />"
558 "                       </menu>"
559 "                       <separator />"
560 "                       <menuitem action='ObjectsMergeProperties' />"
561 "               </menu>"
562 "               <menu action='HelpMenu'>"
563 "                       <menuitem action='HelpContents' />"
564 "                       <menuitem action='HelpAbout' />"
565 "               </menu>"
566 "       </menubar>"
567 ""
568 "       <toolbar name='MainToolBar'>"
569 "               <toolitem action='FileNew' />"
570 "               <toolitem action='FileOpen' />"
571 "               <toolitem action='FileSave' />"
572 "               <separator />"
573 "               <toolitem action='FilePrint' />"
574 "               <separator />"
575 "               <toolitem action='EditCut' />"
576 "               <toolitem action='EditCopy' />"
577 "               <toolitem action='EditPaste' />"
578 "       </toolbar>"
579 ""
580 "       <toolbar name='DrawingToolBar'>"
581 "               <toolitem action='ObjectsArrowMode' />"
582 "               <separator />"
583 "               <toolitem action='ObjectsCreateText' />"
584 "               <toolitem action='ObjectsCreateBox' />"
585 "               <toolitem action='ObjectsCreateLine' />"
586 "               <toolitem action='ObjectsCreateEllipse' />"
587 "               <toolitem action='ObjectsCreateImage' />"
588 "               <toolitem action='ObjectsCreateBarcode' />"
589 "               <separator />"
590 "               <toolitem action='ViewZoomIn' />"
591 "               <toolitem action='ViewZoomOut' />"
592 "               <toolitem action='ViewZoom1to1' />"
593 "               <toolitem action='ViewZoomToFit' />"
594 "               <separator />"
595 "               <toolitem action='ObjectsMergeProperties' />"
596 "       </toolbar>"
597 ""
598 "       <popup action='ContextMenu'>"
599 "               <menu action='ObjectsOrderMenu'>"
600 "                       <menuitem action='ObjectsRaise' />"
601 "                       <menuitem action='ObjectsLower' />"
602 "               </menu>"
603 "               <menu action='ObjectsRotateFlipMenu'>"
604 "                       <menuitem action='ObjectsRotateLeft' />"
605 "                       <menuitem action='ObjectsRotateRight' />"
606 "                       <menuitem action='ObjectsFlipHorizontal' />"
607 "                       <menuitem action='ObjectsFlipVertical' />"
608 "               </menu>"
609 "               <menu action='ObjectsAlignHorizMenu'>"
610 "                       <menuitem action='ObjectsAlignLeft' />"
611 "                       <menuitem action='ObjectsAlignHCenter' />"
612 "                       <menuitem action='ObjectsAlignRight' />"
613 "                       <menuitem action='ObjectsCenterHorizontal' />"
614 "               </menu>"
615 "               <menu action='ObjectsAlignVertMenu'>"
616 "                       <menuitem action='ObjectsAlignTop' />"
617 "                       <menuitem action='ObjectsAlignVCenter' />"
618 "                       <menuitem action='ObjectsAlignBottom' />"
619 "                       <menuitem action='ObjectsCenterVertical' />"
620 "               </menu>"
621 "               <separator />"
622 "               <menuitem action='EditCut' />"
623 "               <menuitem action='EditCopy' />"
624 "               <menuitem action='EditPaste' />"
625 "               <menuitem action='EditDelete' />"
626 "       </popup>"
627 ""
628 "       <popup action='EmptySelectionContextMenu'>"
629 "               <menuitem action='EditPaste' />"
630 "       </popup>"
631 ""
632 "</ui>";
633
634
635 static gchar* doc_verbs [] = {
636         "/ui/MenuBar/FileMenu/FileProperties",
637         "/ui/MenuBar/FileMenu/FileSave",
638         "/ui/MenuBar/FileMenu/FileSaveAs",
639         "/ui/MenuBar/FileMenu/FilePrint",
640         "/ui/MenuBar/FileMenu/FileClose",
641         "/ui/MenuBar/EditMenu/EditCut",
642         "/ui/MenuBar/EditMenu/EditCopy",
643         "/ui/MenuBar/EditMenu/EditDelete",
644         "/ui/MenuBar/EditMenu/EditSelectAll",
645         "/ui/MenuBar/EditMenu/EditUnSelectAll",
646         "/ui/MenuBar/ViewMenu/ViewZoomIn",
647         "/ui/MenuBar/ViewMenu/ViewZoomOut",
648         "/ui/MenuBar/ViewMenu/ViewZoom1to1",
649         "/ui/MenuBar/ViewMenu/ViewZoomToFit",
650         "/ui/MenuBar/ViewMenu/ViewGrid",
651         "/ui/MenuBar/ViewMenu/ViewMarkup",
652         "/ui/MenuBar/ObjectsMenu/ObjectsArrowMode",
653         "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateText",
654         "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateLine",
655         "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateBox",
656         "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateEllipse",
657         "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateImage",
658         "/ui/MenuBar/ObjectsMenu/ObjectsCreateMenu/ObjectsCreateBarcode",
659         "/ui/MenuBar/ObjectsMenu/ObjectsOrderMenu/ObjectsRaise",
660         "/ui/MenuBar/ObjectsMenu/ObjectsOrderMenu/ObjectsLower",
661         "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsRotateLeft",
662         "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsRotateRight",
663         "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsFlipHorizontal",
664         "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsFlipVertical",
665         "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignLeft",
666         "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignRight",
667         "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignHCenter",
668         "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsCenterHorizontal",
669         "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignTop",
670         "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignBottom",
671         "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignVCenter",
672         "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsCenterVertical",
673         "/ui/MenuBar/ObjectsMenu/ObjectsMergeProperties",
674
675         NULL
676 };
677
678 static gchar* doc_modified_verbs [] = {
679         "/ui/MenuBar/FileMenu/FileSave",
680
681         NULL
682 };
683
684 static gchar* paste_verbs [] = {
685         "/ui/MenuBar/EditMenu/EditPaste",
686
687         NULL
688 };
689
690 static gchar* selection_verbs [] = {
691         "/ui/MenuBar/EditMenu/EditCut",
692         "/ui/MenuBar/EditMenu/EditCopy",
693         "/ui/MenuBar/EditMenu/EditDelete",
694         "/ui/MenuBar/EditMenu/EditUnSelectAll",
695         "/ui/MenuBar/ObjectsMenu/ObjectsOrderMenu/ObjectsRaise",
696         "/ui/MenuBar/ObjectsMenu/ObjectsOrderMenu/ObjectsLower",
697         "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsRotateLeft",
698         "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsRotateRight",
699         "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsFlipHorizontal",
700         "/ui/MenuBar/ObjectsMenu/ObjectsRotateFlipMenu/ObjectsFlipVertical",
701         "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsCenterHorizontal",
702         "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsCenterVertical",
703
704         NULL
705 };
706
707 static gchar* atomic_selection_verbs [] = {
708
709         NULL
710 };
711
712 static gchar* multi_selection_verbs [] = {
713         "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignLeft",
714         "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignRight",
715         "/ui/MenuBar/ObjectsMenu/ObjectsAlignHorizMenu/ObjectsAlignHCenter",
716         "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignTop",
717         "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignBottom",
718         "/ui/MenuBar/ObjectsMenu/ObjectsAlignVertMenu/ObjectsAlignVCenter",
719
720         NULL
721 };
722
723
724 /*****************************************************************************/
725 /** Initialize UI component for given window.                                */
726 /*****************************************************************************/
727 GtkUIManager *
728 gl_ui_new (glWindow *window)
729 {
730         GtkUIManager            *ui;
731         GtkActionGroup          *actions;
732         GError                  *error = NULL;
733         GtkWidget               *recent_menu;
734
735         gl_debug (DEBUG_UI, "START");
736
737         g_return_val_if_fail (window && GL_IS_WINDOW (window), NULL);
738
739         gl_debug (DEBUG_UI, "window = %p", window);
740
741         ui = gtk_ui_manager_new ();
742
743         g_signal_connect (ui, "connect_proxy",
744                           G_CALLBACK (connect_proxy_cb), window);
745         g_signal_connect (ui, "disconnect_proxy",
746                           G_CALLBACK (disconnect_proxy_cb), window);
747
748         actions = gtk_action_group_new ("Actions");
749         gtk_action_group_set_translation_domain (actions, NULL);
750         gtk_action_group_add_actions (actions, entries, n_entries, GTK_WINDOW (window));
751         gtk_action_group_add_toggle_actions (actions, 
752                                              toggle_entries, n_toggle_entries, 
753                                              window);
754         gtk_action_group_add_toggle_actions (actions, 
755                                              ui_toggle_entries, n_ui_toggle_entries, 
756                                              ui);
757
758         gtk_ui_manager_insert_action_group (ui, actions, 0);
759         gtk_window_add_accel_group (GTK_WINDOW (window), gtk_ui_manager_get_accel_group (ui));
760
761         gl_debug (DEBUG_UI, "Creating ui from string");
762         if (!gtk_ui_manager_add_ui_from_string (ui, ui_info, strlen (ui_info), &error)) {
763                 g_message ("building menus failed: %s", error->message);
764                 g_error_free (error);
765         }
766
767         /* Set the toolbar styles according to prefs */
768         set_app_main_toolbar_style (ui);
769         set_app_drawing_toolbar_style (ui);
770                 
771         /* Set view grid and markup visibility according to prefs */
772         set_view_style (ui);
773                 
774         /* add an Open Recents Submenu */
775         recent_menu  = gl_recent_create_menu ();
776         g_signal_connect (G_OBJECT (recent_menu), "item-activated",
777                           G_CALLBACK (gl_ui_cmd_file_open_recent), window);
778         gtk_menu_item_set_submenu (GTK_MENU_ITEM (gtk_ui_manager_get_widget (ui, "/MenuBar/FileMenu/FileRecentsMenu")),
779                                    recent_menu);
780
781
782         set_additional_properties (ui);
783
784         gl_ui_util_set_verb_list_sensitive (ui, doc_verbs, FALSE);
785         gl_ui_util_set_verb_list_sensitive (ui, paste_verbs, FALSE);
786
787         gl_debug (DEBUG_UI, "END");
788
789         return ui;
790 }
791
792
793 /*****************************************************************************/
794 /** Unref wrapper.                                                           */
795 /*****************************************************************************/
796 void
797 gl_ui_unref (GtkUIManager *ui)
798 {
799         gl_debug (DEBUG_UI, "START");
800
801         g_object_unref(ui);
802
803         gl_debug (DEBUG_UI, "END");
804 }
805
806
807 /*****************************************************************************/
808 /** Update all verbs of given UI component.                                  */
809 /*****************************************************************************/
810 void
811 gl_ui_update_all (GtkUIManager *ui,
812                   glView       *view)
813 {
814         glLabel *label;
815
816         gl_debug (DEBUG_UI, "START");
817
818         gl_ui_util_set_verb_list_sensitive (ui, doc_verbs, TRUE);
819
820         label = view->label;
821         g_return_if_fail (label != NULL);
822
823         gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/EditMenu/EditUndo",
824                                        gl_label_can_undo (label));
825         gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/EditMenu/EditRedo",
826                                        gl_label_can_redo (label));
827
828         gl_ui_util_set_verb_list_sensitive (ui, doc_modified_verbs,
829                                             gl_label_is_modified (label));
830
831         gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/ViewMenu/ViewZoomIn",
832                                        !gl_view_is_zoom_max (view));
833         gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/ViewMenu/ViewZoomOut",
834                                        !gl_view_is_zoom_min (view));
835
836         gl_ui_util_set_verb_list_sensitive (ui, selection_verbs,
837                                             !gl_label_is_selection_empty (label));
838
839         gl_ui_util_set_verb_list_sensitive (ui, atomic_selection_verbs,
840                                             gl_label_is_selection_atomic (label));
841
842         gl_ui_util_set_verb_list_sensitive (ui, multi_selection_verbs,
843                                             !gl_label_is_selection_empty (label)
844                                             && !gl_label_is_selection_atomic (label));
845
846         gl_debug (DEBUG_UI, "END");
847 }
848
849
850 /*****************************************************************************/
851 /** Update label modified verbs of given UI component.                       */
852 /*****************************************************************************/
853 void
854 gl_ui_update_modified_verbs (GtkUIManager *ui,
855                              glLabel      *label)
856 {
857         gl_debug (DEBUG_UI, "START");
858
859         gl_ui_util_set_verb_list_sensitive (ui, 
860                                             doc_modified_verbs,
861                                             gl_label_is_modified (label));
862
863         gl_debug (DEBUG_UI, "END");
864 }
865
866
867 /*****************************************************************************/
868 /** Update verbs associated with selection state of given UI component.      */
869 /*****************************************************************************/
870 void
871 gl_ui_update_selection_verbs (GtkUIManager *ui,
872                               glView       *view,
873                               gboolean      has_focus)
874 {
875         gl_debug (DEBUG_UI, "START");
876
877         if ( has_focus )
878         {
879                 gl_ui_util_set_verb_list_sensitive (ui, selection_verbs,
880                                                     !gl_label_is_selection_empty (view->label));
881
882                 gl_ui_util_set_verb_list_sensitive (ui, atomic_selection_verbs,
883                                                     gl_label_is_selection_atomic (view->label));
884
885                 gl_ui_util_set_verb_list_sensitive (ui, multi_selection_verbs,
886                                                     !gl_label_is_selection_empty (view->label)
887                                                     && !gl_label_is_selection_atomic (view->label));
888         }
889         else
890         {
891                 gl_ui_util_set_verb_list_sensitive (ui, selection_verbs, FALSE);
892                 gl_ui_util_set_verb_list_sensitive (ui, atomic_selection_verbs, FALSE);
893                 gl_ui_util_set_verb_list_sensitive (ui, multi_selection_verbs, FALSE);
894         }
895
896         gl_debug (DEBUG_UI, "END");
897 }
898
899
900 /*****************************************************************************/
901 /** Update verbs associated with zoom level of given UI component.           */
902 /*****************************************************************************/
903 void
904 gl_ui_update_zoom_verbs (GtkUIManager *ui,
905                          glView       *view)
906 {
907         gl_debug (DEBUG_UI, "START");
908
909         gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/ViewMenu/ViewZoomIn",
910                                        !gl_view_is_zoom_max (view));
911         gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/ViewMenu/ViewZoomOut",
912                                        !gl_view_is_zoom_min (view));
913
914         gl_debug (DEBUG_UI, "END");
915 }
916
917
918 /*****************************************************************************/
919 /** Update paste verbs of given UI component.                                */
920 /*****************************************************************************/
921 void
922 gl_ui_update_paste_verbs (GtkUIManager      *ui,
923                           gboolean           can_paste)
924 {
925         gl_debug (DEBUG_UI, "START");
926
927         gl_ui_util_set_verb_list_sensitive (ui, paste_verbs, can_paste);
928
929         gl_debug (DEBUG_UI, "END");
930 }
931
932
933 /*****************************************************************************/
934 /** Update undo/redo verbs of given UI component.                            */
935 /*****************************************************************************/
936 void
937 gl_ui_update_undo_redo_verbs (GtkUIManager *ui,
938                               glLabel      *label)
939 {
940         gl_debug (DEBUG_UI, "START");
941
942         gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/EditMenu/EditUndo",
943                                        gl_label_can_undo (label));
944
945         gl_ui_util_set_verb_sensitive (ui, "/ui/MenuBar/EditMenu/EditRedo",
946                                        gl_label_can_redo (label));
947
948         gl_debug (DEBUG_UI, "END");
949 }
950
951
952 /*---------------------------------------------------------------------------*/
953 /** PRIVATE.  View menu item toggled callback.                               */
954 /*---------------------------------------------------------------------------*/
955 static void
956 view_ui_item_toggled_cb (GtkToggleAction *action,
957                          GtkUIManager    *ui)
958 {
959         const gchar *name;
960         gboolean     state;
961
962         gl_debug (DEBUG_UI, "START");
963
964         g_return_if_fail (action && GTK_IS_TOGGLE_ACTION (action));
965
966         name  = gtk_action_get_name (GTK_ACTION (action));
967         state = gtk_toggle_action_get_active (action);
968
969         gl_debug (DEBUG_UI, "Action = %s, State = %d", name, state);
970
971         if (strcmp (name, "ViewMainToolBar") == 0)
972         {
973                 gl_prefs_model_set_main_toolbar_visible (gl_prefs, state);
974                 set_app_main_toolbar_style (ui);
975         }
976
977         if (strcmp (name, "ViewDrawingToolBar") == 0)
978         {
979                 gl_prefs_model_set_drawing_toolbar_visible (gl_prefs, state);
980                 set_app_drawing_toolbar_style (ui);
981         }
982
983         gl_debug (DEBUG_UI, "");
984 }
985
986
987 /*---------------------------------------------------------------------------*/
988 /** PRIVATE.  Set main toolbar style.                                        */
989 /*---------------------------------------------------------------------------*/
990 static void
991 set_app_main_toolbar_style (GtkUIManager *ui)
992 {
993         GtkWidget *toolbar;
994
995         gl_debug (DEBUG_UI, "START");
996
997         g_return_if_fail (ui && GTK_IS_UI_MANAGER (ui));
998                         
999         /* Updated view menu */
1000         gl_ui_util_set_verb_state (ui, "/ui/ViewMenu/ViewMainToolBar",
1001                                    gl_prefs_model_get_main_toolbar_visible (gl_prefs));
1002
1003         toolbar = gtk_ui_manager_get_widget (ui, "/MainToolBar");
1004
1005         if (gl_prefs_model_get_main_toolbar_visible (gl_prefs)) {
1006                 gtk_widget_show_all (toolbar);
1007         } else {
1008                 gtk_widget_hide (toolbar);
1009         }
1010         
1011         gl_debug (DEBUG_UI, "END");
1012 }
1013
1014
1015 /*---------------------------------------------------------------------------*/
1016 /** PRIVATE.  Set drawing toolbar style.                                     */
1017 /*---------------------------------------------------------------------------*/
1018 static void
1019 set_app_drawing_toolbar_style (GtkUIManager *ui)
1020 {
1021         GtkWidget *toolbar;
1022
1023         gl_debug (DEBUG_UI, "START");
1024
1025         g_return_if_fail (ui && GTK_IS_UI_MANAGER (ui));
1026                         
1027         /* Updated view menu */
1028         gl_ui_util_set_verb_state (ui, "/ui/MenuBar/ViewMenu/ViewDrawingToolBar",
1029                                    gl_prefs_model_get_drawing_toolbar_visible (gl_prefs));
1030
1031         toolbar = gtk_ui_manager_get_widget (ui, "/DrawingToolBar");
1032
1033         gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_ICONS);
1034
1035         if (gl_prefs_model_get_drawing_toolbar_visible (gl_prefs)) {
1036                 gtk_widget_show_all (toolbar);
1037         } else {
1038                 gtk_widget_hide (toolbar);
1039         }
1040         
1041         gl_debug (DEBUG_UI, "END");
1042 }
1043
1044
1045 /*---------------------------------------------------------------------------*/
1046 /** PRIVATE.  Set visibility of grid and markup.                             */
1047 /*---------------------------------------------------------------------------*/
1048 static void
1049 set_view_style (GtkUIManager *ui)
1050 {
1051         gl_debug (DEBUG_UI, "START");
1052
1053         g_return_if_fail (ui && GTK_IS_UI_MANAGER(ui));
1054                         
1055         gl_ui_util_set_verb_state (ui, "/ui/MenuBar/ViewMenu/ViewGrid",
1056                                    gl_prefs_model_get_grid_visible (gl_prefs));
1057
1058         gl_ui_util_set_verb_state (ui, "/ui/MenuBar/ViewMenu/ViewMarkup",
1059                                    gl_prefs_model_get_markup_visible (gl_prefs));
1060
1061         gl_debug (DEBUG_UI, "END");
1062 }
1063
1064
1065 /*---------------------------------------------------------------------------*/
1066 /** PRIVATE.  Descend menu, set "always-show-image" for all image menu items.*/
1067 /*---------------------------------------------------------------------------*/
1068 static void
1069 descend_menu_set_always_show_image (GtkMenu *menu)
1070 {
1071         GList       *children, *p;
1072         GtkWidget   *submenu;
1073         GtkWidget   *menu_item;
1074
1075         children = gtk_container_get_children (GTK_CONTAINER (menu));
1076
1077         for ( p = children; p != NULL; p = p->next )
1078         {
1079                 menu_item = GTK_WIDGET (p->data);
1080
1081                 submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu_item));
1082                 if ( submenu )
1083                 {
1084                         descend_menu_set_always_show_image (GTK_MENU (submenu));
1085                 }
1086                 else if ( GTK_IS_IMAGE_MENU_ITEM (menu_item) )
1087                 {
1088                         g_object_set (menu_item, "always-show-image", TRUE, NULL);
1089                 }
1090         }
1091 }
1092
1093
1094 /*---------------------------------------------------------------------------*/
1095 /** PRIVATE.  Set additional properties.                                     */
1096 /*---------------------------------------------------------------------------*/
1097 static void
1098 set_additional_properties (GtkUIManager *ui)
1099 {
1100         GtkWidget  *menu;
1101         GtkWidget  *menu_item;
1102
1103         /*
1104          * Set "always-show-image" property for all Object menuitems.  This is
1105          * necessary because, as of Gtk-2.18, images are not shown by default
1106          * and you really need these visual cues for these menu items.
1107          */
1108         menu_item = gtk_ui_manager_get_widget (ui, "/MenuBar/ObjectsMenu/");
1109         menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu_item));
1110         descend_menu_set_always_show_image (GTK_MENU (menu));
1111
1112         menu_item = gtk_ui_manager_get_widget (ui, "/MenuBar/ObjectsMenu/ObjectsMergeProperties");
1113         g_object_set (menu_item, "always-show-image", FALSE, NULL); /* Leave this one out. */
1114
1115         menu_item = gtk_ui_manager_get_widget (ui, "/ContextMenu/ObjectsOrderMenu/");
1116         menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu_item));
1117         descend_menu_set_always_show_image (GTK_MENU (menu));
1118
1119         menu_item = gtk_ui_manager_get_widget (ui, "/ContextMenu/ObjectsRotateFlipMenu/");
1120         menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu_item));
1121         descend_menu_set_always_show_image (GTK_MENU (menu));
1122
1123         menu_item = gtk_ui_manager_get_widget (ui, "/ContextMenu/ObjectsAlignHorizMenu/");
1124         menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu_item));
1125         descend_menu_set_always_show_image (GTK_MENU (menu));
1126
1127         menu_item = gtk_ui_manager_get_widget (ui, "/ContextMenu/ObjectsAlignVertMenu/");
1128         menu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu_item));
1129         descend_menu_set_always_show_image (GTK_MENU (menu));
1130 }
1131
1132
1133 /*---------------------------------------------------------------------------*/
1134 /** PRIVATE.  Connect proxy callback.                                        */
1135 /*---------------------------------------------------------------------------*/
1136 static void
1137 connect_proxy_cb (GtkUIManager *ui,
1138                   GtkAction    *action,
1139                   GtkWidget    *proxy,
1140                   glWindow     *window)
1141 {
1142         if (GTK_IS_MENU_ITEM (proxy))
1143         {
1144                 g_signal_connect (proxy, "select",
1145                                   G_CALLBACK (menu_item_select_cb), window);
1146                 g_signal_connect (proxy, "deselect",
1147                                   G_CALLBACK (menu_item_deselect_cb), window);
1148         }
1149 }
1150
1151
1152 /*---------------------------------------------------------------------------*/
1153 /** PRIVATE.  Disconnect proxy callback.                                     */
1154 /*---------------------------------------------------------------------------*/
1155 static void
1156 disconnect_proxy_cb (GtkUIManager *ui,
1157                      GtkAction    *action,
1158                      GtkWidget    *proxy,
1159                      glWindow     *window)
1160 {
1161         if (GTK_IS_MENU_ITEM (proxy))
1162         {
1163                 g_signal_handlers_disconnect_by_func
1164                         (proxy, G_CALLBACK (menu_item_select_cb), window);
1165                 g_signal_handlers_disconnect_by_func
1166                         (proxy, G_CALLBACK (menu_item_deselect_cb), window);
1167         }
1168 }
1169
1170
1171 /*---------------------------------------------------------------------------*/
1172 /** PRIVATE.  Menu item select callback.                                     */
1173 /*---------------------------------------------------------------------------*/
1174 static void
1175 menu_item_select_cb (GtkMenuItem *proxy,
1176                      glWindow    *window)
1177 {
1178         GtkAction *action;
1179         char      *message;
1180
1181         g_return_if_fail (window && GL_IS_WINDOW (window));
1182         g_return_if_fail (window->status_bar && GTK_IS_STATUSBAR (window->status_bar));
1183
1184         action = g_object_get_data (G_OBJECT (proxy),  "gtk-action");
1185         g_return_if_fail (action != NULL);
1186         
1187         g_object_get (G_OBJECT (action), "tooltip", &message, NULL);
1188         if (message)
1189         {
1190                 gtk_statusbar_push (GTK_STATUSBAR (window->status_bar),
1191                                     window->menu_tips_context_id, message);
1192                 g_free (message);
1193         }
1194 }
1195
1196
1197 /*---------------------------------------------------------------------------*/
1198 /** PRIVATE.  Menu item deselect callback.                                   */
1199 /*---------------------------------------------------------------------------*/
1200 static void
1201 menu_item_deselect_cb (GtkMenuItem *proxy,
1202                        glWindow    *window)
1203 {
1204         g_return_if_fail (window && GL_IS_WINDOW (window));
1205         g_return_if_fail (window->status_bar && GTK_IS_STATUSBAR (window->status_bar));
1206
1207         gtk_statusbar_pop (GTK_STATUSBAR (window->status_bar),
1208                            window->menu_tips_context_id);
1209 }
1210
1211
1212
1213 /*
1214  * Local Variables:       -- emacs
1215  * mode: C                -- emacs
1216  * c-basic-offset: 8      -- emacs
1217  * tab-width: 8           -- emacs
1218  * indent-tabs-mode: nil  -- emacs
1219  * End:                   -- emacs
1220  */