[glibmm] Application: Re-wrap according to the latest API.



commit 0f6a11538935b2a200ff6b79782cb8158687c289
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Mon Nov 1 03:12:25 2010 -0400

    	Application: Re-wrap according to the latest API.
    
    	* gio/src/application.{ccg, hg}: Re-wrapped the API according to the
    	recent changes in the C API.  Old methods were removed and new ones
    	wrapped.  Also wrapped its properties.
    	* tools/m4/convert_gio.m4: Added necessary conversion.

 ChangeLog               |    9 +++++++++
 gio/src/application.ccg |    1 +
 gio/src/application.hg  |   41 +++++++++++++++++++++++++----------------
 tools/m4/convert_gio.m4 |    3 +++
 4 files changed, 38 insertions(+), 16 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9c8d97f..d34994b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2010-11-01  José Alburquerque  <jaalburqu svn gnome org>
 
+	Application: Re-wrap according to the latest API.
+
+	* gio/src/application.{ccg, hg}: Re-wrapped the API according to the
+	recent changes in the C API.  Old methods were removed and new ones
+	wrapped.  Also wrapped its properties.
+	* tools/m4/convert_gio.m4: Added necessary conversion.
+
+2010-11-01  José Alburquerque  <jaalburqu svn gnome org>
+
 	giomm: Add ActionGroup interface.
 
 	* tools/extra_defs_gen/generate_defs_gio.cc:
diff --git a/gio/src/application.ccg b/gio/src/application.ccg
index 64497f3..370aa4f 100644
--- a/gio/src/application.ccg
+++ b/gio/src/application.ccg
@@ -19,6 +19,7 @@
 
 #include <gio/gio.h>
 #include <giomm/file.h>
+#include <giomm/actiongroup.h>
 
 namespace Gio
 {
diff --git a/gio/src/application.hg b/gio/src/application.hg
index 87c5295..1332a6d 100644
--- a/gio/src/application.hg
+++ b/gio/src/application.hg
@@ -29,6 +29,8 @@ namespace Gio
 
 _WRAP_ENUM(ApplicationFlags, GApplicationFlags, NO_GTYPE)
 
+class ActionGroup;
+
 /** TODO
  *
  * @newin{2,26}
@@ -45,34 +47,41 @@ public:
 
   _WRAP_METHOD(static Glib::RefPtr<Application> create(const Glib::ustring& appid, ApplicationFlags flags = APPLICATION_FLAGS_NONE), g_application_new)
 
-  _WRAP_METHOD(static Glib::RefPtr<Application> create_try(const Glib::ustring& appid, ApplicationFlags flags = APPLICATION_FLAGS_NONE), g_application_try_new, errthrow)
+  _WRAP_METHOD(static bool is_valid(const Glib::ustring& application_id), g_application_id_is_valid) 
+
+  _WRAP_METHOD(Glib::ustring get_id() const, g_application_get_application_id)
+  _WRAP_METHOD(void set_id(const Glib::ustring& application_id), g_application_set_application_id)
+
+  _WRAP_METHOD(guint get_inactivity_timeout() const, g_application_get_inactivity_timeout)
+  _WRAP_METHOD(void set_inactivity_timeout(guint inactivity_timeout), g_application_set_inactivity_timeout)
 
-  _WRAP_METHOD(static Glib::RefPtr<Application> create_unregistered_try(const Glib::ustring& appid, ApplicationFlags flags = APPLICATION_FLAGS_NONE), g_application_unregistered_try_new, errthrow)
+  _WRAP_METHOD(ApplicationFlags get_flags() const, g_application_get_flags)
+  _WRAP_METHOD(void set_flags(ApplicationFlags flags), g_application_set_flags)
 
+  _WRAP_METHOD(void set_action_group(const Glib::RefPtr<ActionGroup>& action_group), g_application_set_action_group)
+
+  _WRAP_METHOD(bool is_registered() const, g_application_get_is_registered)
+  _WRAP_METHOD(bool is_remote() const, g_application_get_is_remote)
 
   //TODO: Add a version with no cancellable.
   //Renamed from register() because that is a C++ keyword.
   _WRAP_METHOD(bool register_application(const Glib::RefPtr<Gio::Cancellable>& cancellable), g_application_register, errthrow)
 
-  _WRAP_METHOD(static Glib::RefPtr<Application> get_instance(), g_application_get_instance, refreturn)
-  _WRAP_METHOD(Glib::ustring get_id() const, g_application_get_id)
-
-  _WRAP_METHOD(void add_action(const Glib::ustring& name, const Glib::ustring& description), g_application_add_action)
-  _WRAP_METHOD(void remove_action(const Glib::ustring& name), g_application_remove_action)
-
-   #m4 _CONVERSION(`gchar**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_DEEP)')
-  _WRAP_METHOD(Glib::StringArrayHandle list_actions() const, g_application_list_actions)
+  _WRAP_METHOD(void hold(), g_application_hold)
+  _WRAP_METHOD(void release(), g_application_release)
+  _WRAP_METHOD(void activate(), g_application_activate)
 
-  _WRAP_METHOD(void set_action_enabled(const Glib::ustring& name, bool enabled = true), g_application_set_action_enabled)
-  _WRAP_METHOD(bool get_action_enabled(const Glib::ustring& name) const, g_application_get_action_enabled)
-  _WRAP_METHOD(Glib::ustring get_action_description(const Glib::ustring& name), g_application_get_action_description)
-  _WRAP_METHOD(void invoke_action(const Glib::ustring& name, const Glib::VariantBase& platform_data), g_application_invoke_action)
+  //TODO: _WRAP_METHOD(void open(GFile **files, gint n_files, const Glib::ustring& hint), g_application_open)
 
   _WRAP_METHOD(void run(int argc, char** argv), g_application_run)
   //TODO: g_application_run_with_arguments)
-  _WRAP_METHOD(bool quit_with_data(const Glib::VariantBase& platform_data), g_application_quit_with_data)
 
-  _WRAP_METHOD(bool is_remote() const, g_application_is_remote)
+  _WRAP_PROPERTY("action-group", Glib::RefPtr<ActionGroup>)
+  _WRAP_PROPERTY("application-id", Glib::ustring)
+  _WRAP_PROPERTY("flags", ApplicationFlags)
+  _WRAP_PROPERTY("inactivity-timeout", guint)
+  _WRAP_PROPERTY("is-registered", bool)
+  _WRAP_PROPERTY("is-remote", bool)
 
 //#m4 _CONVERSION(`const gchar*', `const Glib::ustring&', `Glib::ustring($3)')
 //#m4 _CONVERSION(`GVariant*', `const Glib::VariantBase&', `Glib::wrap($3, true)')
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index dcae92e..e7cff5f 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -34,6 +34,9 @@ _CONV_ENUM(G,SocketMsgFlags)
 _CONV_ENUM(G,SocketProtocol)
 _CONV_ENUM(G,SocketType)
 
+# ActionGroup
+_CONVERSION(`const Glib::RefPtr<ActionGroup>&',`GActionGroup*',__CONVERT_REFPTR_TO_P)
+
 # AppInfo
 _CONVERSION(`GAppInfo*',`Glib::RefPtr<AppInfo>',`Glib::wrap($3)')
 _CONVERSION(`const Glib::RefPtr<AppLaunchContext>&',`GAppLaunchContext*',__CONVERT_REFPTR_TO_P)



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