[gtkmm] Replace Gtk::TargetList by Gdk::ContentFormats



commit 0ad808c64916a5784d0aeb0fab404efa5877d1f9
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Fri Nov 24 19:29:37 2017 +0100

    Replace Gtk::TargetList by Gdk::ContentFormats
    
    Remove Gtk::TargetEntry, Gtk::TargetList and enum Gtk::TargetFlags.
    Add Gdk::ContentFormats (replaces Gtk::TargetList) and
    Gdk::ContentFormatsBuilder.
    Corresponding changes have been done in gtk+4.

 .gitignore                            |    7 +-
 demos/gtk-demo/example_iconbrowser.cc |    4 +-
 gdk/src/contentformats.ccg            |   74 ++++++++++++++
 gdk/src/contentformats.hg             |  170 +++++++++++++++++++++++++++++++++
 gdk/src/contentformatsbuilder.ccg     |   52 ++++++++++
 gdk/src/contentformatsbuilder.hg      |   73 ++++++++++++++
 gdk/src/dragcontext.ccg               |    7 +-
 gdk/src/dragcontext.hg                |    8 +-
 gdk/src/filelist.am                   |    2 +
 gdk/src/window.ccg                    |    6 +-
 gdk/src/window.hg                     |   16 +--
 gtk/gtkmm/filelist.am                 |    2 -
 gtk/gtkmm/targetentry.cc              |  100 -------------------
 gtk/gtkmm/targetentry.h               |   88 -----------------
 gtk/src/clipboard.ccg                 |    4 +-
 gtk/src/clipboard.hg                  |   27 +++---
 gtk/src/entry.hg                      |    2 +-
 gtk/src/enums.hg                      |    1 -
 gtk/src/filelist.am                   |    1 -
 gtk/src/iconview.hg                   |    4 +-
 gtk/src/targetlist.ccg                |   54 -----------
 gtk/src/targetlist.hg                 |   84 ----------------
 gtk/src/textbuffer.hg                 |   12 +-
 gtk/src/toolpalette.hg                |    5 +-
 gtk/src/treeview.ccg                  |    9 +-
 gtk/src/treeview.hg                   |   19 ++---
 gtk/src/widget.ccg                    |    1 +
 gtk/src/widget.hg                     |   21 +++--
 tools/m4/convert_gdk.m4               |   10 ++
 tools/m4/convert_gtk.m4               |    7 --
 30 files changed, 449 insertions(+), 421 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index a1dec22..1f94b0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+
 # wildcard patterns
 *.[ao]
 *.l[ao]
@@ -50,6 +51,10 @@ demos/pixbuf-demo
 gdk/gdkmm-*.pc
 gdk/gdkmm/applaunchcontext.cc
 gdk/gdkmm/applaunchcontext.h
+gdk/gdkmm/contentformats.cc
+gdk/gdkmm/contentformats.h
+gdk/gdkmm/contentformatsbuilder.cc
+gdk/gdkmm/contentformatsbuilder.h
 gdk/gdkmm/cursor.cc
 gdk/gdkmm/cursor.h
 gdk/gdkmm/device.cc
@@ -440,8 +445,6 @@ gtk/gtkmm/styleprovider.cc
 gtk/gtkmm/styleprovider.h
 gtk/gtkmm/switch.cc
 gtk/gtkmm/switch.h
-gtk/gtkmm/targetlist.cc
-gtk/gtkmm/targetlist.h
 gtk/gtkmm/textbuffer.cc
 gtk/gtkmm/textbuffer.h
 gtk/gtkmm/textchildanchor.cc
diff --git a/demos/gtk-demo/example_iconbrowser.cc b/demos/gtk-demo/example_iconbrowser.cc
index feaf109..57f19ef 100644
--- a/demos/gtk-demo/example_iconbrowser.cc
+++ b/demos/gtk-demo/example_iconbrowser.cc
@@ -236,7 +236,7 @@ Example_IconBrowser::Example_IconBrowser()
 
   // Enable dragging an icon name, and copying it to another program.
   m_icon_view.enable_model_drag_source(
-    Gtk::TargetList::create({}), Gdk::ModifierType::BUTTON1_MASK, Gdk::DragAction::COPY);
+    Gdk::ContentFormats::create(), Gdk::ModifierType::BUTTON1_MASK, Gdk::DragAction::COPY);
   m_icon_view.drag_source_add_text_targets();
 
   m_icon_view.set_has_tooltip(true);
@@ -907,7 +907,7 @@ DetailDialog::DetailDialog(Gtk::Window& parent)
 
     // Enable dragging an image, and copying it to another program.
     m_image[i].drag_source_set(
-      Gtk::TargetList::create({}), Gdk::ModifierType::BUTTON1_MASK, Gdk::DragAction::COPY);
+      Gdk::ContentFormats::create(), Gdk::ModifierType::BUTTON1_MASK, Gdk::DragAction::COPY);
     m_image[i].drag_source_add_image_targets();
     m_image[i].signal_drag_data_get().connect(
       sigc::bind(sigc::mem_fun(*this, &DetailDialog::on_image_drag_data_get), i));
