/usr/share/doc/libghc-vty-doc/html/Graphics-Vty.html is in libghc-vty-doc 5.11.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Graphics.Vty</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Graphics-Vty.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Graphics-Vty.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">vty-5.11.3: A simple terminal UI library</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell2010</td></tr></table><p class="caption">Graphics.Vty</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Vty supports input and output to terminal devices.</p><ul><li>Input to the terminal is provided to the app as a sequence of <code><a href="Graphics-Vty-Input-Events.html#t:Event">Event</a></code>s.</li><li><p>The output is defined by a <code><a href="Graphics-Vty-Picture.html#t:Picture">Picture</a></code>. Which is one or more layers of <code><a href="Graphics-Vty-Image.html#t:Image">Image</a></code>s.</p><ul><li>The module <a href="Graphics-Vty-Image.html">Graphics.Vty.Image</a> provides a number of constructor equations that will build
correct <code><a href="Graphics-Vty-Image.html#t:Image">Image</a></code> values. See <code><a href="Graphics-Vty-Image.html#v:string">string</a></code>, <code><a href="Graphics-Vty-Image.html#v:-60--124--62-"><|></a></code>, and <code><a href="Graphics-Vty-Image.html#v:-60--45--62-"><-></a></code> for starters.</li><li>The constructors in <a href="Graphics-Vty-Image-Internal.html">Graphics.Vty.Image.Internal</a> should not be used.</li></ul></li><li><code><a href="Graphics-Vty-Image.html#t:Image">Image</a></code>s can be styled using <code><a href="Graphics-Vty-Attributes.html#t:Attr">Attr</a></code>. See <a href="Graphics-Vty-Attributes.html">Graphics.Vty.Attributes</a>.</li></ul><p>See the vty-examples package for a number of examples.</p><pre> import <a href="Graphics-Vty.html">Graphics.Vty</a>
main = do
cfg <- <code><a href="Graphics-Vty-Config.html#v:standardIOConfig">standardIOConfig</a></code>
vty <- <code><a href="Graphics-Vty.html#v:mkVty">mkVty</a></code> cfg
let line0 = <code><a href="Graphics-Vty-Image.html#v:string">string</a></code> (<code><a href="Graphics-Vty-Attributes.html#v:defAttr">defAttr</a></code> ` <code><a href="Graphics-Vty-Attributes.html#v:withForeColor">withForeColor</a></code> ` <code><a href="Graphics-Vty-Attributes.html#v:green">green</a></code>) "first line"
line1 = <code><a href="Graphics-Vty-Image.html#v:string">string</a></code> (<code><a href="Graphics-Vty-Attributes.html#v:defAttr">defAttr</a></code> ` <code><a href="Graphics-Vty-Attributes.html#v:withBackColor">withBackColor</a></code> ` <code><a href="Graphics-Vty-Attributes.html#v:blue">blue</a></code>) "second line"
img = line0 <code><a href="Graphics-Vty-Image.html#v:-60--45--62-"><-></a></code> line1
pic = <code><a href="Graphics-Vty-Picture.html#v:picForImage">picForImage</a></code> img
<code><a href="Graphics-Vty.html#v:update">update</a></code> vty pic
e <- <code><a href="Graphics-Vty.html#v:nextEvent">nextEvent</a></code> vty
<code><a href="Graphics-Vty.html#v:shutdown">shutdown</a></code> vty
<code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#v:print">print</a></code> ("Last event was: " <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/GHC-OldList.html#v:-43--43-">++</a></code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#v:show">show</a></code> e)
</pre><p>Good sources of documentation for terminal programming are:</p><ul><li><a href="https://github.com/b4winckler/vim/blob/master/src/term.c">https://github.com/b4winckler/vim/blob/master/src/term.c</a></li><li><a href="http://invisible-island.net/xterm/ctlseqs/ctlseqs.html">http://invisible-island.net/xterm/ctlseqs/ctlseqs.html</a></li><li><a href="http://ulisse.elettra.trieste.it/services/doc/serial/config.html">http://ulisse.elettra.trieste.it/services/doc/serial/config.html</a></li><li><a href="http://www.leonerd.org.uk/hacks/hints/xterm-8bit.html">http://www.leonerd.org.uk/hacks/hints/xterm-8bit.html</a></li><li><a href="http://www.unixwiz.net/techtips/termios-vmin-vtime.html">http://www.unixwiz.net/techtips/termios-vmin-vtime.html</a></li><li><a href="http://vt100.net/docs/vt100-ug/chapter3.html">vt100 control sequences</a></li></ul></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span> <a href="#t:Vty">Vty</a> = <a href="#v:Vty">Vty</a> {<ul class="subs"><li><a href="#v:update">update</a> :: <a href="Graphics-Vty-Picture.html#t:Picture">Picture</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> ()</li><li><a href="#v:nextEvent">nextEvent</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="Graphics-Vty-Input-Events.html#t:Event">Event</a></li><li><a href="#v:inputIface">inputIface</a> :: <a href="Graphics-Vty-Input.html#t:Input">Input</a></li><li><a href="#v:outputIface">outputIface</a> :: <a href="Graphics-Vty-Output-Interface.html#t:Output">Output</a></li><li><a href="#v:refresh">refresh</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> ()</li><li><a href="#v:shutdown">shutdown</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> ()</li></ul>}</li><li class="src short"><a href="#v:mkVty">mkVty</a> :: <a href="Graphics-Vty-Config.html#t:Config">Config</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="Graphics-Vty.html#t:Vty">Vty</a></li><li class="src short">module <a href="Graphics-Vty-Config.html">Graphics.Vty.Config</a></li><li class="src short">module <a href="Graphics-Vty-Input.html">Graphics.Vty.Input</a></li><li class="src short">module <a href="Graphics-Vty-Output.html">Graphics.Vty.Output</a></li><li class="src short">module <a href="Graphics-Vty-Picture.html">Graphics.Vty.Picture</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:DisplayRegion">DisplayRegion</a> = (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a>)</li><li class="src short"><span class="keyword">data</span> <a href="#t:Mode">Mode</a><ul class="subs"><li>= <a href="#v:Mouse">Mouse</a></li><li>| <a href="#v:BracketedPaste">BracketedPaste</a></li></ul></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Vty" class="def">Vty</a> <a href="src/Graphics-Vty.html#Vty" class="link">Source</a> <a href="#t:Vty" class="selflink">#</a></p><div class="doc"><p>The main object. At most one should be created.</p><p>The use of Vty typically follows this process:</p><ol><li>initialize vty</li><li>use the update equation of Vty to display a picture</li><li>repeat</li><li>shutdown vty.</li></ol><p>An alternative to tracking the Vty instance is to use <code>withVty</code> in <a href="Graphics-Vty-Inline-Unsafe.html">Graphics.Vty.Inline.Unsafe</a>.</p><p>This does not assure any thread safety. In theory, as long as an update action is not executed
when another update action is already then it's safe to call this on multiple threads.</p><p>todo Remove explicit <code><a href="Graphics-Vty.html#v:shutdown">shutdown</a></code> requirement.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:Vty" class="def">Vty</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:update" class="def">update</a> :: <a href="Graphics-Vty-Picture.html#t:Picture">Picture</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> ()</dfn><div class="doc"><p>Outputs the given Picture. Equivalent to <code><a href="Graphics-Vty-Output-Interface.html#v:outputPicture">outputPicture</a></code> applied to a display context
implicitly managed by Vty. The managed display context is reset on resize.</p></div></li><li><dfn class="src"><a id="v:nextEvent" class="def">nextEvent</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="Graphics-Vty-Input-Events.html#t:Event">Event</a></dfn><div class="doc"><p>Get one Event object, blocking if necessary. This will refresh the terminal if the event
is a <code><a href="Graphics-Vty-Input-Events.html#v:EvResize">EvResize</a></code>.</p></div></li><li><dfn class="src"><a id="v:inputIface" class="def">inputIface</a> :: <a href="Graphics-Vty-Input.html#t:Input">Input</a></dfn><div class="doc"><p>The input interface. See <code><a href="Graphics-Vty-Input.html#t:Input">Input</a></code></p></div></li><li><dfn class="src"><a id="v:outputIface" class="def">outputIface</a> :: <a href="Graphics-Vty-Output-Interface.html#t:Output">Output</a></dfn><div class="doc"><p>The output interface. See <code><a href="Graphics-Vty-Output-Interface.html#t:Output">Output</a></code></p></div></li><li><dfn class="src"><a id="v:refresh" class="def">refresh</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> ()</dfn><div class="doc"><p>Refresh the display. <code><a href="Graphics-Vty.html#v:nextEvent">nextEvent</a></code> will refresh the display if a resize occurs.
If other programs output to the terminal and mess up the display then the application might
want to force a refresh.</p></div></li><li><dfn class="src"><a id="v:shutdown" class="def">shutdown</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> ()</dfn><div class="doc"><p>Clean up after vty.
The above methods will throw an exception if executed after this is executed.</p></div></li></ul></div></td></tr></table></div></div><div class="top"><p class="src"><a id="v:mkVty" class="def">mkVty</a> :: <a href="Graphics-Vty-Config.html#t:Config">Config</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/System-IO.html#t:IO">IO</a> <a href="Graphics-Vty.html#t:Vty">Vty</a> <a href="src/Graphics-Vty.html#mkVty" class="link">Source</a> <a href="#v:mkVty" class="selflink">#</a></p><div class="doc"><p>Set up the state object for using vty. At most one state object should be
created at a time for a given terminal device.</p><p>The specified config is added to the <code><a href="Graphics-Vty-Config.html#v:userConfig">userConfig</a></code>. With the <code><a href="Graphics-Vty-Config.html#v:userConfig">userConfig</a></code> taking precedence.
See <a href="Graphics-Vty-Config.html">Graphics.Vty.Config</a></p><p>For most applications <code>mkVty def</code> is sufficient.</p></div></div><div class="top"><p class="src">module <a href="Graphics-Vty-Config.html">Graphics.Vty.Config</a></p></div><div class="top"><p class="src">module <a href="Graphics-Vty-Input.html">Graphics.Vty.Input</a></p></div><div class="top"><p class="src">module <a href="Graphics-Vty-Output.html">Graphics.Vty.Output</a></p></div><div class="top"><p class="src">module <a href="Graphics-Vty-Picture.html">Graphics.Vty.Picture</a></p></div><div class="top"><p class="src"><span class="keyword">type</span> <a id="t:DisplayRegion" class="def">DisplayRegion</a> = (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a>) <a href="src/Graphics-Vty-Prelude.html#DisplayRegion" class="link">Source</a> <a href="#t:DisplayRegion" class="selflink">#</a></p><div class="doc"><p>Named alias for a Int pair</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:Mode" class="def">Mode</a> <a href="src/Graphics-Vty-Output-Interface.html#Mode" class="link">Source</a> <a href="#t:Mode" class="selflink">#</a></p><div class="doc"><p>Modal terminal features that can be enabled and disabled.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:Mouse" class="def">Mouse</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a id="v:BracketedPaste" class="def">BracketedPaste</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:Mode" class="caption collapser" onclick="toggleSection('i:Mode')">Instances</p><div id="section.i:Mode" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Mode:Eq:1" class="instance expander" onclick="toggleSection('i:id:Mode:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Eq.html#t:Eq">Eq</a> <a href="Graphics-Vty.html#t:Mode">Mode</a></span> <a href="src/Graphics-Vty-Output-Interface.html#line-43" class="link">Source</a> <a href="#t:Mode" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Mode:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Graphics-Vty.html#t:Mode">Mode</a> -> <a href="Graphics-Vty.html#t:Mode">Mode</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Graphics-Vty.html#t:Mode">Mode</a> -> <a href="Graphics-Vty.html#t:Mode">Mode</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Mode:Read:2" class="instance expander" onclick="toggleSection('i:id:Mode:Read:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Read.html#t:Read">Read</a> <a href="Graphics-Vty.html#t:Mode">Mode</a></span> <a href="src/Graphics-Vty-Output-Interface.html#line-43" class="link">Source</a> <a href="#t:Mode" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Mode:Read:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:readsPrec">readsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> <a href="Graphics-Vty.html#t:Mode">Mode</a> <a href="#v:readsPrec" class="selflink">#</a></p><p class="src"><a href="#v:readList">readList</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadP.html#t:ReadS">ReadS</a> [<a href="Graphics-Vty.html#t:Mode">Mode</a>] <a href="#v:readList" class="selflink">#</a></p><p class="src"><a href="#v:readPrec">readPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> <a href="Graphics-Vty.html#t:Mode">Mode</a> <a href="#v:readPrec" class="selflink">#</a></p><p class="src"><a href="#v:readListPrec">readListPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-ParserCombinators-ReadPrec.html#t:ReadPrec">ReadPrec</a> [<a href="Graphics-Vty.html#t:Mode">Mode</a>] <a href="#v:readListPrec" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:Mode:Show:3" class="instance expander" onclick="toggleSection('i:id:Mode:Show:3')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:Show">Show</a> <a href="Graphics-Vty.html#t:Mode">Mode</a></span> <a href="src/Graphics-Vty-Output-Interface.html#line-43" class="link">Source</a> <a href="#t:Mode" class="selflink">#</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div id="section.i:id:Mode:Show:3" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-Int.html#t:Int">Int</a> -> <a href="Graphics-Vty.html#t:Mode">Mode</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Graphics-Vty.html#t:Mode">Mode</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Graphics-Vty.html#t:Mode">Mode</a>] -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.0.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr></table></div></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.2</p></div></body></html>
|