fixed dia_image_rgb_data() for non-alpha images
[dia.git] / app / diagram_tree_menu_callbacks.c
blobcb78d1cc5bdcd7718f84d3d6fd4c4447ca774f03
1 /* Dia -- a diagram creation/manipulation program
2 * Copyright (C) 1998 Alexander Larsson
4 * diagram_tree_menu_callbacks.c : callbacks for the diagram tree menus.
5 * Copyright (C) 2001 Jose A Ortega Ruiz
6 *
7 * This program 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 2 of the License, or
10 * (at your option) any later version.
12 * This program 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.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #ifdef HAVE_CONFIG_H
24 # include <config.h>
25 #endif
27 #include <gtk/gtk.h>
29 #include "diagram_tree_menu_callbacks.h"
30 #include "diagram_tree_menu.h"
31 #include "diagram_tree_window.h"
32 #include "preferences.h"
34 void
35 on_locate_object_activate(gpointer user_data,
36 guint action, GtkMenuItem *menuitem)
39 diagram_tree_raise((DiagramTree *)user_data);
42 void
43 on_properties_activate(gpointer user_data,
44 guint action, GtkMenuItem *menuitem)
46 diagram_tree_show_properties((DiagramTree *)user_data);
49 void
50 on_sort_objects_activate(gpointer user_data,
51 guint action, GtkMenuItem *menuitem)
53 diagram_tree_sort_objects((DiagramTree *)user_data, action);
56 void
57 on_sort_all_objects_activate(gpointer user_data,
58 guint action, GtkMenuItem *menuitem)
60 diagram_tree_sort_all_objects((DiagramTree *)user_data, action);
63 void
64 on_sort_def_activate(gpointer user_data,
65 guint action, GtkMenuItem *item)
67 prefs.dia_tree.obj_sort = action;
68 prefs_save();
69 diagram_tree_set_object_sort_type((DiagramTree *)user_data, action);
72 void
73 on_delete_object_activate(gpointer user_data,
74 guint action, GtkMenuItem *menuitem)
79 void
80 on_locate_dia_activate(gpointer user_data,
81 guint action, GtkMenuItem *menuitem)
83 diagram_tree_raise((DiagramTree *)user_data);
87 void
88 on_sort_diagrams_activate(gpointer user_data,
89 guint action, GtkMenuItem *menuitem)
91 diagram_tree_sort_diagrams((DiagramTree *)user_data, action);
95 void
96 on_sort_dia_def_activate(gpointer user_data,
97 guint action, GtkMenuItem *item)
99 prefs.dia_tree.dia_sort = action;
100 prefs_save();
101 diagram_tree_set_diagram_sort_type((DiagramTree *)user_data, action);
104 void
105 on_hide_object_activate(gpointer user_data,
106 guint action, GtkMenuItem *menuitem)
108 const gchar *type = diagram_tree_hide_type((DiagramTree *)user_data);
109 if (type) {
110 diagram_tree_config_add_hidden_type(&prefs.dia_tree, type);
111 if (prefs.dia_tree.save_hidden) prefs_save();