[pygobject] Readd Gdk.Rectangle override for Gtk-2.0



commit 85f4572b3ffbfa364ebb2e470eab759edc557b36
Author: Tomeu Vizoso <tomeu vizoso collabora co uk>
Date:   Tue Jul 27 21:32:41 2010 +0200

    Readd Gdk.Rectangle override for Gtk-2.0

 gi/overrides/Gdk.py |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/gi/overrides/Gdk.py b/gi/overrides/Gdk.py
index f6cc287..3a03132 100644
--- a/gi/overrides/Gdk.py
+++ b/gi/overrides/Gdk.py
@@ -43,6 +43,25 @@ class Color(Gdk.Color):
 Color = override(Color)
 __all__.append('Color')
 
+if Gdk.version == '2.0':
+    class Rectangle(Gdk.Rectangle):
+
+        def __init__(self, x, y, width, height):
+            Gdk.Rectangle.__init__(self)
+            self.x = x
+            self.y = y
+            self.width = width
+            self.height = height
+
+        def __new__(cls, *args, **kwargs):
+            return Gdk.Rectangle.__new__(cls)
+
+        def __repr__(self):
+            return '<Gdk.Rectangle(x=%d, y=%d, width=%d, height=%d)>' % (self.x, self.y, self.height, self.width)
+
+    Rectangle = override(Rectangle)
+    __all__.append('Rectangle')
+
 class Drawable(Gdk.Drawable):
     def cairo_create(self):
         return Gdk.cairo_create(self)



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