This file is indexed.

/usr/share/doc/libghc-brick-doc/html/Brick-Main.html is in libghc-brick-doc 0.18-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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!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>Brick.Main</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_Brick-Main.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Brick-Main.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">brick-0.18: A declarative terminal user interface 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">Brick.Main</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Event handler functions</a><ul><li><a href="#g:2">Viewport scrolling</a></li></ul></li><li><a href="#g:3">Cursor management functions</a></li><li><a href="#g:4">Rendering cache management</a></li></ul></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:App">App</a> s e n = <a href="#v:App">App</a> {<ul class="subs"><li><a href="#v:appDraw">appDraw</a> :: s -&gt; [<a href="Brick-Types.html#t:Widget">Widget</a> n]</li><li><a href="#v:appChooseCursor">appChooseCursor</a> :: s -&gt; [<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n)</li><li><a href="#v:appHandleEvent">appHandleEvent</a> :: s -&gt; <a href="Brick-Types.html#t:BrickEvent">BrickEvent</a> n e -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="Brick-Types.html#t:Next">Next</a> s)</li><li><a href="#v:appStartEvent">appStartEvent</a> :: s -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n s</li><li><a href="#v:appAttrMap">appAttrMap</a> :: s -&gt; <a href="Brick-AttrMap.html#t:AttrMap">AttrMap</a></li></ul>}</li><li class="src short"><a href="#v:defaultMain">defaultMain</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> n =&gt; <a href="Brick-Main.html#t:App">App</a> s e n -&gt; s -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> s</li><li class="src short"><a href="#v:customMain">customMain</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> n =&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/libghc-vty-doc/html/Graphics-Vty.html#t:Vty">Vty</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Brick-BChan.html#t:BChan">BChan</a> e) -&gt; <a href="Brick-Main.html#t:App">App</a> s e n -&gt; s -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> s</li><li class="src short"><a href="#v:simpleMain">simpleMain</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> n =&gt; <a href="Brick-Types.html#t:Widget">Widget</a> n -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:resizeOrQuit">resizeOrQuit</a> :: s -&gt; <a href="Brick-Types.html#t:BrickEvent">BrickEvent</a> n e -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="Brick-Types.html#t:Next">Next</a> s)</li><li class="src short"><a href="#v:continue">continue</a> :: s -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="Brick-Types.html#t:Next">Next</a> s)</li><li class="src short"><a href="#v:halt">halt</a> :: s -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="Brick-Types.html#t:Next">Next</a> s)</li><li class="src short"><a href="#v:suspendAndResume">suspendAndResume</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> s -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="Brick-Types.html#t:Next">Next</a> s)</li><li class="src short"><a href="#v:lookupViewport">lookupViewport</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> n =&gt; n -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Brick-Types.html#t:Viewport">Viewport</a>)</li><li class="src short"><a href="#v:lookupExtent">lookupExtent</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> n =&gt; n -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Brick-Types.html#t:Extent">Extent</a> n))</li><li class="src short"><a href="#v:findClickedExtents">findClickedExtents</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a>) -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n [<a href="Brick-Types.html#t:Extent">Extent</a> n]</li><li class="src short"><a href="#v:clickedExtent">clickedExtent</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a>) -&gt; <a href="Brick-Types.html#t:Extent">Extent</a> n -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:getVtyHandle">getVtyHandle</a> :: <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/libghc-vty-doc/html/Graphics-Vty.html#t:Vty">Vty</a>)</li><li class="src short"><a href="#v:viewportScroll">viewportScroll</a> :: n -&gt; <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n</li><li class="src short"><span class="keyword">data</span> <a href="#t:ViewportScroll">ViewportScroll</a> n</li><li class="src short"><a href="#v:vScrollBy">vScrollBy</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n ()</li><li class="src short"><a href="#v:vScrollPage">vScrollPage</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="Brick-Types.html#t:Direction">Direction</a> -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n ()</li><li class="src short"><a href="#v:vScrollToBeginning">vScrollToBeginning</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n ()</li><li class="src short"><a href="#v:vScrollToEnd">vScrollToEnd</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n ()</li><li class="src short"><a href="#v:hScrollBy">hScrollBy</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n ()</li><li class="src short"><a href="#v:hScrollPage">hScrollPage</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="Brick-Types.html#t:Direction">Direction</a> -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n ()</li><li class="src short"><a href="#v:hScrollToBeginning">hScrollToBeginning</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n ()</li><li class="src short"><a href="#v:hScrollToEnd">hScrollToEnd</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n ()</li><li class="src short"><a href="#v:setTop">setTop</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n ()</li><li class="src short"><a href="#v:setLeft">setLeft</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n ()</li><li class="src short"><a href="#v:neverShowCursor">neverShowCursor</a> :: s -&gt; [<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n)</li><li class="src short"><a href="#v:showFirstCursor">showFirstCursor</a> :: s -&gt; [<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n)</li><li class="src short"><a href="#v:showCursorNamed">showCursorNamed</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> n =&gt; n -&gt; [<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n)</li><li class="src short"><a href="#v:invalidateCacheEntry">invalidateCacheEntry</a> :: n -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n ()</li><li class="src short"><a href="#v:invalidateCache">invalidateCache</a> :: <a href="Brick-Types.html#t:EventM">EventM</a> n ()</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:App" class="def">App</a> s e n <a href="src/Brick-Main.html#App" class="link">Source</a> <a href="#t:App" class="selflink">#</a></p><div class="doc"><p>The library application abstraction. Your application's operations
 are represented here and passed to one of the various main functions
 in this module. An application is in terms of an application state
 type <code>s</code>, an application event type <code>e</code>, and a resource name type
 <code>n</code>. In the simplest case <code>e</code> is unused (left polymorphic or set to
 '()'), but you may define your own event type and use <code><a href="Brick-Main.html#v:customMain">customMain</a></code>
 to provide custom events. The state type is the type of application
 state to be provided by you and iteratively modified by event
 handlers. The resource name type is the type of names you can assign
 to rendering resources such as viewports and cursor locations.</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:App" class="def">App</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><ul><li><dfn class="src"><a id="v:appDraw" class="def">appDraw</a> :: s -&gt; [<a href="Brick-Types.html#t:Widget">Widget</a> n]</dfn><div class="doc"><p>This function turns your application state into a list of
 widget layers. The layers are listed topmost first.</p></div></li><li><dfn class="src"><a id="v:appChooseCursor" class="def">appChooseCursor</a> :: s -&gt; [<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n)</dfn><div class="doc"><p>This function chooses which of the zero or more cursor
 locations reported by the rendering process should be
 selected as the one to use to place the cursor. If this
 returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#v:Nothing">Nothing</a></code>, no cursor is placed. The rationale here
 is that many widgets may request a cursor placement but your
 application state is what you probably want to use to decide
 which one wins.</p></div></li><li><dfn class="src"><a id="v:appHandleEvent" class="def">appHandleEvent</a> :: s -&gt; <a href="Brick-Types.html#t:BrickEvent">BrickEvent</a> n e -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="Brick-Types.html#t:Next">Next</a> s)</dfn><div class="doc"><p>This function takes the current application state and an
 event and returns an action to be taken and a corresponding
 transformed application state. Possible options are
 <code><a href="Brick-Main.html#v:continue">continue</a></code>, <code><a href="Brick-Main.html#v:suspendAndResume">suspendAndResume</a></code>, and <code><a href="Brick-Main.html#v:halt">halt</a></code>.</p></div></li><li><dfn class="src"><a id="v:appStartEvent" class="def">appStartEvent</a> :: s -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n s</dfn><div class="doc"><p>This function gets called once just prior to the first
 drawing of your application. Here is where you can make
 initial scrolling requests, for example.</p></div></li><li><dfn class="src"><a id="v:appAttrMap" class="def">appAttrMap</a> :: s -&gt; <a href="Brick-AttrMap.html#t:AttrMap">AttrMap</a></dfn><div class="doc"><p>The attribute map that should be used during rendering.</p></div></li></ul></div></td></tr></table></div></div><div class="top"><p class="src"><a id="v:defaultMain" class="def">defaultMain</a> <a href="src/Brick-Main.html#defaultMain" class="link">Source</a> <a href="#v:defaultMain" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> n</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">=&gt; <a href="Brick-Main.html#t:App">App</a> s e n</td><td class="doc"><p>The application.</p></td></tr><tr><td class="src">-&gt; s</td><td class="doc"><p>The initial application state.</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> s</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>The default main entry point which takes an application and an
 initial state and returns the final state returned by a <code><a href="Brick-Main.html#v:halt">halt</a></code>
 operation.</p></div></div><div class="top"><p class="src"><a id="v:customMain" class="def">customMain</a> <a href="src/Brick-Main.html#customMain" class="link">Source</a> <a href="#v:customMain" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> n</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">=&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/libghc-vty-doc/html/Graphics-Vty.html#t:Vty">Vty</a></td><td class="doc"><p>An IO action to build a Vty handle. This is used to
 build a Vty handle whenever the event loop begins or is
 resumed after suspension.</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Brick-BChan.html#t:BChan">BChan</a> e)</td><td class="doc"><p>An event channel for sending custom events to the event
 loop (you write to this channel, the event loop reads from
 it). Provide <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#v:Nothing">Nothing</a></code> if you don't plan on sending custom
 events.</p></td></tr><tr><td class="src">-&gt; <a href="Brick-Main.html#t:App">App</a> s e n</td><td class="doc"><p>The application.</p></td></tr><tr><td class="src">-&gt; s</td><td class="doc"><p>The initial application state.</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> s</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>The custom event loop entry point to use when the simpler ones
 don't permit enough control.</p></div></div><div class="top"><p class="src"><a id="v:simpleMain" class="def">simpleMain</a> <a href="src/Brick-Main.html#simpleMain" class="link">Source</a> <a href="#v:simpleMain" class="selflink">#</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> n</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src">=&gt; <a href="Brick-Types.html#t:Widget">Widget</a> n</td><td class="doc"><p>The widget to draw.</p></td></tr><tr><td class="src">-&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</td><td class="doc empty">&nbsp;</td></tr></table></div><div class="doc"><p>A simple main entry point which takes a widget and renders it. This
 event loop terminates when the user presses any key, but terminal
 resize events cause redraws.</p></div></div><div class="top"><p class="src"><a id="v:resizeOrQuit" class="def">resizeOrQuit</a> :: s -&gt; <a href="Brick-Types.html#t:BrickEvent">BrickEvent</a> n e -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="Brick-Types.html#t:Next">Next</a> s) <a href="src/Brick-Main.html#resizeOrQuit" class="link">Source</a> <a href="#v:resizeOrQuit" class="selflink">#</a></p><div class="doc"><p>An event-handling function which continues execution of the event
 loop only when resize events occur; all other types of events trigger
 a halt. This is a convenience function useful as an <code><a href="Brick-Main.html#v:appHandleEvent">appHandleEvent</a></code>
 value for simple applications using the <code><a href="file:///usr/share/doc/libghc-vty-doc/html/Graphics-Vty-Input-Events.html#t:Event">Event</a></code> type that do not need
 to get more sophisticated user input.</p></div></div><h1 id="g:1">Event handler functions</h1><div class="top"><p class="src"><a id="v:continue" class="def">continue</a> :: s -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="Brick-Types.html#t:Next">Next</a> s) <a href="src/Brick-Main.html#continue" class="link">Source</a> <a href="#v:continue" class="selflink">#</a></p><div class="doc"><p>Continue running the event loop with the specified application
 state.</p></div></div><div class="top"><p class="src"><a id="v:halt" class="def">halt</a> :: s -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="Brick-Types.html#t:Next">Next</a> s) <a href="src/Brick-Main.html#halt" class="link">Source</a> <a href="#v:halt" class="selflink">#</a></p><div class="doc"><p>Halt the event loop and return the specified application state as
 the final state value.</p></div></div><div class="top"><p class="src"><a id="v:suspendAndResume" class="def">suspendAndResume</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> s -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="Brick-Types.html#t:Next">Next</a> s) <a href="src/Brick-Main.html#suspendAndResume" class="link">Source</a> <a href="#v:suspendAndResume" class="selflink">#</a></p><div class="doc"><p>Suspend the event loop, save the terminal state, and run the
 specified action. When it returns an application state value, restore
 the terminal state, redraw the application from the new state, and
 resume the event loop.</p></div></div><div class="top"><p class="src"><a id="v:lookupViewport" class="def">lookupViewport</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Ord.html#t:Ord">Ord</a> n =&gt; n -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Brick-Types.html#t:Viewport">Viewport</a>) <a href="src/Brick-Main.html#lookupViewport" class="link">Source</a> <a href="#v:lookupViewport" class="selflink">#</a></p><div class="doc"><p>Given a viewport name, get the viewport's size and offset
 information from the most recent rendering. Returns <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#v:Nothing">Nothing</a></code> if
 no such state could be found, either because the name was invalid
 or because no rendering has occurred (e.g. in an <code><a href="Brick-Main.html#v:appStartEvent">appStartEvent</a></code>
 handler).</p></div></div><div class="top"><p class="src"><a id="v:lookupExtent" class="def">lookupExtent</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> n =&gt; n -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Brick-Types.html#t:Extent">Extent</a> n)) <a href="src/Brick-Main.html#lookupExtent" class="link">Source</a> <a href="#v:lookupExtent" class="selflink">#</a></p><div class="doc"><p>Given a resource name, get the most recent rendering extent for the
 name (if any).</p></div></div><div class="top"><p class="src"><a id="v:findClickedExtents" class="def">findClickedExtents</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a>) -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n [<a href="Brick-Types.html#t:Extent">Extent</a> n] <a href="src/Brick-Main.html#findClickedExtents" class="link">Source</a> <a href="#v:findClickedExtents" class="selflink">#</a></p><div class="doc"><p>Given a mouse click location, return the extents intersected by the
 click. The returned extents are sorted such that the first extent in
 the list is the most specific extent and the last extent is the most
 generic (top-level). So if two extents A and B both intersected the
 mouse click but A contains B, then they would be returned [B, A].</p></div></div><div class="top"><p class="src"><a id="v:clickedExtent" class="def">clickedExtent</a> :: (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a>, <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a>) -&gt; <a href="Brick-Types.html#t:Extent">Extent</a> n -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Brick-Main.html#clickedExtent" class="link">Source</a> <a href="#v:clickedExtent" class="selflink">#</a></p><div class="doc"><p>Did the specified mouse coordinates (column, row) intersect the
 specified extent?</p></div></div><div class="top"><p class="src"><a id="v:getVtyHandle" class="def">getVtyHandle</a> :: <a href="Brick-Types.html#t:EventM">EventM</a> n (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/libghc-vty-doc/html/Graphics-Vty.html#t:Vty">Vty</a>) <a href="src/Brick-Main.html#getVtyHandle" class="link">Source</a> <a href="#v:getVtyHandle" class="selflink">#</a></p><div class="doc"><p>Get the Vty handle currently in use.</p></div></div><h2 id="g:2">Viewport scrolling</h2><div class="top"><p class="src"><a id="v:viewportScroll" class="def">viewportScroll</a> :: n -&gt; <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n <a href="src/Brick-Main.html#viewportScroll" class="link">Source</a> <a href="#v:viewportScroll" class="selflink">#</a></p><div class="doc"><p>Build a viewport scroller for the viewport with the specified name.</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:ViewportScroll" class="def">ViewportScroll</a> n <a href="src/Brick-Main.html#ViewportScroll" class="link">Source</a> <a href="#t:ViewportScroll" class="selflink">#</a></p><div class="doc"><p>A viewport scrolling handle for managing the scroll state of
 viewports.</p></div></div><div class="top"><p class="src"><a id="v:vScrollBy" class="def">vScrollBy</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n () <a href="src/Brick-Main.html#vScrollBy" class="link">Source</a> <a href="#v:vScrollBy" class="selflink">#</a></p><div class="doc"><p>Scroll the viewport vertically by the specified
 number of rows or columns depending on the
 orientation of the viewport.</p></div></div><div class="top"><p class="src"><a id="v:vScrollPage" class="def">vScrollPage</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="Brick-Types.html#t:Direction">Direction</a> -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n () <a href="src/Brick-Main.html#vScrollPage" class="link">Source</a> <a href="#v:vScrollPage" class="selflink">#</a></p><div class="doc"><p>Scroll the viewport vertically by one page in
 the specified direction.</p></div></div><div class="top"><p class="src"><a id="v:vScrollToBeginning" class="def">vScrollToBeginning</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n () <a href="src/Brick-Main.html#vScrollToBeginning" class="link">Source</a> <a href="#v:vScrollToBeginning" class="selflink">#</a></p><div class="doc"><p>Scroll vertically to the beginning of the viewport.</p></div></div><div class="top"><p class="src"><a id="v:vScrollToEnd" class="def">vScrollToEnd</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n () <a href="src/Brick-Main.html#vScrollToEnd" class="link">Source</a> <a href="#v:vScrollToEnd" class="selflink">#</a></p><div class="doc"><p>Scroll vertically to the end of the viewport.</p></div></div><div class="top"><p class="src"><a id="v:hScrollBy" class="def">hScrollBy</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n () <a href="src/Brick-Main.html#hScrollBy" class="link">Source</a> <a href="#v:hScrollBy" class="selflink">#</a></p><div class="doc"><p>Scroll the viewport horizontally by the
 specified number of rows or columns depending on
 the orientation of the viewport.</p></div></div><div class="top"><p class="src"><a id="v:hScrollPage" class="def">hScrollPage</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="Brick-Types.html#t:Direction">Direction</a> -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n () <a href="src/Brick-Main.html#hScrollPage" class="link">Source</a> <a href="#v:hScrollPage" class="selflink">#</a></p><div class="doc"><p>Scroll the viewport horizontally by one page in
 the specified direction.</p></div></div><div class="top"><p class="src"><a id="v:hScrollToBeginning" class="def">hScrollToBeginning</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n () <a href="src/Brick-Main.html#hScrollToBeginning" class="link">Source</a> <a href="#v:hScrollToBeginning" class="selflink">#</a></p><div class="doc"><p>Scroll horizontally to the beginning of the
 viewport.</p></div></div><div class="top"><p class="src"><a id="v:hScrollToEnd" class="def">hScrollToEnd</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n () <a href="src/Brick-Main.html#hScrollToEnd" class="link">Source</a> <a href="#v:hScrollToEnd" class="selflink">#</a></p><div class="doc"><p>Scroll horizontally to the end of the viewport.</p></div></div><div class="top"><p class="src"><a id="v:setTop" class="def">setTop</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n () <a href="src/Brick-Main.html#setTop" class="link">Source</a> <a href="#v:setTop" class="selflink">#</a></p><div class="doc"><p>Set the top row offset of the viewport.</p></div></div><div class="top"><p class="src"><a id="v:setLeft" class="def">setLeft</a> :: <a href="Brick-Main.html#t:ViewportScroll">ViewportScroll</a> n -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n () <a href="src/Brick-Main.html#setLeft" class="link">Source</a> <a href="#v:setLeft" class="selflink">#</a></p><div class="doc"><p>Set the left column offset of the viewport.</p></div></div><h1 id="g:3">Cursor management functions</h1><div class="top"><p class="src"><a id="v:neverShowCursor" class="def">neverShowCursor</a> :: s -&gt; [<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n) <a href="src/Brick-Main.html#neverShowCursor" class="link">Source</a> <a href="#v:neverShowCursor" class="selflink">#</a></p><div class="doc"><p>Ignore all requested cursor positions returned by the rendering
 process. This is a convenience function useful as an
 <code><a href="Brick-Main.html#v:appChooseCursor">appChooseCursor</a></code> value when a simple application has no need to
 position the cursor.</p></div></div><div class="top"><p class="src"><a id="v:showFirstCursor" class="def">showFirstCursor</a> :: s -&gt; [<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n) <a href="src/Brick-Main.html#showFirstCursor" class="link">Source</a> <a href="#v:showFirstCursor" class="selflink">#</a></p><div class="doc"><p>Always show the first cursor, if any, returned by the rendering
 process. This is a convenience function useful as an
 <code><a href="Brick-Main.html#v:appChooseCursor">appChooseCursor</a></code> value when a simple program has zero or more
 widgets that advertise a cursor position.</p></div></div><div class="top"><p class="src"><a id="v:showCursorNamed" class="def">showCursorNamed</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> n =&gt; n -&gt; [<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="Brick-Types.html#t:CursorLocation">CursorLocation</a> n) <a href="src/Brick-Main.html#showCursorNamed" class="link">Source</a> <a href="#v:showCursorNamed" class="selflink">#</a></p><div class="doc"><p>Show the cursor with the specified resource name, if such a cursor
 location has been reported.</p></div></div><h1 id="g:4">Rendering cache management</h1><div class="top"><p class="src"><a id="v:invalidateCacheEntry" class="def">invalidateCacheEntry</a> :: n -&gt; <a href="Brick-Types.html#t:EventM">EventM</a> n () <a href="src/Brick-Main.html#invalidateCacheEntry" class="link">Source</a> <a href="#v:invalidateCacheEntry" class="selflink">#</a></p><div class="doc"><p>Invalidate the rendering cache entry with the specified resource
 name.</p></div></div><div class="top"><p class="src"><a id="v:invalidateCache" class="def">invalidateCache</a> :: <a href="Brick-Types.html#t:EventM">EventM</a> n () <a href="src/Brick-Main.html#invalidateCache" class="link">Source</a> <a href="#v:invalidateCache" class="selflink">#</a></p><div class="doc"><p>Invalidate the entire rendering cache.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>