app: Add some GimpRectangleTool GIMP_LOG() messages

This commit is contained in:
Martin Nordholts 2010-10-26 13:46:11 +02:00
parent ee81f23f0a
commit 73d2f44210
3 changed files with 20 additions and 2 deletions

View File

@ -54,7 +54,8 @@ gimp_log_init (void)
{ "text-editing", GIMP_LOG_TEXT_EDITING },
{ "key-events", GIMP_LOG_KEY_EVENTS },
{ "auto-tab-style", GIMP_LOG_AUTO_TAB_STYLE },
{ "instances", GIMP_LOG_INSTANCES }
{ "instances", GIMP_LOG_INSTANCES },
{ "rectangle-tool", GIMP_LOG_RECTANGLE_TOOL }
};
/* g_parse_debug_string() has special treatment of the string 'help',

View File

@ -37,7 +37,8 @@ typedef enum
GIMP_LOG_TEXT_EDITING = 1 << 13,
GIMP_LOG_KEY_EVENTS = 1 << 14,
GIMP_LOG_AUTO_TAB_STYLE = 1 << 15,
GIMP_LOG_INSTANCES = 1 << 16
GIMP_LOG_INSTANCES = 1 << 16,
GIMP_LOG_RECTANGLE_TOOL = 1 << 17
} GimpLogFlags;
@ -95,6 +96,7 @@ void gimp_logv (const gchar *function,
#define KEY_EVENTS GIMP_LOG_KEY_EVENTS
#define AUTO_TAB_STYLE GIMP_LOG_AUTO_TAB_STYLE
#define INSTANCES GIMP_LOG_INSTANCES
#define RECTANGLE_TOOL GIMP_LOG_RECTANGLE_TOOL
#if 0 /* last resort */
# define GIMP_LOG /* nothing => no varargs, no log */

View File

@ -30,6 +30,7 @@
#include "tools-types.h"
#include "core/gimp-utils.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
#include "core/gimpcontext.h"
@ -50,6 +51,8 @@
#include "gimprectangletool.h"
#include "gimptoolcontrol.h"
#include "gimp-log.h"
#include "gimp-intl.h"
@ -863,6 +866,9 @@ gimp_rectangle_tool_control (GimpTool *tool,
{
GimpRectangleTool *rect_tool = GIMP_RECTANGLE_TOOL (tool);
GIMP_LOG (RECTANGLE_TOOL, "action = %s",
gimp_enum_get_value_name (GIMP_TYPE_TOOL_ACTION, action));
switch (action)
{
case GIMP_TOOL_ACTION_PAUSE:
@ -916,6 +922,9 @@ gimp_rectangle_tool_button_press (GimpTool *tool,
gimp_tool_control_activate (tool->control);
GIMP_LOG (RECTANGLE_TOOL, "coords->x = %f, coords->y = %f",
coords->x, coords->y);
if (display != tool->display)
{
if (gimp_draw_tool_is_active (draw_tool))
@ -1029,6 +1038,9 @@ gimp_rectangle_tool_button_release (GimpTool *tool,
gimp_tool_control_halt (tool->control);
GIMP_LOG (RECTANGLE_TOOL, "coords->x = %f, coords->y = %f",
coords->x, coords->y);
if (private->function == GIMP_RECTANGLE_TOOL_EXECUTING)
gimp_tool_pop_status (tool, display);
@ -1113,6 +1125,9 @@ gimp_rectangle_tool_motion (GimpTool *tool,
private->function == GIMP_RECTANGLE_TOOL_DEAD)
return;
GIMP_LOG (RECTANGLE_TOOL, "coords->x = %f, coords->y = %f",
coords->x, coords->y);
/* Handle snapping. */
gimp_tool_control_get_snap_offsets (tool->control,
&snap_x, &snap_y, NULL, NULL);