[glibmm] giomm: Add SimpleActionGroup.



commit cef8ad38f68f16197f653e5a1dc1a646cfb11458
Author: Josà Alburquerque <jaalburqu svn gnome org>
Date:   Thu Sep 22 15:01:57 2011 -0400

    giomm: Add SimpleActionGroup.
    
    	* gio/src/simpleactiongroup.{ccg,hg}:
    	* gio/src/filelist.am: Add sources and include them in the build file
    	list.
    	* tools/m4/convert_gio.m4: Add necessary conversions.
    	* gio/src/simpleaction.hg: Added class doc title.

 ChangeLog                     |   10 +++++++
 gio/src/filelist.am           |    1 +
 gio/src/simpleaction.hg       |    3 +-
 gio/src/simpleactiongroup.ccg |   24 ++++++++++++++++++
 gio/src/simpleactiongroup.hg  |   54 +++++++++++++++++++++++++++++++++++++++++
 tools/m4/convert_gio.m4       |    4 +++
 6 files changed, 95 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5245338..669ed05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-09-22  Josà Alburquerque  <jaalburqu svn gnome org>
+
+	giomm: Add SimpleActionGroup.
+
+	* gio/src/simpleactiongroup.{ccg,hg}:
+	* gio/src/filelist.am: Add sources and include them in the build file
+	list.
+	* tools/m4/convert_gio.m4: Add necessary conversions.
+	* gio/src/simpleaction.hg: Added class doc title.
+
 2011-09-21  Josà Alburquerque  <jaalburqu svn gnome org>
 
 	SimpleAction: Add create() methods.
diff --git a/gio/src/filelist.am b/gio/src/filelist.am
index 803f442..8e2ce3f 100644
--- a/gio/src/filelist.am
+++ b/gio/src/filelist.am
@@ -80,6 +80,7 @@ giomm_files_any_hg =			\
 	seekable.hg			\
 	settings.hg			\
 	simpleaction.hg			\
+	simpleactiongroup.hg		\
 	socket.hg			\
 	socketaddress.hg		\
 	socketaddressenumerator.hg	\
diff --git a/gio/src/simpleaction.hg b/gio/src/simpleaction.hg
index 08bdc58..cf1292e 100644
--- a/gio/src/simpleaction.hg
+++ b/gio/src/simpleaction.hg
@@ -29,7 +29,8 @@ typedef GObjectClass GSimpleActionClass;
 namespace Gio
 {
 
-/** A SimpleAction is the obvious simple implementation of the Action
+/** SimpleAction - A simple Action implementation.
+ * A SimpleAction is the obvious simple implementation of the Action
  * interface. This is the easiest way to create an action for purposes of
  * adding it to a SimpleActionGroup.
  *
diff --git a/gio/src/simpleactiongroup.ccg b/gio/src/simpleactiongroup.ccg
new file mode 100644
index 0000000..cd3e297
--- /dev/null
+++ b/gio/src/simpleactiongroup.ccg
@@ -0,0 +1,24 @@
+/* Copyright (C) 2011 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>
+#include <giomm/action.h>
+
+namespace Gio
+{
+
+}// namespace Gio
diff --git a/gio/src/simpleactiongroup.hg b/gio/src/simpleactiongroup.hg
new file mode 100644
index 0000000..e9596e3
--- /dev/null
+++ b/gio/src/simpleactiongroup.hg
@@ -0,0 +1,54 @@
+/* Copyright (C) 2011 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/object.h>
+#include <giomm/actiongroup.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gio
+{
+
+class Action;
+
+/** SimpleActionGroup - A simple ActionGroup implementation.
+ * SimpleActionGroup is a hash table filled with Action objects, implementing
+ * the ActionGroup interface.
+ *
+ * @newin{2,30}
+ */
+class SimpleActionGroup : public Glib::Object, public ActionGroup
+{
+  _CLASS_GOBJECT(SimpleActionGroup, GSimpleActionGroup, G_SIMPLE_ACTION_GROUP, Glib::Object, GObject)
+  _IMPLEMENTS_INTERFACE(ActionGroup)
+
+protected:
+  _CTOR_DEFAULT()
+
+public:
+  _WRAP_METHOD_DOCS_ONLY(g_simple_action_group_new)
+  _WRAP_CREATE()
+
+  _WRAP_METHOD(Glib::RefPtr<Action> lookup(const Glib::ustring& action_name), g_simple_action_group_lookup)
+  _WRAP_METHOD(void insert(const Glib::RefPtr<Action>& action), g_simple_action_group_insert)
+  _WRAP_METHOD(void remove(const Glib::ustring& action_name), g_simple_action_group_remove)
+
+  //TODO?: _WRAP_METHOD(void add_entries(const GActionEntry* entries, int n_entries, gpointer user_data), g_simple_action_group_add_entries)
+};
+
+} // namespace Gio
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index ea8e3b4..77e74fb 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -36,6 +36,10 @@ _CONV_ENUM(G,SocketProtocol)
 _CONV_ENUM(G,SocketType)
 _CONV_ENUM(G,UnixSocketAddressType)
 
+# Action
+_CONVERSION(`GAction*',`Glib::RefPtr<Action>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<Action>&',`GAction*',__CONVERT_REFPTR_TO_P)
+
 # ActionGroup
 _CONVERSION(`const Glib::RefPtr<ActionGroup>&',`GActionGroup*',__CONVERT_REFPTR_TO_P)
 



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