[gtkmm] Gdk::ContentFormats is immutable, can be declared const



commit 34c91a738e03898c5c38d9e95ac2e13ade80eb91
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Wed Jan 22 18:22:43 2020 +0100

    Gdk::ContentFormats is immutable, can be declared const
    
    Gdk::ContentFormats is an immutable object. It can be declared const
    in input parameters. No one can change it.

 gdk/src/contentprovider.hg |  3 +++
 gtk/src/droptarget.hg      | 10 ++++++----
 gtk/src/iconview.hg        |  6 ++++--
 gtk/src/treeview.hg        |  6 ++++--
 gtk/src/widget.ccg         |  1 -
 gtk/src/widget.hg          |  1 -
 6 files changed, 17 insertions(+), 10 deletions(-)
---
diff --git a/gdk/src/contentprovider.hg b/gdk/src/contentprovider.hg
index 2a7e9a09..ab02a8f0 100644
--- a/gdk/src/contentprovider.hg
+++ b/gdk/src/contentprovider.hg
@@ -54,6 +54,9 @@ class ContentProvider : public Glib::Object
 {
   _CLASS_GOBJECT(ContentProvider, GdkContentProvider, GDK_CONTENT_PROVIDER, Glib::Object, GObject)
 
+protected:
+  _CTOR_DEFAULT()
+
 public:
   /** Callback type for providing data in a Glib::ValueBase.
    * For instance:
diff --git a/gtk/src/droptarget.hg b/gtk/src/droptarget.hg
index b77b212f..b61d4a99 100644
--- a/gtk/src/droptarget.hg
+++ b/gtk/src/droptarget.hg
@@ -67,13 +67,15 @@ class DropTarget : public EventController
   _CLASS_GOBJECT(DropTarget, GtkDropTarget, GTK_DROP_TARGET, EventController, GtkEventController)
 
 protected:
-  _WRAP_CTOR(DropTarget(const Glib::RefPtr<Gdk::ContentFormats>& formats, Gdk::DragAction actions), 
gtk_drop_target_new)
+  // Gdk::ContentFormats is an immutable object. It can be declared const
+  // in input parameters. No one can change it.
+  _WRAP_CTOR(DropTarget(const Glib::RefPtr<const Gdk::ContentFormats>& formats, Gdk::DragAction actions), 
gtk_drop_target_new)
 
 public:
-  _WRAP_CREATE(const Glib::RefPtr<Gdk::ContentFormats>& formats, Gdk::DragAction actions)
-  static Glib::RefPtr<DropTarget> create(Gdk::DragAction actions);
+  _WRAP_CREATE(const Glib::RefPtr<const Gdk::ContentFormats>& formats, Gdk::DragAction actions = 
static_cast<Gdk::DragAction>(0))
+  static Glib::RefPtr<DropTarget> create(Gdk::DragAction actions = static_cast<Gdk::DragAction>(0));
 
-  _WRAP_METHOD(void set_formats(const Glib::RefPtr<Gdk::ContentFormats>& formats), 
gtk_drop_target_set_formats)
+  _WRAP_METHOD(void set_formats(const Glib::RefPtr<const Gdk::ContentFormats>& formats), 
gtk_drop_target_set_formats)
   _WRAP_METHOD(Glib::RefPtr<Gdk::ContentFormats> get_formats(), gtk_drop_target_get_formats, refreturn)
   _WRAP_METHOD(Glib::RefPtr<const Gdk::ContentFormats> get_formats() const, gtk_drop_target_get_formats, 
refreturn, constversion)
 
diff --git a/gtk/src/iconview.hg b/gtk/src/iconview.hg
index 79001a7d..0db4ece8 100644
--- a/gtk/src/iconview.hg
+++ b/gtk/src/iconview.hg
@@ -224,14 +224,16 @@ public:
   _WRAP_METHOD(void scroll_to_path(const TreeModel::Path& path, bool use_align, gfloat row_align, gfloat 
col_align), gtk_icon_view_scroll_to_path)
 
 /* Drag-and-Drop support */
+  // Gdk::ContentFormats is an immutable object. It can be declared const
+  // in input parameters. No one can change it.
 
-  _WRAP_METHOD(void enable_model_drag_source(const Glib::RefPtr<Gdk::ContentFormats>& formats{.},
+  _WRAP_METHOD(void enable_model_drag_source(const Glib::RefPtr<const 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(Glib::RefPtr<DropTarget> enable_model_drag_dest(
-    const Glib::RefPtr<Gdk::ContentFormats>& formats,
+    const Glib::RefPtr<const Gdk::ContentFormats>& formats,
     Gdk::DragAction actions = Gdk::DragAction::COPY | Gdk::DragAction::MOVE),
     gtk_icon_view_enable_model_drag_dest, refreturn)
 
diff --git a/gtk/src/treeview.hg b/gtk/src/treeview.hg
index 5f01512a..d5f15177 100644
--- a/gtk/src/treeview.hg
+++ b/gtk/src/treeview.hg
@@ -569,8 +569,10 @@ public:
 
 
 /* Drag-and-Drop support */
+  // Gdk::ContentFormats is an immutable object. It can be declared const
+  // in input parameters. No one can change it.
 
-  _WRAP_METHOD(void enable_model_drag_source(const Glib::RefPtr<Gdk::ContentFormats>& formats{.},
+  _WRAP_METHOD(void enable_model_drag_source(const Glib::RefPtr<const 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)
@@ -585,7 +587,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);
 
-  _WRAP_METHOD(void enable_model_drag_dest(const Glib::RefPtr<Gdk::ContentFormats>& formats,
+  _WRAP_METHOD(void enable_model_drag_dest(const Glib::RefPtr<const 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 ea00665b..533596a4 100644
--- a/gtk/src/widget.ccg
+++ b/gtk/src/widget.ccg
@@ -18,7 +18,6 @@
 #include <glibmm/vectorutils.h>
 #include <giomm/listmodel.h>
 
-#include <gdkmm/contentformats.h>
 #include <gdkmm/frameclock.h>
 #include <gdkmm/paintable.h>
 #include <gtkmm/adjustment.h>
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index b479f66e..82110b37 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -51,7 +51,6 @@ class ListModel;
 
 namespace Gdk
 {
-class ContentFormats;
 class FrameClock;
 class Paintable;
 }


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