[glibmm] giomm: Add ActionGroup interface.



commit 910bb14a3bc34df2a1b88e419dc6ca495ee7e132
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Mon Nov 1 03:07:58 2010 -0400

    	giomm: Add ActionGroup interface.
    
    	* tools/extra_defs_gen/generate_defs_gio.cc:
    	* gio/src/gio_signals.defs: Add the GActionGroup type to the extra
    	defs generation tool and regenerate the signal defs file to get the
    	signals of GActionGroup.
    	* gio/src/actiongroup.{ccg, hg}:
    	* gio/src/filelist.am: Add new ActionGroup interface sources and
    	mention them so they are build.

 ChangeLog                                 |   12 +++++
 gio/src/actiongroup.ccg                   |   25 ++++++++++
 gio/src/actiongroup.hg                    |   70 +++++++++++++++++++++++++++++
 gio/src/filelist.am                       |    1 +
 gio/src/gio_signals.defs                  |   48 ++++++++++++++++++--
 tools/extra_defs_gen/generate_defs_gio.cc |    1 +
 6 files changed, 153 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index da63a33..9c8d97f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-11-01  José Alburquerque  <jaalburqu svn gnome org>
+
+	giomm: Add ActionGroup interface.
+
+	* tools/extra_defs_gen/generate_defs_gio.cc:
+	* gio/src/gio_signals.defs: Add the GActionGroup type to the extra
+	defs generation tool and regenerate the signal defs file to get the
+	signals of GActionGroup.
+	* gio/src/actiongroup.{ccg, hg}:
+	* gio/src/filelist.am: Add new ActionGroup interface sources and
+	mention them so they are build.
+
 2010-10-28  José Alburquerque  <jaalburqu svn gnome org>
 
 	DBusConnection: Reorder parameters to allow default values for flags.
diff --git a/gio/src/actiongroup.ccg b/gio/src/actiongroup.ccg
new file mode 100644
index 0000000..555a34b
--- /dev/null
+++ b/gio/src/actiongroup.ccg
@@ -0,0 +1,25 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2010 The giomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gio/gio.h>
+
+namespace Gio
+{
+
+} // namespace Gio
diff --git a/gio/src/actiongroup.hg b/gio/src/actiongroup.hg
new file mode 100644
index 0000000..e98dd98
--- /dev/null
+++ b/gio/src/actiongroup.hg
@@ -0,0 +1,70 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2010 The giomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <glibmm/interface.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(glibmm/private/interface_p.h)
+_PINCLUDE(gio/gio.h)
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+typedef struct _GActionGroupInterface GActionGroupInterface;
+#endif /* DOXYGEN_SHOULD_SKIP_THIS */
+
+namespace Gio
+{
+
+/** TODO
+ */
+class ActionGroup : public Glib::Interface
+{
+  _CLASS_INTERFACE(ActionGroup, GActionGroup, G_ACTION_GROUP, GActionGroupInterface)
+
+public:
+  _WRAP_METHOD(bool has_action(const Glib::ustring& action_name) const, g_action_group_has_action)
+
+  //TODO: _WRAP_METHOD(gchar** list_actions(), g_action_group_list_actions)
+
+  _WRAP_METHOD(bool get_action_enabled(const Glib::ustring& action_name) const, g_action_group_get_action_enabled)
+ 
+/* TODO:
+  _WRAP_METHOD(const GVariantType* get_action_parameter_type(const Glib::ustring& action_name), g_action_group_get_action_parameter_type)
+  GVariantType* get_action_state_type(const Glib::ustring& action_name), g_action_group_get_action_state_type)
+  _WRAP_METHOD(GVariant* get_action_state_hint(const Glib::ustring& action_name), g_action_group_get_action_state_hint)
+  _WRAP_METHOD(GVariant* get_action_state(GActionGroup* action_group, const gchar* action_name), g_action_group_get_action_state)
+*/
+
+  _WRAP_METHOD(void change_action_state(const Glib::ustring& action_name, const Glib::VariantBase& value), g_action_group_change_action_state)
+  _WRAP_METHOD(void activate_action(const Glib::ustring& action_name, const Glib::VariantBase& parameter), g_action_group_activate_action)
+  _WRAP_METHOD(void action_added(const Glib::ustring& action_name), g_action_group_action_added)
+  _WRAP_METHOD(void action_removed(const Glib::ustring& action_name), g_action_group_action_removed)
+  _WRAP_METHOD(void action_enabled_changed(const Glib::ustring& action_name, bool enabled), g_action_group_action_enabled_changed)
+  _WRAP_METHOD(void action_state_changed (const Glib::ustring& action_name, const Glib::VariantBase& state), g_action_group_action_state_changed)
+
+  _WRAP_SIGNAL(void action_added(const Glib::ustring& action_name), "action-added")
+  _WRAP_SIGNAL(void action_enabled_changed(const Glib::ustring& action_name, bool enabled), "action-enabled-changed")
+  _WRAP_SIGNAL(void action_removed(const Glib::ustring& action_name), "action-removed")
+
+#m4 _CONVERSION(`GVariant*', `const Glib::VariantBase&', `Glib::wrap($3, true)')
+  _WRAP_SIGNAL(void action_state_changed(const Glib::ustring& action_name, const Glib::VariantBase& value), "action-state-changed")
+
+//TODO: Wrap virtual functions.
+};
+
+} // namespace Gio
diff --git a/gio/src/filelist.am b/gio/src/filelist.am
index 82b2692..1126aac 100644
--- a/gio/src/filelist.am
+++ b/gio/src/filelist.am
@@ -13,6 +13,7 @@ giomm_files_defs =			\
 	gio_docs_override.xml
 
 giomm_files_any_hg =			\