diff --git a/gdk/src/contentformats.ccg b/gdk/src/contentformats.ccg
new file mode 100644
index 0000000..5596c42
--- /dev/null
+++ b/gdk/src/contentformats.ccg
@@ -0,0 +1,74 @@
+/* Copyright (C) 2017 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <glibmm/vectorutils.h>
+
+namespace Gdk
+{
+
+Glib::RefPtr<ContentFormats> ContentFormats::create(const std::vector<Glib::ustring>& mime_types)
+{
+  return 
Glib::wrap(gdk_content_formats_new(Glib::ArrayHandler<Glib::ustring>::vector_to_array(mime_types).data(), 
mime_types.size()));
+}
+
+Glib::RefPtr<ContentFormats> ContentFormats::create(const Glib::ustring& mime_type)
+{
+  const char* c_mime_type = mime_type.c_str();
+  return Glib::wrap(gdk_content_formats_new(&c_mime_type, 1));
+}
+
+std::vector<GType> ContentFormats::get_gtypes() const
+{
+  gsize n_gtypes = 0;
+  const GType* gtype_array = gdk_content_formats_get_gtypes(const_cast<GdkContentFormats*>(gobj()), 
&n_gtypes);
+  return Glib::ArrayHandler<GType>::array_to_vector(gtype_array, n_gtypes, Glib::OWNERSHIP_NONE);
+}
+
+std::vector<Glib::ustring> ContentFormats::get_mime_types() const
+{
+  gsize n_mime_types = 0;
+  const char* const* mime_type_array = 
gdk_content_formats_get_mime_types(const_cast<GdkContentFormats*>(gobj()), &n_mime_types);
+  return Glib::ArrayHandler<Glib::ustring>::array_to_vector(mime_type_array, n_mime_types, 
Glib::OWNERSHIP_NONE);
+}
+
+Glib::RefPtr<ContentFormats> ContentFormats::join(const Glib::RefPtr<const ContentFormats>& second) const
+{
+  // gdk_content_formats_union() unref's *this! Compensate for that.
+  reference();
+  return Glib::wrap(gdk_content_formats_union(const_cast<GdkContentFormats*>(gobj()), Glib::unwrap(second)));
+}
+
+} // namespace Gdk
+
+namespace Glib
+{
+
+GType Value<RefPtr<Gdk::ContentFormats> >::value_type()
+{
+  return gdk_content_formats_get_type();
+}
+
+void Value<RefPtr<Gdk::ContentFormats> >::set(const CppType& data)
+{
+  set_boxed(Glib::unwrap(data));
+}
+
+Value<RefPtr<Gdk::ContentFormats>>::CppType Value<RefPtr<Gdk::ContentFormats>>::get() const
+{
+  return Glib::wrap(static_cast<CType>(get_boxed()), true);
+}
+
+} // namespace Glib
diff --git a/gdk/src/contentformats.hg b/gdk/src/contentformats.hg
new file mode 100644
index 0000000..871705a
--- /dev/null
+++ b/gdk/src/contentformats.hg
@@ -0,0 +1,170 @@
+/* Copyright (C) 2017 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+_DEFS(gdkmm,gdk)
+
+#include <glibmm/refptr.h>
+#include <glibmm/ustring.h>
+#include <glibmm/value.h>
+#include <gdk/gdk.h> // For GdkContentFormats.
+#include <vector>
+
+_CC_INCLUDE(gdk/gdk.h)
+
+namespace Gdk
+{
+
+/** Advertising and negotiating of content exchange formats.
+ *
+ * %Gdk::ContentFormats is used to advertise and negotiate the format of
+ * content passed between different widgets, windows or applications using
+ * for example the clipboard or drag'n'drop.
+ *
+ * GDK supports content in 2 forms: GType and mime type.
+ * Using GTypes is meant only for in-process content transfers. Mime types
+ * are meant to be used for data passing both in-process and out-of-process.
+ * The details of how data is passed is described in the documentation of
+ * the actual implementations.
+ *
+ * A %Gdk::ContentFormats describes a set of possible formats content can be
+ * exchanged in. It is assumed that this set is ordered. GTypes are more
+ * important than mime types. Order between different Gtypes or mime types
+ * is the order they were added in, most important first. Functions that
+ * care about order, such as join(), describe in
+ * their documentation how they interpret that order, though in general the
+ * order of the first argument is considered the primary order of the result,
+ * followed by the order of further arguments.
+ *
+ * For debugging purposes, the function to_string() exists.
+ * It will print a comma-separated list of formats from most important to least
+ * important.
+ *
+ * %Gdk::ContentFormats is an immutable object. After creation, you cannot change
+ * the types it represents. Instead, new %Gdk::ContentFormats have to be created.
+ * Gdk::ContentFormatsBuilder is meant to help in this endeavor.
+ *
+ * @see Gdk::DragContext, Gtk::Clipboard
+ *
+ * @newin{3,94}
+ */
+class ContentFormats final
+{
+  // GdkContentFormats is actually registered as a boxed type, but it has custom
+  // reference-counting instead of copy/free functions, so we use it via RefPtr.
+  _CLASS_OPAQUE_REFCOUNTED(ContentFormats, GdkContentFormats, NONE, gdk_content_formats_ref, 
gdk_content_formats_unref)
+  _IGNORE(gdk_content_formats_ref, gdk_content_formats_unref)
+public:
+  /** Creates a new %Gdk::ContentFormats from an array of mime types.
+   *
+   * The mime types must be different or the behavior of the return value
+   * is undefined. If you cannot guarantee this, use Gdk::ContentFormatsBuilder
+   * instead.
+   *
+   * @param mime_types A vector of mime types.
+   * @return The new %Gdk::ContentFormats.
+   */
+  static Glib::RefPtr<ContentFormats> create(const std::vector<Glib::ustring>& mime_types = {});
+  _IGNORE(gdk_content_formats_new)
+
+  /** Creates a new %Gdk::ContentFormats from a mime type.
+   *
+   * @param mime_type A mime type.
+   * @return The new %Gdk::ContentFormats.
+   */
+  static Glib::RefPtr<ContentFormats> create(const Glib::ustring& mime_type);
+
+  /** Prints the given %ContentFormats into a string for human consumption.
+   * This is meant for debugging and logging.
+   *
+   * The form of the representation may change at any time and is
+   * not guranteed to stay identical.
+   *
+   * @return A new string.
+   */
+  _WRAP_METHOD(Glib::ustring to_string() const, gdk_content_formats_to_string)
+  _IGNORE(gdk_content_formats_print)
+
+  /** Gets the Types included in the %ContentFormats.
+   * Note that they may not contain any Types, in particular when they are empty.
+   * In that case an empty vector will be returned.
+   *
+   * @return A vector of types included in the %ContentFormats. May be empty.
+   */
+  std::vector<GType> get_gtypes() const;
+  _IGNORE(gdk_content_formats_get_gtypes)
+
+  /** Gets the mime types included in the %ContentFormats.
+   * Note that they may not contain any mime types, in particular when they are empty.
+   * In that case an empty vector will be returned.
+   *
+   * @return A vector of mime types included in the %ContentFormats. May be empty.
+   */
+  std::vector<Glib::ustring> get_mime_types() const;
+  _IGNORE(gdk_content_formats_get_mime_types)
+
+  _WRAP_METHOD(bool contain_gtype(GType type) const, gdk_content_formats_contain_gtype)
+  _WRAP_METHOD(bool contain_mime_type(const Glib::ustring& mime_type) const,
+    gdk_content_formats_contain_mime_type)
+
+  // 'union' is a C and C++ keyword. Can't be a method name.
+  /** Append all missing types from @a second to <tt>*this</tt>, in the order
+   * they had in @a second.
+   *
+   * @param second The %ContentFormats to merge from.
+   * @return A new %ContentFormats.
+   */
+  Glib::RefPtr<ContentFormats> join(const Glib::RefPtr<const ContentFormats>& second) const;
+  _IGNORE(gdk_content_formats_union)
+
+#m4 _INITIALIZATION(`GType&', `GType', `$3 = $4')
+#m4 _INITIALIZATION(`Glib::ustring&', `const char*', `$3 = Glib::convert_const_gchar_ptr_to_ustring($4)')
+  /** Finds the first element from <tt>*this</tt> that is also contained
+   * in @a second. If no matching format is found, <tt>false</tt> is returned
+   * and @a out_gtype and @a out_mime_type are set to G_TYPE_INVALID and
+   * an empty string respectively.
+   *
+   * @param second The %ContentFormats to intersect with.
+   * @param[out] out_gtype Where to store the matching type,
+   *             or G_TYPE_INVALID if @a out_mime_type is set.
+   * @param[out] out_mime_type The matching
+   * mime type, or an empty string if @a out_gtype is set.
+   * @return <tt>true</tt> if a matching format was found.
+   */
+  _WRAP_METHOD(bool match(const Glib::RefPtr<const ContentFormats>& second,
+    GType& out_gtype{>>}, Glib::ustring& out_mime_type{>>}) const,
+    gdk_content_formats_match)
+};
+
+} // namespace Gdk
+
+namespace Glib
+{
+// This is needed so Glib::RefPtr<Gdk::ContentFormats> can be used with
+// Glib::Value and _WRAP_PROPERTY in Gtk::TextBuffer.
+template <>
+class Value<Glib::RefPtr<Gdk::ContentFormats>> : public ValueBase_Boxed
+{
+public:
+  typedef Glib::RefPtr<Gdk::ContentFormats> CppType;
+  typedef GdkContentFormats* CType;
+
+  static GType value_type();
+
+  void set(const CppType& data);
+  CppType get() const;
+};
+
+} // namespace Glib
diff --git a/gdk/src/contentformatsbuilder.ccg b/gdk/src/contentformatsbuilder.ccg
new file mode 100644
index 0000000..051d936
--- /dev/null
+++ b/gdk/src/contentformatsbuilder.ccg
@@ -0,0 +1,52 @@
+/* Copyright (C) 2017 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+namespace Gdk
+{
+ContentFormatsBuilder::ContentFormatsBuilder()
+: gobject_(gdk_content_formats_builder_new())
+{
+}
+
+ContentFormatsBuilder::ContentFormatsBuilder(ContentFormatsBuilder&& other) noexcept
+: gobject_(std::move(other.gobject_))
+{
+  other.gobject_ = gdk_content_formats_builder_new();
+}
+
+ContentFormatsBuilder& ContentFormatsBuilder::operator=(ContentFormatsBuilder&& other) noexcept
+{
+  ContentFormatsBuilder temp(std::move(other));
+  std::swap(gobject_, temp.gobject_);
+  return *this;
+}
+
+ContentFormatsBuilder::~ContentFormatsBuilder()
+{
+  // The only way to destroy a GdkContentFormatsBuilder instance is to
+  // make a GdkContentFormats instance, and unref it.
+  gdk_content_formats_unref(gdk_content_formats_builder_free(gobj()));
+}
+
+Glib::RefPtr<ContentFormats> ContentFormatsBuilder::make_content_formats()
+{
+  GdkContentFormats* formats = gdk_content_formats_builder_free(gobj());
+  // Make sure gobject_ is a valid pointer.
+  gobject_ = gdk_content_formats_builder_new();
+  return Glib::wrap(formats);
+}
+
+} // namespace Gdk
diff --git a/gdk/src/contentformatsbuilder.hg b/gdk/src/contentformatsbuilder.hg
new file mode 100644
index 0000000..91c445e
--- /dev/null
+++ b/gdk/src/contentformatsbuilder.hg
@@ -0,0 +1,73 @@
+/* Copyright (C) 2017 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+_DEFS(gdkmm,gdk)
+
+#include <gdkmm/contentformats.h>
+
+namespace Gdk
+{
+
+/** Helper class for building Gdk::ContentFormats.
+ *
+ * @newin{3,94}
+ */
+class ContentFormatsBuilder final
+{
+  _CLASS_GENERIC(ContentFormatsBuilder, GdkContentFormatsBuilder)
+public:
+  /** Creates a new %ContentFormatsBuilder object.
+   *
+   * The resulting builder would create an empty ContentFormats.
+   * Use addition functions to add types to it.
+   */
+  ContentFormatsBuilder();
+  _IGNORE(gdk_content_formats_builder_new)
+
+  // Can't be copied.
+  ContentFormatsBuilder(const ContentFormatsBuilder& other) = delete;
+  ContentFormatsBuilder& operator=(const ContentFormatsBuilder& other) = delete;
+
+  ContentFormatsBuilder(ContentFormatsBuilder&& other) noexcept;
+  ContentFormatsBuilder& operator=(ContentFormatsBuilder&& other) noexcept;
+
+  ~ContentFormatsBuilder();
+  
+  _WRAP_METHOD(void add_formats(const Glib::RefPtr<const ContentFormats>& formats),
+    gdk_content_formats_builder_add_formats)
+  _WRAP_METHOD(void add_gtype(GType gtype), gdk_content_formats_builder_add_gtype)
+  _WRAP_METHOD(void add_mime_type(const Glib::ustring& mime_type),
+    gdk_content_formats_builder_add_mime_type)
+
+  /** Makes a new Gdk::ContentFormats from the builder.
+   *
+   * The builder is reset to an empty builder, as if it had been newly constructed.
+   *
+   * @return A new Gdk::ContentFormats with all the formats added to the builder.
+   */
+  Glib::RefPtr<ContentFormats> make_content_formats();
+  _IGNORE(gdk_content_formats_builder_free)
+
+  ///Provides access to the underlying C object.
+  GdkContentFormatsBuilder* gobj() { return gobject_; }
+  ///Provides access to the underlying C object.
+  const GdkContentFormatsBuilder* gobj() const { return gobject_; }
+
+private:
+  GdkContentFormatsBuilder* gobject_;
+};
+
+} // namespace Gdk
diff --git a/gdk/src/dragcontext.ccg b/gdk/src/dragcontext.ccg
index 0d8866c..d540978 100644
--- a/gdk/src/dragcontext.ccg
+++ b/gdk/src/dragcontext.ccg
@@ -18,6 +18,7 @@
 
 #include <glibmm/vectorutils.h>
 
