[gtkmm] StyleContext: Wrap gtk_style_context_get_style_property() and friends
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] StyleContext: Wrap gtk_style_context_get_style_property() and friends
- Date: Mon, 28 May 2012 19:49:56 +0000 (UTC)
commit 54e80b62d76884fa19fd968d81ded81152c55b44
Author: Mark Vender <markv743 yahoo co uk>
Date: Wed May 2 13:13:56 2012 +0000
StyleContext: Wrap gtk_style_context_get_style_property() and friends
* gtk/src/stylecontext.hg: Add get_style_property() and
get_style_property_value().
Bug #674746.
ChangeLog | 9 +++++++++
gtk/src/stylecontext.hg | 34 +++++++++++++++++++++++++---------
2 files changed, 34 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 98ab6c5..0697bc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-05-28 Mark Vender <markv743 yahoo co uk>
+
+ StyleContext: Wrap gtk_style_context_get_style_property() and friends
+
+ * gtk/src/stylecontext.hg: Add get_style_property() and
+ get_style_property_value().
+
+ Bug #674746.
+
2012-05-28 Murray Cumming <murrayc murrayc com>
Container: Slight improvements to the vfunc documentation.
diff --git a/gtk/src/stylecontext.hg b/gtk/src/stylecontext.hg
index d68fc6e..cbf13c3 100644
--- a/gtk/src/stylecontext.hg
+++ b/gtk/src/stylecontext.hg
@@ -157,15 +157,17 @@ public:
_WRAP_METHOD(void add_region(const Glib::ustring& region_name, RegionFlags flags), gtk_style_context_add_region)
_WRAP_METHOD(void remove_region(const Glib::ustring& region_name), gtk_style_context_remove_region)
_WRAP_METHOD(bool has_region(const Glib::ustring& region_name, RegionFlags& flags_return), gtk_style_context_has_region)
-/*
- _WRAP_METHOD(void get_style_property (
- const Glib::ustring& property_name,
- GValue *value), gtk_style_context_get_style_property)
- _WRAP_METHOD(void get_style_valist (
- va_list args), gtk_style_context_get_style_valis)
- _WRAP_METHOD(void get_style (
- ...), gtk_style_context_get_style)
-*/
+
+ /** Gets the value of a style property
+ * @param property_name The name of a style property.
+ * @param value Location to return the property value.
+ */
+ template <class PropertyType>
+ void get_style_property(const Glib::ustring& property_name, PropertyType& value) const;
+
+ _WRAP_METHOD(void get_style_property_value(
+ const Glib::ustring& property_name, Glib::ValueBase& value) const,
+ gtk_style_context_get_style_property)
_WRAP_METHOD(Glib::RefPtr<IconSet> lookup_icon_set(const Glib::ustring& stock_id), gtk_style_context_lookup_icon_set, refreturn)
@@ -248,4 +250,18 @@ public:
_WRAP_PROPERTY("parent", Glib::RefPtr<StyleContext>)
};
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
+template <class PropertyType>
+void StyleContext::get_style_property(const Glib::ustring& property_name, PropertyType& value) const
+{
+ Glib::Value<PropertyType> property_value;
+ property_value.init(Glib::Value<PropertyType>::value_type());
+
+ this->get_style_property_value(property_name, property_value);
+
+ value = property_value.get();
+}
+
+#endif
} // namespace Gtk
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]