[gimp] app: Add some GimpRectangleTool GIMP_LOG() messages



commit 73d2f4421032a7cc13a026bd404752a25adf733d
Author: Martin Nordholts <martinn src gnome org>
Date:   Tue Oct 26 13:46:11 2010 +0200

    app: Add some GimpRectangleTool GIMP_LOG() messages

 app/gimp-log.c                |    3 ++-
 app/gimp-log.h                |    4 +++-
 app/tools/gimprectangletool.c |   15 +++++++++++++++
 3 files changed, 20 insertions(+), 2 deletions(-)
---
diff --git a/app/gimp-log.c b/app/gimp-log.c
index 24c59a5..47a98e2 100644
--- a/app/gimp-log.c
+++ b/app/gimp-log.c
@@ -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',
diff --git a/app/gimp-log.h b/app/gimp-log.h
index 49c667c..f74f44c 100644
--- a/app/gimp-log.h
+++ b/app/gimp-log.h
@@ -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 */
diff --git a/app/tools/gimprectangletool.c b/app/tools/gimprectangletool.c
index 06fb559..5aebcd1 100644
--- a/app/tools/gimprectangletool.c
+++ b/app/tools/gimprectangletool.c
@@ -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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]