[balsa/wip/gtk4: 89/351] GdkAtom is no more



commit eb86fc441bc9d21da09e8a275faf41c7ef897a99
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Thu Dec 14 14:06:03 2017 -0500

    GdkAtom is no more

 libbalsa/address.c   |   14 ++++++--------
 src/ab-main.c        |    8 ++++----
 src/sendmsg-window.c |   40 +++++++++++++++++-----------------------
 3 files changed, 27 insertions(+), 35 deletions(-)
---
diff --git a/libbalsa/address.c b/libbalsa/address.c
index 0723a99..f987b4a 100644
--- a/libbalsa/address.c
+++ b/libbalsa/address.c
@@ -869,8 +869,6 @@ const gchar *libbalsa_address_target_list[] = {
 static void
 addrlist_drag_received_cb(GtkWidget        * widget,
                           GdkDragContext   * context,
-                          gint               x,
-                          gint               y,
                           GtkSelectionData * selection_data,
                           guint32            time,
                           gpointer           data)
@@ -885,11 +883,11 @@ addrlist_drag_received_cb(GtkWidget        * widget,
     /* Deal with what we are given from source */
     if (selection_data != NULL
         && gtk_selection_data_get_length(selection_data) >= 0) {
-        GdkAtom target;
+        const gchar *target;
 
         target = gtk_selection_data_get_target(selection_data);
 
-        if (target == gdk_atom_intern_static_string("x-application/x-addr")) {
+        if (target == g_intern_static_string("x-application/x-addr")) {
             addr = *(LibBalsaAddress **) gtk_selection_data_get_data(selection_data);
 
             if (addr != NULL && addr->address_list != NULL) {
@@ -901,8 +899,8 @@ addrlist_drag_received_cb(GtkWidget        * widget,
                                                   -1);
                 dnd_success = TRUE;
             }
-        } else if (target == gdk_atom_intern_static_string("text/plain") ||
-                   target == gdk_atom_intern_static_string("STRING")) {
+        } else if (target == g_intern_static_string("text/plain") ||
+                   target == g_intern_static_string("STRING")) {
             g_print("text/plain target not implemented.\n");
         } else {
             g_print ("nothing good");
@@ -930,14 +928,14 @@ addrlist_drag_drop_cb(GtkWidget *widget, GdkDragContext *context,
   if (formats != NULL) {
       const gchar * const *mime_types;
       gsize                n_mime_types;
-      GdkAtom              target_type;
+      const gchar         *target_type;
 
       mime_types = gdk_content_formats_get_mime_types(formats, &n_mime_types);
       g_assert(n_mime_types > LIBBALSA_ADDRESS_TRG_ADDRESS);
 
       /* Choose the best target type */
       target_type =
-          gdk_atom_intern_static_string(mime_types[LIBBALSA_ADDRESS_TRG_ADDRESS]);
+          g_intern_static_string(mime_types[LIBBALSA_ADDRESS_TRG_ADDRESS]);
 
       /* Request the data from the source. */
       printf("drag_drop requests target=%p\n", target_type);
diff --git a/src/ab-main.c b/src/ab-main.c
index 7f6a543..63b517a 100644
--- a/src/ab-main.c
+++ b/src/ab-main.c
@@ -680,11 +680,11 @@ addrlist_drag_get_cb(GtkWidget        * widget,
                      guint              time,
                      gpointer           user_data)
 {
-    GdkAtom target;
+    const gchar *target;
 
     target = gtk_selection_data_get_target(sel_data);
 
-    if (target == gdk_atom_intern_static_string("x-application/x-addr")) {
+    if (target == g_intern_static_string("x-application/x-addr")) {
         GtkTreeView *addrlist;
         GtkTreeSelection *selection;
         GtkTreeModel *model;
@@ -702,8 +702,8 @@ addrlist_drag_get_cb(GtkWidget        * widget,
                                target,
                                8, (const guchar *) &address,
                                sizeof(LibBalsaAddress*));
-    } else if (target == gdk_atom_intern_static_string("text/plain") ||
-               target == gdk_atom_intern_static_string("STRING")) {
+    } else if (target == g_intern_static_string("text/plain") ||
+               target == g_intern_static_string("STRING")) {
         g_print("Text/plain cannot be sent.\n");
     } else {
         g_print("Do not know what to do!\n");
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index 3c78b09..3ac0d2e 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -2183,22 +2183,20 @@ rfc2396_uri(const gchar *instr)
 }
 
 static void
-attachments_add(GtkWidget * widget,
-               GdkDragContext * context,
-               gint x,
-               gint y,
+attachments_add(GtkWidget        * widget,
+               GdkDragContext   * context,
                GtkSelectionData * selection_data,
-               guint info, guint32 time, BalsaSendmsg * bsmsg)
+               guint32 time,
+                BalsaSendmsg     * bsmsg)
 {
-    GdkAtom target;
+    const gchar *target;
     gboolean drag_result = TRUE;
 
-    if (balsa_app.debug)
-        printf("attachments_add: info %d\n", info);
-
     target = gtk_selection_data_get_target(selection_data);
+    if (balsa_app.debug)
+        printf("attachments_add: target %s\n", target);
 
-    if (target == gdk_atom_intern_static_string("x-application/x-message-list")) {
+    if (target == g_intern_static_string("x-application/x-message-list")) {
        BalsaIndex *index =
             *(BalsaIndex **) gtk_selection_data_get_data(selection_data);
        LibBalsaMailbox *mailbox = index->mailbox_node->mailbox;
@@ -2220,7 +2218,7 @@ attachments_add(GtkWidget * widget,
            g_object_unref(message);
         }
         balsa_index_selected_msgnos_free(index, selected);
-    } else if (target == gdk_atom_intern_static_string("text/uri-list")) {
+    } else if (target == g_intern_static_string("text/uri-list")) {
         GSList *uri_list, *list;
 
         list = uri2gslist((gchar *) gtk_selection_data_get_data(selection_data));
@@ -2229,8 +2227,8 @@ attachments_add(GtkWidget * widget,
             g_free(uri_list->data);
         }
         g_slist_free(list);
-    } else if (target == gdk_atom_intern_static_string("STRING") ||
-               target == gdk_atom_intern_static_string("text/plain")) {
+    } else if (target == g_intern_static_string("STRING") ||
+               target == g_intern_static_string("text/plain")) {
        gchar *url = rfc2396_uri((gchar *) gtk_selection_data_get_data(selection_data));
 
        if (url)
@@ -2246,12 +2244,10 @@ attachments_add(GtkWidget * widget,
 static void
 to_add(GtkWidget        * widget,
        GdkDragContext   * context,
-       gint               x,
-       gint               y,
        GtkSelectionData * selection_data,
        guint32            time)
 {
-    GdkAtom target;
+    const gchar *target;
     gboolean drag_result = FALSE;
 
 #ifdef DEBUG
@@ -2262,8 +2258,8 @@ to_add(GtkWidget        * widget,
 
     target = gtk_selection_data_get_target(selection_data);
 
-    if (target == gdk_atom_intern_static_string("STRING") ||
-        target == gdk_atom_intern_static_string("text/plain")) {
+    if (target == g_intern_static_string("STRING") ||
+        target == g_intern_static_string("text/plain")) {
         const gchar *address;
 
         address =
@@ -2762,13 +2758,11 @@ has_file_attached(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter,
 static void
 drag_data_quote(GtkWidget        * widget,
                 GdkDragContext   * context,
-                gint               x,
-                gint               y,
                 GtkSelectionData * selection_data,
                 guint32            time,
                 BalsaSendmsg     * bsmsg)
 {
-    GdkAtom target;
+    const gchar *target;
     GtkTextBuffer *buffer;
     BalsaIndex *index;
     LibBalsaMailbox *mailbox;
@@ -2777,7 +2771,7 @@ drag_data_quote(GtkWidget        * widget,
 
     target = gtk_selection_data_get_target(selection_data);
 
-    if (target == gdk_atom_intern_static_string(drop_types[TARGET_MESSAGES])) {
+    if (target == g_intern_static_string(drop_types[TARGET_MESSAGES])) {
        index =
             *(BalsaIndex **) gtk_selection_data_get_data(selection_data);
        mailbox = index->mailbox_node->mailbox;
@@ -2799,7 +2793,7 @@ drag_data_quote(GtkWidget        * widget,
             g_string_free(body, TRUE);
         }
         balsa_index_selected_msgnos_free(index, selected);
-    } else if (target == gdk_atom_intern_static_string(drop_types[TARGET_URI_LIST])) {
+    } else if (target == g_intern_static_string(drop_types[TARGET_URI_LIST])) {
         GSList *uri_list =
             uri2gslist((gchar *)
                        gtk_selection_data_get_data(selection_data));


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