renamed log domain TOOLS to TOOL_EVENTS and added domain TOOL_FOCUS.

2007-12-07  Michael Natterer  <mitch@gimp.org>

	* app/gimp-log.[ch]: renamed log domain TOOLS to TOOL_EVENTS and
	added domain TOOL_FOCUS.

	* app/display/gimpdisplayshell-callbacks.c: s/TOOLS/TOOL_EVENTS/

	* app/tools/gimptool.c: port focus debug output to GIMP_LOG().


svn path=/trunk/; revision=24287
This commit is contained in:
Michael Natterer 2007-12-07 18:52:41 +00:00 committed by Michael Natterer
parent 58c2dd9bba
commit efda62544d
5 changed files with 39 additions and 27 deletions

View File

@ -1,3 +1,12 @@
2007-12-07 Michael Natterer <mitch@gimp.org>
* app/gimp-log.[ch]: renamed log domain TOOLS to TOOL_EVENTS and
added domain TOOL_FOCUS.
* app/display/gimpdisplayshell-callbacks.c: s/TOOLS/TOOL_EVENTS/
* app/tools/gimptool.c: port focus debug output to GIMP_LOG().
2007-12-07 Michael Natterer <mitch@gimp.org> 2007-12-07 Michael Natterer <mitch@gimp.org>
* app/core/gimpselection.[ch]: added GErrors to * app/core/gimpselection.[ch]: added GErrors to

View File

