[pyatspi2] Reinstate getStates override



commit 48d6e5d0fbbee181400003dce6a7a461fd771616
Author: Mike Gorse <mgorse suse com>
Date:   Wed May 30 07:43:18 2012 -0500

    Reinstate getStates override
    
    It looks as though the getStates override is still needed after all,
    since pygobject seems to be assuming sizeof(8) for an enum. I need to look
    into this more when I have time, but adding the override back in until then.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677070

 pyatspi/state.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/pyatspi/state.py b/pyatspi/state.py
index 8f13355..6bfe79f 100644
--- a/pyatspi/state.py
+++ b/pyatspi/state.py
@@ -131,8 +131,16 @@ def stateset_init(self, *states):
 	GObject.GObject.__init__(self)
 	map(self.add, states)
 
+# TODO: Fix pygobject so that this isn't needed (BGO#646581 may be related)
+def StateSet_getStates(self):
+        ret = []
+        for i in range(0, 64):
+                if (self.states & (1 << i)):
+                        ret.append(Atspi.StateType(i))
+        return ret
+
 StateSet = Atspi.StateSet
-StateSet.getStates = StateSet.get_states
+StateSet.getStates = StateSet_getStates
 StateSet.isEmpty = StateSet.is_empty
 StateSet.raw = lambda x: x
 StateSet.unref = lambda x: None



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