2 * (GLABELS) Label and Business Card Creation program for GNOME
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
28 #include "print_dialog.h"
33 #ifdef PACKAGE_DATA_DIR
34 #define LOGO_PIXMAP (PACKAGE_DATA_DIR "/pixmaps/glabels/glabels-about-logo.png")
36 #define LOGO_PIXMAP gnome_pixmap_file("glabels/glabels-about-logo.png")
39 /*===========================================*/
40 /* Private function prototypes. */
41 /*===========================================*/
42 static void about_cb (GtkWidget * widget, gpointer data);
43 static void nothing_cb (GtkWidget * widget, gpointer data);
45 /*===========================================*/
46 /* Menu definitions */
47 /*===========================================*/
49 static GnomeUIInfo menu_file[] = {
50 GNOMEUIINFO_MENU_NEW_ITEM (N_("_New"),
51 N_("Make a new, empty label"),
52 gl_file_new_cb, NULL),
54 GNOMEUIINFO_MENU_OPEN_ITEM (gl_file_open_cb, NULL),
56 GNOMEUIINFO_MENU_SAVE_ITEM (gl_file_save_cb, NULL),
58 GNOMEUIINFO_MENU_SAVE_AS_ITEM (gl_file_save_as_cb, NULL),
60 GNOMEUIINFO_SEPARATOR,
62 GNOMEUIINFO_MENU_PRINT_ITEM (gl_print_dialog_cb, NULL),
64 GNOMEUIINFO_SEPARATOR,
65 GNOMEUIINFO_MENU_CLOSE_ITEM (gl_file_close_cb, NULL),
66 GNOMEUIINFO_MENU_EXIT_ITEM (gl_file_exit_cb, NULL),
70 static GnomeUIInfo menu_edit[] = {
72 GNOMEUIINFO_MENU_UNDO_ITEM (nothing_cb, NULL),
73 GNOMEUIINFO_MENU_REDO_ITEM (nothing_cb, NULL),
75 GNOMEUIINFO_SEPARATOR,
78 GNOMEUIINFO_MENU_CUT_ITEM (gl_edit_cut_cb, NULL),
79 GNOMEUIINFO_MENU_COPY_ITEM (gl_edit_copy_cb, NULL),
80 GNOMEUIINFO_MENU_PASTE_ITEM (gl_edit_paste_cb, NULL),
82 GNOMEUIINFO_SEPARATOR,
84 GNOMEUIINFO_MENU_SELECT_ALL_ITEM (gl_edit_select_all_cb, NULL),
85 GNOMEUIINFO_ITEM_NONE (N_("U_nselect All "),
86 N_("Remove all selections"),
92 static GnomeUIInfo menu_tools[] = {
94 GNOMEUIINFO_ITEM_STOCK (N_("Select"),
95 N_("Select, move and modify objects"),
96 gl_tools_arrow_cb, GL_STOCK_PIXMAP_ARROW),
98 GNOMEUIINFO_SEPARATOR,
100 GNOMEUIINFO_ITEM_NONE (N_("Text"), N_("Create text object"),
103 GNOMEUIINFO_ITEM_NONE (N_("Box"), N_("Create box/rectangle object"),
106 GNOMEUIINFO_ITEM_NONE (N_("Line"), N_("Create line object"),
109 GNOMEUIINFO_ITEM_NONE (N_("Ellipse"),
110 N_("Create ellipse/circle object"),
111 gl_tools_ellipse_cb),
113 GNOMEUIINFO_ITEM_NONE (N_("Image"), N_("Create image object"),
116 GNOMEUIINFO_ITEM_NONE (N_("Barcode"), N_("Create barcode object"),
117 gl_tools_barcode_cb),
119 GNOMEUIINFO_SEPARATOR,
121 GNOMEUIINFO_ITEM_NONE (N_("Zoom in"), N_("Zoom in"),
124 GNOMEUIINFO_ITEM_NONE (N_("Zoom out"), N_("Zoom out"),
125 gl_tools_zoomout_cb),
127 GNOMEUIINFO_ITEM_NONE (N_("Zoom 1:1"), N_("Zoom to 1:1"),
128 gl_tools_zoom1to1_cb),
130 GNOMEUIINFO_SEPARATOR,
132 GNOMEUIINFO_ITEM_NONE (N_("Merge properties"),
133 N_("Edit merge properties"),
134 gl_tools_merge_properties_cb),
139 static GnomeUIInfo menu_settings[] = {
140 GNOMEUIINFO_MENU_PREFERENCES_ITEM (gl_prefs_cb, NULL),
144 static GnomeUIInfo menu_windows[] = {
148 static GnomeUIInfo menu_help[] = {
149 GNOMEUIINFO_HELP ("glabels"),
150 GNOMEUIINFO_MENU_ABOUT_ITEM (about_cb, NULL),
154 static GnomeUIInfo menu_main[] = {
155 GNOMEUIINFO_MENU_FILE_TREE (menu_file),
156 GNOMEUIINFO_MENU_EDIT_TREE (menu_edit),
157 GNOMEUIINFO_SUBTREE (N_("_Tools"), menu_tools),
158 GNOMEUIINFO_MENU_SETTINGS_TREE (menu_settings),
159 GNOMEUIINFO_MENU_WINDOWS_TREE (menu_windows),
160 GNOMEUIINFO_MENU_HELP_TREE (menu_help),
164 /*===========================================*/
165 /* Toolbar definitions */
166 /*===========================================*/
167 static GnomeUIInfo toolbar[] = {
168 GNOMEUIINFO_ITEM_STOCK (N_(" New "), N_("New Label/Card"),
169 gl_file_new_cb, GNOME_STOCK_PIXMAP_NEW),
170 GNOMEUIINFO_ITEM_STOCK (N_(" Open "), N_("Open a file"),
171 gl_file_open_cb, GNOME_STOCK_PIXMAP_OPEN),
172 GNOMEUIINFO_ITEM_STOCK (N_(" Save "), N_("Save current file"),
173 gl_file_save_cb, GNOME_STOCK_PIXMAP_SAVE),
174 GNOMEUIINFO_SEPARATOR,
175 GNOMEUIINFO_ITEM_STOCK (N_(" Print "), N_("Print current file"),
176 gl_print_dialog_cb, GNOME_STOCK_PIXMAP_PRINT),
177 GNOMEUIINFO_SEPARATOR,
181 /*****************************************************************************/
182 /* Drawing tools toolbar definitions */
183 /*****************************************************************************/
184 static GnomeUIInfo tools_toolbar[] = {
186 GNOMEUIINFO_ITEM_STOCK (NULL, N_("Select, move and modify objects"),
187 gl_tools_arrow_cb, GL_STOCK_PIXMAP_ARROW),
189 GNOMEUIINFO_SEPARATOR,
191 GNOMEUIINFO_ITEM_STOCK (NULL, N_("Create text object"),
192 gl_tools_text_cb, GL_STOCK_PIXMAP_TEXT),
194 GNOMEUIINFO_ITEM_STOCK (NULL, N_("Create box/rectangle object"),
195 gl_tools_box_cb, GL_STOCK_PIXMAP_BOX),
197 GNOMEUIINFO_ITEM_STOCK (NULL, N_("Create line object"),
198 gl_tools_line_cb, GL_STOCK_PIXMAP_LINE),
200 GNOMEUIINFO_ITEM_STOCK (NULL, N_("Create ellipse/circle object"),
201 gl_tools_ellipse_cb, GL_STOCK_PIXMAP_ELLIPSE),
203 GNOMEUIINFO_ITEM_STOCK (NULL, N_("Create image object"),
204 gl_tools_image_cb, GL_STOCK_PIXMAP_IMAGE),
206 GNOMEUIINFO_ITEM_STOCK (NULL, N_("Create barcode object"),
207 gl_tools_barcode_cb, GL_STOCK_PIXMAP_BARCODE),
209 GNOMEUIINFO_SEPARATOR,
211 GNOMEUIINFO_ITEM_STOCK (NULL, N_("Zoom in"),
212 gl_tools_zoomin_cb, GL_STOCK_PIXMAP_ZOOMIN),
214 GNOMEUIINFO_ITEM_STOCK (NULL, N_("Zoom out"),
215 gl_tools_zoomout_cb, GL_STOCK_PIXMAP_ZOOMOUT),
217 GNOMEUIINFO_ITEM_STOCK (NULL, N_("Zoom to 1:1"),
218 gl_tools_zoom1to1_cb,
219 GL_STOCK_PIXMAP_ZOOM1TO1),
221 GNOMEUIINFO_SEPARATOR,
223 GNOMEUIINFO_ITEM_STOCK (NULL, N_("Merge properties"),
224 gl_tools_merge_properties_cb,
225 GL_STOCK_PIXMAP_MERGE),
231 /****************************************************************************/
232 /* Install menus templates in mdi. */
233 /****************************************************************************/
235 gl_menu_install_menus (GnomeMDI * mdi)
237 gnome_mdi_set_menubar_template (mdi, menu_main);
238 gnome_mdi_set_child_list_path (mdi, GNOME_MENU_WINDOWS_PATH);
241 /****************************************************************************/
242 /* Install toolbar in application window. */
243 /****************************************************************************/
245 gl_menu_install_toolbar (GnomeMDI * mdi)
247 gnome_mdi_set_toolbar_template (mdi, toolbar);
250 /*****************************************************************************/
251 /* Install drawing tools toolbar in application window. */
252 /*****************************************************************************/
254 gl_menu_install_tools_toolbar (GnomeMDI * mdi,
259 toolbar = gtk_toolbar_new (GTK_ORIENTATION_VERTICAL,
262 gnome_app_fill_toolbar_with_data (GTK_TOOLBAR (toolbar), tools_toolbar,
264 gnome_app_add_toolbar (GNOME_APP (app), GTK_TOOLBAR (toolbar),
265 "ToolsToolbar", GNOME_DOCK_ITEM_BEH_NORMAL,
266 GNOME_DOCK_LEFT, 1, 1, 0);
269 /*--------------------------------------------------------------------------*/
270 /* PRIVATE about menu callback. */
271 /*--------------------------------------------------------------------------*/
273 about_cb (GtkWidget * widget,
276 static GtkWidget *dialog = NULL;
277 GnomeApp *app = gnome_mdi_get_active_window (GNOME_MDI (data));
279 if (dialog != NULL) {
280 g_assert (GTK_WIDGET_REALIZED (dialog));
281 gdk_window_show (dialog->window);
282 gdk_window_raise (dialog->window);
284 const gchar *authors[] = {
285 "Jim Evins <evins@snaught.com>",
288 gchar *copy_text = "Copyright 2001 Jim Evins";
290 _("A label and business card creation program for GNOME.\n"
292 "Glabels is free software; you can redistribute it and/or modify it "
293 "under the terms of the GNU General Public License as published by "
294 "the Free Software Foundation; either version 2 of the License, or "
295 "(at your option) any later version.\n" " \n"
296 "This program is distributed in the hope that it will be useful, but "
297 "WITHOUT ANY WARRANTY; without even the implied warranty of "
298 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU "
299 "General Public License for more details.\n");
301 dialog = gnome_about_new ("glabels", VERSION,
302 copy_text, authors, about_text,
304 gtk_window_set_transient_for (GTK_WINDOW (dialog),
307 gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
308 GTK_SIGNAL_FUNC (gtk_widget_destroyed),
311 gtk_widget_show (dialog);
316 /*--------------------------------------------------------------------------*/
317 /* PRIVATE. place-holder callback. */
318 /*--------------------------------------------------------------------------*/
320 nothing_cb (GtkWidget * widget,
324 GnomeApp *app = gnome_mdi_get_active_window (GNOME_MDI (data));
326 dialog = gnome_ok_dialog (_("Function is not implemented!"));
327 gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (app));