Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 86fd57b864e79835d8f7ab7e058637a1 > files > 43

ocaml-lambda-term-devel-1.4-3.mga4.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="LTerm_geom.html">
<link rel="next" href="LTerm_mouse.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class attributes" rel=Appendix href="index_attributes.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of classes" rel=Appendix href="index_classes.html">
<link title="Index of class types" rel=Appendix href="index_class_types.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="LTerm" rel="Chapter" href="LTerm.html">
<link title="LTerm_key" rel="Chapter" href="LTerm_key.html">
<link title="LTerm_event" rel="Chapter" href="LTerm_event.html">
<link title="LTerm_unix" rel="Chapter" href="LTerm_unix.html">
<link title="LTerm_windows" rel="Chapter" href="LTerm_windows.html">
<link title="LTerm_style" rel="Chapter" href="LTerm_style.html">
<link title="LTerm_geom" rel="Chapter" href="LTerm_geom.html">
<link title="LTerm_draw" rel="Chapter" href="LTerm_draw.html">
<link title="LTerm_mouse" rel="Chapter" href="LTerm_mouse.html">
<link title="LTerm_widget" rel="Chapter" href="LTerm_widget.html">
<link title="LTerm_edit" rel="Chapter" href="LTerm_edit.html">
<link title="LTerm_read_line" rel="Chapter" href="LTerm_read_line.html">
<link title="LTerm_text" rel="Chapter" href="LTerm_text.html">
<link title="LTerm_ui" rel="Chapter" href="LTerm_ui.html">
<link title="LTerm_resources" rel="Chapter" href="LTerm_resources.html">
<link title="LTerm_inputrc" rel="Chapter" href="LTerm_inputrc.html">
<link title="LTerm_history" rel="Chapter" href="LTerm_history.html"><title>LTerm_draw</title>
</head>
<body>
<div class="navbar"><a class="pre" href="LTerm_geom.html" title="LTerm_geom">Previous</a>
&nbsp;<a class="up" href="index.html" title="Index">Up</a>
&nbsp;<a class="post" href="LTerm_mouse.html" title="LTerm_mouse">Next</a>
</div>
<h1>Module <a href="type_LTerm_draw.html">LTerm_draw</a></h1>

<pre><span class="keyword">module</span> LTerm_draw: <code class="code">sig</code> <a href="LTerm_draw.html">..</a> <code class="code">end</code></pre><div class="info module top">
Drawing<br>
</div>
<hr width="100%">

<pre><code><span id="TYPEpoint"><span class="keyword">type</span> <code class="type"></code>point</span> = {</code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span class="keyword">mutable&nbsp;</span><span id="TYPEELTpoint.char">char</span>&nbsp;: <code class="type">CamomileLibrary.UChar.t</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The unicode character.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span class="keyword">mutable&nbsp;</span><span id="TYPEELTpoint.bold">bold</span>&nbsp;: <code class="type">bool</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Whether the character is in bold or not.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span class="keyword">mutable&nbsp;</span><span id="TYPEELTpoint.underline">underline</span>&nbsp;: <code class="type">bool</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Whether the character is underlined or not.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span class="keyword">mutable&nbsp;</span><span id="TYPEELTpoint.blink">blink</span>&nbsp;: <code class="type">bool</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Whether the character is blinking or not.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span class="keyword">mutable&nbsp;</span><span id="TYPEELTpoint.reverse">reverse</span>&nbsp;: <code class="type">bool</code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Whether the character is in reverse video mode or not.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span class="keyword">mutable&nbsp;</span><span id="TYPEELTpoint.foreground">foreground</span>&nbsp;: <code class="type"><a href="LTerm_style.html#TYPEcolor">LTerm_style.color</a></code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The foreground color.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span class="keyword">mutable&nbsp;</span><span id="TYPEELTpoint.background">background</span>&nbsp;: <code class="type"><a href="LTerm_style.html#TYPEcolor">LTerm_style.color</a></code>;</code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >The background color.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>
}

<div class="info ">
Type of a point in a matrix of styled characters.<br>
</div>


<pre><span id="TYPEmatrix"><span class="keyword">type</span> <code class="type"></code>matrix</span> = <code class="type"><a href="LTerm_draw.html#TYPEpoint">point</a> array array</code> </pre>
<div class="info ">
Type of a matrix of points. The matrix is indexed by lines
        then columns, i.e. to access the point at line <code class="code">l</code> and column
        <code class="code">c</code> in matrix <code class="code">m</code> you should use <code class="code">m.(l).(c)</code>.<br>
</div>


<pre><span id="VALmake_matrix"><span class="keyword">val</span> make_matrix</span> : <code class="type"><a href="LTerm_geom.html#TYPEsize">LTerm_geom.size</a> -> <a href="LTerm_draw.html#TYPEmatrix">matrix</a></code></pre><div class="info ">
<code class="code">matrix size</code> creates a matrix of the given size containing only
      blank characters.<br>
</div>

