add DND log domain.

2007-11-15  Michael Natterer  <mitch@gimp.org>

	* app/gimp-log.[ch]: add DND log domain.

	* app/widgets/gimpdnd.c: use GIMP_LOG().


svn path=/trunk/; revision=24163
This commit is contained in:
Michael Natterer 2007-11-15 13:21:23 +00:00 committed by Michael Natterer
parent 0ed77b2152
commit df792bf8e8
4 changed files with 35 additions and 25 deletions

View File

@ -1,3 +1,9 @@
2007-11-15 Michael Natterer <mitch@gimp.org>
* app/gimp-log.[ch]: add DND log domain.
* app/widgets/gimpdnd.c: use GIMP_LOG().
2007-11-15 Sven Neumann <sven@gimp.org>
* app/core/gimpcurve-save.c: added sanity checks.

View File

@ -35,7 +35,8 @@ gimp_log_init (void)
{
const GDebugKey log_keys[] =
{
{ "tools", GIMP_LOG_TOOLS }
{ "tools", GIMP_LOG_TOOLS },
{ "dnd", GIMP_LOG_DND }
};
gimp_log_flags = g_parse_debug_string (env_log_val,
@ -51,12 +52,20 @@ gimp_log (const gchar *function,
const gchar *format,
...)
{
va_list args;
gchar *message;
gchar *message;
va_start (args, format);
message = g_strdup_vprintf (format, args);
va_end (args);
if (format)
{
va_list args;
va_start (args, format);
message = g_strdup_vprintf (format, args);
va_end (args);
}
else
{
message = g_strdup ("called");
}
g_log (domain, G_LOG_LEVEL_DEBUG,
"%s(%d): %s", function, line, message);

View File

@ -22,7 +22,8 @@
typedef enum
{
GIMP_LOG_TOOLS = 1 << 0
GIMP_LOG_TOOLS = 1 << 0,
GIMP_LOG_DND = 1 << 1
} GimpLogFlags;

View File

@ -45,8 +45,6 @@
#include "vectors/gimpvectors.h"
/* #define DEBUG_DND */
#include "gimpdnd.h"
#include "gimpdnd-xds.h"
#include "gimppixbuf.h"
@ -54,6 +52,7 @@
#include "gimpview.h"
#include "gimpviewrendererimage.h"
#include "gimp-log.h"
#include "gimp-intl.h"
@ -61,13 +60,6 @@
#define DRAG_ICON_OFFSET -8
#ifdef DEBUG_DND
#define D(stmnt) stmnt
#else
#define D(stmnt)
#endif
typedef GtkWidget * (* GimpDndGetIconFunc) (GtkWidget *widget,
GCallback get_data_func,
gpointer get_data_data);
@ -664,7 +656,7 @@ gimp_dnd_data_drag_begin (GtkWidget *widget,
data_type = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget),
"gimp-dnd-get-data-type"));
D (g_printerr ("\ngimp_dnd_data_drag_begin (%d)\n", data_type));
GIMP_LOG (DND, "data type %d", data_type);
if (! data_type)
return;
@ -721,9 +713,13 @@ static void
gimp_dnd_data_drag_end (GtkWidget *widget,
GdkDragContext *context)
{
GtkWidget *icon_widget;
GimpDndType data_type;
GtkWidget *icon_widget;
D (g_printerr ("\ngimp_dnd_data_drag_end\n"));
data_type = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget),
"gimp-dnd-get-data-type"));
GIMP_LOG (DND, "data type %d", data_type);
icon_widget = g_object_get_data (G_OBJECT (widget), "gimp-dnd-data-widget");
@ -753,7 +749,7 @@ gimp_dnd_data_drag_handle (GtkWidget *widget,
gpointer get_data_data = NULL;
GimpDndType data_type;
D (g_printerr ("\ngimp_dnd_data_drag_handle(%d)\n", info));
GIMP_LOG (DND, "data type %d", info);
for (data_type = GIMP_DND_TYPE_NONE + 1;
data_type <= GIMP_DND_TYPE_LAST;
@ -763,8 +759,7 @@ gimp_dnd_data_drag_handle (GtkWidget *widget,
if (dnd_data->target_entry.info == info)
{
D (g_printerr ("gimp_dnd_data_drag_handle(%s)\n",
dnd_data->target_entry.target));
GIMP_LOG (DND, "target %s", dnd_data->target_entry.target);
if (dnd_data->get_data_func_name)
get_data_func = g_object_get_data (G_OBJECT (widget),
@ -800,7 +795,7 @@ gimp_dnd_data_drop_handle (GtkWidget *widget,
{
GimpDndType data_type;
D (g_printerr ("\ngimp_dnd_data_drop_handle(%d)\n", info));
GIMP_LOG (DND, "data type %d", info);
if (selection_data->length <= 0)
{
@ -819,8 +814,7 @@ gimp_dnd_data_drop_handle (GtkWidget *widget,
GCallback set_data_func = NULL;
gpointer set_data_data = NULL;
D (g_printerr ("gimp_dnd_data_drop_handle(%s)\n",
dnd_data->target_entry.target));
GIMP_LOG (DND, "target %s", dnd_data->target_entry.target);
if (dnd_data->set_data_func_name)
set_data_func = g_object_get_data (G_OBJECT (widget),