app/actions/debug-actions.c app/actions/debug-commands.[ch] added "Dump

2006-09-05  Michael Natterer  <mitch@gimp.org>

	* app/actions/debug-actions.c
	* app/actions/debug-commands.[ch]
	* menus/toolbox-menu.xml.in: added "Dump Attached Data" menu item
	which prints the stuff that is attached to the gimp and
	user_context objects.
This commit is contained in:
Michael Natterer 2006-09-05 21:36:20 +00:00 committed by Michael Natterer
parent febf445c04
commit 42e9548379
5 changed files with 60 additions and 10 deletions

View File

@ -1,3 +1,11 @@
2006-09-05 Michael Natterer <mitch@gimp.org>
* app/actions/debug-actions.c
* app/actions/debug-commands.[ch]
* menus/toolbox-menu.xml.in: added "Dump Attached Data" menu item
which prints the stuff that is attached to the gimp and
user_context objects.
2006-09-05 Sven Neumann <sven@gimp.org>
* plug-ins/common/redeye.c (dialog): use the wilber icon / label

View File

@ -49,6 +49,11 @@ static const GimpActionEntry debug_actions[] =
{ "debug-dump-managers", NULL,
"Dump _UI Managers", NULL, NULL,
G_CALLBACK (debug_dump_managers_cmd_callback),
NULL },
{ "debug-dump-attached-data", NULL,
"Dump Attached Data", NULL, NULL,
G_CALLBACK (debug_dump_attached_data_cmd_callback),
NULL }
};

View File

@ -26,7 +26,8 @@
#include "actions-types.h"
#include "core/gimpobject.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "widgets/gimpmenufactory.h"
#include "widgets/gimpuimanager.h"
@ -41,9 +42,13 @@
/* local function prototypes */
static void debug_dump_menus_recurse_menu (GtkWidget *menu,
gint depth,
gchar *path);
static void debug_dump_menus_recurse_menu (GtkWidget *menu,
gint depth,
gchar *path);
static void debug_print_qdata (GimpObject *object);
static void debug_print_qdata_foreach (GQuark key_id,
gpointer data,
gpointer user_data);
/* public functions */
@ -130,6 +135,17 @@ debug_dump_managers_cmd_callback (GtkAction *action,
}
}
void
debug_dump_attached_data_cmd_callback (GtkAction *action,
gpointer data)
{
Gimp *gimp = action_data_get_gimp (data);
GimpContext *user_context = gimp_get_user_context (gimp);
debug_print_qdata (GIMP_OBJECT (gimp));
debug_print_qdata (GIMP_OBJECT (user_context));
}
/* private functions */
@ -173,4 +189,22 @@ debug_dump_menus_recurse_menu (GtkWidget *menu,
}
}
static void
debug_print_qdata (GimpObject *object)
{
g_print ("\nData attached to '%s':\n\n", gimp_object_get_name (object));
g_datalist_foreach (&G_OBJECT (object)->qdata,
debug_print_qdata_foreach,
NULL);
g_print ("\n");
}
static void
debug_print_qdata_foreach (GQuark key_id,
gpointer data,
gpointer user_data)
{
g_print ("%s: %p\n", g_quark_to_string (key_id), data);
}
#endif /* ENABLE_DEBUG_MENU */

View File

@ -27,12 +27,14 @@
#ifdef ENABLE_DEBUG_MENU
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);
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);
void debug_dump_attached_data_cmd_callback (GtkAction *action,
gpointer data);
#endif /* ENABLE_DEBUG_MENU */

View File

@ -36,6 +36,7 @@
<menuitem action="debug-mem-profile" />
<menuitem action="debug-dump-items" />
<menuitem action="debug-dump-managers" />
<menuitem action="debug-dump-attached-data" />
</menu>
<separator />