| | |
- Char
- Context
- Line
- Word
- Zone
-
- TextZone
class Char |
| |
Represents a single char of an Accessibility_Text object. |
| |
Methods defined here:
- __init__(self, word, index, string, x, y, width, height)
- Creates a new char.
Arguments:
- word: the Word instance this belongs to
- index: the index of this char in the word
- string: the actual char
- x, y, width, height: the extents of this Char on the screen
|
class Context |
| |
Information regarding where a user happens to be exploring
right now. |
| |
Methods defined here:
- __init__(self, script)
- Create a new Context that will be used for handling flat
review mode.
- clickCurrent(self, button=1)
- Performs a mouse click on the current accessible.
- clip(self, ax, ay, awidth, aheight, bx, by, bwidth, bheight)
- Clips region 'a' by region 'b' and returns the new region as
a list: [x, y, width, height].
- clusterZonesByLine(self, zones)
- Given a list of interesting accessible objects (the Zones),
returns a list of lines in order from the top to bottom, where
each line is a list of accessible objects in order from left
to right.
- getCurrent(self, type=0)
- Gets the string, offset, and extent information for the
current locus of interest.
Arguments:
- type: one of ZONE, CHAR, WORD, LINE
Returns: [string, x, y, width, height]
- getCurrentAccessible(self)
- Returns the accessible associated with the current locus of
interest.
- getCurrentBrailleRegions(self)
- Gets the braille for the entire current line.
Returns [regions, regionWithFocus]
- getShowingDescendants(self, parent)
- Given a parent that manages its descendants, return a list of
Accessible children that are actually showing. This algorithm
was inspired a little by the srw_elements_from_accessible logic
in Gnopernicus, and makes the assumption that the children of
an object that manages its descendants are arranged in a row
and column format.
- getShowingZones(self, root)
- Returns a list of all interesting, non-intersecting, regions
that are drawn on the screen. Each element of the list is the
Accessible object associated with a given region. The term
'zone' here is inherited from OCR algorithms and techniques.
The Zones are returned in no particular order.
Arguments:
- root: the Accessible object to traverse
Returns: a list of Zones under the specified object
- getZonesFromAccessible(self, accessible, cliprect)
- Returns a list of Zones for the given accessible.
Arguments:
- accessible: the accessible
- cliprect: the extents that the Zones must fit inside.
- getZonesFromText(self, accessible, cliprect)
- Gets a list of Zones from an object that implements the
AccessibleText specialization.
Arguments:
- accessible: the accessible
- cliprect: the extents that the Zones must fit inside.
Returns a list of Zones.
- goAbove(self, type=3, wrap=3)
- Moves this context's locus of interest to first char
of the type that's closest to and above the current locus of
interest.
Arguments:
- type: LINE
- wrap: if True, will cross top/bottom boundaries; if False, will
stop on top/bottom boundaries.
Returns: [string, startOffset, endOffset, x, y, width, height]
- goBegin(self, type=4)
- Moves this context's locus of interest to the first char
of the first relevant zone.
Arguments:
- type: one of ZONE, LINE or WINDOW
Returns True if the locus of interest actually changed.
- goBelow(self, type=3, wrap=3)
- Moves this context's locus of interest to the first
char of the type that's closest to and below the current
locus of interest.
Arguments:
- type: one of WORD, LINE
- wrap: if True, will cross top/bottom boundaries; if False, will
stop on top/bottom boundaries.
Returns: [string, startOffset, endOffset, x, y, width, height]
- goEnd(self, type=4)
- Moves this context's locus of interest to the last char
of the last relevant zone.
Arguments:
- type: one of ZONE, LINE, or WINDOW
Returns True if the locus of interest actually changed.
- goNext(self, type=0, wrap=3, omitWhitespace=True)
- Moves this context's locus of interest to first char of
the next type.
Arguments:
- type: one of ZONE, CHAR, WORD, LINE
- wrap: if True, will cross boundaries, including top and
bottom; if False, will stop on boundaries.
- goPrevious(self, type=0, wrap=3, omitWhitespace=True)
- Moves this context's locus of interest to the first char
of the previous type.
Arguments:
- type: one of ZONE, CHAR, WORD, LINE
- wrap: if True, will cross boundaries, including top and
bottom; if False, will stop on boundaries.
Returns True if the locus of interest actually changed.
- setCurrent(self, lineIndex, zoneIndex, wordIndex, charIndex)
- Sets the current character of interest.
Arguments:
- lineIndex: index into lines
- zoneIndex: index into lines[lineIndex].zones
- wordIndex: index into lines[lineIndex].zones[zoneIndex].words
- charIndex: index lines[lineIndex].zones[zoneIndex].words[wordIndex].chars
- splitTextIntoZones(self, accessible, string, startOffset, cliprect)
- Traverses the string, splitting it up into separate zones if the
string contains the EMBEDDED_OBJECT_CHARACTER, which is used by apps
such as Firefox to handle containment of things such as links in
paragraphs.
Arguments:
- accessible: the accessible
- string: a substring from the accessible's text specialization
- startOffset: the starting character offset of the string
- cliprect: the extents that the Zones must fit inside.
Returns a list of Zones for the visible text or None if nothing is
visible.
- visible(self, ax, ay, awidth, aheight, bx, by, bwidth, bheight)
- Returns true if any portion of region 'a' is in region 'b'
Data and other attributes defined here:
- CHAR = 1
- LINE = 3
- WINDOW = 4
- WORD = 2
- WRAP_ALL = 3
- WRAP_LINE = 1
- WRAP_NONE = 0
- WRAP_TOP_BOTTOM = 2
- ZONE = 0
|
class Line |
| |
A Line is a single line across a window and is composed of Zones. |
| |
Methods defined here:
- __init__(self, index, zones)
- Creates a new Line, which is a horizontal region of text.
Arguments:
- index: the index of this Line in the window
- zones: the Zones that make up this line
- getBrailleRegions(self)
|
class TextZone(Zone) |
| |
Represents Accessibility_Text that is a portion of a single
horizontal line. |
| |
Methods defined here:
- __getattr__(self, attr)
- Used for lazily determining the words in a Zone. The words
will either be all whitespace (interword boundaries) or actual
words. To determine if a Word is whitespace, use
word.string.isspace()
Arguments:
- attr: a string indicating the attribute name to retrieve
Returns the value of the given attribute.
- __init__(self, accessible, startOffset, string, x, y, width, height)
- Creates a new Zone, which is a horizontal region of text.
Arguments:
- accessible: the Accessible associated with this Zone
- startOffset: the index of the char in the Accessibility_Text
interface where this Zone starts
- string: the string being displayed for this Zone
- extents: x, y, width, height in screen coordinates
Methods inherited from Zone:
- getWordAtOffset(self, charOffset)
- onSameLine(self, zone)
- Returns True if this Zone is on the same horiztonal line as
the given zone.
|
class Word |
| |
Represents a single word of an Accessibility_Text object, or
the entire name of an Image or Component if the associated object
does not implement the Accessibility_Text interface. As a rule of
thumb, all words derived from an Accessibility_Text interface will
start with the word and will end with all chars up to the
beginning of the next word. That is, whitespace and punctuation
will usually be tacked on to the end of words. |
| |
Methods defined here:
- __getattr__(self, attr)
- Used for lazily determining the chars of a word. We do
this to reduce the total number of round trip calls to the app,
and to also spread the round trip calls out over the lifetime
of a flat review context.
Arguments:
- attr: a string indicating the attribute name to retrieve
Returns the value of the given attribute.
- __init__(self, zone, index, startOffset, string, x, y, width, height)
- Creates a new Word.
Arguments:
- zone: the Zone instance this belongs to
- index: the index of this word in the Zone
- string: the actual string
- x, y, width, height: the extents of this Char on the screen
|
class Zone |
| |
Represents text that is a portion of a single horizontal line. |
| |
Methods defined here:
- __getattr__(self, attr)
- Used for lazily determining the words in a Zone.
Arguments:
- attr: a string indicating the attribute name to retrieve
Returns the value of the given attribute.
- __init__(self, accessible, string, x, y, width, height)
- Creates a new Zone, which is a horizontal region of text.
Arguments:
- accessible: the Accessible associated with this Zone
- string: the string being displayed for this Zone
- extents: x, y, width, height in screen coordinates
- getWordAtOffset(self, charOffset)
- onSameLine(self, zone)
- Returns True if this Zone is on the same horiztonal line as
the given zone.
| |