[orca-list] a question with bug #651206 inprogress fix related



Hy Joanie,

I try working a possibility to possible toggling on/off show Orca cursor highlighted word with computer braille format or not. I little try modify the src/orca/braille.py file the contractLine function. A little code part with last trying to prowide right cursor position all situations:
        if not expandOnCursor or cursorOnSpace:
            mode = 0
        else:
            if settings.showcursorComputerBraille==True:
                mode = louis.compbrlAtCursor
            else:
                mode = 0

        contracted, inPos, outPos, cursorPos = \
            louis.translate([self.contractionTable],
                            line,
                            cursorPos=cursorOffset,
                            mode=mode)

        # Make sure the cursor is at a realistic spot.
        #
        #cursorPos = min(cursorPos, len(contracted))
        if len(line)<len(contracted):
            cursorOffset=len(contracted)-len(line)
            cursorPos = min(cursorPos, len(contracted)+cursorOffset)
debug.println(debug.LEVEL_FINEST, "cursor position: "+str(cursorPos)+", contracted line: "+contracted)
        else:
            cursorPos = min(cursorPos, len(contracted))
debug.println(debug.LEVEL_FINEST, "cursor position: "+str(cursorPos)+", contracted line: "+contracted)
        return contracted, inPos, outPos, cursorPos

When I only reading and scrolling the text with braille display, and the present cursor highlighted text with uncontracted format check box is unchecked, everything is working fine. I see right all texts with contracted braille.
But, my fix method have a problem with some applications, for example gedit:
For example, if I write gedit the Alma 1 text, the cursor is offsetted wrong place. Not seeing the braille display the capital indicator, and the a letter. If I write only a number with 0 cursor position, not seeing the numbersign indicator.
Some modified debug.out examples:
1. Only the Alma word have wrote:
cursor position: 5, contracted line: $alma
     VISIBLE:  'alma $l', cursor=5
2. Alma word and space wrote:
cursor position: 6, contracted line: $alma
     VISIBLE:  'alma  $l', cursor=6
3. Alma, space and one number wrote:
cursor position: 8, contracted line: $alma #a
This value is right, because before the 1 number need presenting a numbersign indicator the braille display. But visible line now have difference with cursor position, I need quote the braillegenerator debug part:
required=[]
cursor position: 0, contracted line:
cursor position: 8, contracted line: $alma #a
isReadOnlyTextArea=False for app.name='gedit' name='None' role='text' state='editable enabled focusable focused multi line sensitive showing visible' relations=''
readOnly=[]
cursor position: 0, contracted line:
cursor position: 8, contracted line: $alma #a
nodeLevel=[]
cursor position: 0, contracted line:
cursor position: 8, contracted line: $alma #a
generate braille results:
  Component: 'gedit $alkalma2"s', 0
  Region: ' ', 0
  Component: '*#a/ mentetlen dokumentum - gedit $keret', 0
  Region: ' ', 0
  Component: '$laplista', 1
  Region: ' ', 0
  Component: '*#a/ mentetlen dokumentum $lapf{l', 0
  Region: ' ', 0
  Component: '$gqrd|thet7 ablakt"bla', 1
  Region: ' ', 0
  Text: '$alma #a $l', 8
BRAILLE LINE: 'gedit $alkalma2"s *#a/ mentetlen dokumentum - gedit $keret $laplista *#a/ mentetlen dokumentum $lapf{l $gqrd|thet7 ablakt"bla $alma #a $l'
     VISIBLE:  'lma #a $l', cursor=7

Because Orca always presenting the application related informations if the cursor have the first line when I typing, only not fit the first line right the braille display when I typing a text? When I scroll back the braille display with left, I see the application related informations, and missing text parts with braille display (capsign indicator, and the first capital letter). If I only trying this with a number with first line, I see right end of my braille display the numbersign indicator before real line with containing the number. This is interesting, because if I repeating this test typing for example the second line, everithing is presenting right the braille display. If I writing a number, right presenting the numbersign indicator, if I writing line beginning a capital beginning word and a number after space character, right presenting the capsign indicator before the capital letter, and numbersign indicator before the typed number. If I writing first line a blank line, and repeating the test, every tested things presenting right. This is an another bug and independent my cursor offset related modification trying? Main purpose my fix to possible reading texts with full contracted format. This is done my first attached patch the #651206 bugreport. When I browsing for example the web and reading articles, I always this way reading the articles. But if this is possible I would like doing a flexible way to edited text presenting too with contracted format right if unchecked the present cursor highlighted word with uncontracted format.

Attila



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