Package pyAA :: Module AA
[show private | hide private]
[frames | no frames]

Module pyAA.AA

Classes that wrap IAccessible and the Windows event hook mechanisms.
Classes
AAbase Basic class that supports setting hooks and automatically removing hooks when the object dies.
AccessibleObject Represents the properties and actions of some user interface object.
Constants Holds all public pyAA constants without polluting the namespace.
WinEvent Holds information about an event.

Function Summary
  AccessibleObjectFromEvent(hwnd, obj_id, child_id)
Wrapper for the MSSA function to get an object given an event.
AccessibleObject AccessibleObjectFromPoint(point)
Wrapper for the MSAA function to get an object from a point on the display.
  AccessibleObjectFromWindow(hwnd, obj_id)
Wrapper for the MSSA function to get an object from a window handle.
  AddWinEventHook(callback, event, process_id, thread_id, hwnd, obj_id)
Add a hook to be invoked when an event matching the criteria occurs.
  DeleteWinEventHook(handle)
Disable a previously established hook.
  event_dispatch(event_handle, event_id, hwnd, obj_id, child_id, thread_id, event_time)
Dispatches events received from our C callback.

Variable Summary
dict ObjIdNames = {0: 'OBJID_WINDOW', -1: 'OBJID_SYSMENU', -1...
dict WinEventNames = {32768: 'EVENT_OBJECT_CREATE', 32769: 'E...

Function Details

AccessibleObjectFromEvent(hwnd, obj_id, child_id)

Wrapper for the MSSA function to get an object given an event.
Parameters:
hwnd - Window handle from which the event originated
           (type=integer)
obj_id - Type of object that caused the event
           (type=integer)
child_id - Child ID of the object causing the event
           (type=integer)

AccessibleObjectFromPoint(point)

Wrapper for the MSAA function to get an object from a point on the display. The object returned is the leaf object in the the MSAA tree (I think).
Parameters:
point - Point on the display
           (type=2-tuple of integer)
Returns:
Object containing the given point
           (type=AccessibleObject)

AccessibleObjectFromWindow(hwnd, obj_id)

Wrapper for the MSSA function to get an object from a window handle.
Parameters:
hwnd - Window handle
           (type=integer)
obj_id - Type of the object that caused the event
           (type=integer)

AddWinEventHook(callback, event=(1, 2147483647), process_id=0, thread_id=0, hwnd=None, obj_id=None)

Add a hook to be invoked when an event matching the criteria occurs.
Parameters:
callback - Object that is called when a target event occurs
           (type=function)
event - Number of an event or range of events
           (type=integer or 2-tuple of integer)
process_id - Restrict notifications to those coming from this process
           (type=integer)
thread_id - Restrict notifications to those coming from this thread
           (type=integer)
hwnd - Filter on the window handle
           (type=integer)
obj_id - Filter on object type
           (type=integer)

DeleteWinEventHook(handle)

Disable a previously established hook.
Parameters:
handle - Hook handle returned earlier
           (type=integer)

event_dispatch(event_handle, event_id, hwnd, obj_id, child_id, thread_id, event_time)

Dispatches events received from our C callback. The old version of this function used a number of locks to prevent more than one re-entrant call from handling any callbacks. That approach proved problematic for unknown reasons. This version forgoes using locks because 1) this function cannot be re-entered since the GIL is held when it is invoked by the C callback and 2) supposedly MSAA serializes all out-of-context callbacks anyways, which are the only kind we get.

Events are guaranteed to be delivered in order for a registered hook handle but no such guarantee is made on ordering across handles.

See the instance variables in the WinEvent class for a description of the parameters of this function.

Variable Details

ObjIdNames

Type:
dict
Value:
{-11: 'OBJID_SOUND',
 -10: 'OBJID_ALERT',
 -9: 'OBJID_CURSOR',
 -8: 'OBJID_CARET',
 -7: 'OBJID_SIZEGRIP',
 -6: 'OBJID_HSCROLL',
 -5: 'OBJID_VSCROLL',
 -4: 'OBJID_CLIENT',
...                                                                    

WinEventNames

Type:
dict
Value:
{1: 'EVENT_MIN',
 2: 'EVENT_SYSTEM_ALERT',
 3: 'EVENT_SYSTEM_FOREGROUND',
 4: 'EVENT_SYSTEM_MENUSTART',
 5: 'EVENT_SYSTEM_MENUEND',
 6: 'EVENT_SYSTEM_MENUPOPUPSTART',
 7: 'EVENT_SYSTEM_MENUPOPUPEND',
 8: 'EVENT_SYSTEM_CAPTURESTART',
...                                                                    

Generated by Epydoc 2.1 on Thu Mar 10 23:08:34 2005 http://epydoc.sf.net