403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python2.6/site-packages/orca/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/site-packages/orca/braille.pyc
z#Jc@sdZdZdZdZdZdZddkZeidZddk	Z	ddk
Z
ddkZeiyddk
Z
Wnej
o
dZ
nXy(ddkZdaeZead	aWneZeanXyddkZWnnXddkZddkZddkZddkZdd
klZddklZda gZ!eo"ei"ei#ei$ei%gZ!nhZ&eoede&ei"<ed
e&ei#<ede&ei$<ede&ei%<ede&ei'<ede&ei(<ede&ei)<ede&ei*<ede&ei+<ede&ei,<ede&ei-<ede&ei.<ndZ/e/dga0ga1da2da3d	d	ga4da5ea6ea7d	a8d	a9da:hedd6edd6edd6ed d!6ed"d#6ed$d%6ed&d'6ed(d)6ed*d+6ed,d-6ed.d/6ed0d16ed2d36ed4d56ed6d76ed8d96ed:d;6ed<d=6ed>d?6ed@dA6edBdC6edDdE6edFdG6edHdI6edJdK6edLdM6edNdO6edPdQ6edRdS6Z;dTZ<dUZ=e
o
e=Z>ndVZ?dWddXYZ@dYe@fdZYZAd[eAfd\YZBd]e@fd^YZCd_eAfd`YZDdae@fdbYZEdcdddYZFdeZGdfZHdgZIdhZJdiZKdjZLeedkZMdlZNed	eedmZOdnZPedoZQdpZRdqZSd	drZTdd	dsZUd	dtZVd	duZWdvZXddwZYdxZZdyZ[dzZ\d{Z]d|Z^dd}d~Z_dZ`dS(sA very experimental approach to the refreshable Braille display.  This
module treats each line of the display as a sequential set of regions, where
each region can potentially backed by an Accessible object.  Depending upon
the Accessible object, the cursor routing keys can be used to perform
operations on the Accessible object, such as invoking default actions or
moving the text caret.
s$Id$s
$Revision$s$Date$s-Copyright (c) 2005-2009 Sun Microsystems Inc.tLGPLiNtbraillei(t	tablesdir(t_s	Line Lefts
Line RightsLine Ups	Line DowntFreezesTop LeftsBottom RightsCursor PositionsSix DotssCursor Routings	Cut BeginsCut Linei is
Czech Grade 1sCz-Cz-g1sSpanish Grade 1sEs-Es-g1sCanada French Grade 2sFr-Ca-g2sFrance French Grade 2sFr-Fr-g2sLatvian Grade 1sLv-Lv-g1sNetherlands Dutch Grade 1sNl-Nl-g1sNorwegian Grade 0sNo-No-g0sNorwegian Grade 1sNo-No-g1sNorwegian Grade 2sNo-No-g2sNorwegian Grade 3sNo-No-g3sPolish Grade 1sPl-Pl-g1sPortuguese Grade 1sPt-Pt-g1sSwedish Grade 1sSe-Se-g1sArabic Grade 1sar-ar-g1s
Welsh Grade 1scy-cy-g1s
Welsh Grade 2scy-cy-g2sGerman Grade 0sde-de-g0sGerman Grade 1sde-de-g1sGerman Grade 2sde-de-g2sU.K. English Grade 2sen-GB-g2sU.K. English Grade 1sen-gb-g1sU.S. English Grade 1sen-us-g1sU.S. English Grade 2sen-us-g2sCanada French Grade 1sfr-ca-g1sFrance French Grade 1sfr-fr-g1s
Greek Grade 1sgr-gr-g1s
Hindi Grade 1shi-in-g1sItalian Grade 1sit-it-g1sBelgium Dutch Grade 1snl-be-g1cCsh}ybx[titD]J}|ddjo3|d }tiit||ti||<qqWWntj
onX|S(Nis.utbs.ctb(s.utbs.ctb(tostlistdirRtpathtjointTABLE_NAMEStgettOSError(ttablestfnametalias((s0/usr/lib/python2.6/site-packages/orca/braille.pyt
listTabless
1cCsqyWxPtitD]?}|ddjo(|idotiit|SqqWWntj
onXdS(Nis.utbs.ctbsen-ust(s.utbs.ctb(RRRt
startswithRRR(R
((s0/usr/lib/python2.6/site-packages/orca/braille.pytgetDefaultTables cCsti|dt|dS(sPrints out a Braille event.  The given level may be overridden
    if the eventDebugLevel (see debug.setEventDebugLevel) is greater in
    debug.py.

    Arguments:
    - command: the BrlAPI command for the key that was pressed.
    sBRAILLE EVENT: %sN(tdebugtprintInputEventtrepr(tleveltcommand((s0/usr/lib/python2.6/site-packages/orca/braille.pyt_printBrailleEvent*s	tRegioncBsweZdZdedZdZdZedZdZ	dedZ
dZd	Zd
Z
dZRS(spA Braille region to be displayed on the display.  The width of
    each region is determined by its string.
    icCs|p
d}ntio
tdj	|_||_|idid|_|ioGti	pt
|_|i|i||\|_
|_|_|_n|i|_
||_dS(sCreates a new Region containing the given string.

        Arguments:
        - string: the string to be displayed
        - cursorOffset: a 0-based index saying where to draw the cursor
                        for this Region if it gets focus.
        RsUTF-8s
N(tsettingstenableContractedBrailletlouistNonet
contractedtexpandOnCursortdecodetstriptrawLinetbrailleContractionTablet_defaultContractionTabletcontractionTabletcontractLinetstringtinPostoutPostcursorOffset(tselfR'R*R((s0/usr/lib/python2.6/site-packages/orca/braille.pyt__init__<s	

	

	(cCsd|i|ifS(NsRegion: '%s', %d(R'R*(R+((s0/usr/lib/python2.6/site-packages/orca/braille.pyt__str__]scCsdS(sProcesses a cursor routing key press on this Component.  The offset
        is 0-based, where 0 represents the leftmost character of string
        associated with this region.  Note that the zeroeth character may have
        been scrolled off the display.N((R+toffset((s0/usr/lib/python2.6/site-packages/orca/braille.pytprocessRoutingKey`scCs=t|id|iid}dg|}di|S(sCreates a string which can be used as the attrOr field of brltty's
        write structure for the purpose of indicating text attributes, links,
        and selection.

        Arguments:
        - getLinkMask: Whether or not we should take the time to get
          the attributeMask for links. Reasons we might not want to
          include knowning that we will fail and/or it taking an
          unreasonable amount of time (AKA Gecko).
        iu…tR(tlenR'tcountR(R+tgetLinkMasktmaskSizetmask((s0/usr/lib/python2.6/site-packages/orca/braille.pytgetAttributeMaskgs#
cCsH|io:|i|i|i|i\|_|_|_|_ndS(s:Reposition the cursor offset for contracted mode.
        N(RR&R"R*RR'R(R)(R+((s0/usr/lib/python2.6/site-packages/orca/braille.pytrepositionCursor|s
c

Csy||dj}Wntj
o
t}nX|p|o
d}n
ti}ti|ig|d|d|\}}}}	t|	t|}	||||	fS(s*Contract the given line. Returns the contracted line, and the
        cursor position in the contracted line.

        Arguments:
        - line: Line to contract.
        - cursorOffset: Offset of cursor,defaults to 0.
        - expandOnCursor: Expand word under cursor, False by default.
        t it	cursorPostmode(t
IndexErrortFalseRtcompbrlAtCursort	translateR%tminR1(
R+tlineR*Rt
cursorOnSpaceR:RR(R)R9((s0/usr/lib/python2.6/site-packages/orca/braille.pyR&s

	cCsRy|i|}Wn:tj
ot|i}ntj
o
|}nX|S(N(R(R;R1R"tAttributeError(R+tdisplay_offsetR.((s0/usr/lib/python2.6/site-packages/orca/braille.pytdisplayToBufferOffsetscCs6|o!tipt|_|in|idS(N(RR#R$R%tcontractRegiontexpandRegion(R+R((s0/usr/lib/python2.6/site-packages/orca/braille.pytsetContractedBrailles

	cCsR|iodS|i|i|i|i\|_|_|_|_t|_dS(N(	RR&R"R*RR'R(R)tTrue(R+((s0/usr/lib/python2.6/site-packages/orca/braille.pyREs
$cCsg|ipdS|i|_y|i|i|_Wn%tj
ot|i|_nXt|_dS(N(RR"R'R(R*R;R1R<(R+((s0/usr/lib/python2.6/site-packages/orca/braille.pyRFs
(t__name__t
__module__t__doc__R<R,R-R/RHR6R7R&RDRGRERF(((s0/usr/lib/python2.6/site-packages/orca/braille.pyR7s!				 				t	ComponentcBs;eZdZddedZdZdZdZRS(sA subclass of Region backed by an accessible.  This Region will react
    to any cursor routing key events and perform the default action on the
    accessible, if a default action exists.
    iRcCsYti|||||o/|io|d|i|_qL||_n||_dS(sCreates a new Component.

        Arguments:
        - accessible: the accessible
        - string: the string to use to represent the component
        - cursorOffset: a 0-based index saying where to draw the cursor
                        for this Region if it gets focus.
        R8N(RR,R't
accessible(R+RMR'R*t	indicatorR((s0/usr/lib/python2.6/site-packages/orca/braille.pyR,s

cCsd|i|ifS(NsComponent: '%s', %d(R'R*(R+((s0/usr/lib/python2.6/site-packages/orca/braille.pyR-scCsdS(sReturns the caret position of the given offset if the object
        has text with a caret.  Otherwise, returns -1.

        Arguments:
        - offset: 0-based offset of the cell on the physical display
        i((R+R.((s0/usr/lib/python2.6/site-packages/orca/braille.pytgetCaretOffsetscCsy|ii}Wn^titidyti|idWqtitidtitiqXnX|i	ddS(sProcesses a cursor routing key press on this Component.  The offset
        is 0-based, where 0 represents the leftmost character of string
        associated with this region.  Note that the zeroeth character may have
        been scrolled off the display.s.braille.Component.processRoutingKey: no actionisCould not process routing key:iN(
RMtqueryActionRtprintlntLEVEL_FINESTteventsynthesizertclickObjecttLEVEL_SEVEREtprintExceptiontdoAction(R+R.taction((s0/usr/lib/python2.6/site-packages/orca/braille.pyR/s(RIRJRKR<R,R-ROR/(((s0/usr/lib/python2.6/site-packages/orca/braille.pyRLs			tLinkcBs/eZdZddZdZedZRS(sA subclass of Component backed by an accessible.  This Region will be
    marked as a link by dots 7 or 8, depending on the user's preferences.
    icCs ti||||dtdS(slInitialize a Link region. similar to Component, but here we always
        have the region expand on cursor.RN(RLR,RH(R+RMR'R*((s0/usr/lib/python2.6/site-packages/orca/braille.pyR,scCsd|i|ifS(NsLink: '%s', %d(R'R*(R+((s0/usr/lib/python2.6/site-packages/orca/braille.pyR-scCsttit|iS(sCreates a string which can be used as the attrOr field of brltty's
        write structure for the purpose of indicating text attributes and
        selection.
        Arguments:

        - getLinkMask: Whether or not we should take the time to get
          the attributeMask for links. Reasons we might not want to
          include knowning that we will fail and/or it taking an
          unreasonable amount of time (AKA Gecko).
        (tchrRtbrailleLinkIndicatorR1R'(R+R3((s0/usr/lib/python2.6/site-packages/orca/braille.pyR6s(RIRJRKR,R-RHR6(((s0/usr/lib/python2.6/site-packages/orca/braille.pyRY
s	tTextcBsteZdZdddddZdZdZdZdZe	dZ
de	d	Zd
ZdZ
RS(
sjA subclass of Region backed by a Text object.  This Region will
    react to any cursor routing key events by positioning the caret in
    the associated text object. The line displayed will be the
    contents of the text object preceded by an optional label.
    [[[TODO: WDW - need to add in text selection capabilities.  Logged
    as bugzilla bug 319754.]]]RcCs||_tio5|io+tii|i|\}|_|_nd}d|_d|_|id}|o|id}n|o|id}ny||i}Wntj
onXy||i|_Wntj
od|_nX||i|!}|i|i8_t	|i|it
|}|it
||_||_|o|d|_
n
d|_
|i
|}|t
|i
7}ti|||t|io!tio|i|i7_ntio|id7_ndS(sCreates a new Text region.

        Arguments:
        - accessible: the accessible that implements AccessibleText
        - label: an optional label to display
        RisUTF-8R8N(RMt
orca_statetactiveScripttgetTextLineAtCarettcaretOffsett
lineOffsetR t	TypeErrortstartOffsetR?R1t_maxCaretOffsetteoltlabelRR,RHRRtdisableBrailleEOLR'(R+RMRfReRct	endOffsetR'R*((s0/usr/lib/python2.6/site-packages/orca/braille.pyR,/sF						

cCsd|i|ifS(NsText: '%s', %d(R'R*(R+((s0/usr/lib/python2.6/site-packages/orca/braille.pyR-oscCstii|i|i\}}}|id}t||t|}||ijot	S||_
||_|t|i7}|io1|i
|i|t\|_|_|_}n||_tS(sAttempts to reposition the cursor in response to a new
        caret position.  If it is possible (i.e., the caret is on
        the same line as it was), reposition the cursor and return
        True.  Otherwise, return False.
        sUTF-8(R]R^R_RMRcR R?R1RaR<R`RfRR&R"RHR'R(R)R*(R+R'R`RaR*((s0/usr/lib/python2.6/site-packages/orca/braille.pyR7rs		
1	cCs8|i|}|djodSt|i||iS(sReturns the caret position of the given offset if the object
        has text with a caret.  Otherwise, returns -1.

        Arguments:
        - offset: 0-based offset of the cell on the physical display
        ii(RDR?RaRd(R+R.((s0/usr/lib/python2.6/site-packages/orca/braille.pyROs
cCs;|i|}|djodStii|i|dS(sProcesses a cursor routing key press on this Component.  The offset
        is 0-based, where 0 represents the leftmost character of text
        associated with this region.  Note that the zeroeth character may have
        been scrolled off the display.
        iN(ROR]R^tsetCaretOffsetRM(R+R.R`((s0/usr/lib/python2.6/site-packages/orca/braille.pyR/s
cCsLy|ii}Wntj
odSXt|it|i}|i|}tig|}ti	}ti
}ti}ti
}	|o|tijoy|ii}
|
i}Wn
d}nXd}x||jor|
i|}
|i|
ijoBx?t|
i|
iD]$}y||c|O<WqqXqWn|d7}qWn|o.|	iti}|i}x||jo|	i|i|t\}}}||joPnti}|}xK|D]C}|i|ddjo$||||jo|}PqqqW|tijoZt||id}t||i|}x+t||D]}||c|O<qhWqqWn|o|	i|i}xn|D]b\}}t||id}t||i|}x't||D]}||c|O<qWqWn|iodgt|i}|it|i}|io6g}|D]}||t|idqd~}nxKt|D]=\}}y|||c|O<Wqt j
o
qqXqW|t|i! }n|dgt|i"7}|iodgt|i|}ndi#t$t%|S(sCreates a string which can be used as the attrOr field of brltty's
        write structure for the purpose of indicating text attributes, links,
        and selection.

        Arguments:
        - getLinkMask: Whether or not we should take the time to get
          the attributeMask for links. Reasons we might not want to
          include knowning that we will fail and/or it taking an
          unreasonable amount of time (AKA Gecko).
        Rii(&RMt	queryTexttNotImplementedErrorR1R"RfRaRtTEXT_ATTR_BRAILLE_NONEttextAttributesBrailleIndicatortbrailleSelectorIndicatorR[R]R^tBRAILLE_LINK_NONEtqueryHypertextt	getNLinkstgetLinkt
startIndextxrangetendIndextattributeStringToDictionarytenabledBrailledTextAttributestgetTextAttributesRHR
tmaxR?tgetAllTextSelectionsRR)t	enumerateR;R'ReRtmapRZ(R+R3ttexttstringLengtht
lineEndOffsett
regionMaskt
attrIndicatortselIndicatort
linkIndicatortscriptt	hyperTexttnLinkstntlinktitenabledAttributesR.t
attributesRcRhR5tattribt	maskStarttmaskEndt
selectionstcontractedMaskR)t_[1]tm((s0/usr/lib/python2.6/site-packages/orca/braille.pyR6s
				

	

	
!

6

icCs;ti||||\}}}}||i|||fS(N(RR&Re(R+R@R*RRR(R)R9((s0/usr/lib/python2.6/site-packages/orca/braille.pyR&scCs6ti||}||i7}|t|i8}|S(N(RRDRcR1Rf(R+RCR.((s0/usr/lib/python2.6/site-packages/orca/braille.pyRDs
cCs1ti|||p|i|i7_ndS(N(RRGR'Re(R+R((s0/usr/lib/python2.6/site-packages/orca/braille.pyRGsN(RIRJRKRR,R-R7ROR/RHR6R&RDRG(((s0/usr/lib/python2.6/site-packages/orca/braille.pyR\'s?				f	tReviewComponentcBseZdZdZRS(s@A subclass of Component that is to be used for flat review mode.cCs)ti||||dt||_dS(s_Creates a new Component.

        Arguments:
        - accessible: the accessible
        - string: the string to use to represent the component
        - cursorOffset: a 0-based index saying where to draw the cursor
                        for this Region if it gets focus.
        - zone: the flat review Zone associated with this component
        RN(RLR,RHtzone(R+RMR'R*R((s0/usr/lib/python2.6/site-packages/orca/braille.pyR,&s

(RIRJRKR,(((s0/usr/lib/python2.6/site-packages/orca/braille.pyR#st
ReviewTextcBs)eZdZdZdZdZRS(sA subclass of Region backed by a Text object.  This Region will
    does not react to the caret changes, but will react if one updates
    the cursorPosition.  This class is meant to be used by flat review
    mode to show the current character position.
    cCs5ti||dt||_||_||_dS(sICreates a new Text region.

        Arguments:
        - accessible: the accessible that implements AccessibleText
        - string: the string to use to represent the component
        - lineOffset: the character offset into where the text line starts
        - zone: the flat review Zone associated with this component
        RN(RR,RHRMRaR(R+RMR'RaR((s0/usr/lib/python2.6/site-packages/orca/braille.pyR,;s			cCs,|i|}|djodS|i|S(sReturns the caret position of the given offset if the object
        has text with a caret.  Otherwise, returns -1.

        Arguments:
        - offset: 0-based offset of the cell on the physical display
        ii(RDRa(R+R.((s0/usr/lib/python2.6/site-packages/orca/braille.pyROIs
cCs)|i|}tii|i|dS(sProcesses a cursor routing key press on this Component.  The offset
        is 0-based, where 0 represents the leftmost character of text
        associated with this region.  Note that the zeroeth character may have
        been scrolled off the display.N(ROR]R^RiRM(R+R.R`((s0/usr/lib/python2.6/site-packages/orca/braille.pyR/Ws(RIRJRKR,ROR/(((s0/usr/lib/python2.6/site-packages/orca/braille.pyR4s		tLinecBsSeZdZddZdZdZedZdZ	dZ
dZRS(	saA horizontal line on the display.  Each Line is composed of a sequential
    set of Regions.
    cCs.g|_d|_|o|i|ndS(NR(tregionsR't	addRegion(R+tregion((s0/usr/lib/python2.6/site-packages/orca/braille.pyR,es		cCs|ii|dS(N(Rtappend(R+R((s0/usr/lib/python2.6/site-packages/orca/braille.pyRkscCs|ii|dS(N(Rtextend(R+R((s0/usr/lib/python2.6/site-packages/orca/braille.pyt
addRegionsnscCsd}d}d}xn|iD]c}|tjot|}n|io||iidd7}n|i|}||7}qW|||gS(s$Computes the complete string for this line as well as a
        0-based index where the focused region starts on this line.
        If the region with focus is not on this line, then the index
        will be -1.

        Arguments:
        - getLinkMask: Whether or not we should take the time to get
          the attributeMask for links. Reasons we might not want to
          include knowning that we will fail and/or it taking an
          unreasonable amount of time (AKA Gecko).

        Returns [string, offsetIndex, attributeMask]
        Riu…s...(Rt_regionWithFocusR1R'treplaceR6(R+R3R'tfocusOffsett
attributeMaskRR5((s0/usr/lib/python2.6/site-packages/orca/braille.pytgetLineInfoqs


cCsd}d}d}xH|iD]=}|}||i}t||joPqt|}qW|t|joddgS|||gSdS(s5Finds the Region at the given 0-based offset in this line.

        Returns the [region, offsetinregion] where the region is
        the region at the given offset, and offsetinregion is the
        0-based offset from the beginning of the region, representing
        where in the region the given offset is.RiiN(RRR'R1(R+R.tfoundRegionR'tposR((s0/usr/lib/python2.6/site-packages/orca/braille.pytgetRegionAtOffsets

cCs1|i|\}}|o|i|ndS(sProcesses a cursor routing key press on this Component.  The offset
        is 0-based, where 0 represents the leftmost character of string
        associated with this line.  Note that the zeroeth character may have
        been scrolled off the display.N(RR/(R+R.RtregionOffset((s0/usr/lib/python2.6/site-packages/orca/braille.pyR/scCs%x|iD]}|i|q
WdS(N(RRG(R+RR((s0/usr/lib/python2.6/site-packages/orca/braille.pyRGs
N(RIRJRKRR,RRRHRRR/RG(((s0/usr/lib/python2.6/site-packages/orca/braille.pyR`s		 		
cCsOttdjo.|dtd}td}t|i|SddgSdS(sBGiven a 1-based cell offset, return the braille region
    associated with that cell in the form of [region, offsetinregion]
    where 'region' is the region associated with the cell and
    'offsetinregion' is the 0-based offset of where the cell is
    in the region, where 0 represents the beginning of the region.
    iiiN(R1t_linestviewportRR(tcellR.tlineNum((s0/usr/lib/python2.6/site-packages/orca/braille.pytgetRegionAtCells

cCs||id}t|d\}}|o<t|tpt|to|i}|i|}n
d}d}||gS(sNGets the accesible and caret offset associated with the given
    event.  The event should have a BrlAPI event that contains an
    argument value that corresponds to a cell on the display.

    Arguments:
    - event: an instance of input_event.BrailleEvent.  event.event is
    the dictionary form of the expanded BrlAPI event.
    targumentiiN(teventRt
isinstanceR\RRMROR(RR.RRRMR`((s0/usr/lib/python2.6/site-packages/orca/braille.pytgetCaretContexts

'	cCsgadaddgadS(sgClears the logical structure, but keeps the Braille display as is
    (until a refresh operation).
    iN(RRRR(((s0/usr/lib/python2.6/site-packages/orca/braille.pytclears	cCs
|adS(N(R(tlines((s0/usr/lib/python2.6/site-packages/orca/braille.pytsetLinesscCs ti|tt|_dS(s/Adds a line to the logical display for painting.  The line is added to
    the end of the current list of known lines.  It is necessary for the
    viewport to be over the lines and for refresh to be called for the new
    line to be painted.

    Arguments:
    - line: an instance of Line to add.
    N(RRR1t_index(R@((s0/usr/lib/python2.6/site-packages/orca/braille.pytaddLines

cCsttdS(sEReturns the Line that is currently being painted on the display.
    i(RR(((s0/usr/lib/python2.6/site-packages/orca/braille.pytgetShowingLinesc
Cs|a|ptodSd}t}xZtD]R}x3|iD](}|tjo|td<t}Pq>q>W|oPq.|d7}q.Wttd}|i|\}}}	titdjo|titdd7}nt	d|td<dS(s/Specififes the region with focus.  This region will be positioned
    at the home position if panToFocus is True.

    Arguments:
    - region: the given region, which much be in a line that has been
      added to the logical display
    - panToFocus: whether or not to position the region at the home
      position
    - getLinkMask: Whether or not we should take the time to get the
      attributeMask for links. Reasons we might not want to include
      knowning that we will fail and/or it taking an unreasonable
      amount of time (AKA Gecko).
    Nii(
RR<RRRRHRR*t_displaySizeRy(
Rt
panToFocusR3RtdoneR@tregR'R.R((s0/usr/lib/python2.6/site-packages/orca/braille.pytsetFocuss*	


	c
Csd}|djp>titijp+|tdjo|tdtdjontdtid}tdtdti}td|}titijo:||jo||}qb||jo||}qbntitijop||jot	}tdd}xM||jo?||djo
t
}n|o|d7}Pn|d8}qWt||}|td}n||jot	}tdtd}	xI|	t|jo5||	djo
t
}n
|oPn|	d7}	qWtt||	}	td|	tdtd}nt
|tijoti|t
|}qbn|oMt|td|td<ttdt|t|tdtd<ndS(s\Realigns the braille display to account for braille alignment
    preferences.  By the time this method is called, if there is a
    cursor cell to be displayed, it should already be somewhere in
    the viewport.  All we're going to do is adjust the viewport a
    little to align the viewport edge according to the
    settings.brailleAlignmentStyle.

    Arguments:
    - string: the entire string to be presented
    - focusOffset: where in string the focused region begins
    - cursorOffset: where in the string the cursor should be

    Returns: the viewport[0] value is potentially modified.
    iis 	

N(RtbrailleAlignmentStyletALIGN_BRAILLE_BY_EDGERRtbrailleAlignmentMarginRytALIGN_BRAILLE_BY_MARGINtALIGN_BRAILLE_BY_WORDR<RHR1R?tabstbrailleMaximumJump(
R'RR*tjumpt
leftMargintrightMargintleftMostEdgetinWordtleftWordEdget
rightWordEdge((s0/usr/lib/python2.6/site-packages/orca/braille.pyt_realignViewport7s^









#
cCst\}}}}to/tttoti}ti}	ti}
nd}d}	d}
|otdt	nt
tdjoytpt
ttintoLytiddWqtitidtititqXnd
adS|djotd|d}n|djo|o||jo|
|jo|djoq||	jo
|}q||	jottd||	|}q||	jotd|||	}qnttd}|i|\}}
}d}|
djo|
ti}n|o|djot
|tdjodtd<q|otd||dtd<q|tdjotd|td<q|tdtdjo#td|tddtd<qnt||
|td}|td}||atdjpttdjo
dantd7ad|}titi |t!i"|i#d	d
|||!tf}titi |t!i"|i#d	|||!}tpt
ttinto
t$i%}d|_&t
||_'xG|i'tdjo2|d7}|o|d7}n|i'd7_'q
W||_(t|_)|o|||!|_*ntpt
ttintoIyti+|WqtitidtititqXqnti,o]t-p!t.i/tda-t-i0n|o|||!}nd}t-it||nt-ot-i1da-n|dja2|t
|ja3to/tttotitititfandadS(sdRepaints the Braille on the physical display.  This clips the entire
    logical structure by the viewport and also sets the cursor to the
    appropriate location.  [[[TODO: WDW - I'm not sure how BrlTTY handles
    drawing to displays with more than one line, so I'm only going to handle
    drawing one line right now.]]]

    Arguments:

    - panToCursor: if True, will adjust the viewport so the cursor is
      showing.
    - targetCursorCell: Only effective if panToCursor is True.
      0 means automatically place the cursor somewhere on the display so
      as to minimize movement but show as much of the line as possible.
      A positive value is a 1-based target cell from the left side of
      the display and a negative value is a 1-based target cell from the
      right side of the display.
    - getLinkMask: Whether or not we should take the time to get the
      attributeMask for links. Reasons we might not want to include
      knowning that we will fail and/or it taking an unreasonable
      amount of time (AKA Gecko).
    - stopFlash: if True, kill any flashed message that may be showing.
    itrestoreSavedRs!BrlTTY seems to have disappeared:NiisBRAILLE LINE:  '%s'sUTF-8s     VISIBLE:  '%s', cursor=%dR8R0(Niii(Niii(4t
_lastTextInfoRRR\RMR`RaRt	killFlashR<R1Rt_brlAPIRunningtinitt	_callbackRtttyt_brlAPIt	writeTextRRQt
LEVEL_WARNINGRVtshutdownRR?RyRRR*Rt
cursorCellt
LEVEL_INFOtlogtinfotencodetbrlapitWriteStructtregionBegint
regionSizeR}tcursortattrOrtwritetenableBrailleMonitort_monitortbrlmontBrlMontshow_alltdestroytbeginningIsShowingtendIsShowing(tpanToCursorttargetCursorCellR3t	stopFlashtlastTextObjtlastCaretOffsettlastLineOffsettlastCursorCelltcurrentTextObjtcurrentCaretOffsettcurrentLineOffsetR@R'RRR*tstartPostendPostlogLinet	substringtwriteStructtsubMask((s0/usr/lib/python2.6/site-packages/orca/braille.pytrefreshs%		










'





	
		



cCs:to/t\aaa}tdtdtdantS(NRRi(t_flashEventSourceIdt_savedRRRRR<(t	flashTime((s0/usr/lib/python2.6/site-packages/orca/braille.pyt_flashCallbacks

cCsctoXtdjotitn|o)t\aaa}tdtdtndandS(NiRR(	Rtgobjectt
source_removeRRRRRR<(RR((s0/usr/lib/python2.6/site-packages/orca/braille.pyRs
cCs>tdjo-tittd}ti|tandS(Nii(RRRRttimeout_addR(R((s0/usr/lib/python2.6/site-packages/orca/braille.pytresetFlashTimers


cCsto(tdjotitndanttt|fa|djoti|tan|djo
dandS(sSets up the state needed to flash a message or clears any existing
    flash if nothing is to be flashed.

    Arguments:
    - flashTime:  if non-0, the number of milliseconds to display the
                  regions before reverting back to what was there before.
                  A 0 means to not do any flashing.  A negative number
                  means display the message until some other message
                  comes along or the user presses a cursor routing key.
    iifN(	RRRRRRRRR(R((s0/usr/lib/python2.6/site-packages/orca/braille.pyt
_initFlashs



cCsqt||d}|d}tt}x|D]}|i|q5Wt|t|tdtdS(sDisplays a list of regions on a single line, setting focus to the
       specified region.  The regionInfo parameter is something that is
       typically returned by a call to braille_generator.generateBraille.

    Arguments:
    - regionInfo: a list where the first element is a list of regions
                  to display and the second element is the region
                  with focus (must be in the list from element 0)
    - flashTime:  if non-0, the number of milliseconds to display the
                  regions before reverting back to what was there before.
                  A 0 means to not do any flashing.  A negative number
                  means display the message until some other message
                  comes along or the user presses a cursor routing key.
    iiRN(RRRRRRRR<(t
regionInfoRRt
focusedRegionR@titem((s0/usr/lib/python2.6/site-packages/orca/braille.pytdisplayRegionss


	

cCsNt|tt||}tt|t|ttdtdS(sVDisplays a single line, setting the cursor to the given position,
    ensuring that the cursor is in view.

    Arguments:
    - message: the string to display
    - cursor: the 0-based cursor position, where -1 (default) means no cursor
    - flashTime:  if non-0, the number of milliseconds to display the
                  regions before reverting back to what was there before.
                  A 0 means to not do any flashing.  A negative number
                  means display the message until some other message
                  comes along or the user presses a cursor routing key.
    RN(	RRRRRRRRHR<(tmessageRRR((s0/usr/lib/python2.6/site-packages/orca/braille.pytdisplayMessages

cCsctd}|djotd}ntddjotdtd|td<n|tdjS(sPans the display to the left, limiting the pan to the beginning
    of the line being displayed.

    Arguments:
    - panAmount: the amount to pan.  A value of 0 means the entire
                 width of the physical display.

    Returns True if a pan actually happened.
    i(RRRy(t	panAmounttoldX((s0/usr/lib/python2.6/site-packages/orca/braille.pytpanLefts

cCstd}|djotd}nttdjoVtd}td|}t|i\}}}|t|jo|td<qn|tdjS(sPans the display to the right, limiting the pan to the length
    of the line being displayed.

    Arguments:
    - panAmount: the amount to pan.  A value of 0 means the entire
                 width of the physical display.

    Returns True if a pan actually happened.
    ii(RRR1RR(RR	RtnewXR'RR((s0/usr/lib/python2.6/site-packages/orca/braille.pytpanRights


cCsx<|tdjo*titid|tpPqqWxD|tdtdjo*titid|tpPqBqBWdS(sOAutomatically pan left or right to make sure the current offset is
    showing.isbraille.panToOffset (left) %dsbraille.panToOffset (right) %dN(RRRQRRR
RR(R.((s0/usr/lib/python2.6/site-packages/orca/braille.pytpanToOffset%s


cCstttttS(sPans the display so the region with focus is displayed.

    Arguments:
    - inputEvent: the InputEvent instance that caused this to be called.

    Returns True to mean the command should be consumed.
    (RRRRH(t
inputEvent((s0/usr/lib/python2.6/site-packages/orca/braille.pytreturnToRegionWithFocus5s	

cCsI|idti@djt_xtD]}|itiq$WtdS(sTurns contracted braille on or off based upon the event.

    Arguments:
    - event: an instance of input_event.BrailleEvent.  event.event is
    the dictionary form of the expanded BrlAPI event.
    tflagsiN(RRtKEY_FLG_TOGGLE_ONRRRRGR(RR@((s0/usr/lib/python2.6/site-packages/orca/braille.pyRGCs
	cCsdtotdS|id}ttdjo-|td}td}t|i|ntS(sProcesses a cursor routing key event.

    Arguments:
    - event: an instance of input_event.BrailleEvent.  event.event is
    the dictionary form of the expanded BrlAPI event.
    NRii(RRRR1RRR/RH(RRRR((s0/usr/lib/python2.6/site-packages/orca/braille.pyR/Qs


cCstti|t}tio:tidjo*titititi	tint
oGyt
|}Wqtitidti
tit}qXntio!tidjoti	dn|S(sHandles BrlTTY command events.  This passes commands on to Orca for
    processing.

    Arguments:
    - event: the BrlAPI input event (expanded)
    isIssue processing event:(RRt
LEVEL_FINER<RttimeoutCallbackttimeoutTimetsignaltSIGALRMtalarmRRQRRV(Rtconsumed((s0/usr/lib/python2.6/site-packages/orca/braille.pyt_processBrailleEventhscCsjytit}Wn2titidtititdSX|otti	|nt
S(s\Method to read a key from the BrlAPI bindings.  This is a
    gobject IO watch handler.
    s!BrlTTY seems to have disappeared:N(RtreadKeyR<RRQRRVRRt
expandKeyCodeR(tsourcet	conditiontkey((s0/usr/lib/python2.6/site-packages/orca/braille.pyt_brlAPIKeyReaderscCstptttintpdStitidgti	ti
Bg}x"|D]}|iti	|BqWWtiti
|dS(sHacky method to tell BrlTTY what to send and not send us via
    the readKey method.  This only works with BrlTTY v3.8 and better.

    Arguments:
    -keys: a list of BrlAPI commands.
    Ni(RRRRRRt
ignoreKeysRt
rangeType_alltKEY_TYPE_CMDt
KEY_CMD_ROUTERt
acceptKeystrangeType_command(tkeystkeySetR((s0/usr/lib/python2.6/site-packages/orca/braille.pytsetupKeyRangessicCs`totStiptS|aytiay<t	i
d}titati
tidd|Wn1ti|tati
tid|nXtitititaWn1ti
tidtititatSXti\}}|dgatotid	anti
tidtdtdfttttS(
s"Initializes the braille module, connecting to the BrlTTY driver.

    Arguments:
    - callback: the method to call with a BrlTTY input event.
    - tty: the tty port to take ownership of (default = 7)
    Returns False if BrlTTY cannot be accessed or braille has
    not been enabled.
    t
WINDOWPATHs5Braille module has been initialized using WINDOWPATH=s%ss0Braille module has been initialized using tty=%dsCould not initialize BrlTTY:isbraille display size = (%d, %d)iN(RRHRt
enableBrailleR<RRt
ConnectionRRtenvirontenterTtyModeWithPathRRQtLEVEL_CONFIGURATIONtenterTtyModeRtio_add_watchtfileDescriptortIO_INRt_brlAPISourceIdRVtdisplaySizeRRRRRR(tcallbackRt
windowPathtxty((s0/usr/lib/python2.6/site-packages/orca/braille.pyRsR







cCskto\tatitdaytiWnnXtotidant
dgantStS(sYShuts down the braille module.   Returns True if the shutdown procedure
    was run.
    iiN(
RR<RRR3RtleaveTtyModeRRRtDEFAULT_DISPLAY_SIZERRH(((s0/usr/lib/python2.6/site-packages/orca/braille.pyRs



(Niii(((aRKt__id__t__version__t__date__t
__copyright__t__license__tloggingt	getLoggerRRRRtthreads_initRtImportErrorRRRRHt_brlAPIAvailableR<RR3RRRSR]RtplatformRt	orca_i18nRRtdontInteruptSpeechKeystKEY_CMD_FWINLTtKEY_CMD_FWINRTtKEY_CMD_LNUPtKEY_CMD_LNDNtcommand_nametKEY_CMD_FREEZEtKEY_CMD_TOP_LEFTtKEY_CMD_BOT_LEFTtKEY_CMD_HOMEtKEY_CMD_SIXDOTSR#tKEY_CMD_CUTBEGINtKEY_CMD_CUTLINER:RRRRRRRRRRRR	RRR$RRRLRYR\RRRRRRRRRRRRRRRRRRR
RR
RRGR/RRR(RR(((s0/usr/lib/python2.6/site-packages/orca/braille.pyt<module>s


			


























	
	
	
>,[			
		
	5	x	

						 		J

Youez - 2016 - github.com/yon3zu
LinuXploit