[gtkmm] Application: Add some new methods.



commit 2a4d69818429a124e496840e9e0177271fdbf266
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Aug 24 11:45:35 2014 +0200

    Application: Add some new methods.
    
    * gtk/src/application.hg: Add get_actions_for_accel(),
      prefers_app_menu(), and get_menu_by_id().
    * tools/m4/convert_gtk.m4: Add conversions for GMenu.

 gtk/src/application.hg  |    9 +++++++++
 tools/m4/convert_gtk.m4 |    3 +++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gtk/src/application.hg b/gtk/src/application.hg
index a13ca91..a41082e 100644
--- a/gtk/src/application.hg
+++ b/gtk/src/application.hg
@@ -22,6 +22,7 @@ _CONFIGINCLUDE(gtkmmconfig.h)
 #include <gtkmm/actiongroup.h>
 #include <giomm/application.h>
 #include <giomm/menumodel.h>
+#include <giomm/menu.h>
 #include <vector>
 #include <glibmm/arrayhandle.h>
 
@@ -122,6 +123,7 @@ protected:
   explicit Application(const Glib::ustring& application_id = Glib::ustring(), Gio::ApplicationFlags flags = 
Gio::APPLICATION_FLAGS_NONE);
   _IGNORE(gtk_application_new)
   _IGNORE(gtk_application_window_new)
+  _IGNORE(gtk_application_impl_new)
 
   //This constructor does not correspond to anything in the C API.
   //We added it so we can choose to always initialize gtkmm as early as possible.
@@ -336,6 +338,8 @@ public:
 #m4 
_CONVERSION(`gchar**',`std::vector<Glib::ustring>',`Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, 
Glib::OWNERSHIP_DEEP)')
   _WRAP_METHOD(std::vector<Glib::ustring> get_accels_for_action(const Glib::ustring& detailed_action_name) 
const, gtk_application_get_accels_for_action)
 
+  _WRAP_METHOD(std::vector<Glib::ustring> get_actions_for_accel(const Glib::ustring& accel) const, 
gtk_application_get_actions_for_accel)
+
 #m4 _CONVERSION(`const std::vector<Glib::ustring>&',`const 
gchar*-const*',`Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data ()')
   _WRAP_METHOD(void set_accels_for_action(const Glib::ustring& detailed_action_name, const 
std::vector<Glib::ustring>& accels), gtk_application_set_accels_for_action)
 
@@ -363,6 +367,11 @@ public:
    */
   void unset_accels_for_action(const Glib::ustring& detailed_action_name);
 
+  _WRAP_METHOD(bool prefers_app_menu() const, gtk_application_prefers_app_menu)
+
+  _WRAP_METHOD(Glib::RefPtr<Gio::Menu> get_menu_by_id(const Glib::ustring& id), 
gtk_application_get_menu_by_id, refreturn)
+  _WRAP_METHOD(Glib::RefPtr<const Gio::Menu> get_menu_by_id(const Glib::ustring& id) const, 
gtk_application_get_menu_by_id, refreturn, constversion)
+
   _WRAP_PROPERTY("app-menu", Glib::RefPtr<Gio::MenuModel>)
   _WRAP_PROPERTY("menubar", Glib::RefPtr<Gio::MenuModel>)
   _WRAP_PROPERTY("register-session", bool)
diff --git a/tools/m4/convert_gtk.m4 b/tools/m4/convert_gtk.m4
index 202a5a3..802be80 100644
--- a/tools/m4/convert_gtk.m4
+++ b/tools/m4/convert_gtk.m4
@@ -707,6 +707,9 @@ _CONVERSION(`const Glib::RefPtr<Gio::InputStream>&',`GInputStream*',__CONVERT_CO
 _CONVERSION(`const Glib::RefPtr<Gio::AppInfo>&',`GAppInfo*',__CONVERT_CONST_REFPTR_TO_P_SUN(Gio::AppInfo))
 _CONVERSION(`GAppInfo*',`Glib::RefPtr<Gio::AppInfo>',`Glib::wrap($3)')
 
+_CONVERSION(`GMenu*',`Glib::RefPtr<Gio::Menu>',`Glib::wrap($3)')
+_CONVERSION(`GMenu*',`Glib::RefPtr<const Gio::Menu>',`Glib::wrap($3)')
+
 _CONVERSION(`const Glib::RefPtr<Gio::MenuModel>&',`GMenuModel*',__CONVERT_REFPTR_TO_P)
 _CONVERSION(`const Glib::RefPtr<const Gio::MenuModel>&',`GMenuModel*',__CONVERT_CONST_REFPTR_TO_P)
 _CONVERSION(`GMenuModel*',`Glib::RefPtr<Gio::MenuModel>',`Glib::wrap($3)')


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