@ -668,7 +668,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
{ {
GdkEventCrossing *cevent = (GdkEventCrossing *) event; GdkEventCrossing *cevent = (GdkEventCrossing *) event;
GIMP_LOG (TOOLS, "event (display %p): ENTER_NOTIFY", display); GIMP_LOG (TOOL_EVENTS, "event (display %p): ENTER_NOTIFY", display);
if (cevent->mode != GDK_CROSSING_NORMAL) if (cevent->mode != GDK_CROSSING_NORMAL)
return TRUE; return TRUE;
@ -686,7 +686,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
{ {
GdkEventCrossing *cevent = (GdkEventCrossing *) event; GdkEventCrossing *cevent = (GdkEventCrossing *) event;
GIMP_LOG (TOOLS, "event (display %p): LEAVE_NOTIFY", display); GIMP_LOG (TOOL_EVENTS, "event (display %p): LEAVE_NOTIFY", display);
if (cevent->mode != GDK_CROSSING_NORMAL) if (cevent->mode != GDK_CROSSING_NORMAL)
return TRUE; return TRUE;
@ -702,7 +702,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
break; break;
case GDK_PROXIMITY_IN: case GDK_PROXIMITY_IN:
GIMP_LOG (TOOLS, "event (display %p): PROXIMITY_IN", display); GIMP_LOG (TOOL_EVENTS, "event (display %p): PROXIMITY_IN", display);
tool_manager_oper_update_active (gimp, tool_manager_oper_update_active (gimp,
&image_coords, state, &image_coords, state,
@ -711,7 +711,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
break; break;
case GDK_PROXIMITY_OUT: case GDK_PROXIMITY_OUT:
GIMP_LOG (TOOLS, "event (display %p): PROXIMITY_OUT", display); GIMP_LOG (TOOL_EVENTS, "event (display %p): PROXIMITY_OUT", display);
shell->proximity = FALSE; shell->proximity = FALSE;
gimp_display_shell_clear_cursor (shell); gimp_display_shell_clear_cursor (shell);
@ -728,7 +728,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
if (fevent->in) if (fevent->in)
{ {
GIMP_LOG (TOOLS, "event (display %p): FOCUS_IN", display); GIMP_LOG (TOOL_EVENTS, "event (display %p): FOCUS_IN", display);
GTK_WIDGET_SET_FLAGS (canvas, GTK_HAS_FOCUS); GTK_WIDGET_SET_FLAGS (canvas, GTK_HAS_FOCUS);
@ -744,7 +744,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
} }
else else
{ {
GIMP_LOG (TOOLS, "event (display %p): FOCUS_OUT", display); GIMP_LOG (TOOL_EVENTS, "event (display %p): FOCUS_OUT", display);
GTK_WIDGET_UNSET_FLAGS (canvas, GTK_HAS_FOCUS); GTK_WIDGET_UNSET_FLAGS (canvas, GTK_HAS_FOCUS);
@ -774,7 +774,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
GdkEventButton *bevent = (GdkEventButton *) event; GdkEventButton *bevent = (GdkEventButton *) event;
GdkEventMask event_mask; GdkEventMask event_mask;
GIMP_LOG (TOOLS, "event (display %p): BUTTON_PRESS (%d)", GIMP_LOG (TOOL_EVENTS, "event (display %p): BUTTON_PRESS (%d)",
display, bevent->button); display, bevent->button);
if (! GTK_WIDGET_HAS_FOCUS (canvas)) if (! GTK_WIDGET_HAS_FOCUS (canvas))
@ -921,7 +921,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
{ {
GdkEventButton *bevent = (GdkEventButton *) event; GdkEventButton *bevent = (GdkEventButton *) event;
GIMP_LOG (TOOLS, "event (display %p): BUTTON_RELEASE (%d)", GIMP_LOG (TOOL_EVENTS, "event (display %p): BUTTON_RELEASE (%d)",
display, bevent->button); display, bevent->button);
gimp_display_shell_autoscroll_stop (shell); gimp_display_shell_autoscroll_stop (shell);
@ -988,7 +988,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
GdkScrollDirection direction; GdkScrollDirection direction;
GimpController *wheel; GimpController *wheel;
GIMP_LOG (TOOLS, "event (display %p): SCROLL (%d)", GIMP_LOG (TOOL_EVENTS, "event (display %p): SCROLL (%d)",
display, sevent->direction); display, sevent->direction);
wheel = gimp_controllers_get_wheel (gimp); wheel = gimp_controllers_get_wheel (gimp);
@ -1092,7 +1092,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
GdkEventMotion *mevent = (GdkEventMotion *) event; GdkEventMotion *mevent = (GdkEventMotion *) event;
GdkEvent *compressed_motion = NULL; GdkEvent *compressed_motion = NULL;
GIMP_LOG (TOOLS, "event (display %p): MOTION_NOTIFY", display); GIMP_LOG (TOOL_EVENTS, "event (display %p): MOTION_NOTIFY", display);
if (gimp->busy) if (gimp->busy)
return TRUE; return TRUE;
@ -1256,7 +1256,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
{ {
GdkEventKey *kevent = (GdkEventKey *) event; GdkEventKey *kevent = (GdkEventKey *) event;
GIMP_LOG (TOOLS, "event (display %p): KEY_PRESS (%d, %s)", GIMP_LOG (TOOL_EVENTS, "event (display %p): KEY_PRESS (%d, %s)",
display, kevent->keyval, display, kevent->keyval,
gdk_keyval_name (kevent->keyval) ? gdk_keyval_name (kevent->keyval) ?
gdk_keyval_name (kevent->keyval) : "<none>"); gdk_keyval_name (kevent->keyval) : "<none>");
@ -1371,7 +1371,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
{ {
GdkEventKey *kevent = (GdkEventKey *) event; GdkEventKey *kevent = (GdkEventKey *) event;
GIMP_LOG (TOOLS, "event (display %p): KEY_RELEASE (%d, %s)", GIMP_LOG (TOOL_EVENTS, "event (display %p): KEY_RELEASE (%d, %s)",
display, kevent->keyval, display, kevent->keyval,
gdk_keyval_name (kevent->keyval) ? gdk_keyval_name (kevent->keyval) ?
gdk_keyval_name (kevent->keyval) : "<none>"); gdk_keyval_name (kevent->keyval) : "<none>");

View File

@ -35,7 +35,8 @@ gimp_log_init (void)
{ {
const GDebugKey log_keys[] = const GDebugKey log_keys[] =
{ {
{ "tools", GIMP_LOG_TOOLS }, { "tool-events", GIMP_LOG_TOOL_EVENTS },
{ "tool-focus", GIMP_LOG_TOOL_FOCUS },
{ "dnd", GIMP_LOG_DND }, { "dnd", GIMP_LOG_DND },
{ "help", GIMP_LOG_HELP }, { "help", GIMP_LOG_HELP },
{ "dialog-factory", GIMP_LOG_DIALOG_FACTORY }, { "dialog-factory", GIMP_LOG_DIALOG_FACTORY },

View File

@ -22,12 +22,13 @@
typedef enum typedef enum
{ {
GIMP_LOG_TOOLS = 1 << 0, GIMP_LOG_TOOL_EVENTS = 1 << 0,
GIMP_LOG_DND = 1 << 1, GIMP_LOG_TOOL_FOCUS = 1 << 1,
GIMP_LOG_HELP = 1 << 2, GIMP_LOG_DND = 1 << 2,
GIMP_LOG_DIALOG_FACTORY = 1 << 3, GIMP_LOG_HELP = 1 << 3,
GIMP_LOG_SAVE_DIALOG = 1 << 4, GIMP_LOG_DIALOG_FACTORY = 1 << 4,
GIMP_LOG_IMAGE_SCALE = 1 << 5 GIMP_LOG_SAVE_DIALOG = 1 << 5,
GIMP_LOG_IMAGE_SCALE = 1 << 6
} GimpLogFlags; } GimpLogFlags;

View File

@ -37,6 +37,8 @@
#include "gimptool.h" #include "gimptool.h"
#include "gimptoolcontrol.h" #include "gimptoolcontrol.h"
#include "gimp-log.h"
enum enum
{ {
@ -624,10 +626,8 @@ gimp_tool_set_focus_display (GimpTool *tool,
g_return_if_fail (GIMP_IS_TOOL (tool)); g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (display == NULL || GIMP_IS_DISPLAY (display)); g_return_if_fail (display == NULL || GIMP_IS_DISPLAY (display));
#ifdef DEBUG_FOCUS GIMP_LOG (TOOL_FOCUS, "tool: %p focus_display: %p tool->focus_display: %p",
g_printerr ("%s: tool: %p display: %p focus_display: %p\n", tool, display, tool->focus_display);
G_STRFUNC, tool, display, tool->focus_display);
#endif
if (display != tool->focus_display) if (display != tool->focus_display)
{ {
@ -678,10 +678,8 @@ gimp_tool_set_modifier_state (GimpTool *tool,
g_return_if_fail (GIMP_IS_TOOL (tool)); g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (display)); g_return_if_fail (GIMP_IS_DISPLAY (display));
#ifdef DEBUG_FOCUS GIMP_LOG (TOOL_FOCUS, "tool: %p display: %p tool->focus_display: %p",
g_printerr ("%s: tool: %p display: %p focus_display: %p\n", tool, display, tool->focus_display);
G_STRFUNC, tool, display, tool->focus_display);
#endif
g_return_if_fail (display == tool->focus_display); g_return_if_fail (display == tool->focus_display);
@ -732,6 +730,9 @@ gimp_tool_set_active_modifier_state (GimpTool *tool,
g_return_if_fail (GIMP_IS_TOOL (tool)); g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (display)); g_return_if_fail (GIMP_IS_DISPLAY (display));
GIMP_LOG (TOOL_FOCUS, "tool: %p display: %p tool->focus_display: %p",
tool, display, tool->focus_display);
g_return_if_fail (display == tool->focus_display); g_return_if_fail (display == tool->focus_display);
if ((tool->active_modifier_state & GDK_SHIFT_MASK) != if ((tool->active_modifier_state & GDK_SHIFT_MASK) !=