[gimp] app: rename GimpTextTool::text_buffer to just ::buffer



commit dbe54e3f05f5aab99134387e6767d00442e758ab
Author: Michael Natterer <mitch gimp org>
Date:   Thu Feb 25 17:49:33 2010 +0100

    app: rename GimpTextTool::text_buffer to just ::buffer

 app/actions/text-tool-commands.c |    5 ++-
 app/tools/gimptexttool-editor.c  |   31 +++++++++++++-------------
 app/tools/gimptexttool.c         |   44 +++++++++++++++++++-------------------
 app/tools/gimptexttool.h         |    2 +-
 4 files changed, 41 insertions(+), 41 deletions(-)
---
diff --git a/app/actions/text-tool-commands.c b/app/actions/text-tool-commands.c
index 38b981b..88e813b 100644
--- a/app/actions/text-tool-commands.c
+++ b/app/actions/text-tool-commands.c
@@ -28,6 +28,7 @@
 #include "core/gimptoolinfo.h"
 
 #include "widgets/gimphelp-ids.h"
+#include "widgets/gimptextbuffer.h"
 #include "widgets/gimpuimanager.h"
 #include "widgets/gimpwidgets-utils.h"
 
@@ -155,7 +156,7 @@ text_tool_clear_cmd_callback (GtkAction *action,
                               gpointer   data)
 {
   GimpTextTool  *text_tool = GIMP_TEXT_TOOL (data);
-  GtkTextBuffer *buffer    = GTK_TEXT_BUFFER (text_tool->text_buffer);
+  GtkTextBuffer *buffer    = GTK_TEXT_BUFFER (text_tool->buffer);
   GtkTextIter    start, end;
 
   gtk_text_buffer_get_bounds (buffer, &start, &end);
@@ -218,7 +219,7 @@ text_tool_load_dialog_response (GtkWidget    *dialog,
 
       filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
 
-      if (! gimp_text_buffer_load (tool->text_buffer, filename, &error))
+      if (! gimp_text_buffer_load (tool->buffer, filename, &error))
         {
           gimp_message (GIMP_TOOL (tool)->tool_info->gimp, G_OBJECT (dialog),
                         GIMP_MESSAGE_ERROR,
diff --git a/app/tools/gimptexttool-editor.c b/app/tools/gimptexttool-editor.c
index c03bb50..6d39dba 100644
--- a/app/tools/gimptexttool-editor.c
+++ b/app/tools/gimptexttool-editor.c
@@ -188,7 +188,7 @@ gimp_text_tool_editor_button_press (GimpTextTool        *text_tool,
                                     gdouble              y,
                                     GimpButtonPressType  press_type)
 {
-  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->text_buffer);
+  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->buffer);
   GtkTextIter    cursor;
   GtkTextIter    selection;
   gint           offset;
@@ -236,7 +236,7 @@ gimp_text_tool_editor_button_press (GimpTextTool        *text_tool,
 void
 gimp_text_tool_editor_button_release (GimpTextTool *text_tool)
 {
-  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->text_buffer);
+  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->buffer);
 
   if (gtk_text_buffer_get_has_selection (buffer))
     {
@@ -256,7 +256,7 @@ gimp_text_tool_editor_motion (GimpTextTool *text_tool,
                               gdouble       x,
                               gdouble       y)
 {
-  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->text_buffer);
+  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->buffer);
   GtkTextIter    cursor;
   GtkTextIter    selection;
   gint           cursor_offset;
@@ -344,7 +344,7 @@ gboolean
 gimp_text_tool_editor_key_press (GimpTextTool *text_tool,
                                  GdkEventKey  *kevent)
 {
-  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->text_buffer);
+  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->buffer);
   GtkTextIter    cursor;
   GtkTextIter    selection;
   gint           x_pos  = -1;
@@ -452,7 +452,7 @@ gimp_text_tool_editor_get_cursor_rect (GimpTextTool   *text_tool,
                                        gint           *logical_off_x,
                                        gint           *logical_off_y)
 {
-  GtkTextBuffer  *buffer = GTK_TEXT_BUFFER (text_tool->text_buffer);
+  GtkTextBuffer  *buffer = GTK_TEXT_BUFFER (text_tool->buffer);
   PangoLayout    *layout;
   PangoRectangle  ink_extents;
   PangoRectangle  logical_extents;
@@ -481,8 +481,7 @@ gimp_text_tool_editor_get_cursor_rect (GimpTextTool   *text_tool,
 
   gtk_text_buffer_get_iter_at_mark (buffer, &cursor,
                                     gtk_text_buffer_get_insert (buffer));
-  cursor_index = gimp_text_buffer_get_iter_index (text_tool->text_buffer,
-                                                  &cursor);
+  cursor_index = gimp_text_buffer_get_iter_index (text_tool->buffer, &cursor);
 
   pango_layout_index_to_pos (layout, cursor_index, cursor_rect);
   gimp_text_layout_transform_rect (text_tool->layout, cursor_rect);
@@ -559,7 +558,7 @@ gimp_text_tool_move_cursor (GimpTextTool    *text_tool,
                             gint             count,
                             gboolean         extend_selection)
 {
-  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->text_buffer);
+  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->buffer);
   GtkTextIter    cursor;
   GtkTextIter    selection;
   GtkTextIter   *sel_start;
@@ -647,7 +646,7 @@ gimp_text_tool_move_cursor (GimpTextTool    *text_tool,
 
         gtk_text_buffer_get_bounds (buffer, &start, &end);
 
-        cursor_index = gimp_text_buffer_get_iter_index (text_tool->text_buffer,
+        cursor_index = gimp_text_buffer_get_iter_index (text_tool->buffer,
                                                         &cursor);
 
         gimp_text_tool_ensure_layout (text_tool);
@@ -770,7 +769,7 @@ gimp_text_tool_insert_at_cursor (GimpTextTool *text_tool,
 {
   gimp_draw_tool_pause (GIMP_DRAW_TOOL (text_tool));
 
-  gtk_text_buffer_insert_at_cursor (GTK_TEXT_BUFFER (text_tool->text_buffer),
+  gtk_text_buffer_insert_at_cursor (GTK_TEXT_BUFFER (text_tool->buffer),
                                     str, -1);
 
   gimp_draw_tool_resume (GIMP_DRAW_TOOL (text_tool));
@@ -812,7 +811,7 @@ gimp_text_tool_delete_from_cursor (GimpTextTool  *text_tool,
                                    GtkDeleteType  type,
                                    gint           count)
 {
-  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->text_buffer);
+  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->buffer);
   GtkTextIter    cursor;
   GtkTextIter    end;
 
@@ -909,7 +908,7 @@ gimp_text_tool_delete_from_cursor (GimpTextTool  *text_tool,
 static void
 gimp_text_tool_backspace (GimpTextTool *text_tool)
 {
-  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->text_buffer);
+  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->buffer);
 
   gimp_text_tool_reset_im_context (text_tool);
 
@@ -946,7 +945,7 @@ static void
 gimp_text_tool_select_all (GimpTextTool *text_tool,
                            gboolean      select)
 {
-  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->text_buffer);
+  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->buffer);
 
   gimp_draw_tool_pause (GIMP_DRAW_TOOL (text_tool));
 
@@ -1018,7 +1017,7 @@ gimp_text_tool_editor_dialog (GimpTextTool *text_tool)
     gimp_text_options_editor_new (parent, options,
                                   gimp_dialog_factory_get_menu_factory (dialog_factory),
                                   _("GIMP Text Editor"),
-                                  text_tool->text_buffer);
+                                  text_tool->buffer);
 
   g_object_add_weak_pointer (G_OBJECT (text_tool->editor_dialog),
                              (gpointer) &text_tool->editor_dialog);
@@ -1049,7 +1048,7 @@ static void
 gimp_text_tool_enter_text (GimpTextTool *text_tool,
                            const gchar  *str)
 {
-  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->text_buffer);
+  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->buffer);
   gboolean       had_selection;
 
   had_selection = gtk_text_buffer_get_has_selection (buffer);
@@ -1099,7 +1098,7 @@ gimp_text_tool_xy_to_offset (GimpTextTool *text_tool,
   if (ink_extents.y < 0)
     y += ink_extents.y;
 
-  string = gimp_text_buffer_get_text (text_tool->text_buffer);
+  string = gimp_text_buffer_get_text (text_tool->buffer);
 
   pango_layout_xy_to_index (layout,
                             x * PANGO_SCALE,
diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c
index a0dc4c8..f01a9e5 100644
--- a/app/tools/gimptexttool.c
+++ b/app/tools/gimptexttool.c
@@ -241,9 +241,9 @@ gimp_text_tool_init (GimpTextTool *text_tool)
   text_tool->image   = NULL;
   text_tool->layout  = NULL;
 
-  text_tool->text_buffer = gimp_text_buffer_new ();
+  text_tool->buffer = gimp_text_buffer_new ();
 
-  g_signal_connect (text_tool->text_buffer, "changed",
+  g_signal_connect (text_tool->buffer, "changed",
                     G_CALLBACK (gimp_text_tool_buffer_changed),
                     text_tool);
 
@@ -315,10 +315,10 @@ gimp_text_tool_finalize (GObject *object)
       text_tool->proxy = NULL;
     }
 
-  if (text_tool->text_buffer)
+  if (text_tool->buffer)
     {
-      g_object_unref (text_tool->text_buffer);
-      text_tool->text_buffer = NULL;
+      g_object_unref (text_tool->buffer);
+      text_tool->buffer = NULL;
     }
 
   gimp_text_tool_editor_finalize (text_tool);
@@ -699,7 +699,7 @@ static void
 gimp_text_tool_draw (GimpDrawTool *draw_tool)
 {
   GimpTextTool   *text_tool = GIMP_TEXT_TOOL (draw_tool);
-  GtkTextBuffer  *buffer    = GTK_TEXT_BUFFER (text_tool->text_buffer);
+  GtkTextBuffer  *buffer    = GTK_TEXT_BUFFER (text_tool->buffer);
   PangoRectangle  cursor_rect;
   gint            logical_offset_x;
   gint            logical_offset_y;
@@ -750,7 +750,7 @@ gimp_text_tool_draw_selection (GimpDrawTool *draw_tool,
                                gint          logical_off_y)
 {
   GimpTextTool    *text_tool = GIMP_TEXT_TOOL (draw_tool);
-  GtkTextBuffer   *buffer    = GTK_TEXT_BUFFER (text_tool->text_buffer);
+  GtkTextBuffer   *buffer    = GTK_TEXT_BUFFER (text_tool->buffer);
   PangoLayout     *layout;
   PangoLayoutIter *iter;
   GtkTextIter      sel_start, sel_end;
@@ -759,8 +759,8 @@ gimp_text_tool_draw_selection (GimpDrawTool *draw_tool,
 
   gtk_text_buffer_get_selection_bounds (buffer, &sel_start, &sel_end);
 
-  min = gimp_text_buffer_get_iter_index (text_tool->text_buffer, &sel_start);
-  max = gimp_text_buffer_get_iter_index (text_tool->text_buffer, &sel_end);
+  min = gimp_text_buffer_get_iter_index (text_tool->buffer, &sel_start);
+  max = gimp_text_buffer_get_iter_index (text_tool->buffer, &sel_end);
 
   layout = gimp_text_layout_get_pango_layout (text_tool->layout);
 
@@ -905,7 +905,7 @@ gimp_text_tool_connect (GimpTextTool  *text_tool,
     {
       GimpTextOptions *options = GIMP_TEXT_TOOL_GET_OPTIONS (tool);
 
-      g_signal_handlers_block_by_func (text_tool->text_buffer,
+      g_signal_handlers_block_by_func (text_tool->buffer,
                                        gimp_text_tool_buffer_changed,
                                        text_tool);
 
@@ -922,7 +922,7 @@ gimp_text_tool_connect (GimpTextTool  *text_tool,
           text_tool->text = NULL;
 
           g_object_set (text_tool->proxy, "text", NULL, NULL);
-          gimp_text_buffer_set_text (text_tool->text_buffer, NULL);
+          gimp_text_buffer_set_text (text_tool->buffer, NULL);
 
           gimp_text_tool_clear_layout (text_tool);
         }
@@ -934,7 +934,7 @@ gimp_text_tool_connect (GimpTextTool  *text_tool,
       if (text)
         {
           gimp_config_sync (G_OBJECT (text), G_OBJECT (text_tool->proxy), 0);
-          gimp_text_buffer_set_text (text_tool->text_buffer, text->text);
+          gimp_text_buffer_set_text (text_tool->buffer, text->text);
 
           gimp_text_tool_clear_layout (text_tool);
 
@@ -945,7 +945,7 @@ gimp_text_tool_connect (GimpTextTool  *text_tool,
                             text_tool);
         }
 
-      g_signal_handlers_unblock_by_func (text_tool->text_buffer,
+      g_signal_handlers_unblock_by_func (text_tool->buffer,
                                          gimp_text_tool_buffer_changed,
                                          text_tool);
     }
@@ -1038,13 +1038,13 @@ gimp_text_tool_text_notify (GimpText     *text,
    */
   if (strcmp (pspec->name, "text") == 0)
     {
-      g_signal_handlers_block_by_func (text_tool->text_buffer,
+      g_signal_handlers_block_by_func (text_tool->buffer,
                                        gimp_text_tool_buffer_changed,
                                        text_tool);
 
-      gimp_text_buffer_set_text (text_tool->text_buffer, text->text);
+      gimp_text_buffer_set_text (text_tool->buffer, text->text);
 
-      g_signal_handlers_unblock_by_func (text_tool->text_buffer,
+      g_signal_handlers_unblock_by_func (text_tool->buffer,
                                          gimp_text_tool_buffer_changed,
                                          text_tool);
     }
@@ -1224,7 +1224,7 @@ gimp_text_tool_create_layer (GimpTextTool *text_tool,
     }
   else
     {
-      gchar *string = gimp_text_buffer_get_text (text_tool->text_buffer);
+      gchar *string = gimp_text_buffer_get_text (text_tool->buffer);
 
       g_object_set (text_tool->proxy,
                     "text",     string,
@@ -1611,7 +1611,7 @@ gimp_text_tool_set_layer (GimpTextTool *text_tool,
 gboolean
 gimp_text_tool_get_has_text_selection (GimpTextTool *text_tool)
 {
-  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->text_buffer);
+  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->buffer);
 
   return gtk_text_buffer_get_has_selection (buffer);
 }
@@ -1619,7 +1619,7 @@ gimp_text_tool_get_has_text_selection (GimpTextTool *text_tool)
 void
 gimp_text_tool_delete_selection (GimpTextTool *text_tool)
 {
-  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->text_buffer);
+  GtkTextBuffer *buffer = GTK_TEXT_BUFFER (text_tool->buffer);
 
   if (gtk_text_buffer_get_has_selection (buffer))
     {
@@ -1646,7 +1646,7 @@ gimp_text_tool_cut_clipboard (GimpTextTool *text_tool)
 
   gimp_draw_tool_pause (GIMP_DRAW_TOOL (text_tool));
 
-  gtk_text_buffer_cut_clipboard (GTK_TEXT_BUFFER (text_tool->text_buffer),
+  gtk_text_buffer_cut_clipboard (GTK_TEXT_BUFFER (text_tool->buffer),
                                  clipboard, TRUE);
 
   gimp_draw_tool_resume (GIMP_DRAW_TOOL (text_tool));
@@ -1665,7 +1665,7 @@ gimp_text_tool_copy_clipboard (GimpTextTool *text_tool)
   clipboard = gtk_widget_get_clipboard (GTK_WIDGET (shell),
                                         GDK_SELECTION_CLIPBOARD);
 
-  gtk_text_buffer_copy_clipboard (GTK_TEXT_BUFFER (text_tool->text_buffer),
+  gtk_text_buffer_copy_clipboard (GTK_TEXT_BUFFER (text_tool->buffer),
                                   clipboard);
 }
 
@@ -1684,7 +1684,7 @@ gimp_text_tool_paste_clipboard (GimpTextTool *text_tool)
 
   gimp_draw_tool_pause (GIMP_DRAW_TOOL (text_tool));
 
-  gtk_text_buffer_paste_clipboard (GTK_TEXT_BUFFER (text_tool->text_buffer),
+  gtk_text_buffer_paste_clipboard (GTK_TEXT_BUFFER (text_tool->buffer),
                                    clipboard, NULL, TRUE);
 
   gimp_draw_tool_resume (GIMP_DRAW_TOOL (text_tool));
diff --git a/app/tools/gimptexttool.h b/app/tools/gimptexttool.h
index 09023fc..5c3b385 100644
--- a/app/tools/gimptexttool.h
+++ b/app/tools/gimptexttool.h
@@ -49,7 +49,7 @@ struct _GimpTextTool
 
   gboolean        moving;
 
-  GimpTextBuffer *text_buffer;
+  GimpTextBuffer *buffer;
 
   GimpText       *text;
   GimpTextLayer  *layer;



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