From 6ce08f3ce7224047451defe1c0f0dc0f8daf5ae1 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 20 Mar 2002 20:08:19 +0000 Subject: [PATCH] app/gui/Makefile.am removed... 2002-03-20 Michael Natterer * app/gui/Makefile.am * app/gui/commands.[ch]: removed... * app/gui/help-commands.[ch]: ...and added here. * app/gui/menus.c: changed accordingly and added the mem_profile debug callback so all debug stuff is in one place. --- ChangeLog | 10 ++++++ app/actions/help-commands.c | 25 +++------------ app/actions/help-commands.h | 15 +++++---- app/gui/Makefile.am | 4 +-- app/gui/commands.c | 63 ------------------------------------- app/gui/commands.h | 32 ------------------- app/gui/help-commands.c | 25 +++------------ app/gui/help-commands.h | 15 +++++---- app/gui/menus.c | 36 +++++++++++++++------ app/menus/menus.c | 36 +++++++++++++++------ 10 files changed, 90 insertions(+), 171 deletions(-) delete mode 100644 app/gui/commands.c delete mode 100644 app/gui/commands.h diff --git a/ChangeLog b/ChangeLog index 37ff0fd0ef..5851a4c9dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-03-20 Michael Natterer + + * app/gui/Makefile.am + * app/gui/commands.[ch]: removed... + + * app/gui/help-commands.[ch]: ...and added here. + + * app/gui/menus.c: changed accordingly and added the mem_profile + debug callback so all debug stuff is in one place. + 2002-03-20 Sven Neumann * app/Makefile.am: moved display after gui to make the build work diff --git a/app/actions/help-commands.c b/app/actions/help-commands.c index ab3be6bb91..53b6dcdf85 100644 --- a/app/actions/help-commands.c +++ b/app/actions/help-commands.c @@ -28,36 +28,21 @@ #include "plug-in/plug-in.h" -#include "commands.h" +#include "help-commands.h" -/***** Help *****/ - void help_help_cmd_callback (GtkWidget *widget, - gpointer data) + gpointer data, + guint action) { gimp_standard_help_func (NULL); } void help_context_help_cmd_callback (GtkWidget *widget, - gpointer data) + gpointer data, + guint action) { gimp_context_help (); } - -/***** Debug *****/ - -void -debug_mem_profile_cmd_callback (GtkWidget *widget, - gpointer data) -{ - extern gboolean gimp_debug_memsize; - - gimp_debug_memsize = TRUE; - - gimp_object_get_memsize (GIMP_OBJECT (data)); - - gimp_debug_memsize = FALSE; -} diff --git a/app/actions/help-commands.h b/app/actions/help-commands.h index 9ee0c216be..c9bc563f58 100644 --- a/app/actions/help-commands.h +++ b/app/actions/help-commands.h @@ -16,17 +16,16 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __COMMANDS_H__ -#define __COMMANDS_H__ +#ifndef __HELP_COMMANDS_H__ +#define __HELP_COMMANDS_H__ void help_help_cmd_callback (GtkWidget *widget, - gpointer data); + gpointer data, + guint action); void help_context_help_cmd_callback (GtkWidget *widget, - gpointer data); - -void debug_mem_profile_cmd_callback (GtkWidget *widget, - gpointer data); + gpointer data, + guint action); -#endif /* __COMMANDS_H__ */ +#endif /* __HELP_COMMANDS_H__ */ diff --git a/app/gui/Makefile.am b/app/gui/Makefile.am index 45a75b5004..5599fa3b90 100644 --- a/app/gui/Makefile.am +++ b/app/gui/Makefile.am @@ -20,8 +20,6 @@ libappgui_a_SOURCES = @STRIP_BEGIN@ \ color-select.h \ colormap-editor-commands.c \ colormap-editor-commands.h \ - commands.c \ - commands.h \ convert-dialog.c \ convert-dialog.h \ data-commands.c \ @@ -61,6 +59,8 @@ libappgui_a_SOURCES = @STRIP_BEGIN@ \ gui.c \ gui.h \ gui-types.h \ + help-commands.c \ + help-commands.h \ image-commands.c \ image-commands.h \ info-dialog.c \ diff --git a/app/gui/commands.c b/app/gui/commands.c deleted file mode 100644 index ab3be6bb91..0000000000 --- a/app/gui/commands.c +++ /dev/null @@ -1,63 +0,0 @@ -/* The GIMP -- an image manipulation program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "config.h" - -#include - -#include "libgimpwidgets/gimpwidgets.h" - -#include "core/core-types.h" - -#include "core/gimpobject.h" - -#include "plug-in/plug-in.h" - -#include "commands.h" - - -/***** Help *****/ - -void -help_help_cmd_callback (GtkWidget *widget, - gpointer data) -{ - gimp_standard_help_func (NULL); -} - -void -help_context_help_cmd_callback (GtkWidget *widget, - gpointer data) -{ - gimp_context_help (); -} - -/***** Debug *****/ - -void -debug_mem_profile_cmd_callback (GtkWidget *widget, - gpointer data) -{ - extern gboolean gimp_debug_memsize; - - gimp_debug_memsize = TRUE; - - gimp_object_get_memsize (GIMP_OBJECT (data)); - - gimp_debug_memsize = FALSE; -} diff --git a/app/gui/commands.h b/app/gui/commands.h deleted file mode 100644 index 9ee0c216be..0000000000 --- a/app/gui/commands.h +++ /dev/null @@ -1,32 +0,0 @@ -/* The GIMP -- an image manipulation program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __COMMANDS_H__ -#define __COMMANDS_H__ - - -void help_help_cmd_callback (GtkWidget *widget, - gpointer data); -void help_context_help_cmd_callback (GtkWidget *widget, - gpointer data); - -void debug_mem_profile_cmd_callback (GtkWidget *widget, - gpointer data); - - -#endif /* __COMMANDS_H__ */ diff --git a/app/gui/help-commands.c b/app/gui/help-commands.c index ab3be6bb91..53b6dcdf85 100644 --- a/app/gui/help-commands.c +++ b/app/gui/help-commands.c @@ -28,36 +28,21 @@ #include "plug-in/plug-in.h" -#include "commands.h" +#include "help-commands.h" -/***** Help *****/ - void help_help_cmd_callback (GtkWidget *widget, - gpointer data) + gpointer data, + guint action) { gimp_standard_help_func (NULL); } void help_context_help_cmd_callback (GtkWidget *widget, - gpointer data) + gpointer data, + guint action) { gimp_context_help (); } - -/***** Debug *****/ - -void -debug_mem_profile_cmd_callback (GtkWidget *widget, - gpointer data) -{ - extern gboolean gimp_debug_memsize; - - gimp_debug_memsize = TRUE; - - gimp_object_get_memsize (GIMP_OBJECT (data)); - - gimp_debug_memsize = FALSE; -} diff --git a/app/gui/help-commands.h b/app/gui/help-commands.h index 9ee0c216be..c9bc563f58 100644 --- a/app/gui/help-commands.h +++ b/app/gui/help-commands.h @@ -16,17 +16,16 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef __COMMANDS_H__ -#define __COMMANDS_H__ +#ifndef __HELP_COMMANDS_H__ +#define __HELP_COMMANDS_H__ void help_help_cmd_callback (GtkWidget *widget, - gpointer data); + gpointer data, + guint action); void help_context_help_cmd_callback (GtkWidget *widget, - gpointer data); - -void debug_mem_profile_cmd_callback (GtkWidget *widget, - gpointer data); + gpointer data, + guint action); -#endif /* __COMMANDS_H__ */ +#endif /* __HELP_COMMANDS_H__ */ diff --git a/app/gui/menus.c b/app/gui/menus.c index 34f08fb4f8..0f7148ed42 100644 --- a/app/gui/menus.c +++ b/app/gui/menus.c @@ -40,7 +40,6 @@ #include "buffers-commands.h" #include "channels-commands.h" #include "colormap-editor-commands.h" -#include "commands.h" #include "data-commands.h" #include "dialogs-commands.h" #include "documents-commands.h" @@ -49,6 +48,7 @@ #include "file-commands.h" #include "gradient-editor-commands.h" #include "gradients-commands.h" +#include "help-commands.h" #include "image-commands.h" #include "layers-commands.h" #include "menus.h" @@ -89,12 +89,15 @@ static void menus_color_changed (GimpContext *context, GimpItemFactory *item_factory); static void menus_filters_subdirs_to_top (GtkMenu *menu); #ifdef ENABLE_DEBUG_ENTRIES -static void menus_debug_recurse_menu (GtkWidget *menu, - gint depth, - gchar *path); -static void menus_debug_cmd_callback (GtkWidget *widget, - gpointer data, - guint action); +static void menus_debug_recurse_menu (GtkWidget *menu, + gint depth, + gchar *path); +static void menus_debug_cmd_callback (GtkWidget *widget, + gpointer data, + guint action); +static void menus_mem_profile_cmd_callback (GtkWidget *widget, + gpointer data, + guint action); #endif /* ENABLE_DEBUG_ENTRIES */ @@ -212,7 +215,7 @@ static GimpItemFactoryEntry toolbox_entries[] = NULL, NULL, NULL }, { { "/File/Debug/Mem Profile", NULL, - debug_mem_profile_cmd_callback, 0 }, + menus_mem_profile_cmd_callback, 0 }, NULL, NULL, NULL }, { { "/File/Debug/Dump Items", NULL, menus_debug_cmd_callback, 0 }, @@ -248,7 +251,8 @@ static GimpItemFactoryEntry toolbox_entries[] = NULL, "help/dialogs/help.html", NULL }, { { N_("/Help/Context Help..."), "F1", - help_context_help_cmd_callback, 0 }, + help_context_help_cmd_callback, 0, + "", GTK_STOCK_HELP }, NULL, "help/context_help.html", NULL }, { { N_("/Help/Tip of the Day..."), NULL, @@ -2727,4 +2731,18 @@ menus_debug_cmd_callback (GtkWidget *widget, #endif } +static void +menus_mem_profile_cmd_callback (GtkWidget *widget, + gpointer data, + guint action) +{ + extern gboolean gimp_debug_memsize; + + gimp_debug_memsize = TRUE; + + gimp_object_get_memsize (GIMP_OBJECT (data)); + + gimp_debug_memsize = FALSE; +} + #endif /* ENABLE_DEBUG_ENTRIES */ diff --git a/app/menus/menus.c b/app/menus/menus.c index 34f08fb4f8..0f7148ed42 100644 --- a/app/menus/menus.c +++ b/app/menus/menus.c @@ -40,7 +40,6 @@ #include "buffers-commands.h" #include "channels-commands.h" #include "colormap-editor-commands.h" -#include "commands.h" #include "data-commands.h" #include "dialogs-commands.h" #include "documents-commands.h" @@ -49,6 +48,7 @@ #include "file-commands.h" #include "gradient-editor-commands.h" #include "gradients-commands.h" +#include "help-commands.h" #include "image-commands.h" #include "layers-commands.h" #include "menus.h" @@ -89,12 +89,15 @@ static void menus_color_changed (GimpContext *context, GimpItemFactory *item_factory); static void menus_filters_subdirs_to_top (GtkMenu *menu); #ifdef ENABLE_DEBUG_ENTRIES -static void menus_debug_recurse_menu (GtkWidget *menu, - gint depth, - gchar *path); -static void menus_debug_cmd_callback (GtkWidget *widget, - gpointer data, - guint action); +static void menus_debug_recurse_menu (GtkWidget *menu, + gint depth, + gchar *path); +static void menus_debug_cmd_callback (GtkWidget *widget, + gpointer data, + guint action); +static void menus_mem_profile_cmd_callback (GtkWidget *widget, + gpointer data, + guint action); #endif /* ENABLE_DEBUG_ENTRIES */ @@ -212,7 +215,7 @@ static GimpItemFactoryEntry toolbox_entries[] = NULL, NULL, NULL }, { { "/File/Debug/Mem Profile", NULL, - debug_mem_profile_cmd_callback, 0 }, + menus_mem_profile_cmd_callback, 0 }, NULL, NULL, NULL }, { { "/File/Debug/Dump Items", NULL, menus_debug_cmd_callback, 0 }, @@ -248,7 +251,8 @@ static GimpItemFactoryEntry toolbox_entries[] = NULL, "help/dialogs/help.html", NULL }, { { N_("/Help/Context Help..."), "F1", - help_context_help_cmd_callback, 0 }, + help_context_help_cmd_callback, 0, + "", GTK_STOCK_HELP }, NULL, "help/context_help.html", NULL }, { { N_("/Help/Tip of the Day..."), NULL, @@ -2727,4 +2731,18 @@ menus_debug_cmd_callback (GtkWidget *widget, #endif } +static void +menus_mem_profile_cmd_callback (GtkWidget *widget, + gpointer data, + guint action) +{ + extern gboolean gimp_debug_memsize; + + gimp_debug_memsize = TRUE; + + gimp_object_get_memsize (GIMP_OBJECT (data)); + + gimp_debug_memsize = FALSE; +} + #endif /* ENABLE_DEBUG_ENTRIES */