<pre><span id="VALset_style"><span class="keyword">val</span> set_style</span> : <code class="type"><a href="LTerm_draw.html#TYPEpoint">point</a> -> <a href="LTerm_style.html#TYPEt">LTerm_style.t</a> -> unit</code></pre><div class="info ">
<code class="code">set_style point style</code> sets fields of <code class="code">point</code> according to
      fields of <code class="code">style</code>. For example:
<p>

      <pre class="codepre"><code class="code">        set_style point { LTerm_style.none with LTerm_style.bold = Some true }
      </code></pre>
<p>

      will have the following effect:
<p>

      <pre class="codepre"><code class="code">        point.bold &lt;- true
      </code></pre><br>
</div>

<pre><span id="TYPEcontext"><span class="keyword">type</span> <code class="type"></code>context</span> </pre>
<div class="info ">
Type of contexts. A context is used for drawing.<br>
</div>


<pre><span id="VALcontext"><span class="keyword">val</span> context</span> : <code class="type"><a href="LTerm_draw.html#TYPEmatrix">matrix</a> -> <a href="LTerm_geom.html#TYPEsize">LTerm_geom.size</a> -> <a href="LTerm_draw.html#TYPEcontext">context</a></code></pre><div class="info ">
<code class="code">context m s</code> creates a context from a matrix <code class="code">m</code> of size
      <code class="code">s</code>. It raises <code class="code">Invalid_argument</code> if <code class="code">s</code> is not the size of
      <code class="code">m</code>.<br>
</div>

<pre><span id="EXCEPTIONOut_of_bounds"><span class="keyword">exception</span> Out_of_bounds</span></pre>
<div class="info ">
Exception raised when trying to access a point that is outside
      the bounds of a context.<br>
</div>

<pre><span id="VALsize"><span class="keyword">val</span> size</span> : <code class="type"><a href="LTerm_draw.html#TYPEcontext">context</a> -> <a href="LTerm_geom.html#TYPEsize">LTerm_geom.size</a></code></pre><div class="info ">
<code class="code">size ctx</code> returns the size of the given context.<br>
</div>

<pre><span id="VALsub"><span class="keyword">val</span> sub</span> : <code class="type"><a href="LTerm_draw.html#TYPEcontext">context</a> -> <a href="LTerm_geom.html#TYPErect">LTerm_geom.rect</a> -> <a href="LTerm_draw.html#TYPEcontext">context</a></code></pre><div class="info ">
<code class="code">sub ctx rect</code> creates a sub-context from the given context. It
      raises <a href="LTerm_draw.html#EXCEPTIONOut_of_bounds"><code class="code">LTerm_draw.Out_of_bounds</code></a> if the rectangle is not contained in the
      given context.<br>
</div>

<pre><span id="VALclear"><span class="keyword">val</span> clear</span> : <code class="type"><a href="LTerm_draw.html#TYPEcontext">context</a> -> unit</code></pre><div class="info ">
<code class="code">clear ctx</code> clears the given context. It resets all styles to
      their default and sets characters to spaces.<br>
</div>

<pre><span id="VALfill"><span class="keyword">val</span> fill</span> : <code class="type"><a href="LTerm_draw.html#TYPEcontext">context</a> -> ?style:<a href="LTerm_style.html#TYPEt">LTerm_style.t</a> -> CamomileLibrary.UChar.t -> unit</code></pre><div class="info ">
<code class="code">fill ctx ch</code> fills the given context with <code class="code">ch</code>.<br>
</div>

<pre><span id="VALfill_style"><span class="keyword">val</span> fill_style</span> : <code class="type"><a href="LTerm_draw.html#TYPEcontext">context</a> -> <a href="LTerm_style.html#TYPEt">LTerm_style.t</a> -> unit</code></pre><div class="info ">
<code class="code">fill_style style</code> fills the given context with <code class="code">style</code>.<br>
</div>

<pre><span id="VALpoint"><span class="keyword">val</span> point</span> : <code class="type"><a href="LTerm_draw.html#TYPEcontext">context</a> -> int -> int -> <a href="LTerm_draw.html#TYPEpoint">point</a></code></pre><div class="info ">
<code class="code">point ctx row column</code> returns the point at given position in
      <code class="code">ctx</code>. It raises <a href="LTerm_draw.html#EXCEPTIONOut_of_bounds"><code class="code">LTerm_draw.Out_of_bounds</code></a> if the coordinates are outside
      the given context.<br>
</div>

<pre><span id="VALdraw_char"><span class="keyword">val</span> draw_char</span> : <code class="type"><a href="LTerm_draw.html#TYPEcontext">context</a> -><br>       int -> int -> ?style:<a href="LTerm_style.html#TYPEt">LTerm_style.t</a> -> CamomileLibrary.UChar.t -> unit</code></pre><div class="info ">
<code class="code">draw_char ctx row column ?style ch</code> sets the character at given
      coordinates to <code class="code">ch</code>. It does nothing if the given coordinates
      are outside the bounds of the context.<br>
</div>

<pre><span id="VALdraw_string"><span class="keyword">val</span> draw_string</span> : <code class="type"><a href="LTerm_draw.html#TYPEcontext">context</a> -> int -> int -> ?style:<a href="LTerm_style.html#TYPEt">LTerm_style.t</a> -> string -> unit</code></pre><div class="info ">
<code class="code">draw_string ctx row column ?style str</code> draws the given string
      at given coordinates. This does not affect styles. <code class="code">str</code> may
      contains newlines.<br>
