[gtkmm] Add Gdk::Device::get_timestamp(), Gtk::IconTheme::has_gicon() etc.



commit 796793a6556ae1814e4c0f4ef2dfac939407dddb
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Sat May 22 12:04:04 2021 +0200

    Add Gdk::Device::get_timestamp(), Gtk::IconTheme::has_gicon() etc.
    
    * configure.ac:
    * meson.build: Require gtk4 >= 4.2.0.
    * gdk/src/device.hg: Add get_timestamp().
    * gdk/src/popuplayout.[ccg|hg]: Add set/get_shadow_width().
    * gdk/src/surface.hg: Add property_scale_factor().
    * gtk/src/checkbutton.hg: Ignore a signal.
    * gtk/src/icontheme.hg: Add has_gicon().
    * gtk/src/window.hg: Add set/get/property_handle_menubar_accel().

 configure.ac            |  2 +-
 gdk/src/device.hg       |  1 +
 gdk/src/popuplayout.ccg |  9 +++++++++
 gdk/src/popuplayout.hg  | 16 ++++++++++++++++
 gdk/src/surface.hg      |  1 +
 gtk/src/checkbutton.hg  |  1 +
 gtk/src/icontheme.hg    |  1 +
 gtk/src/window.hg       |  5 ++++-
 meson.build             |  2 +-
 9 files changed, 35 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 96944a92..0adc44a2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,7 +95,7 @@ AS_IF([test "x$enable_static" = xyes],
 # gdkmm really does need GTK, because part of Gdk::DragContext is in GTK.
 # The extra gdk-pixbuf-2.0 check is because gdkmm requires a newer gdk-pixbuf than gtk4 requires.
 # TODO: Remove the mention of cairomm once pangomm needs to depend on such a new version.
-AC_SUBST([GDKMM_MODULES], ['giomm-2.68 >= 2.68.0 pangomm-2.48 >= 2.48.0 cairomm-1.16 >= 1.15.4 gtk4 >= 4.0.0 
gdk-pixbuf-2.0 >= 2.35.5'])
+AC_SUBST([GDKMM_MODULES], ['giomm-2.68 >= 2.68.0 pangomm-2.48 >= 2.48.0 cairomm-1.16 >= 1.15.4 gtk4 >= 4.2.0 
gdk-pixbuf-2.0 >= 2.35.5'])
 
 AS_IF([test "x$gtkmm_host_windows" = xyes],
       [GTKMM_MODULES=$GDKMM_MODULES],
diff --git a/gdk/src/device.hg b/gdk/src/device.hg
index c5b812ed..4b3289ca 100644
--- a/gdk/src/device.hg
+++ b/gdk/src/device.hg
@@ -93,6 +93,7 @@ public:
   _WRAP_METHOD(ModifierType get_modifier_state() const, gdk_device_get_modifier_state)
   _WRAP_METHOD(Pango::Direction get_direction() const, gdk_device_get_direction)
   _WRAP_METHOD(bool has_bidi_layouts() const, gdk_device_has_bidi_layouts)
+  _WRAP_METHOD(guint32 get_timestamp() const, gdk_device_get_timestamp)
 
   /** Checks if this %Device instance is a DeviceWithPad.
    *
diff --git a/gdk/src/popuplayout.ccg b/gdk/src/popuplayout.ccg
index 16221a6d..38e32e6f 100644
--- a/gdk/src/popuplayout.ccg
+++ b/gdk/src/popuplayout.ccg
@@ -14,3 +14,12 @@
  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
+namespace Gdk
+{
+
+void PopupLayout::set_shadow_width(int width)
+{
+  gdk_popup_layout_set_shadow_width(gobj(), width, width, width, width);
+}
+
+} // namespace Gdk
diff --git a/gdk/src/popuplayout.hg b/gdk/src/popuplayout.hg
index f9a8fe12..4bf4b671 100644
--- a/gdk/src/popuplayout.hg
+++ b/gdk/src/popuplayout.hg
@@ -58,6 +58,22 @@ public:
   _WRAP_METHOD(AnchorHints get_anchor_hints() const, gdk_popup_layout_get_anchor_hints)
   _WRAP_METHOD(void set_offset(int dx, int dy), gdk_popup_layout_set_offset)
   _WRAP_METHOD(void get_offset(int& dx, int& dy), gdk_popup_layout_get_offset)
+  _WRAP_METHOD(void set_shadow_width(int left, int right, int top, int bottom),
+    gdk_popup_layout_set_shadow_width)
+
+  /** Sets the shadow width of the popup.
+   *
+   * The shadow width corresponds to the part of the computed
+   * surface size that would consist of the shadow margin
+   * surrounding the window, would there be any.
+   *
+   * @newin{4,2}
+   * @param width Width of all parts of the shadow.
+   */
+  void set_shadow_width(int width);
+
+  _WRAP_METHOD(void get_shadow_width(int& left, int& right, int& top, int& bottom) const,
+    gdk_popup_layout_get_shadow_width)
 };
 
 } // namespace Gdk
diff --git a/gdk/src/surface.hg b/gdk/src/surface.hg
index 4532e97a..53b6e1db 100644
--- a/gdk/src/surface.hg
+++ b/gdk/src/surface.hg
@@ -184,6 +184,7 @@ public:
   _WRAP_PROPERTY("mapped", bool)
   _WRAP_PROPERTY("width", int)
   _WRAP_PROPERTY("height", int)
+  _WRAP_PROPERTY("scale-factor", int)
 };
 
 } // namespace Gdk
diff --git a/gtk/src/checkbutton.hg b/gtk/src/checkbutton.hg
index df3a16af..0e1ed0e0 100644
--- a/gtk/src/checkbutton.hg
+++ b/gtk/src/checkbutton.hg
@@ -66,6 +66,7 @@ public:
   void unset_group();
 
   _WRAP_SIGNAL(void toggled(), "toggled")
+  _IGNORE_SIGNAL("activate")dnl // Action signal
 
   _WRAP_PROPERTY("active", bool)
   _WRAP_PROPERTY("group", CheckButton*)
diff --git a/gtk/src/icontheme.hg b/gtk/src/icontheme.hg
index 7b9015c3..7d801c37 100644
--- a/gtk/src/icontheme.hg
+++ b/gtk/src/icontheme.hg
@@ -83,6 +83,7 @@ public:
   _WRAP_METHOD(void set_theme_name(const Glib::ustring& theme_name), gtk_icon_theme_set_theme_name)
   _WRAP_METHOD(Glib::ustring get_theme_name() const, gtk_icon_theme_get_theme_name)
   _WRAP_METHOD(bool has_icon(const Glib::ustring& icon_name) const, gtk_icon_theme_has_icon)
+  _WRAP_METHOD(bool has_gicon(const Glib::RefPtr<const Gio::Icon>& gicon) const, gtk_icon_theme_has_gicon)
 
 #m4 _CONVERSION(`int*',`std::vector<int>',`Glib::ArrayHandler<int>::array_to_vector($3, 
Glib::OWNERSHIP_SHALLOW)')
   _WRAP_METHOD(std::vector<int> get_icon_sizes(const Glib::ustring& icon_name) const, 
gtk_icon_theme_get_icon_sizes)
diff --git a/gtk/src/window.hg b/gtk/src/window.hg
index 71e0bdcb..c5bf4bae 100644
--- a/gtk/src/window.hg
+++ b/gtk/src/window.hg
@@ -104,6 +104,7 @@ public:
   _WRAP_PROPERTY("default-widget", Widget*)
   _WRAP_PROPERTY("focus-widget", Widget*)
   _WRAP_PROPERTY("child", Widget*)
+  _WRAP_PROPERTY("handle-menubar-accel", bool)
 
   _WRAP_SIGNAL(void keys_changed(), "keys_changed")
   _WRAP_SIGNAL(bool close_request(), "close-request")
@@ -266,9 +267,11 @@ dnl
   _WRAP_METHOD(const Widget* get_titlebar() const, gtk_window_get_titlebar, constversion)
 
   _WRAP_METHOD(bool is_maximized() const, gtk_window_is_maximized)
-
   _WRAP_METHOD(bool is_fullscreen() const, gtk_window_is_fullscreen)
 
+  _WRAP_METHOD(void set_handle_menubar_accel(bool handle_menubar_accel), gtk_window_set_handle_menubar_accel)
+  _WRAP_METHOD(bool get_handle_menubar_accel() const, gtk_window_get_handle_menubar_accel)
+
   // from gtk/gtkshow.h:
   //TODO: _WRAP_METHOD(void show_uri(const Glib::ustring& uri, guint32 timestamp), gtk_show_uri)
   // gtk_show_uri_full[_finish]()
diff --git a/meson.build b/meson.build
index 89e01c03..8aea5d17 100644
--- a/meson.build
+++ b/meson.build
@@ -103,7 +103,7 @@ install_pkgconfigdir = install_libdir / 'pkgconfig'
 glibmm_req = '>= 2.68.0'
 
 # Gtk supported pkg-config files on MSVC files for a good while, so just use that
-gtk_req = '>= 4.0.0'
+gtk_req = '>= 4.2.0'
 gtk_dep = dependency('gtk4', version: gtk_req)
 
 cairomm_req = '>= 1.15.4'


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