[vte] vteapp: Use gtk API to get the text targets



commit e36b4f0f906bb1386229b778b6b901a49c2cbc42
Author: Christian Persch <chpe gnome org>
Date:   Thu May 26 22:50:38 2011 +0200

    vteapp: Use gtk API to get the text targets
    
    Conflicts:
        src/vteapp.c

 src/vteapp.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/src/vteapp.c b/src/vteapp.c
index ed69827..7ad3b3b 100644
--- a/src/vteapp.c
+++ b/src/vteapp.c
@@ -430,12 +430,14 @@ take_xconsole_ownership(GtkWidget *widget, gpointer data)
        char *name, hostname[255];
        GdkAtom atom;
        GtkClipboard *clipboard;
-       const GtkTargetEntry targets[] = {
-               {(char*)"UTF8_STRING", 0, 0},
-               {(char*)"COMPOUND_TEXT", 0, 0},
-               {(char*)"TEXT", 0, 0},
-               {(char*)"STRING", 0, 0},
-       };
+        GtkTargetList *target_list;
+        GtkTargetEntry *targets;
+        int n_targets;
+
+        target_list = gtk_target_list_new(NULL, 0);
+        gtk_target_list_add_text_targets(target_list, 0);
+        targets = gtk_target_table_new_from_list (target_list, &n_targets);
+        gtk_target_list_unref(target_list);
 
        memset(hostname, '\0', sizeof(hostname));
        gethostname(hostname, sizeof(hostname) - 1);
@@ -448,7 +450,7 @@ take_xconsole_ownership(GtkWidget *widget, gpointer data)
 
        gtk_clipboard_set_with_owner(clipboard,
                                     targets,
-                                    G_N_ELEMENTS(targets),
+                                    n_targets,
                                     clipboard_get,
                                     (GtkClipboardClearFunc)gtk_main_quit,
                                     G_OBJECT(widget));


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