[gtkmm] Add Window methods to preserve API from Drawable.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Add Window methods to preserve API from Drawable.
- Date: Fri, 3 Dec 2010 15:17:06 +0000 (UTC)
commit a48f6df651e815be5a5225653ff4ac535aff5f01
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Dec 3 16:16:42 2010 +0100
Add Window methods to preserve API from Drawable.
* gdk/src/window.hg: Aded set_background(RGBA) and renamed
set_background_pattern() to set_background(Pattern).
Added set_clip_region() and get_visible_region() and create_cairo_context(),
which were previously in Drawable.
* tools/m4/convert_gdk.m4: Added a conversion.
ChangeLog | 10 ++++++++++
gdk/src/window.hg | 18 ++++++++++++++++--
tools/m4/convert_gdk.m4 | 2 ++
3 files changed, 28 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c605685..bea0d5a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2010-12-03 Murray Cumming <murrayc murrayc com>
+ Add Window methods to preserve API from Drawable.
+
+ * gdk/src/window.hg: Aded set_background(RGBA) and renamed
+ set_background_pattern() to set_background(Pattern).
+ Added set_clip_region() and get_visible_region() and create_cairo_context(),
+ which were previously in Drawable.
+ * tools/m4/convert_gdk.m4: Added a conversion.
+
+2010-12-03 Murray Cumming <murrayc murrayc com>
+
gtk-demo: Fix the build for the append_text() to append() change.
* demos/gtk-demo/example_sizegroup.cc:
diff --git a/gdk/src/window.hg b/gdk/src/window.hg
index 32def1e..4571c39 100644
--- a/gdk/src/window.hg
+++ b/gdk/src/window.hg
@@ -23,6 +23,8 @@ _CONFIGINCLUDE(gdkmmconfig.h)
#include <cairomm/region.h>
#include <cairomm/pattern.h>
#include <gdkmm/visual.h>
+#include <gdkmm/rgba.h>
+#include <cairomm/context.h>
#include <gdk/gdk.h>
_DEFS(gdkmm,gdk)
@@ -148,9 +150,10 @@ public:
_WRAP_METHOD(void set_startup_id(const Glib::ustring& startup_id), gdk_window_set_startup_id)
_WRAP_METHOD(void set_transient_for(const Glib::RefPtr<Window>& parent), gdk_window_set_transient_for)
_WRAP_METHOD(void set_background(const Color& color), gdk_window_set_background)
-
+ _WRAP_METHOD(void set_background(const RGBA& color), gdk_window_set_background_rgba)
+
#m4 _CONVERSION(`const Cairo::RefPtr<Cairo::Pattern>&',`cairo_pattern_t*',`($3)->cobj()')
- _WRAP_METHOD(void set_background_pattern(const Cairo::RefPtr<Cairo::Pattern>& pattern), gdk_window_set_background_pattern)
+ _WRAP_METHOD(void set_background(const Cairo::RefPtr<Cairo::Pattern>& pattern), gdk_window_set_background_pattern)
#m4 _CONVERSION(`cairo_pattern_t*',`Cairo::RefPtr<Cairo::Pattern>',`Cairo::RefPtr<Cairo::Pattern>(new Cairo::Pattern($3, false /* take reference */))')
_WRAP_METHOD(Cairo::RefPtr<Cairo::Pattern> get_background_pattern(), gdk_window_get_background_pattern)
@@ -340,6 +343,17 @@ public:
_WRAP_METHOD(void set_support_multidevice(bool support_multidevice = true), gdk_window_set_support_multidevice)
_WRAP_METHOD(bool get_support_multidevice(), gdk_window_get_support_multidevice)
+ #m4 _CONVERSION(`cairo_region_t*',`Cairo::RefPtr<Cairo::Region>',`Cairo::RefPtr<Cairo::Region>(new Cairo::Region($3, true /* do not take ref */))')
+
+ //This is const because it returns a copy (though that is not very clear from the C documentation)
+ _WRAP_METHOD(Cairo::RefPtr<Cairo::Region> get_clip_region() const, gdk_window_get_clip_region)
+
+ //This is const because it returns a copy (though that is not very clear from the C documentation)
+ _WRAP_METHOD(Cairo::RefPtr<Cairo::Region> get_visible_region() const, gdk_window_get_visible_region)
+
+ #m4 _CONVERSION(`cairo_t*',`Cairo::RefPtr<Cairo::Context>',`Cairo::RefPtr<Cairo::Context>(new Cairo::Context($3, true /* has_reference */))')
+ _WRAP_METHOD(Cairo::RefPtr<Cairo::Context> create_cairo_context(), gdk_cairo_create)
+
//TODO: Wrap these? Find out when they are emitted and if they are useful outside of GTK+, and improve the C docs.
//_WRAP_SIGNAL(Glib::RefPtr<Gdk::Window> pick_embedded_child(double x, double y), pick-embedded-child, no_default_handler)
//_WRAP_SIGNAL(Glib::RefPtr<Gdk::Window> to_embedder(double offscreen_x, double offscreen_y, double& embedder_x, double& embedder_y), to-embedder, no_default_handler)
diff --git a/tools/m4/convert_gdk.m4 b/tools/m4/convert_gdk.m4
index 88d8705..1b326c3 100644
--- a/tools/m4/convert_gdk.m4
+++ b/tools/m4/convert_gdk.m4
@@ -91,6 +91,8 @@ _CONVERSION(`GdkColor',`Gdk::Color', `Gdk::Color(const_cast<GdkColor*>(&($3)), t
# Ref (gdkmm) -> Ptr (gtk+)
_CONVERSION(`Color&',`GdkColor*',($3).gobj())
_CONVERSION(`const Gdk::Color&',`const GdkColor*',`($3).gobj()')
+_CONVERSION(`const RGBA&',`const GdkRGBA*',`($3).gobj()')
+_CONVERSION(`const RGBA&',`GdkRGBA*',`const_cast<RGBA&>($3).gobj()')
_CONVERSION(`const Gdk::RGBA&',`const GdkRGBA*',`($3).gobj()')
_CONVERSION(`const Color&',`const GdkColor*',`($3).gobj()')
_CONVERSION(`const Cursor&',`GdkCursor*',const_cast<GdkCursor*>(($3).gobj()))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]