[gtkmm] FileChooser: Change FileChooserAction to FileChooser::Action.



commit a8f10e8275ac472bb027f93614367c6433c516e6
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Apr 27 22:13:21 2017 +0200

    FileChooser: Change FileChooserAction to FileChooser::Action.

 gtk/src/filechooser.ccg       |    2 ++
 gtk/src/filechooser.hg        |    8 ++++----
 gtk/src/filechooserbutton.ccg |    2 +-
 gtk/src/filechooserbutton.hg  |    6 +++---
 gtk/src/filechooserdialog.ccg |    4 ++--
 gtk/src/filechooserdialog.hg  |    4 ++--
 gtk/src/filechooserwidget.hg  |    2 +-
 tools/m4/convert_gtk.m4       |    2 +-
 8 files changed, 16 insertions(+), 14 deletions(-)
---
diff --git a/gtk/src/filechooser.ccg b/gtk/src/filechooser.ccg
index 45abc10..66aa79c 100644
--- a/gtk/src/filechooser.ccg
+++ b/gtk/src/filechooser.ccg
@@ -19,6 +19,8 @@
 
 #include <gtk/gtk.h>
 
+using Action = Gtk::FileChooser::Action;
+
 namespace Gtk
 {
 void FileChooser::add_choice(const Glib::ustring& id, const Glib::ustring& label)
diff --git a/gtk/src/filechooser.hg b/gtk/src/filechooser.hg
index 2f96257..78593a9 100644
--- a/gtk/src/filechooser.hg
+++ b/gtk/src/filechooser.hg
@@ -27,7 +27,6 @@ _PINCLUDE(glibmm/private/interface_p.h)
 namespace Gtk
 {
 
-_WRAP_ENUM(FileChooserAction, GtkFileChooserAction)
 _WRAP_ENUM(FileChooserConfirmation, GtkFileChooserConfirmation)
 
 //Note that GTK_FILE_SYSTEM_ERROR is not currently public GTK+ API and should
@@ -64,9 +63,10 @@ class FileChooser : public Glib::Interface
 {
   _CLASS_INTERFACE(FileChooser, GtkFileChooser, GTK_FILE_CHOOSER, GtkFileChooserClass)
 public:
+  _WRAP_ENUM(Action, GtkFileChooserAction)
 
-  _WRAP_METHOD(void set_action(FileChooserAction action), gtk_file_chooser_set_action)
-  _WRAP_METHOD(FileChooserAction get_action() const, gtk_file_chooser_get_action)
+  _WRAP_METHOD(void set_action(Action action), gtk_file_chooser_set_action)
+  _WRAP_METHOD(Action get_action() const, gtk_file_chooser_get_action)
   _WRAP_METHOD(void set_local_only(bool local_only = true), gtk_file_chooser_set_local_only)
   _WRAP_METHOD(bool get_local_only() const, gtk_file_chooser_get_local_only)
   _WRAP_METHOD(void set_select_multiple(bool select_multiple = true), gtk_file_chooser_set_select_multiple)
@@ -209,7 +209,7 @@ public:
   _WRAP_SIGNAL(void file_activated(), "file_activated", no_default_handler)
   _WRAP_SIGNAL(FileChooserConfirmation confirm_overwrite(), "confirm-overwrite", no_default_handler)
 
-  _WRAP_PROPERTY("action", FileChooserAction)
+  _WRAP_PROPERTY("action", Action)
   _WRAP_PROPERTY("filter", Glib::RefPtr<FileFilter>)
   _WRAP_PROPERTY("local-only", bool)
   _WRAP_PROPERTY("preview-widget", Widget*)
diff --git a/gtk/src/filechooserbutton.ccg b/gtk/src/filechooserbutton.ccg
index df63b4f..25af1fe 100644
--- a/gtk/src/filechooserbutton.ccg
+++ b/gtk/src/filechooserbutton.ccg
@@ -21,7 +21,7 @@
 namespace Gtk
 {
 
-FileChooserButton::FileChooserButton(FileChooserAction action)
+FileChooserButton::FileChooserButton(Action action)
 :
   _CONSTRUCT("action", action)
 {
diff --git a/gtk/src/filechooserbutton.hg b/gtk/src/filechooserbutton.hg
index 3a80674..373edb4 100644
--- a/gtk/src/filechooserbutton.hg
+++ b/gtk/src/filechooserbutton.hg
@@ -31,7 +31,7 @@ namespace Gtk
  * button to bring up a FileChooserDialog. The user can then use that dialog to change the file associated 
with that
  * button. This widget does not support setting the "select_multiple" property to true.
  *
- * The FileChooserButton supports the FileChooserActions FileChooserAction::OPEN and 
FileChooserAction::SELECT_FOLDER.
+ * The FileChooserButton supports the Actions Action::OPEN and Action::SELECT_FOLDER.
  *
  * The FileChooserButton will ellipsize the label, and will thus request little horizontal space. To give 
the button more
  * space, you should call size_request(), set_width_chars(), or pack the button in such a way that other 
interface
@@ -53,14 +53,14 @@ public:
   /** Creates a new file-selecting button widget with the default title.
    * @param action The open mode for the widget.
    */
-  explicit FileChooserButton(FileChooserAction action = FileChooserAction::OPEN);
+  explicit FileChooserButton(Action action = Action::OPEN);
 
   /** Creates a new file-selecting button widget.
    *
    * @param title The title of the browse dialog.
    * @param action The open mode for the widget.
    */
-  _WRAP_CTOR(FileChooserButton(const Glib::ustring& title, FileChooserAction action = 
FileChooserAction::OPEN), gtk_file_chooser_button_new)
+  _WRAP_CTOR(FileChooserButton(const Glib::ustring& title, Action action = Action::OPEN), 
gtk_file_chooser_button_new)
 
   /** Creates a new file-selecting button widget which uses dialog as its file-picking window.
    *
diff --git a/gtk/src/filechooserdialog.ccg b/gtk/src/filechooserdialog.ccg
index 9ffdc46..7c16945 100644
--- a/gtk/src/filechooserdialog.ccg
+++ b/gtk/src/filechooserdialog.ccg
@@ -22,14 +22,14 @@
 namespace Gtk
 {
 
-FileChooserDialog::FileChooserDialog(Gtk::Window& parent, const Glib::ustring& title, FileChooserAction 
action, bool use_header_bar)
+FileChooserDialog::FileChooserDialog(Gtk::Window& parent, const Glib::ustring& title, Action action, bool 
use_header_bar)
 :
   _CONSTRUCT("title", title.c_str(), "action", static_cast<GtkFileChooserAction>(action), "use-header-bar", 
static_cast<int>(use_header_bar))
 {
   set_transient_for(parent);
 }
 
-FileChooserDialog::FileChooserDialog(const Glib::ustring& title, FileChooserAction action, bool 
use_header_bar)
+FileChooserDialog::FileChooserDialog(const Glib::ustring& title, Action action, bool use_header_bar)
 :
   _CONSTRUCT("title", title.c_str(), "action", static_cast<GtkFileChooserAction>(action), "use-header-bar", 
static_cast<int>(use_header_bar))
 {
diff --git a/gtk/src/filechooserdialog.hg b/gtk/src/filechooserdialog.hg
index bd13472..bfaaddf 100644
--- a/gtk/src/filechooserdialog.hg
+++ b/gtk/src/filechooserdialog.hg
@@ -41,8 +41,8 @@ class FileChooserDialog
   _UNMANAGEABLE
 public:
   _IGNORE(gtk_file_chooser_dialog_new)
-  FileChooserDialog(Gtk::Window& parent, const Glib::ustring& title, FileChooserAction action = 
FileChooserAction::OPEN, bool use_header_bar = false);
-  explicit FileChooserDialog(const Glib::ustring& title, FileChooserAction action = FileChooserAction::OPEN, 
bool use_header_bar = false);
+  FileChooserDialog(Gtk::Window& parent, const Glib::ustring& title, Action action = Action::OPEN, bool 
use_header_bar = false);
+  explicit FileChooserDialog(const Glib::ustring& title, Action action = Action::OPEN, bool use_header_bar = 
false);
 };
 
 } // namespace Gtk
diff --git a/gtk/src/filechooserwidget.hg b/gtk/src/filechooserwidget.hg
index fa90a79..e60614f 100644
--- a/gtk/src/filechooserwidget.hg
+++ b/gtk/src/filechooserwidget.hg
@@ -53,7 +53,7 @@ public:
    *
    * @newin{2,4}
    */
-  _WRAP_CTOR(FileChooserWidget(FileChooserAction action), gtk_file_chooser_widget_new)
+  _WRAP_CTOR(FileChooserWidget(Action action), gtk_file_chooser_widget_new)
 };
 
 } // namespace Gtk
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 32e1dfa..560a8b2 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -128,7 +128,7 @@ _CONV_ENUM(Gtk,Visibility)
 _CONV_ENUM(Gtk,WindowPosition)
 _CONV_ENUM(Gtk,WindowType)
 _CONV_ENUM(Gtk,WrapMode)
-_CONV_ENUM(Gtk,FileChooserAction)
+_CONV_INCLASS_ENUM(Gtk,FileChooser,Action)
 _CONV_INCLASS_ENUM(Gtk,FileFilter,Flags)
 _CONV_ENUM(Gtk,IconLookupFlags)
 _CONV_ENUM(Gtk,IconThemeError)


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