+#include <gdkmm/contentformats.h>
 #include <gdkmm/window.h>
 #include <gtk/gtk.h>
 #include <gdk/gdk.h>
@@ -41,10 +42,4 @@ void DragContext::drag_refuse(guint32 time)
   gdk_drag_status(gobj(), ((GdkDragAction)(0)) /* see GDK docs */, time);
 }
 
-std::vector<std::string> DragContext::list_targets() const
-{
-  //Note that we don't free the GList* (or it's items), because we are accessing the struct directly:
-  return Glib::ListHandler<std::string, AtomStringTraits>::list_to_vector( 
gdk_drag_context_list_targets(const_cast<GdkDragContext*>(gobj())), Glib::OWNERSHIP_NONE);
-}
-
 } // namespace Gdk
diff --git a/gdk/src/dragcontext.hg b/gdk/src/dragcontext.hg
index c757c30..34b3d2e 100644
--- a/gdk/src/dragcontext.hg
+++ b/gdk/src/dragcontext.hg
@@ -28,6 +28,7 @@ _PINCLUDE(glibmm/private/object_p.h)
 
 namespace Gdk
 {
+class ContentFormats;
 
 _WRAP_ENUM(DragAction, GdkDragAction)
 _WRAP_ENUM(DragProtocol, GdkDragProtocol)
@@ -84,11 +85,8 @@ public:
   _WRAP_METHOD(Glib::RefPtr<Device> get_device(), gdk_drag_context_get_device, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Device> get_device() const, gdk_drag_context_get_device, refreturn, 
constversion)
 
-  /** Get a list of targets offered by the source.
-   * @result a list of targets offered by the source.
-   */
-  std::vector<std::string> list_targets() const;
-  _IGNORE(gdk_drag_context_list_targets)
+  _WRAP_METHOD(Glib::RefPtr<ContentFormats> get_formats(), gdk_drag_context_get_formats, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const ContentFormats> get_formats() const, gdk_drag_context_get_formats, 
refreturn, constversion)
 
   _WRAP_METHOD(DragAction get_actions() const, gdk_drag_context_get_actions)
   _WRAP_METHOD(DragAction get_suggested_action() const, gdk_drag_context_get_suggested_action)
diff --git a/gdk/src/filelist.am b/gdk/src/filelist.am
index f2ba30f..e4a092b 100644
--- a/gdk/src/filelist.am
+++ b/gdk/src/filelist.am
@@ -14,6 +14,8 @@ gdkmm_files_defs =            \
 
 gdkmm_files_any_hg =           \
        applaunchcontext.hg     \
+       contentformats.hg               \
+       contentformatsbuilder.hg                \
        cursor.hg               \
        device.hg               \
        devicemanager.hg        \
diff --git a/gdk/src/window.ccg b/gdk/src/window.ccg
index 3631308..2fa5f51 100644
--- a/gdk/src/window.ccg
+++ b/gdk/src/window.ccg
@@ -17,6 +17,7 @@
 
 #include <gdk/gdk.h>
 #include <gdkmm/cairoutils.h>
+#include <gdkmm/contentformats.h>
 #include <gdkmm/cursor.h>
 #include <gdkmm/device.h>
 #include <gdkmm/types.h>
@@ -56,11 +57,6 @@ void Window::restack(bool above)
   gdk_window_restack(gobj(), nullptr, above);
 }
 
