[gtkmm] Adapt to the GdkWindowObject -> GdkWindow change in GTK+ 3.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Adapt to the GdkWindowObject -> GdkWindow change in GTK+ 3.
- Date: Sun, 5 Dec 2010 09:47:25 +0000 (UTC)
commit 0bb96e3a3adf0546fa134270aa940d9597fa9c60
Author: Murray Cumming <murrayc murrayc com>
Date: Sun Dec 5 10:45:02 2010 +0100
Adapt to the GdkWindowObject -> GdkWindow change in GTK+ 3.
* gdk/src/window.hg: Remove the extra parameter to _CLASS_GOBJECT(). Maybe
we can now remove that option from gmmproc.
* gdk/src/display.ccg:
* gdk/src/dragcontext.ccg:
* gtk/src/style.hg: Remove casts to GdkWindowObject*.
* tools/m4/convert_gdk.m4: Change the conversions.
This is much nicer.
ChangeLog | 12 ++++++++++++
gdk/src/display.ccg | 6 +++---
gdk/src/dragcontext.ccg | 2 +-
gdk/src/window.hg | 3 +--
gtk/src/style.hg | 2 +-
tools/m4/convert_gdk.m4 | 8 ++++----
6 files changed, 22 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index bea0d5a..80b4186 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-05 Murray Cumming <murrayc murrayc com>
+
+ Adapt to the GdkWindowObject -> GdkWindow change in GTK+ 3.
+
+ * gdk/src/window.hg: Remove the extra parameter to _CLASS_GOBJECT(). Maybe
+ we can now remove that option from gmmproc.
+ * gdk/src/display.ccg:
+ * gdk/src/dragcontext.ccg:
+ * gtk/src/style.hg: Remove casts to GdkWindowObject*.
+ * tools/m4/convert_gdk.m4: Change the conversions.
+ This is much nicer.
+
2010-12-03 Murray Cumming <murrayc murrayc com>
Add Window methods to preserve API from Drawable.
diff --git a/gdk/src/display.ccg b/gdk/src/display.ccg
index 1513807..03cc8b2 100644
--- a/gdk/src/display.ccg
+++ b/gdk/src/display.ccg
@@ -33,7 +33,7 @@ bool Display::set_selection_owner(const Glib::RefPtr<Window>& owner, Glib::ustri
Glib::RefPtr<Window> Display::get_selection_owner(const Glib::ustring& selection)
{
- return Glib::wrap( (GdkWindowObject*)gdk_selection_owner_get_for_display(gobj(), Gdk::AtomString::to_c_type(selection)) , true);
+ return Glib::wrap(gdk_selection_owner_get_for_display(gobj(), Gdk::AtomString::to_c_type(selection)) , true);
}
void Display::selection_send_notify(GdkNativeWindow requestor, Glib::ustring& selection, Glib::ustring& target, Glib::ustring& property, guint32 time_)
@@ -77,7 +77,7 @@ void Display::get_pointer(int& x, int& y, ModifierType& mask)
Glib::RefPtr<Window> Display::get_window_at_pointer()
{
- Glib::RefPtr<Window> retvalue = Glib::wrap((GdkWindowObject*)(gdk_display_get_window_at_pointer(gobj(), 0, 0)));
+ Glib::RefPtr<Window> retvalue = Glib::wrap(gdk_display_get_window_at_pointer(gobj(), 0, 0));
if(retvalue)
retvalue->reference(); //The function does not do a ref for us.
@@ -87,7 +87,7 @@ Glib::RefPtr<Window> Display::get_window_at_pointer()
Glib::RefPtr<const Window> Display::get_window_at_pointer() const
{
- Glib::RefPtr<const Window> retvalue = Glib::wrap((GdkWindowObject*)(gdk_display_get_window_at_pointer(const_cast<GdkDisplay*>(gobj()), 0, 0)));
+ Glib::RefPtr<const Window> retvalue = Glib::wrap(gdk_display_get_window_at_pointer(const_cast<GdkDisplay*>(gobj()), 0, 0));
if(retvalue)
retvalue->reference(); //The function does not do a ref for us.
diff --git a/gdk/src/dragcontext.ccg b/gdk/src/dragcontext.ccg
index 2c1e33c..cf5ce05 100644
--- a/gdk/src/dragcontext.ccg
+++ b/gdk/src/dragcontext.ccg
@@ -32,7 +32,7 @@ void DragContext::find_window_for_screen(const Glib::RefPtr<Window>& drag_window
{
GdkWindow* cWindow = 0;
gdk_drag_find_window_for_screen(const_cast<GdkDragContext*>(gobj()), drag_window->gobj(), screen->gobj(), x_root, y_root, &cWindow, (GdkDragProtocol*)(protocol));
- dest_window = Glib::wrap((GdkWindowObject*)cWindow);
+ dest_window = Glib::wrap(cWindow);
}
void DragContext::drag_refuse(guint32 time)
diff --git a/gdk/src/window.hg b/gdk/src/window.hg
index 4571c39..26053ed 100644
--- a/gdk/src/window.hg
+++ b/gdk/src/window.hg
@@ -56,8 +56,7 @@ class Pixbuf;
*/
class Window : public Glib::Object
{
- // GdkWindow is a typedef to GdkDrawable, but it's actually a GdkWindowObject.
- _CLASS_GOBJECT(Window, GdkWindow, GDK_WINDOW, Glib::Object, GObject, GdkWindowObject)
+ _CLASS_GOBJECT(Window, GdkWindow, GDK_WINDOW, Glib::Object, GObject)
_STRUCT_NOT_HIDDEN
_IGNORE(gdk_window_set_hints, gdk_window_destroy, gdk_window_new, gdk_window_get_deskrelative_origin)
_IGNORE(gdk_window_destroy_notify, gdk_window_is_destroyed)
diff --git a/gtk/src/style.hg b/gtk/src/style.hg
index 05634e7..239515d 100644
--- a/gtk/src/style.hg
+++ b/gtk/src/style.hg
@@ -370,7 +370,7 @@ protected:
_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((GdkWindowObject*)($3), true)')
+#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)
diff --git a/tools/m4/convert_gdk.m4 b/tools/m4/convert_gdk.m4
index 1b326c3..ec08016 100644
--- a/tools/m4/convert_gdk.m4
+++ b/tools/m4/convert_gdk.m4
@@ -182,10 +182,10 @@ _CONVERSION(`const Glib::RefPtr<const GC>&', `GdkGC*',__CONVERT_CONST_REFPTR_TO_
#_CONVERSION(`const Glib::RefPtr<const Display>&', `GdkDrawable*',__CONVERT_CONST_REFPTR_TO_P_SUN(Drawable))
-_CONVERSION(`GdkWindow*',`Glib::RefPtr<Window>', `Glib::wrap((GdkWindowObject*)($3))')
-_CONVERSION(`GdkWindow*',`Glib::RefPtr<const Window>', `Glib::wrap((GdkWindowObject*)($3))')
-_CONVERSION(`GdkWindow*',`Glib::RefPtr<Gdk::Window>', `Glib::wrap((GdkWindowObject*)($3))')
-_CONVERSION(`GdkWindow*',`Glib::RefPtr<const Gdk::Window>', `Glib::wrap((GdkWindowObject*)($3))')
+_CONVERSION(`GdkWindow*',`Glib::RefPtr<Window>', `Glib::wrap($3)')
+_CONVERSION(`GdkWindow*',`Glib::RefPtr<const Window>', `Glib::wrap($3)')
+_CONVERSION(`GdkWindow*',`Glib::RefPtr<Gdk::Window>', `Glib::wrap($3)')
+_CONVERSION(`GdkWindow*',`Glib::RefPtr<const Gdk::Window>', `Glib::wrap($3)')
_CONVERSION(`GdkPixmap*',`Glib::RefPtr<Pixmap>', `Glib::wrap((GdkPixmapObject*)($3))')
_CONVERSION(`GdkPixmap*',`Glib::RefPtr<const Pixmap>', `Glib::wrap((GdkPixmapObject*)($3))')
_CONVERSION(`GdkPixmap*',`Glib::RefPtr<const Gdk::Pixmap>', `Glib::wrap((GdkPixmapObject*)($3))')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]