[gtk+] gtk/gtktextbuffer: Use accessor functions to access GtkSelectionData



commit 1ceddae7da71dae9f32bad726db5a4b490b8f0e5
Author: Javier Jardón <jjardon gnome org>
Date:   Wed Dec 15 23:53:00 2010 +0000

    gtk/gtktextbuffer: Use accessor functions to access GtkSelectionData

 gtk/gtktextbuffer.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c
index f1cd6f5..c71d79b 100644
--- a/gtk/gtktextbuffer.c
+++ b/gtk/gtktextbuffer.c
@@ -3156,7 +3156,7 @@ clipboard_get_selection_cb (GtkClipboard     *clipboard,
            * used within-process
            */
           gtk_selection_data_set (selection_data,
-                                  selection_data->target,
+                                  gtk_selection_data_get_target (selection_data),
                                   8, /* bytes */
                                   (void*)&buffer,
                                   sizeof (buffer));
@@ -3167,11 +3167,11 @@ clipboard_get_selection_cb (GtkClipboard     *clipboard,
           gsize   len;
 
           str = gtk_text_buffer_serialize (buffer, buffer,
-                                           selection_data->target,
+                                           gtk_selection_data_get_target (selection_data),
                                            &start, &end, &len);
 
           gtk_selection_data_set (selection_data,
-                                  selection_data->target,
+                                  gtk_selection_data_get_target (selection_data),
                                   8, /* bytes */
                                   str, len);
           g_free (str);
@@ -3226,7 +3226,7 @@ clipboard_get_contents_cb (GtkClipboard     *clipboard,
        * be used within-process. OK to supply a NULL value for contents.
        */
       gtk_selection_data_set (selection_data,
-                              selection_data->target,
+                              gtk_selection_data_get_target (selection_data),
                               8, /* bytes */
                               (void*)&contents,
                               sizeof (contents));
@@ -3244,11 +3244,11 @@ clipboard_get_contents_cb (GtkClipboard     *clipboard,
       gtk_text_buffer_get_bounds (contents, &start, &end);
 
       str = gtk_text_buffer_serialize (clipboard_source_buffer, contents,
-                                       selection_data->target,
+                                       gtk_selection_data_get_target (selection_data),
                                        &start, &end, &len);
 
       gtk_selection_data_set (selection_data,
-			      selection_data->target,
+			      gtk_selection_data_get_target (selection_data),
 			      8, /* bytes */
 			      str, len);
       g_free (str);
@@ -3404,23 +3404,22 @@ selection_data_get_buffer (GtkSelectionData *selection_data,
   GtkTextBuffer *src_buffer = NULL;
 
   /* If we can get the owner, the selection is in-process */
-  owner = gdk_selection_owner_get_for_display (selection_data->display,
-					       selection_data->selection);
+  owner = gdk_selection_owner_get_for_display (gtk_selection_data_get_display (selection_data),
+					       gtk_selection_data_get_selection (selection_data));
 
   if (owner == NULL)
     return NULL;
   
   if (gdk_window_get_window_type (owner) == GDK_WINDOW_FOREIGN)
     return NULL;
- 
-  if (selection_data->type !=
-      gdk_atom_intern_static_string ("GTK_TEXT_BUFFER_CONTENTS"))
+
+  if (gtk_selection_data_get_data_type (selection_data) != gdk_atom_intern_static_string ("GTK_TEXT_BUFFER_CONTENTS"))
     return NULL;
 
-  if (selection_data->length != sizeof (src_buffer))
+  if (gtk_selection_data_get_length (selection_data) != sizeof (src_buffer))
     return NULL;
-          
-  memcpy (&src_buffer, selection_data->data, sizeof (src_buffer));
+
+  memcpy (&src_buffer, gtk_selection_data_get_data (selection_data), sizeof (src_buffer));
 
   if (src_buffer == NULL)
     return NULL;



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