summaryrefslogtreecommitdiff
path: root/gio/src/menu.hg
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2012-03-22 20:42:52 +0100
committerMurray Cumming <murrayc@murrayc.com>2012-03-22 20:42:52 +0100
commita22076a82e4ac83fc3db28e4bdb761288966e4c7 (patch)
tree20f403b11663e10b8efcd2a91607149d5cd95edd /gio/src/menu.hg
parent5776341bd182931ae415d5eeaedbf71bca91e525 (diff)
downloadglibmm-a22076a82e4ac83fc3db28e4bdb761288966e4c7.tar.gz
Gio: Add Menu and MenuItem.
* tools/extra_defs_gen/generate_defs_gio.cc: Mention the new GTypes here, though they do not seem to have any properties or signals. * gio/src/filelist.am: * gio/src/menu.[hg|ccg]: * gio/src/menuitem.[hg|ccg]: Add these classes, as a way to create the Gio::MenuModel for Gtk::Application::set_app_menu() and set_menubar(). * tools/m4/convert_gio.m4: Add MenuItem conversion. * gio/giomm.h: Mention the new headers here.
Diffstat (limited to 'gio/src/menu.hg')
-rw-r--r--gio/src/menu.hg62
1 files changed, 62 insertions, 0 deletions
diff --git a/gio/src/menu.hg b/gio/src/menu.hg
new file mode 100644
index 00000000..c3ebb12c
--- /dev/null
+++ b/gio/src/menu.hg
@@ -0,0 +1,62 @@
+/* Copyright (C) 2012 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 <giomm/menumodel.h>
+#include <giomm/menuitem.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(giomm/private/menumodel_p.h)
+
+namespace Gio
+{
+
+/** TODO
+ *
+ * @newin{2,32}
+ */
+class Menu : public Gio::MenuModel
+{
+ _CLASS_GOBJECT(Menu, GMenu, G_MENU, ::Gio::MenuModel, GMenuModel)
+
+protected:
+ _CTOR_DEFAULT
+ _IGNORE(g_menu_new)
+
+public:
+ _WRAP_CREATE()
+
+ _WRAP_METHOD(void freeze(), g_menu_freeze)
+
+ _WRAP_METHOD(void insert_item(int position, const Glib::RefPtr<MenuItem>& item), g_menu_insert_item)
+ _WRAP_METHOD(void prepend_item(const Glib::RefPtr<MenuItem>& item), g_menu_prepend_item)
+ _WRAP_METHOD(void append_item(const Glib::RefPtr<MenuItem>& item), g_menu_append_item)
+ _WRAP_METHOD(void remove(int position), g_menu_remove)
+
+ _WRAP_METHOD(void insert(int position, const Glib::ustring& label, const Glib::ustring& detailed_action), g_menu_insert)
+ _WRAP_METHOD(void prepend(const Glib::ustring& label, const Glib::ustring& detailed_action), g_menu_prepend)
+ _WRAP_METHOD(void append(const Glib::ustring& label, const Glib::ustring& detailed_action), g_menu_append)
+
+ _WRAP_METHOD(void insert_section(int position, const Glib::ustring& label, const Glib::RefPtr<MenuModel>& section), g_menu_insert_section)
+ _WRAP_METHOD(void prepend_section(const Glib::ustring& label, const Glib::RefPtr<MenuModel>& section), g_menu_prepend_section)
+
+ _WRAP_METHOD(void insert_submenu(int position, const Glib::ustring& label, const Glib::RefPtr<MenuModel>& submenu), g_menu_insert_submenu)
+ _WRAP_METHOD(void prepend_submenu(const Glib::ustring& label, const Glib::RefPtr<MenuModel>& submenu), g_menu_prepend_submenu)
+ _WRAP_METHOD(void append_submenu(const Glib::ustring& label, const Glib::RefPtr<MenuModel>& submenu), g_menu_append_submenu)
+
+};
+
+} // namespace Gio