1Writing on the braille display(3)   BrlAPI   Writing on the braille display(3)
2
3
4

NAME

6       Writing on the braille display - Write text to the braille display.
7
8
9   Data Structures
10       struct brlapi_writeArguments_t
11
12   Defines
13       #define BRLAPI_DISPLAY_DEFAULT   -1
14       #define BRLAPI_CURSOR_LEAVE   -1
15       #define BRLAPI_CURSOR_OFF   0
16       #define BRLAPI_WRITEARGUMENTS_INITIALIZER   { BRLAPI_DISPLAY_DEFAULT,
17           0, 0, NULL, -1, NULL, NULL, BRLAPI_CURSOR_LEAVE, NULL }
18
19   Functions
20       int BRLAPI_STDCALL brlapi_writeText (int cursor, const char *text)
21       int BRLAPI_STDCALL brlapi__writeText (brlapi_handle_t *handle, int
22           cursor, const char *text)
23       int BRLAPI_STDCALL brlapi_writeDots (const unsigned char *dots)
24       int BRLAPI_STDCALL brlapi__writeDots (brlapi_handle_t *handle, const
25           unsigned char *dots)
26       int BRLAPI_STDCALL brlapi_write (const brlapi_writeArguments_t
27           *arguments)
28       int BRLAPI_STDCALL brlapi__write (brlapi_handle_t *handle, const
29           brlapi_writeArguments_t *arguments)
30

Detailed Description

32       After brlapi_enterTtyMode() has been called, the application can call
33       one of these functions to write things on the braille display.
34
35       Note:
36           Be sure to call brlapi_enterTtyMode() before calling
37           brlapi_write(), or else you'll get an error. This is particularly
38           not always trivial when writing multithreaded applications.
39
40           Dots are coded as described in ISO/TR 11548-1: a dot pattern is
41           coded by a byte in which bit 0 is set iff dot 1 is up, bit 1 is set
42           iff dot 2 is up, ... bit 7 is set iff dot 8 is up. This also
43           corresponds to the low-order byte of the coding of unicode's
44           braille row U+2800.
45
46           Text is translated by the server one to one, by just using a simple
47           wchar_t to pattern table, i.e. no contraction/expansion is
48           performed, because the client would then have no way to know how
49           wide the output would be and thus the quantity of text to feed. If
50           contraction/expansion is desired, the client should perform it
51           itself (e.g. thanks to liblouis or gnome-braille) and send the
52           resulting dot patterns. This is actually exactly the same problem
53           as font rendering on a graphical display: for better control,
54           nowadays all font rasterization is performed on the client side,
55           and mere pixmaps are sent to the X server.
56

Define Documentation

58   #define BRLAPI_CURSOR_LEAVE   -1
59       Do not change the cursor's state or position.
60
61       See also:
62           brlapi_writeText() brlapi_write() brlapi_writeArguments_t
63
64   #define BRLAPI_CURSOR_OFF   0
65       Do not display the cursor.
66
67       See also:
68           brlapi_writeText() brlapi_write() brlapi_writeArguments_t
69
70   #define BRLAPI_DISPLAY_DEFAULT   -1
71       Write to the default display on the braille device.
72
73       See also:
74           brlapi_write() brlapi_writeArguments_t
75
76   #define BRLAPI_WRITEARGUMENTS_INITIALIZER   { BRLAPI_DISPLAY_DEFAULT, 0, 0,
77       NULL, -1, NULL, NULL, BRLAPI_CURSOR_LEAVE, NULL }
78       Allows to initialize a structure of type brlapi_writeArguments_t * with
79       default values: displayNumber = BRLAPI_DISPLAY_DEFAULT; (unspecified)
80       regionBegin = regionSize = 0; (update the whole display, DEPRECATED and
81       will be forbidden in next release. You must always express the region
82       you wish to update) text = andMask = orMask = NULL; (no text, no
83       attribute) cursor = BRLAPI_CURSOR_LEAVE; (don't touch cursor)
84

Function Documentation

86   int BRLAPI_STDCALL brlapi__write (brlapi_handle_t * handle, const
87       brlapi_writeArguments_t * arguments)
88   int BRLAPI_STDCALL brlapi__writeDots (brlapi_handle_t * handle, const
89       unsigned char * dots)
90   int BRLAPI_STDCALL brlapi__writeText (brlapi_handle_t * handle, int cursor,
91       const char * text)
92   int BRLAPI_STDCALL brlapi_write (const brlapi_writeArguments_t * arguments)
93       Update a specific region of the braille display and apply and/or masks
94
95       Parameters:
96           arguments gives information necessary for the update
97
98       regionBegin and regionSize must be filled for specifying which part of
99       the display will be updated, as well as the size (in characters, not
100       bytes) of the text, andMask and orMask members.
101
102       If given, the 'text' field holds the text that will be displayed in the
103       region. The char string must hold exactly as many characters as the
104       region fields express. For multibyte text, this is the number of
105       multibyte caracters. Notably, combining and double-width caracters
106       count for 1.
107
108       The actual length of the text in bytes may be specified thanks to
109       textSize. If -1 is given, it will be computed thanks to strlen(), so
110       'text' must then be a NUL-terminated string.
111
112       The 'andMask' and 'orMask' masks, if present, are then applied on top
113       of the text, one byte per character. This hence permits the
114       superimposing of attributes over the text. For instance, setting an
115       andMask mask full of BRLAPI_DOTS(1,1,1,1,1,1,0,0) will only keep
116       (logical AND) dots 1-6, hence dropping dots 7 and 8. On the contrary,
117       setting an orMask full of BRLAPI_DOT7|BRLAPI_DOT8 will add (logical OR)
118       dots 7 and 8.
119
120       The 'charset' field, if present, specifies the charset of the 'text'
121       field. If it is '', the current locale's charset (if any) is assumed.
122       Else, the 8-bit charset of the server is assumed.
123
124       A special invocation is with an unmodified initialized structure: this
125       clears the client's whole display, letting the display of other
126       applications on the same tty or of applications 'under' the tty appear.
127       See Concurrency management section of the BrlAPI documentation for more
128       details.
129
130       Returns:
131           0 on success, -1 on error.
132
133   int BRLAPI_STDCALL brlapi_writeDots (const unsigned char * dots)
134       Write the given dots array to the display
135
136       Parameters:
137           dots points on an array of dot information, one per character. Its
138           size must hence be the same as what brlapi_getDisplaySize()
139           returns.
140
141       Returns:
142           0 on success, -1 on error.
143
144   int BRLAPI_STDCALL brlapi_writeText (int cursor, const char * text)
145       Write the given \0-terminated string to the braille display
146
147       If the string is too long, it is cut. If it's too short, spaces are
148       appended. The current LC_CTYPE locale is considered, unless it is left
149       as default 'C', in which case the charset is assumed to be 8bits, and
150       the same as the server's.
151
152       Parameters:
153           cursor gives the cursor position; if equal to BRLAPI_CURSOR_OFF, no
154           cursor is shown at all; if cursor==BRLAPI_CURSOR_LEAVE, the cursor
155           is left where it is
156           text points to the string to be displayed.
157
158       Returns:
159           0 on success, -1 on error.
160
161Version 1.0                       7 Oct 2009 Writing on the braille display(3)
Impressum