[gtkmm] Gdk, Gtk: Update for the latest gtk4 (Widget::activate_action(), etc.)



commit 05c95930ae109d5142c0e411d1bd17503a298fe4
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Sat Jun 29 11:56:15 2019 +0200

    Gdk, Gtk: Update for the latest gtk4 (Widget::activate_action(), etc.)

 gdk/src/monitor.hg         |  2 ++
 gtk/src/eventcontroller.hg |  3 +++
 gtk/src/widget.hg          | 18 +++++++++++++++++-
 3 files changed, 22 insertions(+), 1 deletion(-)
---
diff --git a/gdk/src/monitor.hg b/gdk/src/monitor.hg
index 420db7e7..a279e55e 100644
--- a/gdk/src/monitor.hg
+++ b/gdk/src/monitor.hg
@@ -55,6 +55,7 @@ public:
   _WRAP_METHOD(int get_height_mm() const, gdk_monitor_get_height_mm)
   _WRAP_METHOD(Glib::ustring get_manufacturer() const, gdk_monitor_get_manufacturer)
   _WRAP_METHOD(Glib::ustring get_model() const, gdk_monitor_get_model)
+  _WRAP_METHOD(Glib::ustring get_connector() const, gdk_monitor_get_connector)
   _WRAP_METHOD(int get_scale_factor() const, gdk_monitor_get_scale_factor)
   _WRAP_METHOD(int get_refresh_rate() const, gdk_monitor_get_refresh_rate)
   _WRAP_METHOD(SubpixelLayout get_subpixel_layout() const, gdk_monitor_get_subpixel_layout)
@@ -68,6 +69,7 @@ public:
   _WRAP_PROPERTY("display", Glib::RefPtr<Display>)
   _WRAP_PROPERTY("manufacturer", Glib::ustring)
   _WRAP_PROPERTY("model", Glib::ustring)
+  _WRAP_PROPERTY("connector", Glib::ustring)
   _WRAP_PROPERTY("scale-factor", int)
   _WRAP_PROPERTY("geometry", Gdk::Rectangle)
   _WRAP_PROPERTY("workarea", Gdk::Rectangle)
diff --git a/gtk/src/eventcontroller.hg b/gtk/src/eventcontroller.hg
index da677765..7942480f 100644
--- a/gtk/src/eventcontroller.hg
+++ b/gtk/src/eventcontroller.hg
@@ -76,10 +76,13 @@ public:
   _WRAP_METHOD(void set_propagation_phase(PropagationPhase phase), 
gtk_event_controller_set_propagation_phase)
   _WRAP_METHOD(PropagationLimit get_propagation_limit() const, gtk_event_controller_get_propagation_limit)
   _WRAP_METHOD(void set_propagation_limit(PropagationLimit limit), 
gtk_event_controller_set_propagation_limit)
+  _WRAP_METHOD(Glib::ustring get_name() const, gtk_event_controller_get_name)
+  _WRAP_METHOD(void set_name(const Glib::ustring& name), gtk_event_controller_set_name)
 
   _WRAP_PROPERTY("widget", Widget*)
   _WRAP_PROPERTY("propagation-phase", PropagationPhase)
   _WRAP_PROPERTY("propagation-limit", PropagationLimit)
+  _WRAP_PROPERTY("name", Glib::ustring)
 
   // EventController has no signals
 };
diff --git a/gtk/src/widget.hg b/gtk/src/widget.hg
index 7cd19c5b..75de4f94 100644
--- a/gtk/src/widget.hg
+++ b/gtk/src/widget.hg
@@ -556,7 +556,23 @@ public:
    */
   void remove_action_group(const Glib::ustring& name);
 
-  _WRAP_METHOD(void activate_action(const Glib::ustring& name, const Glib::VariantBase& parameter), 
gtk_widget_activate_action)
+  /** Looks up the action in the action groups associated
+   * with the widget and its ancestors, and activates it.
+   *
+   * If the action is in an action group added with
+   * insert_action_group(), the @a name is
+   * expected to be prefixed with the prefix that was
+   * used when the group was inserted.
+   *
+   * The arguments must match the action's expected parameter
+   * type, as returned by Gio::Action::get_parameter_type().
+   *
+   * @param name The name of the action to activate.
+   * @param args Parameters to use. If the action does not expect parameters,
+   *             use the activate_action() overload without the @a args argument.
+   */
+  _WRAP_METHOD(void activate_action(const Glib::ustring& name, const Glib::VariantBase& args{?}), 
gtk_widget_activate_action_variant)
+  _IGNORE(gtk_widget_activate_action)
   _WRAP_METHOD(void activate_default(), gtk_widget_activate_default)
 
   _WRAP_METHOD(void set_font_map(const Glib::RefPtr<Pango::FontMap>& font_map), gtk_widget_set_font_map)


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