After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 354470 - ] Contracted Braille
] Contracted Braille
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: braille
1.0.x
Other All
: Normal enhancement
: 2.22.0
Assigned To: Eitan Isaacson
Orca Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-09-05 16:24 UTC by Willie Walker
Modified: 2008-07-22 19:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed UI changes (11.24 KB, patch)
2008-01-03 23:23 UTC, Eitan Isaacson
none Details | Review
Proposed UI changes (11.32 KB, patch)
2008-01-04 19:48 UTC, Eitan Isaacson
none Details | Review
UI changes plus new louis module (20.14 KB, patch)
2008-01-11 19:26 UTC, Eitan Isaacson
committed Details | Review
Repackaged version of liblouis (617.89 KB, application/x-gzip)
2008-01-18 01:43 UTC, Eitan Isaacson
  Details
Initial grade 2 support (12.44 KB, patch)
2008-01-18 01:51 UTC, Eitan Isaacson
needs-work Details | Review
Another repacked liblouis (619.89 KB, application/x-gzip)
2008-01-24 22:50 UTC, Eitan Isaacson
  Details
Grade 2 support (15.31 KB, patch)
2008-01-24 22:52 UTC, Eitan Isaacson
needs-work Details | Review
Grade 2 support (14.41 KB, patch)
2008-01-29 22:06 UTC, Eitan Isaacson
needs-work Details | Review
Grade 2 support (16.53 KB, patch)
2008-01-30 19:19 UTC, Eitan Isaacson
none Details | Review
Grade 2 support (18.66 KB, patch)
2008-01-31 02:30 UTC, Eitan Isaacson
none Details | Review
Grade 2 support (15.94 KB, patch)
2008-02-01 09:42 UTC, Eitan Isaacson
none Details | Review
Grade 2 support (17.67 KB, patch)
2008-02-03 23:14 UTC, Eitan Isaacson
none Details | Review
Grade 2 support (26.89 KB, patch)
2008-02-07 07:00 UTC, Eitan Isaacson
none Details | Review
Patch to remove a print, fix some pylint issues, and work with Python 2.4 (27.95 KB, patch)
2008-02-08 02:20 UTC, Willie Walker
none Details | Review
Grade 2 support (30.57 KB, patch)
2008-02-08 23:00 UTC, Eitan Isaacson
none Details | Review
Patch to address regressions in role_text_multiline_navigation.py (29.82 KB, patch)
2008-02-10 18:47 UTC, Willie Walker
none Details | Review
Patch to eliminate all the gtk-demo regressions (29.91 KB, patch)
2008-02-10 21:50 UTC, Willie Walker
none Details | Review
Same patch, but with simple pylint fix (remove a tab) (29.92 KB, patch)
2008-02-11 03:20 UTC, Willie Walker
committed Details | Review

Description Willie Walker 2006-09-05 16:24:01 UTC
Orca should support grade 2 braille and provide an option for turning it on and off.  (NOTE: this needs to be written up better in the Orca doc set).
Comment 1 Rich Burridge 2006-09-05 16:45:16 UTC
Tracking.
Comment 2 Willie Walker 2006-10-15 00:25:33 UTC
Add accessibility keyword.  Apologies for spam.
Comment 3 Rich Burridge 2007-01-25 18:36:58 UTC
Allow grade-1 and grade-2 to be switched quickly using the buttons on
the braille display.
Comment 4 Willie Walker 2007-05-08 11:46:36 UTC
From Michael Whapples on the Orca users list:

http://mail.gnome.org/archives/orca-list/2007-April/msg00285.html

"For doing the contracted braille in orca, it could use something such as
liblouis (www.jjb-software.com). This can do braille translation in both
directions, has tables for a few braille codes, and also is open source.
I have used it in some of my own projects written in python, and it
seems to work fine. You would need to write a python API for it, I have
done that before using ctypes. The one problem I did have when
interfacing with ctypes, which is relevant to mention here, is that if
someone has compiled python from source with 32-bit unicode then you
will need to convert to 16-bit unicode as that is what liblouis uses. I
don't know of any python function to check if python is using unicode32
or unicode16, but I managed to do it by comparing the results from len
and sizeof from a ctypes unicode buffer (create_unicode_buffer), the
relationship should be a multiple of 2 if unicode16 is used and 4 if
unicode32 is used (one gives the number of characters and the other
gives number of bytes and then you can calculate number of bytes per
character). I may be making more of this than is necessary, but I have
found this to be so in one distro of Linux I have used."
Comment 5 Willie Walker 2007-09-04 15:12:17 UTC
Assigning to Eitan as part of the speech/braille refactor.
Comment 6 Eitan Isaacson 2008-01-03 23:23:56 UTC
Created attachment 102075 [details] [review]
Proposed UI changes