</div>

<pre><span id="VALdraw_styled"><span class="keyword">val</span> draw_styled</span> : <code class="type"><a href="LTerm_draw.html#TYPEcontext">context</a> -><br>       int -> int -> ?style:<a href="LTerm_style.html#TYPEt">LTerm_style.t</a> -> <a href="LTerm_text.html#TYPEt">LTerm_text.t</a> -> unit</code></pre><div class="info ">
<code class="code">draw_styled ctx row column ?style text</code> draws the given styled
      text at given coordinates.<br>
</div>

<pre><span id="VALdraw_string_aligned"><span class="keyword">val</span> draw_string_aligned</span> : <code class="type"><a href="LTerm_draw.html#TYPEcontext">context</a> -><br>       int -> <a href="LTerm_geom.html#TYPEhorz_alignment">LTerm_geom.horz_alignment</a> -> ?style:<a href="LTerm_style.html#TYPEt">LTerm_style.t</a> -> string -> unit</code></pre><div class="info ">
Draws a string with the given alignment.<br>
</div>

<pre><span id="VALdraw_styled_aligned"><span class="keyword">val</span> draw_styled_aligned</span> : <code class="type"><a href="LTerm_draw.html#TYPEcontext">context</a> -><br>       int -><br>       <a href="LTerm_geom.html#TYPEhorz_alignment">LTerm_geom.horz_alignment</a> -> ?style:<a href="LTerm_style.html#TYPEt">LTerm_style.t</a> -> <a href="LTerm_text.html#TYPEt">LTerm_text.t</a> -> unit</code></pre><div class="info ">
Draws a styled string with the given aglienment.<br>
</div>

<pre><code><span id="TYPEconnection"><span class="keyword">type</span> <code class="type"></code>connection</span> = </code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTconnection.Blank"><span class="constructor">Blank</span></span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >No connection.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTconnection.Light"><span class="constructor">Light</span></span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Connection with a light line.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTconnection.Heavy"><span class="constructor">Heavy</span></span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >Connection with a heavy line.</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>

<div class="info ">
Type of an connection in a piece that can be connected to other
    pieces.<br>
</div>


<pre><code><span id="TYPEpiece"><span class="keyword">type</span> <code class="type"></code>piece</span> = {</code></pre><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTpiece.top">top</span>&nbsp;: <code class="type"><a href="LTerm_draw.html#TYPEconnection">connection</a></code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTpiece.bottom">bottom</span>&nbsp;: <code class="type"><a href="LTerm_draw.html#TYPEconnection">connection</a></code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTpiece.left">left</span>&nbsp;: <code class="type"><a href="LTerm_draw.html#TYPEconnection">connection</a></code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span id="TYPEELTpiece.right">right</span>&nbsp;: <code class="type"><a href="LTerm_draw.html#TYPEconnection">connection</a></code>;</code></td>

</tr></table>
}

<div class="info ">
Type of a piece, given by its four connection.<br>
</div>


<pre><span id="VALdraw_piece"><span class="keyword">val</span> draw_piece</span> : <code class="type"><a href="LTerm_draw.html#TYPEcontext">context</a> -><br>       int -> int -> ?style:<a href="LTerm_style.html#TYPEt">LTerm_style.t</a> -> <a href="LTerm_draw.html#TYPEpiece">piece</a> -> unit</code></pre><div class="info ">
Draws a piece. It may modify pieces around it.<br>
</div>

<pre><span id="VALdraw_hline"><span class="keyword">val</span> draw_hline</span> : <code class="type"><a href="LTerm_draw.html#TYPEcontext">context</a> -><br>       int -> int -> int -> ?style:<a href="LTerm_style.html#TYPEt">LTerm_style.t</a> -> <a href="LTerm_draw.html#TYPEconnection">connection</a> -> unit</code></pre><div class="info ">
<code class="code">draw_hline ctx row column length connection</code> draws an
      horizontal line.<br>
</div>

<pre><span id="VALdraw_vline"><span class="keyword">val</span> draw_vline</span> : <code class="type"><a href="LTerm_draw.html#TYPEcontext">context</a> -><br>       int -> int -> int -> ?style:<a href="LTerm_style.html#TYPEt">LTerm_style.t</a> -> <a href="LTerm_draw.html#TYPEconnection">connection</a> -> unit</code></pre><div class="info ">
<code class="code">draw_hline ctx row column length connection</code> draws a vertical
      line.<br>
</div>

<pre><span id="VALdraw_frame"><span class="keyword">val</span> draw_frame</span> : <code class="type"><a href="LTerm_draw.html#TYPEcontext">context</a> -><br>       <a href="LTerm_geom.html#TYPErect">LTerm_geom.rect</a> -> ?style:<a href="LTerm_style.html#TYPEt">LTerm_style.t</a> -> <a href="LTerm_draw.html#TYPEconnection">connection</a> -> unit</code></pre><div class="info ">
Draws a rectangle.<br>
</div>
</body></html>