app/actions/debug-actions.c app/actions/debug-commands.[ch] added action &

2004-05-05  Michael Natterer  <mitch@gimp.org>

	* app/actions/debug-actions.c
	* app/actions/debug-commands.[ch]
	* menus/toolbox-menu.xml.in: added action & callback which XML-dump
	all UI managers.
This commit is contained in:
Michael Natterer 2004-05-05 15:54:42 +00:00 committed by Michael Natterer
parent 03d8d8278e
commit 9d08d3ed43
5 changed files with 53 additions and 10 deletions

View File

@ -1,3 +1,10 @@
2004-05-05 Michael Natterer <mitch@gimp.org>
* app/actions/debug-actions.c
* app/actions/debug-commands.[ch]
* menus/toolbox-menu.xml.in: added action & callback which XML-dump
all UI managers.
2004-05-05 Michael Natterer <mitch@gimp.org>
* app/actions/plug-in-actions.c (plug_in_actions_add_proc): fixed

View File

@ -42,6 +42,11 @@ static GimpActionEntry debug_actions[] =
{ "debug-dump-items", NULL,
"_Dump Items", NULL, NULL,
G_CALLBACK (debug_dump_menus_cmd_callback),
NULL },
{ "debug-dump-managers", NULL,
"Dump _UI Managers", NULL, NULL,
G_CALLBACK (debug_dump_managers_cmd_callback),
NULL }
};

View File

@ -29,6 +29,7 @@
#include "core/gimpobject.h"
#include "widgets/gimpmenufactory.h"
#include "widgets/gimpuimanager.h"
#include "debug-commands.h"
#include "gui/menus.h"
@ -45,6 +46,19 @@ static void debug_dump_menus_recurse_menu (GtkWidget *menu,
/* public functions */
void
debug_mem_profile_cmd_callback (GtkAction *action,
gpointer data)
{
extern gboolean gimp_debug_memsize;
gimp_debug_memsize = TRUE;
gimp_object_get_memsize (GIMP_OBJECT (data), NULL);
gimp_debug_memsize = FALSE;
}
void
debug_dump_menus_cmd_callback (GtkAction *action,
gpointer data)
@ -84,16 +98,30 @@ debug_dump_menus_cmd_callback (GtkAction *action,
}
void
debug_mem_profile_cmd_callback (GtkAction *action,
gpointer data)
debug_dump_managers_cmd_callback (GtkAction *action,
gpointer data)
{
extern gboolean gimp_debug_memsize;
GList *list;
gimp_debug_memsize = TRUE;
for (list = global_menu_factory->registered_menus;
list;
list = g_list_next (list))
{
GimpMenuFactoryEntry *entry = list->data;
GList *managers;
gimp_object_get_memsize (GIMP_OBJECT (data), NULL);
managers = gimp_ui_managers_from_name (entry->identifier);
gimp_debug_memsize = FALSE;
if (managers)
{
g_print ("\n\n========================================\n"
"UI Manager: %s\n"
"========================================\n\n",
entry->identifier);
g_print (gtk_ui_manager_get_ui (managers->data));
}
}
}

View File

@ -27,10 +27,12 @@
#ifdef ENABLE_DEBUG_MENU
void debug_dump_menus_cmd_callback (GtkAction *action,
gpointer data);
void debug_mem_profile_cmd_callback (GtkAction *action,
gpointer data);
void debug_mem_profile_cmd_callback (GtkAction *action,
gpointer data);
void debug_dump_menus_cmd_callback (GtkAction *action,
gpointer data);
void debug_dump_managers_cmd_callback (GtkAction *action,
gpointer data);
#endif /* ENABLE_DEBUG_MENU */

View File

@ -26,6 +26,7 @@
<menu action="debug-menu" name="Debug">
<menuitem action="debug-mem-profile" />
<menuitem action="debug-dump-items" />
<menuitem action="debug-dump-managers" />
</menu>
<separator />
<menuitem action="file-quit" />