[gtkmm] PrintOperation: Change PrintOperationResult to PrintOperation::Result.



commit a7ee01928c66e8ce92d066be3b935bf907b357d6
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Apr 27 21:58:17 2017 +0200

    PrintOperation: Change PrintOperationResult to PrintOperation::Result.

 gtk/src/printoperation.ccg |   10 ++++++----
 gtk/src/printoperation.hg  |   16 +++++++++-------
 tools/m4/convert_gtk.m4    |    2 +-
 3 files changed, 16 insertions(+), 12 deletions(-)
---
diff --git a/gtk/src/printoperation.ccg b/gtk/src/printoperation.ccg
index dc56ae7..87054aa 100644
--- a/gtk/src/printoperation.ccg
+++ b/gtk/src/printoperation.ccg
@@ -17,6 +17,8 @@
 
 #include <gtk/gtk.h>
 
+using Result = Gtk::PrintOperation::Result;
+
 // This Signal Proxy allows the C++ coder to specify a sigc::slot instead of a static function.
 
 static void
@@ -40,14 +42,14 @@ SignalProxy_PrintSetupDone_gtk_callback(GtkPageSetup* page_setup, gpointer data)
 namespace Gtk
 {
 
-PrintOperationResult
+PrintOperation::Result
 PrintOperation::run(PrintOperationAction action)
 {
   GError* gerror = nullptr;
-  PrintOperationResult res =
-    (PrintOperationResult)gtk_print_operation_run(this->gobj(), (GtkPrintOperationAction)action, nullptr, 
&gerror);
+  Result res =
+    (Result)gtk_print_operation_run(this->gobj(), (GtkPrintOperationAction)action, nullptr, &gerror);
 
-  if (res == PrintOperationResult::ERROR)
+  if (res == PrintOperation::Result::ERROR)
   {
     gtk_print_operation_get_error(this->gobj(), &gerror);
     ::Glib::Error::throw_exception(gerror);
diff --git a/gtk/src/printoperation.hg b/gtk/src/printoperation.hg
index db6454a..b346079 100644
--- a/gtk/src/printoperation.hg
+++ b/gtk/src/printoperation.hg
@@ -31,7 +31,6 @@ namespace Gtk
 {
 
 _WRAP_ENUM(PrintStatus, GtkPrintStatus)
-_WRAP_ENUM(PrintOperationResult, GtkPrintOperationResult)
 _WRAP_ENUM(PrintOperationAction, GtkPrintOperationAction)
 _WRAP_GERROR(PrintError, GtkPrintError, GTK_PRINT_ERROR)
 
@@ -64,9 +63,12 @@ class PrintOperation :
   _IMPLEMENTS_INTERFACE(PrintOperationPreview)
 
 protected:
+
   _CTOR_DEFAULT
 
 public:
+  _WRAP_ENUM(Result, GtkPrintOperationResult)
+
   _WRAP_CREATE()
 
   _WRAP_METHOD(void set_default_page_setup(const Glib::RefPtr<PageSetup>& default_page_setup),
@@ -96,9 +98,9 @@ public:
 
   /** See the run() method that takes both action and parent parameters.
    */
-  PrintOperationResult run(PrintOperationAction action = PrintOperationAction::PRINT_DIALOG);
+  Result run(PrintOperationAction action = PrintOperationAction::PRINT_DIALOG);
 
-  _WRAP_METHOD(PrintOperationResult run(PrintOperationAction action, Window& parent), 
gtk_print_operation_run, errthrow)
+  _WRAP_METHOD(Result run(PrintOperationAction action, Window& parent), gtk_print_operation_run, errthrow)
 
   _WRAP_METHOD(PrintStatus get_status() const, gtk_print_operation_get_status)
   _WRAP_METHOD(Glib::ustring get_status_string() const, gtk_print_operation_get_status_string)
@@ -120,13 +122,13 @@ public:
 
   _IGNORE(gtk_print_run_page_setup_dialog, gtk_print_run_page_setup_dialog_async)
 
-  #m4 _CONVERSION(`GtkPrintOperationResult',`PrintOperationResult',`($2)$3')
+  #m4 _CONVERSION(`GtkPrintOperationResult',`Result',`($2)$3')
 
   _IGNORE(gtk_print_operation_get_error)
 
-  //TODO: point out in the docs that the PrintOperationResult enum may also indicate
-  // that an error occurred, and in that case it is up to him to handle it.
-  _WRAP_SIGNAL(void done(PrintOperationResult result), "done")
+  //TODO: point out in the docs that the Result enum may also indicate
+  // that an error occurred, and in that case it is up to the application developer to handle it.
+  _WRAP_SIGNAL(void done(Result result), "done")
 
   #m4 _CONVERSION(`GtkPrintContext*',`const Glib::RefPtr<PrintContext>&',`Glib::wrap($3, true)')
   _WRAP_SIGNAL(void begin_print(const Glib::RefPtr<PrintContext>& context), "begin_print")
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 67ca7c0..f4e2fa0 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -146,7 +146,7 @@ _CONV_ENUM(Gtk,PrintQuality)
 _CONV_ENUM(Gtk,PrintPages)
 _CONV_ENUM(Gtk,PageSet)
 _CONV_ENUM(Gtk,PrintStatus)
-_CONV_ENUM(Gtk,PrintOperationResult)
+_CONV_INCLASS_ENUM(Gtk,PrintOperation,Result)
 _CONV_ENUM(Gtk,PrintOperationAction)
 _CONV_ENUM(Gtk,PrintError)
 _CONV_ENUM(Gtk,PrintCapabilities)


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