[gtkmm] Fix the gdkmm build with latest GTK+ 3 from git master.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Fix the gdkmm build with latest GTK+ 3 from git master.
- Date: Mon, 6 Dec 2010 10:03:26 +0000 (UTC)
commit 74040a096c7c44f7bc3409fd6c8eecc5de40959a
Author: Murray Cumming <murrayc murrayc com>
Date: Mon Dec 6 10:53:35 2010 +0100
Fix the gdkmm build with latest GTK+ 3 from git master.
* gdk/src/gdk_methods.defs: Regenerated with h2defs.py.
* gdk/src/window.hg: get_geometry(): Remove the depth parameter, to match
the change in GTK+ 3.
ChangeLog | 10 +-
gdk/src/window.hg | 2 +-
gtk/src/stylecontext.ccg | 98 +++++++++
gtk/src/stylecontext.hg | 526 ++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 634 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 66a3c96..a1b3ec9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,16 @@
+2010-12-06 Murray Cumming <murrayc murrayc com>
+
+ Fix the gdkmm build with latest GTK+ 3 from git master.
+
+ * gdk/src/gdk_methods.defs: Regenerated with h2defs.py.
+ * gdk/src/window.hg: get_geometry(): Remove the depth parameter, to match
+ the change in GTK+ 3.
+
2010-12-05 Murray Cumming <murrayc murrayc com>
Regenerate gtk_methods.defs.
- * gtk/src/gtk_methods.defs:
+ * gtk/src/gtk_methods.defs: Regenerated with h2defs.py.
* gtk/src/iconinfo.[hg|ccg]: Remove use of
gtk_icon_info_load_symbolic_for_style() because it is now deprecated in
GTK+ 3.
diff --git a/gdk/src/window.hg b/gdk/src/window.hg
index 26053ed..d37a509 100644
--- a/gdk/src/window.hg
+++ b/gdk/src/window.hg
@@ -181,7 +181,7 @@ public:
//TODO: _WRAP_METHOD(Cursor get_cursor(), gdk_window_get_cursor)
_WRAP_METHOD(void get_user_data(gpointer* data), gdk_window_get_user_data)
- _WRAP_METHOD(void get_geometry(int& x, int& y, int& width, int& height, int& depth) const, gdk_window_get_geometry)
+ _WRAP_METHOD(void get_geometry(int& x, int& y, int& width, int& height) const, gdk_window_get_geometry)
_WRAP_METHOD(int get_width() const, gdk_window_get_width)
_WRAP_METHOD(int get_height() const, gdk_window_get_height)
diff --git a/gtk/src/stylecontext.ccg b/gtk/src/stylecontext.ccg
new file mode 100644
index 0000000..d7e8e8a
--- /dev/null
+++ b/gtk/src/stylecontext.ccg
@@ -0,0 +1,98 @@
+// -*- c++ -*-
+/* $Id: style.ccg,v 1.5 2006/11/23 14:47:48 murrayc Exp $ */
+
+/* Copyright 1998-2002 The gtkmm 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 <gtkmm/widget.h>
+#include <gtkmm/rc.h>
+#include <gtk/gtk.h>
+
+
+namespace Gtk
+{
+
+/*
+Design notes:
+
+Okay these are my notes on how a GtkStyle works.
+They are not meant to be taken as documentation as I didn't
+write the code.
+
+styles keeps a copy of itself for each color depth. Thus
+changing a style after it has been attached wont work!
+
+At allocation time a Gtk Style has
+ - all GC set to 0 as they will be allocated later
+ - has all color values set to default values.
+ - a ref count of 1 and an attach count of 0 (floating?)
+ - a properly referenced font.
+ - colormap and depth are invalid.
+ - The style list and rcstyle are 0. (??? styles wasn't set explicitly!)
+
+It returns to this state if the style is detatched from
+all widgets.
+
+Attach acts to sink the object removing it from the floating state.
+
+attaching a style for the first time initializes it.
+Initializing a style
+ - sets the colormap and depth.
+ - sets the mid colors. (thus allowing user to set these would be pointless)
+ - gets black and white from the colormap.
+ - allocates all the colors.
+ - uses gtk_gc_get to share a gc if there is a matching one.
+
+Conclusions, we need to rework the concept of Gdk to allow
+for const objects.
+
+*/
+
+void Style::set_font(const Pango::FontDescription& font_desc)
+{
+ g_return_if_fail(font_desc.gobj() != 0);
+
+ // It will be freed when it goes out of scope.
+ const Pango::FontDescription fontBefore (gobj()->font_desc, false);
+
+ gobj()->font_desc = font_desc.gobj_copy();
+}
+
+Pango::FontDescription Style::get_font() const
+{
+ // Direct struct access seems the only way.
+ return Pango::FontDescription(gobj()->font_desc, true); // true = make a copy.
+}
+
+void Style::set_xthickness(int xthickness)
+{
+ gobj()->xthickness = xthickness;
+}
+
+void Style::set_ythickness(int ythickness)
+{
+ gobj()->ythickness = ythickness;
+}
+
+IconSet Style::lookup_icon_set(const Gtk::StockID& stock_id)
+{
+ GtkIconSet* pIconSet = gtk_style_lookup_icon_set(gobj(), stock_id.get_c_str());
+ return IconSet(pIconSet, true); //true = take_copy.
+
+}
+
+} // namespace Gtk
diff --git a/gtk/src/stylecontext.hg b/gtk/src/stylecontext.hg
new file mode 100644
index 0000000..239515d
--- /dev/null
+++ b/gtk/src/stylecontext.hg
@@ -0,0 +1,526 @@
+/* $Id: style.hg,v 1.11 2006/11/23 14:47:48 murrayc Exp $ */
+
+/* Copyright (C) 1998-2002 The gtkmm 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.
+ */
+
+// This is for including the config header before any code (such as
+// the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
+_CONFIGINCLUDE(gtkmmconfig.h)
+
+_DEFS(gtkmm,gtk)
+_PINCLUDE(glibmm/private/object_p.h)
+_PINCLUDE(gtk/gtk.h)
+#m4begin
+
+m4_define(`_STYLE_MEMBER_COLOR',`dnl
+void set_$1(Gtk::StateType state, const Gdk::Color& color);
+ Gdk::Color get_$1(Gtk::StateType state) const;
+_PUSH(SECTION_CC)
+void Style::set_$1(StateType state, const Gdk::Color& color)
+{
+ gobj()->$1[state] = *color.gobj();
+}
+
+Gdk::Color Style::get_$1(StateType state) const
+{
+ return Gdk::Color(const_cast<GdkColor*>(&gobj()->$1[state]), true);
+}
+
+_POP()
+')dnl
+
+#m4end
+
+#include <pangomm/fontdescription.h>
+#include <pangomm/layout.h>
+
+#include <gdkmm/types.h>
+#include <gdkmm/window.h>
+
+#include <gtkmm/enums.h>
+#include <gtkmm/iconsource.h>
+#include <gtkmm/iconset.h>
+#include <gtkmmconfig.h>
+
+
+namespace Gtk
+{
+
+class Widget;
+class RcStyle;
+
+
+class Style : public Glib::Object
+{
+ _CLASS_GOBJECT(Style, GtkStyle, GTK_STYLE, Glib::Object, GObject)
+ _IGNORE(gtk_style_ref, gtk_style_unref, gtk_style_get_font, gtk_style_set_font)
+
+protected:
+ _CTOR_DEFAULT()
+
+public:
+ _WRAP_CREATE()
+ _IGNORE(gtk_style_new)
+
+ _STYLE_MEMBER_COLOR(fg)
+ _STYLE_MEMBER_COLOR(bg)
+ _STYLE_MEMBER_COLOR(light)
+ _STYLE_MEMBER_COLOR(dark)
+ _STYLE_MEMBER_COLOR(mid)
+ _STYLE_MEMBER_COLOR(text)
+ _STYLE_MEMBER_COLOR(base)
+ _STYLE_MEMBER_COLOR(text_aa)
+
+ _MEMBER_SET(black, black, Gdk::Color, GdkColor)
+ _MEMBER_GET(black, black, Gdk::Color, GdkColor)
+ _MEMBER_SET(white, white, Gdk::Color, GdkColor)
+ _MEMBER_GET(white, white, Gdk::Color, GdkColor)
+
+ void set_font(const Pango::FontDescription& font_desc);
+
+ // These are only available after being attached to a window.
+ Pango::FontDescription get_font() const;
+
+ void set_xthickness(int xthickness);
+ _MEMBER_GET(xthickness, xthickness, int, gint)
+
+ void set_ythickness(int ythickness);
+ _MEMBER_GET(ythickness, ythickness, int, gint)
+
+ _WRAP_METHOD(void paint_arrow(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ ArrowType arrow_type,
+ bool fill,
+ int x,
+ int y,
+ int width,
+ int height) const, gtk_paint_arrow)
+
+ _WRAP_METHOD(void paint_box(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x,
+ int y,
+ int width,
+ int height) const, gtk_paint_box)
+
+ _WRAP_METHOD(void paint_box_gap(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x,
+ int y,
+ int width,
+ int height,
+ PositionType gap_side,
+ int gap_x,
+ int gap_width) const, gtk_paint_box_gap)
+
+ _WRAP_METHOD(void paint_check(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x,
+ int y,
+ int width,
+ int height) const, gtk_paint_check)
+
+ _WRAP_METHOD(void paint_diamond(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x,
+ int y,
+ int width,
+ int height) const, gtk_paint_diamond)
+
+ _WRAP_METHOD(void paint_extension(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x,
+ int y,
+ int width,
+ int height,
+ PositionType gap_side) const, gtk_paint_extension)
+
+ _WRAP_METHOD(void paint_flat_box(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x,
+ int y,
+ int width,
+ int height) const, gtk_paint_flat_box)
+
+ _WRAP_METHOD(void paint_focus(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x,
+ int y,
+ int width,
+ int height) const, gtk_paint_focus)
+
+ _WRAP_METHOD(void paint_handle(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x,
+ int y,
+ int width,
+ int height,
+ Orientation orientation) const, gtk_paint_handle)
+
+ _WRAP_METHOD(void paint_hline(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x1,
+ int x2,
+ int y) const, gtk_paint_hline)
+
+ _WRAP_METHOD(void paint_option(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x,
+ int y,
+ int width,
+ int height) const, gtk_paint_option)
+
+ _WRAP_METHOD(void paint_shadow(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x,
+ int y,
+ int width,
+ int height) const, gtk_paint_shadow)
+
+ _WRAP_METHOD(void paint_shadow_gap(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x,
+ int y,
+ int width,
+ int height,
+ PositionType gap_side,
+ int gap_x,
+ int gap_width) const, gtk_paint_shadow_gap)
+
+ _WRAP_METHOD(void paint_slider(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x,
+ int y,
+ int width,
+ int height,
+ Orientation orientation) const, gtk_paint_slider)
+
+ _WRAP_METHOD(void paint_tab(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x,
+ int y,
+ int width,
+ int height) const, gtk_paint_tab)
+
+
+ _WRAP_METHOD(void paint_vline(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int y1,
+ int y2,
+ int x) const, gtk_paint_vline)
+
+ _WRAP_METHOD(void paint_expander(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x,
+ int y,
+ ExpanderStyle expander_style) const, gtk_paint_expander)
+
+ _WRAP_METHOD(void paint_layout(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ bool use_text,
+ Widget& widget,
+ const Glib::ustring& detail,
+ int x,
+ int y,
+ const Glib::RefPtr<Pango::Layout>& layout) const, gtk_paint_layout)
+
+ _WRAP_METHOD(void paint_resize_grip(
+ const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ Widget& widget,
+ const Glib::ustring& detail,
+ Gdk::WindowEdge edge,
+ int x,
+ int y,
+ int width,
+ int height) const, gtk_paint_resize_grip)
+
+
+ _WRAP_METHOD(Glib::RefPtr<Style> copy(), gtk_style_copy, deprecated "Use the const version")
+ _WRAP_METHOD(Glib::RefPtr<Style> copy() const, gtk_style_copy)
+
+ _WRAP_METHOD(Glib::RefPtr<Style> attach(const Glib::RefPtr<Gdk::Window>& window), gtk_style_attach)
+ _WRAP_METHOD(void detach(), gtk_style_detach)
+
+ _WRAP_METHOD(void set_background(const Glib::RefPtr<Gdk::Window>& window, Gtk::StateType state_type), gtk_style_set_background)
+
+ _WRAP_METHOD(void apply_default_background(const Cairo::RefPtr<Cairo::Context>& cr,
+ const Glib::RefPtr<Gdk::Window>& window,
+ Gtk::StateType state_type,
+ int x, int y, int width, int height), gtk_style_apply_default_background)
+
+ _WRAP_METHOD_DOCS_ONLY(gtk_style_lookup_icon_set)
+ IconSet lookup_icon_set(const Gtk::StockID& stock_id);
+
+ _CONVERSION(`Gdk::Color&',`GdkColor*',`($3).gobj()')
+ _WRAP_METHOD(bool lookup_color(const Glib::ustring& color_name, Gdk::Color& color) const, gtk_style_lookup_color)
+
+
+ _WRAP_METHOD(Glib::RefPtr<Gdk::Pixbuf> render_icon(const IconSource& source,
+ Gtk::TextDirection direction, Gtk::StateType state, Gtk::IconSize size,
+ Gtk::Widget& widget, const Glib::ustring& detail), gtk_style_render_icon)
+
+ _IGNORE(gtk_style_get, gtk_style_get_valist)
+ _WRAP_METHOD(void get_style_property_value(GType widget_type, const Glib::ustring& property_name, Glib::ValueBase& value), gtk_style_get_style_property)
+
+ /** Queries the value of a style property corresponding to a
+ * widget class in the given style.
+ *
+ * @param widget_type the GType of a descendant of GtkWidget.
+ * @param property_name The name of the style property to get.
+ * @param value: An output parameter in which the value of the property being queried will be stored.
+ *
+ * @newin{2,16}
+ */
+ template <class PropertyType>
+ void get_style_property(GType widget_type, const Glib::ustring& property_name, PropertyType& value) const;
+
+
+protected:
+ _WRAP_VFUNC(void realize(), realize)
+ _WRAP_VFUNC(void unrealize(), unrealize)
+
+#m4 _CONVERSION(`GtkStyle*',`const Glib::RefPtr<Style>&',`Glib::wrap($3, true)')
+ _WRAP_VFUNC(void copy(const Glib::RefPtr<Style>& src), copy)
+
+#m4 _CONVERSION(`GtkStyle*', `Glib::RefPtr<Style>', `Glib::wrap($3, true)')
+ _WRAP_VFUNC(Glib::RefPtr<Style> clone(), clone)
+#m4 _CONVERSION(`GtkStyle*', `Glib::RefPtr<Style>', `Glib::wrap($3)')
+
+#m4 _CONVERSION(`GtkRcStyle*',`const Glib::RefPtr<RcStyle>&',`Glib::wrap($3, true)')
+ _WRAP_VFUNC(void init_from_rc(const Glib::RefPtr<RcStyle>& rc_style), init_from_rc)
+
+
+#m4 _CONVERSION(`GdkWindow*',`const Glib::RefPtr<Gdk::Window>&', `Glib::wrap(($3), true)')
+ _WRAP_VFUNC(void set_background(const Glib::RefPtr<Gdk::Window>& window, Gtk::StateType state_type), set_background)
+
+#m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
+ _WRAP_VFUNC(Glib::RefPtr<Gdk::Pixbuf> render_icon(const IconSource& source,
+ TextDirection direction,
+ Gtk::StateType state,
+ IconSize size,
+ Widget* widget,
+ const Glib::ustring& detail), render_icon)
+
+#m4 _CONVERSION(`cairo_t*',`const Cairo::RefPtr<Cairo::Context>&',`Cairo::RefPtr<Cairo::Context>(new Cairo::Context($3, false /* has_reference */))')
+ _WRAP_VFUNC(void draw_hline(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x1, int x2, int y), draw_hline)
+ _WRAP_VFUNC(void draw_vline(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int y1, int y2, int x), draw_vline)
+ _WRAP_VFUNC(void draw_shadow(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x, int y, int width, int height), draw_shadow)
+ _WRAP_VFUNC(void draw_arrow(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ Gtk::ArrowType arrow_type, bool fill,
+ int x, int y, int width, int height), draw_arrow)
+ _WRAP_VFUNC(void draw_diamond(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x, int y, int width, int height), draw_diamond)
+ _WRAP_VFUNC(void draw_box(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x, int y, int width, int height), draw_box)
+ _WRAP_VFUNC(void draw_flat_box(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x, int y, int width, int height), draw_flat_box)
+ _WRAP_VFUNC(void draw_check(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x, int y, int width, int height), draw_check)
+ _WRAP_VFUNC(void draw_option(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x, int y, int width, int height), draw_option)
+ _WRAP_VFUNC(void draw_tab(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x, int y, int width, int height), draw_tab)
+ _WRAP_VFUNC(void draw_shadow_gap(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x, int y, int width, int height,
+ Gtk::PositionType gap_side, int gap_x, int gap_width), draw_shadow_gap)
+ _WRAP_VFUNC(void draw_box_gap(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x, int y, int width, int height,
+ Gtk::PositionType gap_side, int gap_x, int gap_width), draw_box_gap)
+ _WRAP_VFUNC(void draw_extension(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x, int y, int width, int height,
+ PositionType gap_side), draw_extension)
+ _WRAP_VFUNC(void draw_focus(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x, int y, int width, int height), draw_focus)
+ _WRAP_VFUNC(void draw_slider(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x, int y, int width, int height,
+ Orientation orientation), draw_slider)
+ _WRAP_VFUNC(void draw_handle(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ ShadowType shadow_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x, int y, int width, int height,
+ Orientation orientation), draw_handle)
+ _WRAP_VFUNC(void draw_expander(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x, int y, ExpanderStyle expander_style), draw_expander)
+#m4 _CONVERSION(`PangoLayout*',`const Glib::RefPtr<Pango::Layout>&',Glib::wrap($3, true))
+ _WRAP_VFUNC(void draw_layout(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ bool use_text,
+ Widget* widget,
+ const Glib::ustring& detail,
+ int x, int y,
+ const Glib::RefPtr<Pango::Layout>& layout), draw_layout)
+ _WRAP_VFUNC(void draw_resize_grip(const Cairo::RefPtr<Cairo::Context>& cr,
+ Gtk::StateType state_type,
+ Widget* widget,
+ const Glib::ustring& detail,
+ Gdk::WindowEdge edge,
+ int x, int y, int width, int height), draw_resize_grip)
+
+ _WRAP_SIGNAL(void realize(), realize)
+ _WRAP_SIGNAL(void unrealize(), unrealize)
+};
+
+
+template <class PropertyType> inline
+void Style::get_style_property(GType widget_type, const Glib::ustring& property_name, PropertyType& value) const
+{
+ Glib::Value<PropertyType> property_value;
+ property_value.init(Glib::Value<PropertyType>::value_type());
+
+ //We cast away the const.
+ //TODO: Either this get_style_property() should be non-const,
+ //or get_style_property_value() should be const.
+ //We can't really have both const and unconst versions of them because output parameters can't be const.
+ //Bug https://bugzilla.gnome.org/show_bug.cgi?id=594171
+ Style* unconst_this = const_cast<Style*>(this);
+ unconst_this->get_style_property_value(widget_type, property_name, property_value);
+
+ value = property_value.get();
+}
+
+} // namespace Gtk
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]