+	actiongroup.hg			\
 	appinfo.hg			\
 	application.hg			\
 	asyncinitable.hg		\
diff --git a/gio/src/gio_signals.defs b/gio/src/gio_signals.defs
index 092a8bc..8d1ae87 100644
--- a/gio/src/gio_signals.defs
+++ b/gio/src/gio_signals.defs
@@ -1,5 +1,45 @@
 ;; From GAsyncResult
 
+;; From GActionGroup
+
+(define-signal action-added
+  (of-object "GActionGroup")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("const-gchar*" "p0")
+  )
+)
+
+(define-signal action-removed
+  (of-object "GActionGroup")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("const-gchar*" "p0")
+  )
+)
+
+(define-signal action-enabled-changed
+  (of-object "GActionGroup")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("const-gchar*" "p0")
+    '("gboolean" "p1")
+  )
+)
+
+(define-signal action-state-changed
+  (of-object "GActionGroup")
+  (return-type "void")
+  (when "last")
+  (parameters
+    '("const-gchar*" "p0")
+    '("GVariant*" "p1")
+  )
+)
+
 ;; From GApplication
 
 (define-signal startup
@@ -37,7 +77,7 @@
 (define-property application-id
   (of-object "GApplication")
   (prop-type "GParamString")
-  (docs "Unique identifier for the application")
+  (docs "The unique identifier for the application")
   (readable #t)
   (writable #t)
   (construct-only #f)
@@ -72,8 +112,8 @@
 
 (define-property inactivity-timeout
   (of-object "GApplication")
-  (prop-type "GParamBoolean")
-  (docs "time (ms) to stay alive after becoming idle")
+  (prop-type "GParamUInt")
+  (docs "Iime (ms) to stay alive after becoming idle")
   (readable #t)
   (writable #t)
   (construct-only #f)
@@ -82,7 +122,7 @@
 (define-property action-group
   (of-object "GApplication")
   (prop-type "GParamObject")
-  (docs "the group of actions that the application exports")
+  (docs "The group of actions that the application exports")
   (readable #f)
   (writable #t)
   (construct-only #f)
diff --git a/tools/extra_defs_gen/generate_defs_gio.cc b/tools/extra_defs_gen/generate_defs_gio.cc
index 816cabb..1d498ec 100644
--- a/tools/extra_defs_gen/generate_defs_gio.cc
+++ b/tools/extra_defs_gen/generate_defs_gio.cc
@@ -37,6 +37,7 @@ int main(int, char**)
   g_type_init ();
 
   std::cout << get_defs(G_TYPE_ASYNC_RESULT)
+            << get_defs(G_TYPE_ACTION_GROUP)
             << get_defs(G_TYPE_APPLICATION)
             << get_defs(G_TYPE_CANCELLABLE)
             << get_defs(G_TYPE_BUFFERED_INPUT_STREAM)



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