This patch adds a "contracted braille" frame to the preferences interface.
I made this so it could be committed into trunk without the options actually being exposed by default. To review the interface simply run the file orca_gui_prefs.py as standalone.

All of the new strings have been properly marked for translation.
Comment 7 Mike Pedersen 2008-01-04 01:56:58 UTC
I just tested this and I'm fine with the strings and layout if everyone else is.  
Comment 8 Willie Walker 2008-01-04 14:43:46 UTC
Looks cool to me, though I have a couple comments:

1) It would be much better if we got the braille contraction table strings from the liblouis bindings rather than hard coding them into our stuff.  Is this something you plan on doing before the final commit?

2) Mnemonics should be used for the new checkbox and combobox.  I'm not sure of great ones, but how about the "E" in Enable and the "T" in Table?

I'm also assuming that the default braille contraction table will be chosen based upon the current locale?  In any case, it will be great to have this for GNOME 2.22, so I'm psyched to see progress on this.

Thanks!
Comment 9 Eitan Isaacson 2008-01-04 17:04:54 UTC
(In reply to comment #8)
> Looks cool to me, though I have a couple comments:
> 
> 1) It would be much better if we got the braille contraction table strings from
> the liblouis bindings rather than hard coding them into our stuff.  Is this
> something you plan on doing before the final commit?
> 

You mean the "U.S. English Grade 2" part? I see a couple of problems there:
* There is no way in liblouis today to list tables or extract a description out of a table, liblouis simply uses the file that you point at it.
* Liblouis currently is not localized, so even if it could give human readable names for the tables, they would always be in English.
* Liblouis is not a GNOME module, so it will never get as much translation as a GNOME module gets, assuming it becomes localizable.

So that hard coding is ugly, but I figured we should get as much strings as possible in before the freeze. 

Is there another approach you would suggest?

> 2) Mnemonics should be used for the new checkbox and combobox.  I'm not sure of
> great ones, but how about the "E" in Enable and the "T" in Table?
> 

Yeah, I'll add those.

> I'm also assuming that the default braille contraction table will be chosen
> based upon the current locale? 

Yep, sounds right.

Comment 10 Willie Walker 2008-01-04 17:14:10 UTC
> * Liblouis currently is not localized, so even if it could give human readable
> names for the tables, they would always be in English.
> * Liblouis is not a GNOME module, so it will never get as much translation as a
> GNOME module gets, assuming it becomes localizable.

Ah...bummer.  Yeah, my thought was to put the strings in the Python bindings for liblouis and defer the translation problem.  A possible interim workaround to this might be to put the liblouis Python bindings under the orca module (e.g., parallel to the brl directory).  With that, the translations for the tables would happen as part of the Orca translation, but be more tightly coupled with the liblouis stuff.

Do you know what the status of liblouis is these days?  It is still under development?  Does it need a home for source code control and bug management?  If so, do you think the maintainers might be amenable to proposing it as a module for GNOME 2.24?
Comment 11 Joanmarie Diggs (IRC: joanie) 2008-01-04 17:24:19 UTC
Yea contracted braille!!! This is going to be awesome to have!

