[gimp] app: turn text editing debug spew into proper GIMP_LOG() output



commit 5c9b660c243f7a64978898a33f64807b984fd685
Author: Michael Natterer <mitch gimp org>
Date:   Thu Feb 18 09:39:25 2010 +0100

    app: turn text editing debug spew into proper GIMP_LOG() output

 app/gimp-log.c                  |    1 +
 app/gimp-log.h                  |    4 +++-
 app/tools/gimptexttool-editor.c |   24 ++++++++++++------------
 3 files changed, 16 insertions(+), 13 deletions(-)
---
diff --git a/app/gimp-log.c b/app/gimp-log.c
index 6ccb995..dabc71a 100644
--- a/app/gimp-log.c
+++ b/app/gimp-log.c
@@ -49,6 +49,7 @@ gimp_log_init (void)
         { "scale",              GIMP_LOG_SCALE              },
         { "wm",                 GIMP_LOG_WM                 },
         { "floating-selection", GIMP_LOG_FLOATING_SELECTION },
+        { "text-editing",       GIMP_LOG_TEXT_EDITING       },
         { "shm",                GIMP_LOG_SHM                }
       };
 
diff --git a/app/gimp-log.h b/app/gimp-log.h
index 01ce4d4..6a3aacd 100644
--- a/app/gimp-log.h
+++ b/app/gimp-log.h
@@ -33,7 +33,8 @@ typedef enum
   GIMP_LOG_SCALE              = 1 << 9,
   GIMP_LOG_WM                 = 1 << 10,
   GIMP_LOG_FLOATING_SELECTION = 1 << 11,
-  GIMP_LOG_SHM                = 1 << 12
+  GIMP_LOG_SHM                = 1 << 12,
+  GIMP_LOG_TEXT_EDITING       = 1 << 13
 } GimpLogFlags;
 
 
@@ -87,6 +88,7 @@ void   gimp_logv     (const gchar *function,
 #define WM                 GIMP_LOG_WM
 #define FLOATING_SELECTION GIMP_LOG_FLOATING_SELECTION
 #define SHM                GIMP_LOG_SHM
+#define TEXT_EDITING       GIMP_LOG_TEXT_EDITING
 
 #if 0 /* last resort */
 #  define GIMP_LOG /* nothing => no varargs, no log */
diff --git a/app/tools/gimptexttool-editor.c b/app/tools/gimptexttool-editor.c
index d5d0fa8..c76d3ab 100644
--- a/app/tools/gimptexttool-editor.c
+++ b/app/tools/gimptexttool-editor.c
@@ -45,6 +45,7 @@
 #include "gimptexttool.h"
 #include "gimptexttool-editor.h"
 
+#include "gimp-log.h"
 #include "gimp-intl.h"
 
 
@@ -185,7 +186,8 @@ gimp_text_tool_editor_key_press (GimpTextTool *text_tool,
   if (gtk_bindings_activate_event (GTK_OBJECT (text_tool->proxy_text_view),
                                    kevent))
     {
-      g_printerr ("binding handled event!\n");
+      GIMP_LOG (TEXT_EDITING, "binding handled event");
+
       return TRUE;
     }
 
@@ -338,12 +340,11 @@ gimp_text_tool_move_cursor (GimpTextTool    *text_tool,
   gboolean       cancel_selection = FALSE;
   gint           x_pos  = -1;
 
-  g_printerr ("%s: %s count = %d, select = %s\n",
-              G_STRFUNC,
-              g_enum_get_value (g_type_class_ref (GTK_TYPE_MOVEMENT_STEP),
-                                step)->value_name,
-              count,
-              extend_selection ? "TRUE" : "FALSE");
+  GIMP_LOG (TEXT_EDITING, "%s count = %d, select = %s",
+            g_enum_get_value (g_type_class_ref (GTK_TYPE_MOVEMENT_STEP),
+                              step)->value_name,
+            count,
+            extend_selection ? "TRUE" : "FALSE");
 
   gtk_text_buffer_get_iter_at_mark (buffer, &cursor,
                                     gtk_text_buffer_get_insert (buffer));
@@ -580,11 +581,10 @@ gimp_text_tool_delete_from_cursor (GimpTextTool  *text_tool,
   GtkTextIter    cursor;
   GtkTextIter    end;
 
-  g_printerr ("%s: %s count = %d\n",
-              G_STRFUNC,
-              g_enum_get_value (g_type_class_ref (GTK_TYPE_DELETE_TYPE),
-                                type)->value_name,
-              count);
+  GIMP_LOG (TEXT_EDITING, "%s count = %d",
+            g_enum_get_value (g_type_class_ref (GTK_TYPE_DELETE_TYPE),
+                              type)->value_name,
+            count);
 
   gtk_text_buffer_get_iter_at_mark (buffer, &cursor,
                                     gtk_text_buffer_get_insert (buffer));



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