-Glib::RefPtr<DragContext> Window::drag_begin (const std::vector<Glib::ustring>& targets)
-{
-  return Glib::wrap (gdk_drag_begin (gobj (), Glib::ListHandler<Glib::ustring, 
AtomUstringTraits>::vector_to_list(targets).data ()), true);
-}
-
 DragProtocol Window::get_drag_protocol(Glib::RefPtr<Window>& target) const
 {
   GdkWindow* window = nullptr;
diff --git a/gdk/src/window.hg b/gdk/src/window.hg
index 2bc9b9e..a666e81 100644
--- a/gdk/src/window.hg
+++ b/gdk/src/window.hg
@@ -44,6 +44,7 @@ _WRAP_ENUM(FullscreenMode, GdkFullscreenMode,
   s#^CURRENT_MONITOR$#ON_CURRENT_MONITOR#,
   s#^ALL_MONITORS$#ON_ALL_MONITORS#)
 
+class ContentFormats;
 class Cursor;
 class GLContext;
 class DrawContext;
@@ -257,16 +258,11 @@ public:
 
   _WRAP_METHOD(void begin_move_drag(const Glib::RefPtr<Device>& device, int button, int root_x, int root_y, 
guint32 timestamp), gdk_window_begin_move_drag_for_device)
 
-  /** Starts a drag and creates a new drag context for it.
-   *
-   * This method is called by the drag source.
-   * @param targets A list of the offered targets names.
-   * @return A newly created Gdk::DragContext.
-   *
-   * @newin{2,24}
-   */
-  Glib::RefPtr<DragContext> drag_begin(const std::vector<Glib::ustring>& targets);
-  _IGNORE(gdk_drag_begin)
+  _WRAP_METHOD(Glib::RefPtr<DragContext> drag_begin(const Glib::RefPtr<ContentFormats>& formats), 
gdk_drag_begin)
+  _WRAP_METHOD(Glib::RefPtr<DragContext> drag_begin_for_device(const Glib::RefPtr<Device>& device,
+    const Glib::RefPtr<ContentFormats>& formats), gdk_drag_begin_for_device)
+  _WRAP_METHOD(Glib::RefPtr<DragContext> drag_begin_from_point(const Glib::RefPtr<Device>& device,
+    const Glib::RefPtr<ContentFormats>& formats, int x_root, int y_root), gdk_drag_begin_from_point)
 
   _WRAP_METHOD(void invalidate_rect(const Rectangle& rect, bool invalidate_children), 
gdk_window_invalidate_rect)
 
diff --git a/gtk/gtkmm/filelist.am b/gtk/gtkmm/filelist.am
index d5577b7..b9ed5fc 100644
--- a/gtk/gtkmm/filelist.am
+++ b/gtk/gtkmm/filelist.am
@@ -14,7 +14,6 @@ gtkmm_files_extra_any_cc =            \
        object.cc \
        radiobuttongroup.cc             \
        selectiondata_private.cc        \
-       targetentry.cc                  \
        treemodelcolumn.cc              \
        treeview_private.cc \
        widgetcustomdraw.cc \
@@ -34,7 +33,6 @@ gtkmm_files_extra_any_h =                     \
        object.h \
        radiobuttongroup.h              \
        selectiondata_private.h         \
-       targetentry.h                   \
        treemodelcolumn.h               \
        treeview_private.h              \
        widgetcustomdraw.h \
diff --git a/gtk/src/clipboard.ccg b/gtk/src/clipboard.ccg
index 5c6a0b6..57830a2 100644
--- a/gtk/src/clipboard.ccg
+++ b/gtk/src/clipboard.ccg
@@ -198,7 +198,7 @@ static void SignalProxy_ImageReceived_gtk_callback(GtkClipboard*, GdkPixbuf* ima
 namespace Gtk
 {
 
-bool Clipboard::set(const Glib::RefPtr<TargetList>& targets,
+bool Clipboard::set(const Glib::RefPtr<Gdk::ContentFormats>& formats,
                     const SlotGet& slot_get, const SlotClear& slot_clear)
 {
   // Create a signal proxy. A pointer to this will be passed through the callback's data parameter.
@@ -206,7 +206,7 @@ bool Clipboard::set(const Glib::RefPtr<TargetList>& targets,
 
   return gtk_clipboard_set_with_data(
       gobj(),
-      targets->gobj(),
+      formats->gobj(),
       &SignalProxy_GetClear_gtk_callback_get,
       &SignalProxy_GetClear_gtk_callback_clear,
       pSignalProxy);
diff --git a/gtk/src/clipboard.hg b/gtk/src/clipboard.hg
index 80b0826..11ab270 100644
--- a/gtk/src/clipboard.hg
+++ b/gtk/src/clipboard.hg
@@ -18,10 +18,10 @@
 
 #include <vector>
 
+#include <gdkmm/contentformats.h>
 #include <gdkmm/display.h>
 #include <gdkmm/events.h>
 #include <gdkmm/pixbuf.h>
-#include <gtkmm/targetlist.h>
 #include <gtkmm/selectiondata.h>
 #include <glibmm/object.h>
 
@@ -36,7 +36,7 @@ class TextBuffer;
 #endif //DOXYGEN_SHOULD_SKIP_THIS
 
 /** The Clipboard object represents a clipboard of data shared between different processes or between
- * different widgets in the same process. Each clipboard is identified by a name encoded as a GdkAtom. *
+ * different widgets in the same process. Each clipboard is identified by a name encoded as a GdkAtom.
  * (Conversion to and from strings can be done with gdk_atom_intern() and gdk_atom_name().) The default
  * clipboard corresponds to the "CLIPBOARD" atom; another commonly used clipboard is the "PRIMARY" clipboard,
  * which, in X, traditionally contains the currently selected text.
@@ -85,16 +85,16 @@ public:
   * a list of supported formats for the clipboard data and a function
   * to call to get the actual data when it is requested.
   *
-  * @param targets Information about the available forms for the clipboard data.
-  * @param slot_get method to call to get the actual clipboard data.
+  * @param formats The targets (data formats) in which the methods can provide the data.
+  * @param slot_get Method to call to get the actual clipboard data.
   * @param slot_clear When the clipboard contents are set again, this method will
-  *              be called, and slot_get will not be subsequently called.
+  *              be called, and @a slot_get will not be subsequently called.
   *
-  * @return true if setting the clipboard data succeeded. If setting
+  * @return <tt>true</tt> if setting the clipboard data succeeded. If setting
   *               the clipboard data failed then the provided callback methods
   *               will be ignored.
   */
-  bool set(const Glib::RefPtr<TargetList>& targets, const SlotGet& slot_get, const SlotClear& slot_clear);
+  bool set(const Glib::RefPtr<Gdk::ContentFormats>& formats, const SlotGet& slot_get, const SlotClear& 
slot_clear);
   _IGNORE(gtk_clipboard_set_with_owner, gtk_clipboard_set_with_data)
 
   _WRAP_METHOD(Glib::RefPtr<Glib::Object> get_owner(), gtk_clipboard_get_owner, refreturn)
@@ -289,24 +289,23 @@ public:
    */
   _WRAP_METHOD(std::vector<Glib::ustring> wait_for_uris() const, gtk_clipboard_wait_for_uris)
 
-  /** Hints that the clipboard data should be stored somewhere when the application exits or when store()
-   * is called.
+  /** Hints that the clipboard data should be stored somewhere when the application
+   * exits or when store() is called.
    *
    * This value is reset when the clipboard owner changes. Where the clipboard data is stored is platform
    * dependent, see Gdk::Display::store_clipboard() for more information.
    *
-   * @param targets The targets (data formats) in which the functions can provide the data.
+   * @param formats The targets (data formats) in which the functions can provide the data.
    */
-  _WRAP_METHOD(void set_can_store(const Glib::RefPtr<TargetList>& targets), gtk_clipboard_set_can_store)
+  _WRAP_METHOD(void set_can_store(const Glib::RefPtr<Gdk::ContentFormats>& formats), 
gtk_clipboard_set_can_store)
 
-  /** Hints that all forms of clipboard data should be stored somewhere when the application exits or when 
store()
-   * is called.
+  /** Hints that all forms of clipboard data should be stored somewhere when
+   * the application exits or when store() is called.
    *
    * This value is reset when the clipboard owner changes. Where the clipboard data is stored is platform
    * dependent, see Gdk::Display::store_clipboard() for more information.
    */
   void set_can_store();
-  _IGNORE(gtk_clipboard_set_can_store)
 
   _WRAP_METHOD(void store(), gtk_clipboard_store)
   _WRAP_METHOD(GdkAtom get_selection() const, gtk_clipboard_get_selection)
diff --git a/gtk/src/entry.hg b/gtk/src/entry.hg
index 0237b91..90ea2c0 100644
--- a/gtk/src/entry.hg
+++ b/gtk/src/entry.hg
@@ -160,7 +160,7 @@ public:
 
   _WRAP_METHOD(Glib::ustring get_icon_tooltip_markup(IconPosition icon_pos = IconPosition::PRIMARY) const, 
gtk_entry_get_icon_tooltip_markup)
 
-  _WRAP_METHOD(void set_icon_drag_source(const Glib::RefPtr<TargetList>& target_list{.},
+  _WRAP_METHOD(void set_icon_drag_source(const Glib::RefPtr<Gdk::ContentFormats>& formats{.},
     Gdk::DragAction actions{.} = Gdk::DragAction::COPY,
     IconPosition icon_pos{.} = IconPosition::PRIMARY), gtk_entry_set_icon_drag_source)
 
diff --git a/gtk/src/enums.hg b/gtk/src/enums.hg
index 130b8e5..606bac8 100644
--- a/gtk/src/enums.hg
+++ b/gtk/src/enums.hg
@@ -50,7 +50,6 @@ _WRAP_ENUM(ScrollType, GtkScrollType)
 _WRAP_ENUM(SelectionMode, GtkSelectionMode)
 _WRAP_ENUM(ShadowType, GtkShadowType)
 _WRAP_ENUM(StackTransitionType, GtkStackTransitionType)
-_WRAP_ENUM(TargetFlags, GtkTargetFlags)
 _WRAP_ENUM(ToolbarStyle, GtkToolbarStyle)
 _WRAP_ENUM(WindowPosition,GtkWindowPosition)
 _WRAP_ENUM(WindowType,GtkWindowType)
diff --git a/gtk/src/filelist.am b/gtk/src/filelist.am
index 4f9673a..8b0f899 100644
--- a/gtk/src/filelist.am
+++ b/gtk/src/filelist.am
@@ -174,7 +174,6 @@ gtkmm_files_any_hg =                \
        stylecontext.hg         \
        styleprovider.hg        \
        switch.hg               \
-       targetlist.hg           \
        textbuffer.hg           \
        textchildanchor.hg      \
        textiter.hg             \
diff --git a/gtk/src/iconview.hg b/gtk/src/iconview.hg
index 183b037..2a7126a 100644
--- a/gtk/src/iconview.hg
+++ b/gtk/src/iconview.hg
@@ -240,12 +240,12 @@ public:
 
 /* Drag-and-Drop support */
 
-  _WRAP_METHOD(void enable_model_drag_source(const Glib::RefPtr<TargetList>& targets{.},
+  _WRAP_METHOD(void enable_model_drag_source(const Glib::RefPtr<Gdk::ContentFormats>& formats{.},
      Gdk::ModifierType start_button_mask{.} = Gdk::ModifierType::MODIFIER_MASK,
      Gdk::DragAction actions{.} = Gdk::DragAction::COPY | Gdk::DragAction::MOVE),
      gtk_icon_view_enable_model_drag_source)
 
-  _WRAP_METHOD(void enable_model_drag_dest(const Glib::RefPtr<TargetList>& targets,
+  _WRAP_METHOD(void enable_model_drag_dest(const Glib::RefPtr<Gdk::ContentFormats>& formats,
      Gdk::DragAction actions = Gdk::DragAction::COPY | Gdk::DragAction::MOVE),
      gtk_icon_view_enable_model_drag_dest)
 
diff --git a/gtk/src/textbuffer.hg b/gtk/src/textbuffer.hg
index df8ab93..48a6118 100644
--- a/gtk/src/textbuffer.hg
+++ b/gtk/src/textbuffer.hg
@@ -499,10 +499,10 @@ public:
   _WRAP_METHOD(void begin_user_action(), gtk_text_buffer_begin_user_action)
   _WRAP_METHOD(void end_user_action(), gtk_text_buffer_end_user_action)
 
-  _WRAP_METHOD(Glib::RefPtr<TargetList> get_copy_target_list(), gtk_text_buffer_get_copy_target_list, 
refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const TargetList> get_copy_target_list() const, 
gtk_text_buffer_get_copy_target_list, refreturn, constversion)
-  _WRAP_METHOD(Glib::RefPtr<TargetList> get_paste_target_list(), gtk_text_buffer_get_paste_target_list, 
refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const TargetList> get_paste_target_list() const, 
gtk_text_buffer_get_paste_target_list, refreturn, constversion)
+  _WRAP_METHOD(Glib::RefPtr<Gdk::ContentFormats> get_copy_target_list(), 
gtk_text_buffer_get_copy_target_list, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gdk::ContentFormats> get_copy_target_list() const, 
gtk_text_buffer_get_copy_target_list, refreturn, constversion)
+  _WRAP_METHOD(Glib::RefPtr<Gdk::ContentFormats> get_paste_target_list(), 
gtk_text_buffer_get_paste_target_list, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gdk::ContentFormats> get_paste_target_list() const, 
gtk_text_buffer_get_paste_target_list, refreturn, constversion)
 
   /** For instance,<br>
    * guint8* on_serialize(const Glib::RefPtr<TextBuffer>& content_buffer, const const_iterator& range_start, 
const const_iterator& range_end, gsize& length);
@@ -620,8 +620,8 @@ _CONVERSION(`GtkTextIter*',`TextBuffer::iterator&',Glib::wrap_iter($3))
   _WRAP_PROPERTY("text", Glib::ustring)
   _WRAP_PROPERTY("has-selection", bool)
   _WRAP_PROPERTY("cursor-position", int)
-  _WRAP_PROPERTY("copy-target-list", Glib::RefPtr<TargetList>)
-  _WRAP_PROPERTY("paste-target-list", Glib::RefPtr<TargetList>)
+  _WRAP_PROPERTY("copy-target-list", Glib::RefPtr<Gdk::ContentFormats>)
+  _WRAP_PROPERTY("paste-target-list", Glib::RefPtr<Gdk::ContentFormats>)
 
 private:
   friend TextMark;
diff --git a/gtk/src/toolpalette.hg b/gtk/src/toolpalette.hg
index f87aaf5..4ef5731 100644
--- a/gtk/src/toolpalette.hg
+++ b/gtk/src/toolpalette.hg
@@ -86,9 +86,8 @@ public:
   _WRAP_METHOD(void set_drag_source(ToolPaletteDragTargets targets = ToolPaletteDragTargets::ITEMS), 
gtk_tool_palette_set_drag_source)
   _WRAP_METHOD(void add_drag_dest(Gtk::Widget& widget, DestDefaults flags = DestDefaults::ALL, 
ToolPaletteDragTargets targets = ToolPaletteDragTargets::ITEMS, Gdk::DragAction actions = 
Gdk::DragAction::COPY), gtk_tool_palette_add_drag_dest)
 
-#m4 _CONVERSION(`const GtkTargetEntry*',`TargetEntry',`TargetEntry(*$3)')
-  _WRAP_METHOD(static TargetEntry get_drag_target_item(), gtk_tool_palette_get_drag_target_item)
-  _WRAP_METHOD(static TargetEntry get_drag_target_group(), gtk_tool_palette_get_drag_target_group)
+  _WRAP_METHOD(static Glib::ustring get_drag_target_item(), gtk_tool_palette_get_drag_target_item)
+  _WRAP_METHOD(static Glib::ustring get_drag_target_group(), gtk_tool_palette_get_drag_target_group)
 
   _WRAP_PROPERTY("toolbar-style", ToolbarStyle)
 
diff --git a/gtk/src/treeview.ccg b/gtk/src/treeview.ccg
index 87e360b..810ac30 100644
--- a/gtk/src/treeview.ccg
+++ b/gtk/src/treeview.ccg
@@ -18,6 +18,7 @@
 #include <climits> // INT_MIN, etc.
 #include <glibmm/vectorutils.h>
 #include <gdkmm/cairoutils.h>
+#include <gdkmm/contentformats.h>
 #include <gtkmm/treeviewcolumn.h>
 #include <gtkmm/treeview_private.h>
 #include <gtkmm/treemodel.h>
@@ -149,16 +150,12 @@ void TreeView::get_cursor(TreeModel::Path& path, TreeViewColumn*& focus_column)
 
 void TreeView::enable_model_drag_source(Gdk::ModifierType start_button_mask, Gdk::DragAction actions)
 {
-  std::vector<TargetEntry> targets (1, TargetEntry (treeview_target_row));
-
-  enable_model_drag_source(TargetList::create(targets), start_button_mask, actions);
+  enable_model_drag_source(Gdk::ContentFormats::create(treeview_target_row), start_button_mask, actions);
 }
 
 void TreeView::enable_model_drag_dest(Gdk::DragAction actions)
 {
-  std::vector<TargetEntry> targets (1, TargetEntry (treeview_target_row));
-
-  enable_model_drag_dest(TargetList::create(targets), actions);
+  enable_model_drag_dest(Gdk::ContentFormats::create(treeview_target_row), actions);
 }
 
 bool TreeView::get_path_at_pos(int x, int y, TreeModel::Path& path, TreeViewColumn*& column, int& cell_x, 
int& cell_y) const
diff --git a/gtk/src/treeview.hg b/gtk/src/treeview.hg
index f6c047e..f7cfddc 100644
--- a/gtk/src/treeview.hg
+++ b/gtk/src/treeview.hg
@@ -27,19 +27,22 @@ _CONFIGINCLUDE(gtkmmconfig.h)
 #include <gtkmm/treemodelcolumn.h>
 #include <gtkmm/cellrenderer.h>
 #include <gtkmm/scrollable.h>
-#include <gtkmm/targetlist.h>
 #include <gtkmm/entry.h>
 #include <gtkmm/tooltip.h>
 
 _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/container_p.h)
 
+namespace Gdk
+{
+class ContentFormats;
+}
+
 namespace Gtk
 {
 
 _CC_INCLUDE(gtk/gtk.h)
 
-
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 
 class TreeView;
@@ -558,7 +561,7 @@ public:
 
 /* Drag-and-Drop support */
 
-  _WRAP_METHOD(void enable_model_drag_source(const Glib::RefPtr<TargetList>& targets{.},
+  _WRAP_METHOD(void enable_model_drag_source(const Glib::RefPtr<Gdk::ContentFormats>& formats{.},
     Gdk::ModifierType start_button_mask{.} = Gdk::ModifierType::MODIFIER_MASK,
     Gdk::DragAction actions{.} = Gdk::DragAction::COPY | Gdk::DragAction::MOVE),
     gtk_tree_view_enable_model_drag_source)
@@ -573,15 +576,7 @@ public:
   void enable_model_drag_source(Gdk::ModifierType start_button_mask = Gdk::ModifierType::MODIFIER_MASK,
                                 Gdk::DragAction actions = Gdk::DragAction::COPY | Gdk::DragAction::MOVE);
 
-  //TODO: Remove the hand-coded description when gtk+'s description contains
-  // the correct number of parameters (no @n_targets).
-  /** Turns this %TreeView instance into a drop destination for automatic DND. Calling
-   * this method sets Gtk::TreeView::property_reorderable() to <tt>false</tt>.
-   *
-   * @param targets The targets that the drag will support.
-   * @param actions The bitmask of possible actions for a drag from this widget.
-   */
-  _WRAP_METHOD(void enable_model_drag_dest(const Glib::RefPtr<TargetList>& targets,
+  _WRAP_METHOD(void enable_model_drag_dest(const Glib::RefPtr<Gdk::ContentFormats>& formats,
     Gdk::DragAction actions = Gdk::DragAction::COPY | Gdk::DragAction::MOVE),
     gtk_tree_view_enable_model_drag_dest)
 
diff --git a/gtk/src/widget.ccg b/gtk/src/widget.ccg
index e5bbc22..fcf5420 100644
--- a/gtk/src/widget.ccg
+++ b/gtk/src/widget.ccg
@@ -17,6 +17,7 @@
 
 #include <glibmm/vectorutils.h>
 
+#include <gdkmm/contentformats.h>
 #include <gtkmm/adjustment.h>
 #include <gtkmm/window.h>
 #include <gtkmm/accelgroup.h>
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index 5adcf2d..3e35ba9 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -36,7 +36,6 @@ _CONFIGINCLUDE(gtkmmconfig.h)
 #include <gdkmm/pixbuf.h>
 #include <gtkmm/enums.h>
 #include <gdkmm/display.h>
-#include <gtkmm/targetlist.h>
 #include <gtkmm/clipboard.h>
 #include <gtkmm/requisition.h>
 #include <gtkmm/stylecontext.h>
@@ -46,6 +45,11 @@ _CONFIGINCLUDE(gtkmmconfig.h)
 _DEFS(gtkmm,gtk)
 _PINCLUDE(gtkmm/private/object_p.h)
 
+namespace Gdk
+{
+class ContentFormats;
+}
+
 namespace Gtk
 {
 
@@ -381,17 +385,18 @@ public:
 
   // I've used Gdk::DragAction::COPY as the default, because Gdk::DragAction::DEFAULT means that
   // it's never a drag destination, so it would seem like this method didn't work. murrayc.
-  _WRAP_METHOD(void drag_dest_set(const Glib::RefPtr<TargetList>& targets{.},
+  _WRAP_METHOD(void drag_dest_set(const Glib::RefPtr<Gdk::ContentFormats>& formats{.},
     DestDefaults flags{.} = DestDefaults::ALL,
     Gdk::DragAction actions{.} = Gdk::DragAction::COPY), gtk_drag_dest_set)
 
   _WRAP_METHOD(void drag_dest_unset(), gtk_drag_dest_unset)
-  _WRAP_METHOD(Glib::ustring drag_dest_find_target(const Glib::RefPtr<Gdk::DragContext>& context, const 
Glib::RefPtr<TargetList>& target_list) const, gtk_drag_dest_find_target)
+  _WRAP_METHOD(Glib::ustring drag_dest_find_target(const Glib::RefPtr<Gdk::DragContext>& context,
+    const Glib::RefPtr<Gdk::ContentFormats>& target_list) const, gtk_drag_dest_find_target)
   Glib::ustring drag_dest_find_target(const Glib::RefPtr<Gdk::DragContext>& context) const;
 
-  _WRAP_METHOD(Glib::RefPtr<TargetList> drag_dest_get_target_list(), gtk_drag_dest_get_target_list, 
refreturn)
-  _WRAP_METHOD(Glib::RefPtr<const TargetList> drag_dest_get_target_list() const, 
gtk_drag_dest_get_target_list, refreturn, constversion)
-  _WRAP_METHOD(void drag_dest_set_target_list(const Glib::RefPtr<TargetList>& target_list), 
gtk_drag_dest_set_target_list)
+  _WRAP_METHOD(Glib::RefPtr<Gdk::ContentFormats> drag_dest_get_target_list(), gtk_drag_dest_get_target_list, 
refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gdk::ContentFormats> drag_dest_get_target_list() const, 
gtk_drag_dest_get_target_list, refreturn, constversion)
+  _WRAP_METHOD(void drag_dest_set_target_list(const Glib::RefPtr<Gdk::ContentFormats>& target_list), 
gtk_drag_dest_set_target_list)
 
   _WRAP_METHOD(void drag_dest_add_text_targets(), gtk_drag_dest_add_text_targets)
   _WRAP_METHOD(void drag_dest_add_image_targets(), gtk_drag_dest_add_image_targets)
@@ -399,7 +404,7 @@ public:
 
   // I've used Gdk::ModifierType::MODIFIER_MASK as the default, because it seems
   // to mean 'whatever is possible in the context'. murrayc.
-  _WRAP_METHOD(void drag_source_set(const Glib::RefPtr<TargetList>& targets{.},
+  _WRAP_METHOD(void drag_source_set(const Glib::RefPtr<Gdk::ContentFormats>& formats{.},
     Gdk::ModifierType start_button_mask{.} = Gdk::ModifierType::MODIFIER_MASK,
     Gdk::DragAction actions{.} = Gdk::DragAction::COPY), gtk_drag_source_set)
 
@@ -412,7 +417,7 @@ public:
   _WRAP_METHOD(void drag_source_add_uri_targets(), gtk_drag_source_add_uri_targets)
   _WRAP_METHOD(void drag_source_add_image_targets(), gtk_drag_source_add_image_targets)
 
-  _WRAP_METHOD(Glib::RefPtr<Gdk::DragContext> drag_begin(const Glib::RefPtr<TargetList>& targets,
+  _WRAP_METHOD(Glib::RefPtr<Gdk::DragContext> drag_begin(const Glib::RefPtr<Gdk::ContentFormats>& targets,
     Gdk::DragAction actions, int button, const Gdk::Event& gdk_event, int x, int y), 
gtk_drag_begin_with_coordinates, refreturn)
   _WRAP_METHOD(bool drag_check_threshold(int start_x, int start_y, int current_x, int current_y), 
gtk_drag_check_threshold)
 
diff --git a/tools/m4/convert_gdk.m4 b/tools/m4/convert_gdk.m4
index c601f98..0d1d018 100644
--- a/tools/m4/convert_gdk.m4
+++ b/tools/m4/convert_gdk.m4
@@ -221,6 +221,16 @@ _CONVERSION(`GdkDeviceManager*',`Glib::RefPtr<const DeviceManager>', `Glib::wrap
 
 _CONVERSION(`gpointer',`const void*', `static_cast<$2>($3)')
 
+# ContentFormats
+_CONVERSION(`const Glib::RefPtr<ContentFormats>&',`GdkContentFormats*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<const ContentFormats>&',`GdkContentFormats*',__CONVERT_CONST_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<const ContentFormats>&',`const GdkContentFormats*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<Gdk::ContentFormats>&',`GdkContentFormats*',__CONVERT_REFPTR_TO_P)
+_CONVERSION(`const Glib::RefPtr<const 
Gdk::ContentFormats>&',`GdkContentFormats*',__CONVERT_CONST_REFPTR_TO_P)
+_CONVERSION(`GdkContentFormats*',`Glib::RefPtr<ContentFormats>',`Glib::wrap($3)')
+_CONVERSION(`GdkContentFormats*',`Glib::RefPtr<const ContentFormats>',`Glib::wrap($3)')
+_CONVERSION(`GdkContentFormats*',`Glib::RefPtr<Gdk::ContentFormats>',`Glib::wrap($3)')
+_CONVERSION(`GdkContentFormats*',`Glib::RefPtr<const Gdk::ContentFormats>',`Glib::wrap($3)')
 
 # XPM data
 _CONVERSION(`const char*const*',`const char**',`const_cast<const char**>($3)',`$3')
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index c27561c..38adfa9 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -77,7 +77,6 @@ _CONV_ENUM(Gtk,SortType)
 _CONV_INCLASS_ENUM(Gtk,SpinButton,UpdatePolicy)
 _CONV_ENUM(Gtk,SpinType)
 _CONV_ENUM(Gtk,StackTransitionType)
-_CONV_ENUM(Gtk,TargetFlags)
 _CONV_ENUM(Gtk,TextDirection)
 _CONV_ENUM(Gtk,TextSearchFlags)
 _CONV_ENUM(Gtk,TextWindowType)
@@ -400,12 +399,6 @@ _CONVERSION(const Gtk::Widget&,GtkWidget*,__CFR2P)
 
 _CONVERSION(`const Glib::RefPtr<Tooltip>&',`GtkTooltip*',__CONVERT_REFPTR_TO_P)
 
-#TargetList
-_CONVERSION(`const Glib::RefPtr<TargetList>&',`GtkTargetList*',__CONVERT_CONST_REFPTR_TO_P)
-_CONVERSION(`Glib::RefPtr<TargetList>&',`GtkTargetList*',__CONVERT_REFPTR_TO_P($3))
-_CONVERSION(`GtkTargetList*',`Glib::RefPtr<TargetList>',`Glib::wrap($3)')
-_CONVERSION(`GtkTargetList*',`Glib::RefPtr<const TargetList>',`Glib::wrap($3)')
-
 #IconInfo
 _CONVERSION(`GtkIconInfo*',`IconInfo',`Glib::wrap($3)')
 



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