Seeing as how we're trying to get in strings before the freeze.... A setting that other screen readers have is to expand/uncontract the word that's at the caret.  I think this is handy because sometimes you want to see how something is spelled. (As a related aside, I have always wanted to do a study of highly literate folks and compare the spelling ability of braille readers versus print readers.)  Anyhoo, is this a feature we want to include and if so, should it be added to the prefs dialog now?
Comment 12 Mike Pedersen 2008-01-04 17:31:37 UTC
> Seeing as how we're trying to get in strings before the freeze.... A setting
> that other screen readers have is to expand/uncontract the word that's at the
> caret.  I think this is handy because sometimes you want to see how something
> is spelled.
I've never found this setting to be all that useful because I think any braile user will normally want to see the word under the caret expanded.  This is currently the intended plan.  That said, if you really think we need the feature I'm fine with it.  
Comment 13 Eitan Isaacson 2008-01-04 19:41:40 UTC
(In reply to comment #10)
> Ah...bummer.  Yeah, my thought was to put the strings in the Python bindings
> for liblouis and defer the translation problem.  A possible interim workaround
> to this might be to put the liblouis Python bindings under the orca module
> (e.g., parallel to the brl directory).  With that, the translations for the
> tables would happen as part of the Orca translation, but be more tightly
> coupled with the liblouis stuff.

John offered to have the Python bindings ship with liblouis. I thought that was great news, but I am thinking now that perhaps it would be better if they were in Orca for now. Liblouis does not have any schedule commitments, while Orca does.

Not sure, we need to make these decisions quickly so that the distros don't get too confused.

> 
> Do you know what the status of liblouis is these days?  It is still under
> development?  Does it need a home for source code control and bug management? 

I am in contact with John, so far it needs all of that, I suggested to him sf, launchpad or the google code thing.

> If so, do you think the maintainers might be amenable to proposing it as a
> module for GNOME 2.24?
> 

I'm not sure if that would be the right decision for liblouis, it would require a certain commitment from the maintainers, scheduled releases, etc.
Plus liblouis has more uses than just screen readers, for example embossers.
Comment 14 Eitan Isaacson 2008-01-04 19:48:00 UTC
Created attachment 102154 [details] [review]
Proposed UI changes

This patch adds the mnemonics.
Could I submit this to trunk?
Comment 15 Eitan Isaacson 2008-01-04 19:51:30 UTC
(In reply to comment #12)
> > Seeing as how we're trying to get in strings before the freeze.... A setting
> > that other screen readers have is to expand/uncontract the word that's at the
> > caret.  I think this is handy because sometimes you want to see how something
> > is spelled.
> I've never found this setting to be all that useful because I think any braile
> user will normally want to see the word under the caret expanded.  This is
> currently the intended plan.  That said, if you really think we need the
> feature I'm fine with it.  
> 

I'm fine either way too.

My thought now is to put down as many strings as possibly needed, so if we think we might want it, I'll put it in. Worst case we could take it out, I think it is better than the other way around, it's better if we have one extra translated string than a string that we use but is not as widely translated.
Comment 16 Joanmarie Diggs (IRC: joanie) 2008-01-04 20:35:45 UTC
> I've never found this setting to be all that useful because I think any braile
> user will normally want to see the word under the caret expanded.  This is
> currently the intended plan.  

I didn't realize it was the intended plan.  I *believe* in other screen readers the default is not to expand it (which I think is silly).  I just want it to be expanded <smile>.  So never mind my suggestion.
Comment 17 Willie Walker 2008-01-05 13:00:31 UTC
(In reply to comment #14)
> Created an attachment (id=102154) [edit]
> Proposed UI changes
> 
> This patch adds the mnemonics.
> Could I submit this to trunk?

I'm OK with committing this for 2.21.5.  I still wish we could figure out a way to keep Orca from needing to maintain knowledge of the liblouis table strings.  Those really should come from liblouis.

The comments for translators should probably include some reference to what "Grade 1", "Grade 2", and "Grade 3" refer to.  A pointer to http://en.wikipedia.org/wiki/Braille might be sufficient.

> John offered to have the Python bindings ship with liblouis. I thought that was
> great news, but I am thinking now that perhaps it would be better if they were
> in Orca for now. Liblouis does not have any schedule commitments, while Orca
> does.

How about we go for keeping the bindings with Orca for now and migrate them out to a more 'public' space after we've had a chance to work with them and let them mature?  With this, we could also put the table name strings in the Python bindings, yet still benefit from the GNOME translations.  Thoughts?

> I am in contact with John, so far it needs all of that, I suggested to him sf,
> launchpad or the google code thing.
> 
> > If so, do you think the maintainers might be amenable to proposing it as a
> > module for GNOME 2.24?
> > 
> 
> I'm not sure if that would be the right decision for liblouis, it would require
> a certain commitment from the maintainers, scheduled releases, etc.
> Plus liblouis has more uses than just screen readers, for example embossers.

Sounds fair enough.  I guess treating it similar to how we treat brltty is fine (i.e., if it's there, we use it.  if it's not, we don't).  I think the main end goal is just to get liblouis in a more 'open source' state so it can evolve more easily and we can track bugs and enhancement requests.
Comment 18 Mike Pedersen 2008-01-05 22:18:17 UTC
Lets not include the expand current word checkbox in the UI.  I really think users want the word containing the caret expanded so this checkbox will just be extra UI clutter to tab through.
Comment 19 Eitan Isaacson 2008-01-11 19:26:24 UTC
Created attachment 102613 [details] [review]
UI changes plus new louis module

This is what I am committing for the 2.21.5 release.
Comment 20 Willie Walker 2008-01-12 18:13:53 UTC
Thank you!  Please make sure to send out a string change announcement (see 17-Dec entry of http://live.gnome.org/TwoPointTwentyone) for the new strings:

+TABLE_NAMES = {'Cz-Cz-g1': _('Czech Grade 1'),
+               'Es-Es-g1': _('Spanish Grade 1'),
+               'Fr-Ca-g2': _('Canada French Grade 2'),
+               'Fr-Fr-g2': _('France French Grade 2'),
+               'Lv-Lv-g1': _('Latvian Grade 1'),
+               'Nl-Nl-g1': _('Netherlands Dutch Grade 1'),
+               'No-No-g0': _('Norwegian Grade 0'),
+               'No-No-g1': _('Norwegian Grade 1'),
+               'No-No-g2': _('Norwegian Grade 2'),
+               'No-No-g3': _('Norwegian Grade 3'),
+               'Pl-Pl-g1': _('Polish Grade 1'),
+               'Pt-Pt-g1': _('Portuguese Grade 1'),
+               'Se-Se-g1': _('Swedish Grade 1'),
+               'ar-ar-g1': _('Arabic Grade 1'),
+               'cy-cy-g1': _('Welsh Grade 1'),
+               'cy-cy-g2': _('Welsh Grade 2'),
+               'de-de-g0': _('German Grade 0'),
+               'de-de-g1': _('German Grade 1'),
+               'de-de-g2': _('German Grade 2'),
+               'en-GB-g2': _('U.K. English Grade 2'),
+               'en-gb-g1': _('U.K. English Grade 1'),
+               'en-us-g1': _('U.S. English Grade 1'),
+               'en-us-g2': _('U.S. English Grade 2'),
+               'fr-ca-g1': _('Canada French Grade 1'),
+               'fr-fr-g1': _('France French 1'),
+               'gr-gr-g1': _('Greek Grade 1'),
+               'hi-in-g1': _('Hindi Grade 1'),
+               'it-it-g1': _('Italian Grade 1'),
+               'nl-be-g1': _('Belgium Dutch Grade 1')}
Comment 21 Eitan Isaacson 2008-01-18 01:43:54 UTC
Created attachment 103107 [details]
Repackaged version of liblouis

This is a repackaged version of liblouis (1.3.5). It has all of the pkg-config magic needed to build Orca smoothly with liblouis support.

When configuring use --enable-ucs4, if you won't do that you will get gibberish.
Comment 22 Eitan Isaacson 2008-01-18 01:51:18 UTC
Created attachment 103108 [details] [review]
Initial grade 2 support

This patch gives Orca initial grade 2 support. When you do "configure" when building orca use --enable-liblouis=yes. If liblouis is not installed properly configure will fail, but generally configure should autodetect liblouis.

Some known issues:
- The radio and checkbutton indicators are mangled, we eed to have a minor refactor so that we don't contract those indicators.
- Uncontract under cursor does not work yet, this seems to be a liblouis bug, I could make a workaround, but maybe John could fix it.
- The U.S. Grade 2 table is chosen by default, I need to implement smarter default table selection.
- No routing key support yet.
- Barely tested in general.
Comment 23 Willie Walker 2008-01-22 14:05:19 UTC
> When configuring use --enable-ucs4, if you won't do that you will get
> gibberish.

As Eitan and I discovered last week, you don't need this flag on Solaris Express.  If you use this flag on Solaris, you get gibberish.  :-)
Comment 24 Willie Walker 2008-01-22 14:14:05 UTC
(In reply to comment #22)
> Created an attachment (id=103108) [edit]
> Initial grade 2 support

This is looking pretty cool (THANKS!).  I think some bullet proofing and defensive code might be needed, however.  When I select the 'compressed' table, for example, Orca ends up hanging.  :-(  I wonder also if we need to update the braille monitor to check for strings that contain non-printable characters?   I notice the braille output sometimes ends up causing the braille monitor to complain.

> Some known issues:
> - The radio and checkbutton indicators are mangled, we eed to have a minor
> refactor so that we don't contract those indicators.

Eitan and I talked about this last week as well.  One of the ideas was to create braille.py:Component subclasses named CheckBoxIndicator and RadioButtonIndicator (or something similar).  These subclasses would present the indicators (e.g., one of settings.brailleCheckBoxIndicators or setting.brailleRadioButtonIndicators) and would resist contraction.  The braillegenerator would use these classes to build up a sequence of braille regions, where there would be a region for the indicator and a region for the label, with both being backed by the same accessible checkbox/radiobutton.

I also noticed that cursor tracking in flat review doesn't work very well.

In any case, this is something to play with and is a good start.  Thanks Eitan!
Comment 25 Eitan Isaacson 2008-01-24 22:50:54 UTC
Created attachment 103681 [details]
Another repacked liblouis

Ignore the identical version name, this is an updated package.
Comment 26 Eitan Isaacson 2008-01-24 22:52:57 UTC
Created attachment 103682 [details] [review]
Grade 2 support

This adds expand under cursor support. Also a bit of cleanup.
Comment 27 Willie Walker 2008-01-28 16:33:28 UTC
(In reply to comment #26)
> Created an attachment (id=103682) [edit]
> Grade 2 support
> 
> This adds expand under cursor support. Also a bit of cleanup.
> 

This patch ends up with rejections for settings.py and _louis.c when applied to trunk (svnversion 3509).  In looking at it, I'm guessing the UI code that is changing isn't really presenting a UI layout change, but is more about enabling the buttons?  Is that correct?
Comment 28 Eitan Isaacson 2008-01-29 22:06:38 UTC
Created attachment 103988 [details] [review]
Grade 2 support

This is a patch that applies cleanly to trunk (rev 3523).
Comment 29 Willie Walker 2008-01-29 23:03:47 UTC
(In reply to comment #28)
> Created an attachment (id=103988) [edit]
> Grade 2 support
> 
> This is a patch that applies cleanly to trunk (rev 3523).
> 

Thanks!  I'm building/running this on a system w/o louis, and it fails because of the "import louis" in braille.py.  :-(  Can you work up a patch that gracefully recovers if liblouis support is not available (please :-))?
Comment 30 Eitan Isaacson 2008-01-30 19:19:23 UTC
Created attachment 104053 [details] [review]
Grade 2 support

This patch has the beginning of router key support (only tested in gedit).
It also fails safely when liblouis is not present.
I would suggest throwing this in to trunk, so that testing could resume more easily.
Also, liblouis is now available as a code.google.com project:
http://code.google.com/p/liblouis/
Comment 31 Mike Pedersen 2008-01-30 21:19:07 UTC
Every one of these patches look better and better.  thanks a lot
Here are just a few bugs I've noticed so far.  
1.  turning off grade2 in terminal doesn't seem to be working.  To test do the following: 
A.  enable contracted braille
B.  open gnome-terminal
C.  press orca+CTRL+space to bring up the orca prefs for terminal.
D.  on the braille tab uncheck contracted braille and press OK
Notice that any time you open terminal after the change contracted braile is still turned on.  I took a look  and noticed that the setting in .orca/app-settings is correct ie set to false.  
2.  On any web page or HTML message in thunderbird the word under the orca cursor/caret is not uncontracted as I would expect.  Just to confirm this should behave exactly the way we are doing in text documents.  
   
Comment 32 Eitan Isaacson 2008-01-31 02:30:23 UTC
Created attachment 104089 [details] [review]
Grade 2 support

This patch addresses none of Mike's input :)
I'll get to that tomorrow. In the meantime these are the changes:
1. gnome-terminal caret behavior fixed.
2. Fixed cursor behavior with labeled entries.
Comment 33 Eitan Isaacson 2008-01-31 02:32:35 UTC
This is the 6th patch. It still needs plenty of work, but I am hoping that now that it is safe with installations without liblouis, we could put it in trunk.
Comment 34 Eitan Isaacson 2008-02-01 09:42:06 UTC
Created attachment 104176 [details] [review]
Grade 2 support

Further cleanup, and new stuff.
1. Settings should work per-app, like in Mike's gnome-terminal example above.
2. Quick grade 2 toggling from the braille display, right now I set it to the "A" button that appears in the X11 driver, but I think ideally it should be bound to CMD_SIXDOT, if that actually maps to an actual key on the display.
Comment 35 Eitan Isaacson 2008-02-03 23:14:51 UTC
Created attachment 104350 [details] [review]
Grade 2 support

This patch adds attribute and selection support.
Comment 36 Willie Walker 2008-02-06 18:50:51 UTC
(In reply to comment #35)
> Created an attachment (id=104350) [edit]
> Grade 2 support
> 
> This patch adds attribute and selection support.
> 

I just took a quick look at this patch....there might be some stuff in there that works with Python 2.5, but not 2.4.  Pylint doesn't like this line in braille.py (thinks it is invalid syntax), and my version of Python (2.4) also doesn't like it:

+        self.label = label+ ' ' if label else ''

In addition, pylint also complained about this line in orca_gui_prefs.py, where the complaint is that it is redefining the built-in 'iter':

+        iter = combobox.get_active_iter()

Just renaming iter to myIter or something like that would be fine.

Thanks!
Comment 37 Eitan Isaacson 2008-02-07 07:00:34 UTC
Created attachment 104617 [details] [review]
Grade 2 support

This patch fixes the issues that Will pointed out above.
Also expand on cursor should work with Firefox.
Also components with indicators, like radio and checkboxes should appear correctly.
Comment 38 Willie Walker 2008-02-08 02:20:22 UTC
Created attachment 104679 [details] [review]
Patch to remove a print, fix some pylint issues, and work with Python 2.4

This builds upon the previous patch and does the following:

1) Eliminates some pylint warnings
2) Removes a debug 'print' that was in the code
3) Supports Python 2.4

The supporting of Python 2.4 surrounds the use of rpartition and partition in __init__.py.  These methods are new for Python 2.5.  The workaround defaults to trying to use these methods first, but then falling back to stuff that works with Python 2.4

I've only tested it with gedit.
Comment 39 Willie Walker 2008-02-08 14:02:16 UTC
(In reply to comment #38)
> Created an attachment (id=104679) [edit]
> Patch to remove a print, fix some pylint issues, and work with Python 2.4
> 
> This builds upon the previous patch and does the following:
> 
> 1) Eliminates some pylint warnings
> 2) Removes a debug 'print' that was in the code
> 3) Supports Python 2.4
> 
> The supporting of Python 2.4 surrounds the use of rpartition and partition in
> __init__.py.  These methods are new for Python 2.5.  The workaround defaults to
> trying to use these methods first, but then falling back to stuff that works
> with Python 2.4
> 
> I've only tested it with gedit.

In testing this more, some work needs to be done in flat review so that the current word being reviewed (i.e., the word with the character we are reviewing, the word we are reviewing, etc.) is uncontracted.  Right now, the "uncontraction" seems to be biased towards caret offset.
Comment 40 Willie Walker 2008-02-08 18:34:13 UTC
Obsoleting the other patch - Eitan tested the new one and verified it works with Python 2.5.  Between Eitan and me, we have 2.4 and 2.5 covered.  :-)  We still need to fix the flat review uncontraction support, though.
Comment 41 Eitan Isaacson 2008-02-08 23:00:09 UTC
Created attachment 104748 [details] [review]
Grade 2 support

This patch has the following addition:
Make text regions always expand on cursor.
Fixed component expansion in flat review.
Fixed expand on cursor for flat review.
Comment 42 Willie Walker 2008-02-09 00:05:00 UTC
(In reply to comment #41)
> Created an attachment (id=104748) [edit]
> Grade 2 support
> 
> This patch has the following addition:
> Make text regions always expand on cursor.
> Fixed component expansion in flat review.
> Fixed expand on cursor for flat review.
> 

This is looking much better!  Thanks!  I see some strangeness with expansion when reviewing the status bar in flat review: the "Ln x, Col y" stuff is all expanded when reviewing it, but this is much better.  

Mike - I think it's time for you to take this for a ride again.
Comment 43 Willie Walker 2008-02-09 16:51:34 UTC
> Mike - I think it's time for you to take this for a ride again.

PS - when applying this patch use -p1 instead of -p0.
Comment 44 Willie Walker 2008-02-10 03:16:51 UTC
Yikes!  Bummer.  This patch seems to introduce some odd regressions. Here's a typical one when running the following test:

./runone.sh ../keystrokes/gtk-demo/role_text_multiline_navigation.pytk-demo 0

...
Test 29 of 100 FAILED: ../keystrokes/gtk-demo/role_text_multiline_navigation.py:KP_5 to flat review ' '
EXPECTED:
     "BRAILLE LINE:  '  $l'",
     "     VISIBLE:  '  $l', cursor=1",
     "SPEECH OUTPUT: 'white space'",
ACTUAL:
     "BRAILLE LINE:  ' ",
     " $l'",
     "     VISIBLE:  ' ",
     " $l', cursor=1",
     "SPEECH OUTPUT: 'white space'",
...
Comment 45 Willie Walker 2008-02-10 16:46:06 UTC
(In reply to comment #44)
> Yikes!  Bummer.  This patch seems to introduce some odd regressions.

OK - that regression was easy to fix.  The patch introduced a change that was not quite right:

-        if string[-1:] == "\n":
-            string = string[:-1]
-        self.string = string.encode("UTF-8")
+        string.strip('\n')
+        self.rawLine = string.encode("UTF-8")

Changing it to this made it work (i.e., save the result of string.strip('\n')):

-        if string[-1:] == "\n":
-            string = string[:-1]
-        self.string = string.encode("UTF-8")
+        string = string.strip('\n')
+        self.rawLine = string.encode("UTF-8")

There's still some regressions in flat review, however, where braille is being omitted:

Test 69 of 100 FAILED: ../keystrokes/gtk-demo/role_text_multiline_navigation.py:
KP_7 to flat review toolbar
EXPECTED:
     "BRAILLE LINE:  'Open & y toggle button Quit panel GTK! $l'",
     "     VISIBLE:  'Open & y toggle button Quit pane', cursor=1",
     "SPEECH OUTPUT: 'Open not pressed toggle button Quit panel GTK!'",
ACTUAL:
     "SPEECH OUTPUT: 'Open not pressed toggle button Quit panel GTK!'",

In looking at the debug, it looks like it's being caused by a traceback:

Traceback (most recent call last):
  • File "/usr/local/lib/python2.4/site-packages/orca/input_event.py", line 182
    n processInputEvent     consumed = self.function(script, inputEvent)
  • File "/usr/local/lib/python2.4/site-packages/orca/default.py", line 4218 in r
    eviewNextItem     self._reviewCurrentItem(inputEvent)
  • File "/usr/local/lib/python2.4/site-packages/orca/default.py", line 4173 in _
    reviewCurrentItem     self.updateBrailleReview(targetCursorCell)
  • File "/usr/local/lib/python2.4/site-packages/orca/default.py", line 3772 in u
    pdateBrailleReview     [regions, regionWithFocus] = context.getCurrentBrailleRegions()
  • File "/usr/local/lib/python2.4/site-packages/orca/flat_review.py", line 1643 in getCurrentBrailleRegions
    regionWithFocus.expandRegion()
  • File "/usr/local/lib/python2.4/site-packages/orca/braille.py", line 395 in ex
    pandRegion     self.cursorOffset = self.inPos[self.cursorOffset]
AttributeError: ReviewComponent instance has no attribute 'inPos'

I'll dig a little more.
Comment 46 Willie Walker 2008-02-10 17:10:05 UTC
> In looking at the debug, it looks like it's being caused by a traceback

OK - seems as though expandRegion was being called for a region even if contracted braille was not enabled.  I resolved this by modifying braille.py:expandRegion to check for this.  Not sure if this was the right thing to do, but this and the previous fix address all the regressions in role_text_multiline_navigation.py.

    def expandRegion(self):
	if not self.contracted:
            return
        self.string = self.rawLine
        try:
            self.cursorOffset = self.inPos[self.cursorOffset]
        except IndexError:
            self.cursorOffset = len(self.string)

PS - new patch to follow.
Comment 47 Willie Walker 2008-02-10 18:47:52 UTC
Created attachment 104860 [details] [review]
Patch to address regressions in role_text_multiline_navigation.py

This addresses the role_text_multiline_navigation.py regressions as described in the previous comments.  There are still additional regressions when running the whole suite of gtk-demo tests.  The problem seems to be an extra space in the braille output when we're working with tables.  Here's a typical failure -- look for the extra space before "Fixed?":

Test 7 of 8 FAILED: /export/home/wwalker/orca/trunk.354470/test/harness/../keystrokes/gtk-demo/role_column_header.py:Checkbox cell
EXPECTED:
     "BRAILLE LINE:  'gtk-demo Application GtkListStore demo Frame ScrollPane Table Fixed? ColumnHeader < > Fixed?'",
     "     VISIBLE:  '< > Fixed?', cursor=1",
     "SPEECH OUTPUT: ''",
     "SPEECH OUTPUT: 'Fixed? column header'",
     "SPEECH OUTPUT: 'check box not checked '",
ACTUAL:
     "BRAILLE LINE:  'gtk-demo Application GtkListStore demo Frame ScrollPane Table Fixed? ColumnHeader < >  Fixed?'",
     "     VISIBLE:  '< >  Fixed?', cursor=1",
     "SPEECH OUTPUT: ''",
     "SPEECH OUTPUT: 'Fixed? column header'",
     "SPEECH OUTPUT: 'check box not checked '",
Comment 48 Willie Walker 2008-02-10 18:54:51 UTC
(In reply to comment #47)
> look for the extra space before "Fixed?":

Actually, it might be an extra space after the "< >" indicator.  I'm not sure, though.  Just a hunch since the patch does work in the area of indicators and all the regressions are in the area of extra spaces after indicators.
Comment 49 Willie Walker 2008-02-10 21:50:53 UTC
Created attachment 104870 [details] [review]
Patch to eliminate all the gtk-demo regressions

The problem with the extra space was, well, an extra space.  :-)  A space was always being added after the indicator in braille.py:Component:__init__ even if there was no string.  In the regressions we were seeing, we were working with table cells that were just check boxes.  As a result, there was no label for the check box and we were just getting the indicator.  This patch checks and adjusts for that condition.

I ran the entire gtk-demo regression test suite with this patch and it's now regression free.  :-)
Comment 50 Willie Walker 2008-02-11 03:20:51 UTC
Created attachment 104887 [details] [review]
Same patch, but with simple pylint fix (remove a tab)

This is the same as the previous patch, but it pylints better.  Made against svnversion 3556.
Comment 51 Willie Walker 2008-02-11 17:37:33 UTC
Talked with the team - committing this patch for GNOME 2.21.91.  Mike will still work on identifying remaining issues (e.g., text selection indication for contracted text), so leaving this bug open.  Thanks for the hard work so far, Eitan!
Comment 52 Mike Pedersen 2008-02-22 23:01:09 UTC
One small issue I've just discovered with this functionality is as follows.
1.  Open gnome-terminal
2.  type ls in a directory with several files.
3.  flat review the output.
Notice that the line you are flat reviewing is expanded.  I would expect only the word under the flat review focus to be expanded.  
Comment 53 Eitan Isaacson 2008-03-25 22:35:20 UTC
The gnome-terminal behavior is expected, as the contraction table in liblouis tries to use computer braille on detected file names.

I am closing this bug. Any further grade 2 bugs should be files separately.