[BRLTTY] Low-level BrlAPI questions

Samuel Thibault samuel.thibault at ens-lyon.org
Tue Apr 20 08:39:21 EDT 2021


Aura Kelloniemi, le mar. 20 avril 2021 15:26:53 +0300, a ecrit:
> On 2021-04-17 at 23:19 +0200, Samuel Thibault <samuel.thibault at ens-lyon.org> wrote:
>  > Aura Kelloniemi, le ven. 16 avril 2021 09:22:32 +0300, a ecrit:
>  > > On 2021-04-16 at 01:04 +0200, Samuel Thibault <samuel.thibault at ens-lyon.org> wrote:
>  > >  > Such languages can then use brlapi__write with setting the charset, the
>  > >  > textSize, regionBegin set to 0, and regionSize with that flag or special
>  > >  > value. Is there something missing here?
>  > > 
>  > > No, there isn't. This would be a working solution.
> 
>  > This has now landed!
> 
> According to documentation, setting regionSize to a negative value blanks the
> rest of the display. If the masks are shorter than the number of cells until
> the end of the display, but text is longer than regionSize, what happens?

They are completed with 0xff for and and 0x00 for or.

> I wonder whether it would be semantically clearer to blank only up to
> (regionSize * -1) if regionSize < 0, because we already decided that it is
> most likely a programming bug,

? I thought we decided it would be considered a bug only if the
programmer provided a positive value, and when it is a negative value,
it means the programmer doesn't really care, and we just complete.

> This is partly because the caller of brlapi__write uses masks to
> add/remove dots from particular characters, and to do that they need to know
> about the exact indices of those characters.

Then what we can do is still blank up to the end of the display, so the
programmer doesn't have to care about the size of the display, but
reject incoherency between the number of characters of the text and the
number of characters of and/or.

> Thinking about regional writes brought oen more question to my mind:
> 
> If an application uses regional writes, and another application "steals" the
> TTY from the original client, and later restores it, will the display contents
> be restored to original text the first client was showing?

Yes. Each client has its own buffer.

If they were not, it would be a terrible mess, clients would have to
rewrite each time one switches focus, etc.

Samuel


More information about the BRLTTY mailing list