[gtkmm] FileFilter: Change FileFilterFlags to FileFilter::Flags.



commit 707a0a3212bcaf27f0c75463cf01806332019848
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Apr 27 21:03:03 2017 +0200

    FileFilter: Change FileFilterFlags to FileFilter::Flags.

 gtk/src/filefilter.ccg  |    6 ++++--
 gtk/src/filefilter.hg   |   10 +++++-----
 tools/m4/convert_gtk.m4 |    2 +-
 3 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/gtk/src/filefilter.ccg b/gtk/src/filefilter.ccg
index 9bf16b4..46db223 100644
--- a/gtk/src/filefilter.ccg
+++ b/gtk/src/filefilter.ccg
@@ -17,6 +17,8 @@
 
 #include <gtk/gtk.h> //For gtk_file_filter_flags_get_type().
 
+using Flags = Gtk::FileFilter::Flags;
+
 static gboolean SignalProxy_Custom_gtk_callback(const GtkFileFilterInfo* filter_info, gpointer data)
 {
   auto the_slot = static_cast<Gtk::FileFilter::SlotCustom*>(data);
@@ -25,7 +27,7 @@ static gboolean SignalProxy_Custom_gtk_callback(const GtkFileFilterInfo* filter_
   {
     //Create a suitable C++ instance to pass to the C++ method:
     Gtk::FileFilter::Info cppInfo;
-    cppInfo.contains = (Gtk::FileFilterFlags)filter_info->contains;
+    cppInfo.contains = (Gtk::FileFilter::Flags)filter_info->contains;
     cppInfo.filename = Glib::convert_const_gchar_ptr_to_ustring(filter_info->filename);
     cppInfo.uri = Glib::convert_const_gchar_ptr_to_ustring(filter_info->uri);
     cppInfo.display_name = Glib::convert_const_gchar_ptr_to_ustring(filter_info->display_name);
@@ -49,7 +51,7 @@ static void SignalProxy_Custom_gtk_callback_destroy(void* data)
 namespace Gtk
 {
 
-void FileFilter::add_custom(FileFilterFlags needed, const SlotCustom& slot)
+void FileFilter::add_custom(Flags needed, const SlotCustom& slot)
 {
   //Create a copy of the slot. A pointer to this will be passed through the callback's data parameter.
   //It will be deleted when SignalProxy_Custom::gtk_callback_destroy() is called.
diff --git a/gtk/src/filefilter.hg b/gtk/src/filefilter.hg
index 210390e..455b62c 100644
--- a/gtk/src/filefilter.hg
+++ b/gtk/src/filefilter.hg
@@ -23,8 +23,6 @@ _PINCLUDE(glibmm/private/object_p.h)
 namespace Gtk
 {
 
-_WRAP_ENUM(FileFilterFlags, GtkFileFilterFlags)
-
 /** A filter for selecting a file subset.
  *
  * A Gtk::FileFilter can be used to restrict the files being shown in a Gtk::FileChooser.
@@ -48,6 +46,8 @@ protected:
   _CTOR_DEFAULT
 
 public:
+  _WRAP_ENUM(Flags, GtkFileFilterFlags)
+
   _WRAP_CREATE()
 
   _WRAP_METHOD(void set_name(const Glib::ustring& name), gtk_file_filter_set_name)
@@ -60,7 +60,7 @@ public:
   class Info
   {
   public:
-    FileFilterFlags contains;
+    Flags contains;
     Glib::ustring filename;
     Glib::ustring uri;
     Glib::ustring display_name;
@@ -70,10 +70,10 @@ public:
   /// For instance, bool on_custom(const Gtk::FileFilter::Info& filter_info);
   typedef sigc::slot<bool(const Info&)> SlotCustom;
 
-  void add_custom(FileFilterFlags needed, const SlotCustom& slot);
+  void add_custom(Flags needed, const SlotCustom& slot);
   _IGNORE(gtk_file_filter_add_custom)
 
-  _WRAP_METHOD(FileFilterFlags get_needed() const, gtk_file_filter_get_needed)
+  _WRAP_METHOD(Flags get_needed() const, gtk_file_filter_get_needed)
 
   //TODO: This method is only used by FileChooser implementors, so we don't need to wrap it.
   _IGNORE(gtk_file_filter_filter)
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index e1145e9..b0e822f 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -129,7 +129,7 @@ _CONV_ENUM(Gtk,WindowPosition)
 _CONV_ENUM(Gtk,WindowType)
 _CONV_ENUM(Gtk,WrapMode)
 _CONV_ENUM(Gtk,FileChooserAction)
-_CONV_ENUM(Gtk,FileFilterFlags)
+_CONV_INCLASS_ENUM(Gtk,FileFilter,Flags)
 _CONV_ENUM(Gtk,IconLookupFlags)
 _CONV_ENUM(Gtk,IconThemeError)
 _CONV_ENUM(Gtk,FileChooserConfirmation)


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