[pyatspi2] Move BoundingBox to utils.py
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pyatspi2] Move BoundingBox to utils.py
- Date: Fri, 6 Jul 2012 22:11:22 +0000 (UTC)
commit 13d7be43bc990bf743fe47a5ab5ec1f3b9a33e50
Author: Mike Gorse <mgorse suse com>
Date: Fri Jul 6 17:15:38 2012 -0500
Move BoundingBox to utils.py
pyatspi/Accessibility.py | 30 ------------------------------
pyatspi/utils.py | 30 ++++++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 30 deletions(-)
---
diff --git a/pyatspi/Accessibility.py b/pyatspi/Accessibility.py
index b45152c..f48f2b6 100644
--- a/pyatspi/Accessibility.py
+++ b/pyatspi/Accessibility.py
@@ -59,36 +59,6 @@ def pointToList(point):
return (point.x, point.y)
# TODO: Figure out how to override Atspi.Rect constructor and remove this class
-class BoundingBox(list):
- def __new__(cls, x, y, width, height):
- return list.__new__(cls, (x, y, width, height))
- def __init__(self, x, y, width, height):
- list.__init__(self, (x, y, width, height))
-
- def __str__(self):
- return ("(%d, %d, %d, %d)" % (self.x, self.y, self.width, self.height))
-
- def _get_x(self):
- return self[0]
- def _set_x(self, val):
- self[0] = val
- x = property(fget=_get_x, fset=_set_x)
- def _get_y(self):
- return self[1]
- def _set_y(self, val):
- self[1] = val
- y = property(fget=_get_y, fset=_set_y)
- def _get_width(self):
- return self[2]
- def _set_width(self, val):
- self[2] = val
- width = property(fget=_get_width, fset=_set_width)
- def _get_height(self):
- return self[3]
- def _set_height(self, val):
- self[3] = val
- height = property(fget=_get_height, fset=_set_height)
-
def getInterface(func, obj):
ret = func(obj)
if ret:
diff --git a/pyatspi/utils.py b/pyatspi/utils.py
index bd243c6..d6d7904 100644
--- a/pyatspi/utils.py
+++ b/pyatspi/utils.py
@@ -345,5 +345,35 @@ def attributeListToHash(list):
def hashToAttributeList(h):
return [x + ":" + h[x] for x in h.keys()]
+class BoundingBox(list):
+ def __new__(cls, x, y, width, height):
+ return list.__new__(cls, (x, y, width, height))
+ def __init__(self, x, y, width, height):
+ list.__init__(self, (x, y, width, height))
+
+ def __str__(self):
+ return ("(%d, %d, %d, %d)" % (self.x, self.y, self.width, self.height))
+
+ def _get_x(self):
+ return self[0]
+ def _set_x(self, val):
+ self[0] = val
+ x = property(fget=_get_x, fset=_set_x)
+ def _get_y(self):
+ return self[1]
+ def _set_y(self, val):
+ self[1] = val
+ y = property(fget=_get_y, fset=_set_y)
+ def _get_width(self):
+ return self[2]
+ def _set_width(self, val):
+ self[2] = val
+ width = property(fget=_get_width, fset=_set_width)
+ def _get_height(self):
+ return self[3]
+ def _set_height(self, val):
+ self[3] = val
+ height = property(fget=_get_height, fset=_set_height)
+
def getBoundingBox(rect):
return BoundingBox (rect.x, rect.y, rect.width, rect.height)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]