Changeset 113
- Timestamp:
- 01/08/08 16:20:08
- Files:
-
- inapp/trunk/README (modified) (4 diffs)
- inapp/trunk/src/jambu/AccDecorator.py (modified) (2 diffs)
- inapp/trunk/src/jambu/ActionBrowser.py (modified) (6 diffs)
- inapp/trunk/src/jambu/ActionTree.py (modified) (7 diffs)
- inapp/trunk/src/jambu/HighLight.py (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
inapp/trunk/README
r112 r113 2 2 ==================== 3 3 4 Operate an application from switches by stepping through the UI.4 Operate an application from switches ot 2 keys by stepping through the UI. 5 5 6 This version works with GTK accessibile apps and has been tested with gedit and7 Minefield.6 This version works with GTK accessibile apps and has been tested with Minefield 7 and gedit. 8 8 9 9 Dependencies … … 23 23 3) python setup.py install (note run as root or sudo) 24 24 25 Source 26 ------ 27 Grab the latest from SVN at http://www.oatsoft.org/svn/jambu/inapp/trunk 28 25 29 Useage 26 30 ------ … … 31 35 Make sure gedit/minefield is already open and make it the active application 32 36 again to be safe. 37 38 Operation 39 --------- 40 Use 'next' gesture to move around items and 'action' to enter a group of items or 41 perform the action for an interactive item. 'next' iterates arround items in a 42 group and also the group itself to allow moving up and out of the group 43 (the highlight changes colour in this case) 33 44 34 45 Gestures … … 44 55 Known Bugs 45 56 ========== 57 If highlight disappears simple do a next gesture. The temporary use of simulated 58 mouse click for minefield menues and buttons requires that the highlight be hidden. 46 59 Need to sort multi column selections + scrolling in selections. 47 The blinking rect is temporary so just ignore the artifacts that get left around.60 Document only works with visible items, need scrolling to hidden items. 48 61 49 62 Web site inapp/trunk/src/jambu/AccDecorator.py
r108 r113 44 44 return req_states.issubset(act_states) 45 45 46 def getStates(self , *states):46 def getStates(self): 47 47 return self._acc.getState().getStates() 48 48 … … 50 50 act_states = set(self._acc.getState().getStates()) 51 51 req_states = set(states) 52 return len(req_states.intersection(act_states) <> 0)52 return len(req_states.intersection(act_states)) <> 0 53 53 54 54 def hasInterface(self, iface): inapp/trunk/src/jambu/ActionBrowser.py
r111 r113 16 16 from ActionTree import ActionTree 17 17 from Blinker import Blinker 18 from HighLight import ActionHighLight, ExitGroupHighLight 18 19 import MessageTransport 19 20 … … 21 22 22 23 ACTION_KEY_DOWN, ACTION_SWITCH_DOWN, ACTION_MOUSE_CLICK = xrange(3) 24 HIGHLIGHT_ACTION, HIGHLIGHT_EXIT = xrange(2) 23 25 24 26 _mt = MessageTransport.MessageTransport() … … 56 58 self._show_tree_view = kwargs['show_tree'] 57 59 self._scan = kwargs['scan'] 60 # transparent background if pos 61 win = self.get_toplevel() 62 self._onScreenChanged(self) 63 self.connect('screen-changed', self._onScreenChanged) 58 64 self.init() 59 65 self._onGenerate(None) 66 self.set_keep_above(True) 60 67 61 68 def init(self): … … 65 72 self._buildUI() 66 73 self.bl = None 74 self.hl = None 67 75 self.show_all() 68 76 if not getattr(self, '_show_tree_view', True): … … 84 92 vbox.pack_start(top_hbox) 85 93 vbox.pack_start(bottom_hbox, False) 86 self.groups_tree = ActionTree( )94 self.groups_tree = ActionTree(self.killHighlight) 87 95 88 96 self.groups_tree.connect('row-activated', self._onRowActivated) … … 167 175 if extents: 168 176 expanded = self.groups_tree.row_expanded(self.groups_tree.get_selected_path(selection)) 169 size = (1 if expanded else 3)170 self. blink(extents, size)177 hl = (HIGHLIGHT_EXIT if expanded else HIGHLIGHT_ACTION) 178 self.highlight(extents, hl) 171 179 172 def blink(self, extents, thickness): 173 if self.bl: 174 self.bl.stop() 175 del self.bl 176 self.bl = None 177 self.bl = Blinker(extents, thickness) 178 self.bl.start() 180 def killHighlight(self): 181 if self.hl: 182 self.hl.close() 183 del self.hl 184 self.hl = None 185 186 def highlight(self, extents, type): 187 if self.supports_alpha: 188 self.killHighlight() 189 hl_factory = (ExitGroupHighLight if type==HIGHLIGHT_EXIT else ActionHighLight) 190 self.hl = hl_factory(extents.x, extents.y, extents.width, extents.height) 191 else: 192 if self.bl: 193 self.bl.stop() 194 del self.bl 195 self.bl = None 196 self.bl = Blinker(extents, 5) 197 self.bl.start() 198 199 def _onScreenChanged(self, widget, old_screen=None): 200 screen = self.get_screen() 201 colormap = screen.get_rgba_colormap() 202 win = self.get_toplevel() 203 self.supports_alpha = colormap is not None and win.is_composited() 179 204 180 205 def _onKeyDown(self, event): inapp/trunk/src/jambu/ActionTree.py
r112 r113 24 24 EVENTS = ('object', 'window', 'focus') 25 25 26 def __init__(self ):26 def __init__(self, killHighlight): 27 27 gtk.TreeView.__init__(self) 28 28 self.connect('row-expanded', self._onExpanded) … … 46 46 #self.set_property('fixed-height-mode', True) # speed display 47 47 48 # temp hack while we needt ogenerate CLicks for minefield 49 # Highlight is a window and so intercepts mous events 50 self.killHighlight = killHighlight 51 48 52 def _onCollapsed(self, treeview, iter, path): 49 53 model = self.get_model() … … 211 215 self.adding_children = True 212 216 PrintMessage(s).send() 213 self.id = gobject.timeout_add( 500, self._onChildAddTimeout)217 self.id = gobject.timeout_add(300, self._onChildAddTimeout) 214 218 return 215 219 … … 238 242 239 243 elif event.source.getRole() == pyatspi.ROLE_WINDOW: 240 if event.type in ('object:state-changed:iconified'): 244 if event.type in ('object:state-changed:iconified') and \ 245 not source_acc.hasStates(pyatspi.STATE_VISIBLE, pyatspi.STATE_SHOWING): 241 246 PrintMessage(s).send() 242 247 HideMenuMessage().send() … … 340 345 # assume is location list 341 346 print 'gk: pt button action' 342 acc.generateClick()347 self.generateClick(acc) 343 348 344 349 elif acc.hasToolkitIn('Gecko') and \ 345 350 acc.hasRoleIn(pyatspi.ROLE_MENU, pyatspi.ROLE_MENU_ITEM): 346 351 print 'gk: click' 347 acc.generateClick()352 self.generateClick(acc) 348 353 349 354 elif acc.isSelectable(): … … 371 376 if acc.hasToolkitIn('Gecko'): 372 377 print 'click' 373 acc.generateClick()378 self.generateClick(acc) 374 379 else: 375 380 print 'action' … … 401 406 self.expand_row(path, False) 402 407 self.next() # select 1st item 403 408 409 def generateClick(self, acc): 410 self.killHighlight() 411 gobject.timeout_add(100, self._onKillHighlightTimeout, acc) 412 413 def _onKillHighlightTimeout(self, acc): 414 acc.grabFocus() 415 acc.generateClick() 416 return False 417 404 418 def goToPath(self, path): 405 419 if len(path) > 1:
