Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > main-release > by-pkgid > 78cff6a8ec39f0e621e35b5f5c351f9d > files > 51

lib64brlapi-devel-4.1-1mdv2010.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>BrlAPI: Writing on the braille display</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Writing on the braille display</h1>Write text to the braille display.  
<a href="#_details">More...</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structbrlapi__writeArguments__t.html">brlapi_writeArguments_t</a></td></tr>

<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__brlapi__write.html#gb1a71f82cac5d0b7ea1170697fe0dfc2">BRLAPI_DISPLAY_DEFAULT</a>&nbsp;&nbsp;&nbsp;-1</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__brlapi__write.html#gb0f523a333efcd272ac591785747f8ce">BRLAPI_CURSOR_LEAVE</a>&nbsp;&nbsp;&nbsp;-1</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__brlapi__write.html#gdf7ed09ca3d6694bcd993fa3c351cebf">BRLAPI_CURSOR_OFF</a>&nbsp;&nbsp;&nbsp;0</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__brlapi__write.html#gff27465103fb53fb7725e7cb0e89ef00">BRLAPI_WRITEARGUMENTS_INITIALIZER</a>&nbsp;&nbsp;&nbsp;{ BRLAPI_DISPLAY_DEFAULT, 0, 0, NULL, -1, NULL, NULL, BRLAPI_CURSOR_LEAVE, NULL }</td></tr>

<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int BRLAPI_STDCALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__brlapi__write.html#g7e6063c33a34fe23a564cfc1a44a9c47">brlapi_writeText</a> (int cursor, const char *text)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int BRLAPI_STDCALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__brlapi__write.html#g40c638da4a7e92e7a52d3051a9577865">brlapi__writeText</a> (<a class="el" href="group__brlapi__handles.html#g57f2aec62b18f8aefea2ab550744b0c1">brlapi_handle_t</a> *handle, int cursor, const char *text)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int BRLAPI_STDCALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__brlapi__write.html#g9aa155c03d33aa2ab45a07396ca4c835">brlapi_writeDots</a> (const unsigned char *dots)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int BRLAPI_STDCALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__brlapi__write.html#g6284e93dc8986554613efd35f936317a">brlapi__writeDots</a> (<a class="el" href="group__brlapi__handles.html#g57f2aec62b18f8aefea2ab550744b0c1">brlapi_handle_t</a> *handle, const unsigned char *dots)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int BRLAPI_STDCALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__brlapi__write.html#g287f9a11719e1c350fb0280a38e0e069">brlapi_write</a> (const <a class="el" href="structbrlapi__writeArguments__t.html">brlapi_writeArguments_t</a> *arguments)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">int BRLAPI_STDCALL&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__brlapi__write.html#gc35d4baf687d4d1726c76e5c5b33cdb0">brlapi__write</a> (<a class="el" href="group__brlapi__handles.html#g57f2aec62b18f8aefea2ab550744b0c1">brlapi_handle_t</a> *handle, const <a class="el" href="structbrlapi__writeArguments__t.html">brlapi_writeArguments_t</a> *arguments)</td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
After <a class="el" href="group__brlapi__tty.html#g6d8ae822fa87d9bfb1fb15ecf2bbcaac">brlapi_enterTtyMode()</a> has been called, the application can call one of these functions to write things on the braille display.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Be sure to call <a class="el" href="group__brlapi__tty.html#g6d8ae822fa87d9bfb1fb15ecf2bbcaac">brlapi_enterTtyMode()</a> <em>before</em> calling <a class="el" href="group__brlapi__write.html#g287f9a11719e1c350fb0280a38e0e069">brlapi_write()</a>, or else you'll get an error. This is particularly not always trivial when writing multithreaded applications.<p>
Dots are coded as described in ISO/TR 11548-1: a dot pattern is coded by a byte in which bit 0 is set iff dot 1 is up, bit 1 is set iff dot 2 is up, ... bit 7 is set iff dot 8 is up. This also corresponds to the low-order byte of the coding of unicode's braille row U+2800.<p>
Text is translated by the server one to one, by just using a simple wchar_t to pattern table, i.e. no contraction/expansion is performed, because the client would then have no way to know how wide the output would be and thus the quantity of text to feed. If contraction/expansion is desired, the client should perform it itself (e.g. thanks to liblouis or gnome-braille) and send the resulting dot patterns. This is actually exactly the same problem as font rendering on a graphical display: for better control, nowadays all font rasterization is performed on the client side, and mere pixmaps are sent to the X server. </dd></dl>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="gb0f523a333efcd272ac591785747f8ce"></a><!-- doxytag: member="brlapi.h::BRLAPI_CURSOR_LEAVE" ref="gb0f523a333efcd272ac591785747f8ce" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BRLAPI_CURSOR_LEAVE&nbsp;&nbsp;&nbsp;-1          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Do not change the cursor's state or position.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__brlapi__write.html#g7e6063c33a34fe23a564cfc1a44a9c47">brlapi_writeText()</a> <a class="el" href="group__brlapi__write.html#g287f9a11719e1c350fb0280a38e0e069">brlapi_write()</a> <a class="el" href="structbrlapi__writeArguments__t.html">brlapi_writeArguments_t</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="gdf7ed09ca3d6694bcd993fa3c351cebf"></a><!-- doxytag: member="brlapi.h::BRLAPI_CURSOR_OFF" ref="gdf7ed09ca3d6694bcd993fa3c351cebf" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BRLAPI_CURSOR_OFF&nbsp;&nbsp;&nbsp;0          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Do not display the cursor.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__brlapi__write.html#g7e6063c33a34fe23a564cfc1a44a9c47">brlapi_writeText()</a> <a class="el" href="group__brlapi__write.html#g287f9a11719e1c350fb0280a38e0e069">brlapi_write()</a> <a class="el" href="structbrlapi__writeArguments__t.html">brlapi_writeArguments_t</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="gb1a71f82cac5d0b7ea1170697fe0dfc2"></a><!-- doxytag: member="brlapi.h::BRLAPI_DISPLAY_DEFAULT" ref="gb1a71f82cac5d0b7ea1170697fe0dfc2" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BRLAPI_DISPLAY_DEFAULT&nbsp;&nbsp;&nbsp;-1          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Write to the default display on the braille device.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__brlapi__write.html#g287f9a11719e1c350fb0280a38e0e069">brlapi_write()</a> <a class="el" href="structbrlapi__writeArguments__t.html">brlapi_writeArguments_t</a> </dd></dl>

</div>
</div><p>
<a class="anchor" name="gff27465103fb53fb7725e7cb0e89ef00"></a><!-- doxytag: member="brlapi.h::BRLAPI_WRITEARGUMENTS_INITIALIZER" ref="gff27465103fb53fb7725e7cb0e89ef00" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BRLAPI_WRITEARGUMENTS_INITIALIZER&nbsp;&nbsp;&nbsp;{ BRLAPI_DISPLAY_DEFAULT, 0, 0, NULL, -1, NULL, NULL, BRLAPI_CURSOR_LEAVE, NULL }          </td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Allows to initialize a structure of type <em><a class="el" href="structbrlapi__writeArguments__t.html">brlapi_writeArguments_t</a></em> * with default values: displayNumber = <a class="el" href="group__brlapi__write.html#gb1a71f82cac5d0b7ea1170697fe0dfc2">BRLAPI_DISPLAY_DEFAULT</a>; (unspecified) regionBegin = regionSize = 0; (update the whole display, DEPRECATED and will be forbidden in next release. You must always express the region you wish to update) text = andMask = orMask = NULL; (no text, no attribute) cursor = <a class="el" href="group__brlapi__write.html#gb0f523a333efcd272ac591785747f8ce">BRLAPI_CURSOR_LEAVE</a>; (don't touch cursor) 
</div>
</div><p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="gc35d4baf687d4d1726c76e5c5b33cdb0"></a><!-- doxytag: member="brlapi.h::brlapi__write" ref="gc35d4baf687d4d1726c76e5c5b33cdb0" args="(brlapi_handle_t *handle, const brlapi_writeArguments_t *arguments)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int BRLAPI_STDCALL brlapi__write           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__brlapi__handles.html#g57f2aec62b18f8aefea2ab550744b0c1">brlapi_handle_t</a> *&nbsp;</td>
          <td class="paramname"> <em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structbrlapi__writeArguments__t.html">brlapi_writeArguments_t</a> *&nbsp;</td>
          <td class="paramname"> <em>arguments</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<a class="anchor" name="g6284e93dc8986554613efd35f936317a"></a><!-- doxytag: member="brlapi.h::brlapi__writeDots" ref="g6284e93dc8986554613efd35f936317a" args="(brlapi_handle_t *handle, const unsigned char *dots)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int BRLAPI_STDCALL brlapi__writeDots           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__brlapi__handles.html#g57f2aec62b18f8aefea2ab550744b0c1">brlapi_handle_t</a> *&nbsp;</td>
          <td class="paramname"> <em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char *&nbsp;</td>
          <td class="paramname"> <em>dots</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<a class="anchor" name="g40c638da4a7e92e7a52d3051a9577865"></a><!-- doxytag: member="brlapi.h::brlapi__writeText" ref="g40c638da4a7e92e7a52d3051a9577865" args="(brlapi_handle_t *handle, int cursor, const char *text)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int BRLAPI_STDCALL brlapi__writeText           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__brlapi__handles.html#g57f2aec62b18f8aefea2ab550744b0c1">brlapi_handle_t</a> *&nbsp;</td>
          <td class="paramname"> <em>handle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>cursor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>text</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<a class="anchor" name="g287f9a11719e1c350fb0280a38e0e069"></a><!-- doxytag: member="brlapi.h::brlapi_write" ref="g287f9a11719e1c350fb0280a38e0e069" args="(const brlapi_writeArguments_t *arguments)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int BRLAPI_STDCALL brlapi_write           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structbrlapi__writeArguments__t.html">brlapi_writeArguments_t</a> *&nbsp;</td>
          <td class="paramname"> <em>arguments</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Update a specific region of the braille display and apply and/or masks<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>arguments</em>&nbsp;</td><td>gives information necessary for the update</td></tr>
  </table>
</dl>
regionBegin and regionSize must be filled for specifying which part of the display will be updated, as well as the size (in characters, not bytes) of the text, andMask and orMask members.<p>
If given, the "text" field holds the text that will be displayed in the region. The char string must hold exactly as many characters as the region fields express. For multibyte text, this is the number of <em>multibyte</em> caracters. Notably, combining and double-width caracters count for 1.<p>
The actual length of the text in <em>bytes</em> may be specified thanks to textSize. If -1 is given, it will be computed thanks to strlen(), so "text" must then be a NUL-terminated string.<p>
The "andMask" and "orMask" masks, if present, are then applied on top of the text, one byte per character. This hence permits the superimposing of attributes over the text. For instance, setting an andMask mask full of <a class="el" href="group__brlapi__keycodes.html#ge01727afff33b4fcb303a82f1144a471">BRLAPI_DOTS(1,1,1,1,1,1,0,0)</a> will only keep (logical AND) dots 1-6, hence dropping dots 7 and 8. On the contrary, setting an orMask full of BRLAPI_DOT7|BRLAPI_DOT8 will add (logical OR) dots 7 and 8.<p>
The "charset" field, if present, specifies the charset of the "text" field. If it is "", the current locale's charset (if any) is assumed. Else, the 8-bit charset of the server is assumed.<p>
A special invocation is with an unmodified initialized structure: this clears the client's whole display, letting the display of other applications on the same tty or of applications "under" the tty appear. See Concurrency management section of the BrlAPI documentation for more details.<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success, -1 on error. </dd></dl>

</div>
</div><p>
<a class="anchor" name="g9aa155c03d33aa2ab45a07396ca4c835"></a><!-- doxytag: member="brlapi.h::brlapi_writeDots" ref="g9aa155c03d33aa2ab45a07396ca4c835" args="(const unsigned char *dots)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int BRLAPI_STDCALL brlapi_writeDots           </td>
          <td>(</td>
          <td class="paramtype">const unsigned char *&nbsp;</td>
          <td class="paramname"> <em>dots</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Write the given dots array to the display<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dots</em>&nbsp;</td><td>points on an array of dot information, one per character. Its size must hence be the same as what <a class="el" href="group__brlapi__info.html#g3df1f8106020b1fa4a4b34380abeb191">brlapi_getDisplaySize()</a> returns.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success, -1 on error. </dd></dl>

</div>
</div><p>
<a class="anchor" name="g7e6063c33a34fe23a564cfc1a44a9c47"></a><!-- doxytag: member="brlapi.h::brlapi_writeText" ref="g7e6063c33a34fe23a564cfc1a44a9c47" args="(int cursor, const char *text)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int BRLAPI_STDCALL brlapi_writeText           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>cursor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>text</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Write the given \0-terminated string to the braille display<p>
If the string is too long, it is cut. If it's too short, spaces are appended. The current LC_CTYPE locale is considered, unless it is left as default "C", in which case the charset is assumed to be 8bits, and the same as the server's.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>cursor</em>&nbsp;</td><td>gives the cursor position; if equal to <a class="el" href="group__brlapi__write.html#gdf7ed09ca3d6694bcd993fa3c351cebf">BRLAPI_CURSOR_OFF</a>, no cursor is shown at all; if cursor==<a class="el" href="group__brlapi__write.html#gb0f523a333efcd272ac591785747f8ce">BRLAPI_CURSOR_LEAVE</a>, the cursor is left where it is</td></tr>
    <tr><td valign="top"></td><td valign="top"><em>text</em>&nbsp;</td><td>points to the string to be displayed.</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success, -1 on error. </dd></dl>

</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Oct 7 22:37:56 2009 for BrlAPI by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>