eM      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe-InferedDA'  Safe-Inferedq      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNO  Safe-InferedPQPQPQ  Safe-InferedRSRSRS Safe-InferedZStyles are represented as an 8 bit word. Each bit in the word is 1 if the style attribute \ assigned to that bit should be applied and 0 if the style attribute should not be applied. )Abstract data type representing a color. SCurrently the foreground and background color are specified as points in either a: _ 16 color palette. Where the first 8 colors are equal to the 8 colors of the ISO 6429 (ANSI) 8 2 color palette and the second 8 colors are bright/&vivid versions of the first 8 colors. T 240 color palette. This palette is a regular sampling of the full RGB colorspace. -The 8 ISO 6429 (ANSI) colors are as follows:   black  red  green  yellow  blue  magenta  cyan  white `The mapping from points in the 240 color palette to colors actually displayable by the terminal ` depends on the number of colors the terminal claims to support. Which is usually determined by  the terminfo colorsL property. If this property is not being accurately reported then the color ! reproduction will be incorrect. If the terminal reports <G= 16 colors then the 240 color palette points are only mapped to the 8  color pallete. I'%m not sure of the RGB points for the bright" colors which is why they are not ) addressable via the 240 color palette. `If the terminal reports > 16 colors then the 240 color palette points are mapped to the nearest  points in a ( color count- - 16) subsampling of the 240 color palette. aAll of this assumes the terminals are behaving similarly to xterm and rxvt when handling colors. a And that the individual colors have not been remapped by the user. There may be a way to verify  this through terminfo but I don' t know it. -Seriously, terminal color support is INSANE. \The style and color attributes can either be the terminal defaults. Or be equivalent to the 3 previously applied style. Or be a specific value. ]Specifies the display attributes such that the final style and color values do not depend on Z the previously applied display attribute. The display attributes can still depend on the  terminal'"s default colors (unfortunately). YA display attribute defines the Color and Style of all the characters rendered after the  attribute is applied. `At most 256 colors, picked from a 240 and 16 color palette, are possible for the background and ` foreground. The 240 colors and 16 colors are points in different palettes. See Color for more  information. ,Standard 8-color ANSI terminal color codes. ,Standard 8-color ANSI terminal color codes. ,Standard 8-color ANSI terminal color codes. ,Standard 8-color ANSI terminal color codes. ,Standard 8-color ANSI terminal color codes. ,Standard 8-color ANSI terminal color codes. ,Standard 8-color ANSI terminal color codes. ,Standard 8-color ANSI terminal color codes. Bright/-Vivid variants of the standard 8-color ANSI Bright/-Vivid variants of the standard 8-color ANSI Bright/-Vivid variants of the standard 8-color ANSI Bright/-Vivid variants of the standard 8-color ANSI "!The 6 possible style attributes:  standout  underline  reverse_video  blink  dim  bold/bright [( The invisible, protect, and altcharset display attributes some terminals support are not  supported via VTY.) #!The 6 possible style attributes:  standout  underline  reverse_video  blink  dim  bold/bright [( The invisible, protect, and altcharset display attributes some terminals support are not  supported via VTY.) $!The 6 possible style attributes:  standout  underline  reverse_video  blink  dim  bold/bright [( The invisible, protect, and altcharset display attributes some terminals support are not  supported via VTY.) %!The 6 possible style attributes:  standout  underline  reverse_video  blink  dim  bold/bright [( The invisible, protect, and altcharset display attributes some terminals support are not  supported via VTY.) &!The 6 possible style attributes:  standout  underline  reverse_video  blink  dim  bold/bright [( The invisible, protect, and altcharset display attributes some terminals support are not  supported via VTY.) '!The 6 possible style attributes:  standout  underline  reverse_video  blink  dim  bold/bright [( The invisible, protect, and altcharset display attributes some terminals support are not  supported via VTY.) *;true if the given Style value has the specified Style set. +Set the foreground color of an  . ,Set the background color of an  . -Add the given style attribute .^Sets the style, background color and foreground color to the default values for the terminal. Z There is no easy way to determine what the default background and foreground colors are. /XKeeps the style, background color and foreground color that was previously set. Used to + override some part of the previous style. EG: current_style + bright_magenta `Would be the currently applied style (be it underline, bold, etc) but with the foreground color  set to bright_magenta. 2  !"#$%&'()*+,-./TU0  !"#$%&'()*+,-./0  ! "'&%$#()*+,-./%  !"#$%&'()*+,-./TU  Safe-InferedVWGiven the previously applied display attributes as a FixedAttr and the current display a attributes as an Attr produces a FixedAttr that represents the current display attributes. This J is done by using the previously applied display attributes to remove the  KeepCurrent  abstraction. WXYZ[\]^_`abcdefghijklVmnopqrWXYZ[\]^_`abcdefghijklVmnopq W cba`_^]\[ZYXdgfehijklVmnopqr  Safe-Infered0An image in VTY defines: ] properties required to display the image. These are properties that effect the output image % but are independent of position S A set of position-dependent text and attribute regions. The possible regions are:  a point. ( char ) P a horizontal line of characters with a single attribute. (string, utf8_string,  utf8_bytestring ) + a fill of a single character. (char_fill)  a fill of the picture' s background. (background_fill) Ctodo: increase the number of encoded bytestring formats supported. sWe pair each character with it'?s display length. This way we only compute the length once per  character. P * Though currently the width of some strings is still compute multiple times. 1An area of the picture'6s bacground (See Background) of w columns and h rows. 2QThe width of an Image. This is the number display columns the image will occupy. 3RThe height of an Image. This is the number of display rows the image will occupy. 4"Combines two images side by side. bThe result image will have a width equal to the sum of the two images width. And the height will ` equal the largest height of the two images. The area not defined in one image due to a height 7 missmatch will be filled with the background pattern. 5 Combines two images vertically. U The result image will have a height equal to the sum of the heights of both images. ; The width will equal the largest width of the two images. _ The area not defined in one image due to a width missmatch will be filled with the background  pattern. 6+Compose any number of images horizontally. 7)Compose any number of images vertically. 8]an image of a single character. This is a standard Haskell 31-bit character assumed to be in  the ISO-10646 encoding. 9`A string of characters layed out on a single row with the same display attribute. The string is 4 assumed to be a sequence of ISO-10646 characters. ]Note: depending on how the Haskell compiler represents string literals a string literal in a T UTF-8 encoded source file, for example, may be represented as a ISO-10646 string. Q That is, I think, the case with GHC 6.10. This means, for the most part, you don't need to worry \ about the encoding format when outputting string literals. Just provide the string literal ) directly to iso_10646_string or string. :OAlias for iso_10646_string. Since the usual case is that a literal string like foo is D represented internally as a list of ISO 10646 31 bit characters. `Note: Keep in mind that GHC will compile source encoded as UTF-8 but the literal strings, while Z UTF-8 encoded in the source, will be transcoded to a ISO 10646 31 bit characters runtime  representation. ;\A string of characters layed out on a single row. The string is assumed to be a sequence of  UTF-8 characters. taReturns the display width of a character. Assumes all characters with unknown widths are 1 width u^Returns the display width of a string. Assumes all characters with unknown widths are 1 width <%Renders a UTF-8 encoded bytestring. =_creates a fill of the specified character. The dimensions are in number of characters wide and  number of rows high. ZUnlike the Background fill character this character can have double column display width. >[The empty image. Useful for fold combinators. These occupy no space nor define any display  attributes. ?%Apply the given offset to the image. @WEnsure an image is no larger than the provided size. If the image is larger then crop. AQEnsure an image is at least the provided size. If the image is smaller then pad. v9Currently append in the Monoid instance is equivalent to  -. (0wxyz{|}~s123456789:;tu<=>?@AvXRS  !"#$%&'()*+,-./0wxyz{|}~s123456789:;tu<=>?@A0|{zyxw}~s123456789:;tu<=>?@Av Safe-InferedBGeneric events. FMouse buttons. Not yet used. JMModifier keys. Key codes are interpreted such that users are more likely to ; have Meta than Alt; for instance on the PC Linux console, L will / generally correspond to the physical Alt key. O&Representations of non-modifier keys. eCSet up the terminal for input. Returns a function which reads key ? events, and a function for shutting down the terminal access. $BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcde$BCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcde$Odcba`_^]\[ZYXWVUTSRQPJNMLKFIHGBEDCeBEDCFIHGJNMLKOdcba`_^]\[ZYXWVUTSRQPe Safe-Inferedfghifghifghifghi Safe-Inferedj/Unspecified regions are filled with the picture'.s background pattern. The background pattern b can specify a character and a display attribute. If the display attribute used previously should ( be used for a background fill then use /+ for the background attribute. This is the ' default background display attribute. c(tofix) The current attribute is always set to the default attributes at the start of updating the  screen to a picture. N(tofix) The background character *must* occupy a single column and no more. n^A picture can be configured either to not show the cursor or show the cursor at the specified  character position. \There is not a 1 to 1 map from character positions to a row and column on the screen due to * characters that take more than 1 column. \todo: The Cursor can be given a (character,row) offset outside of the visible bounds of the ; output region. In this case the cursor will not be shown. q)The type of images to be displayed using update. & Can be constructed directly or using v*. Which provides an initial instance with 8 reasonable defaults for pic_cursor and pic_background. v_Create a picture for display for the given image. The picture will not have a displayed cursor . and the background display attribute will be /. jklmnopqrstuvO  !"#$%&'()*+,-./0123456789:;<=>?@Ajklmnopqrstuvqrstuvnpojklm023456718:9;<=>?@Ajklmnpoqrstuv Safe-InferedRtodo: This type may need to be restructured to increase sharing in the bytestring todo: Make foldable Va span of UTF-8 text occupies a specific number of screen space columns. A single UTF R character does not necessarially represent 1 colunm. See Codec.Binary.UTF8.Width " TextSpan [output width in columns] [number of characters] [data] OA picture is translated into a sequences of state changes and character spans. ` - State changes are currently limited to new attribute values. The attribute is applied to all e - following spans. Including spans of the next row. The nth element of the sequence represents the : - nth row (from top to bottom) of the picture to render.  - d - A span op sequence will be defined for all rows and columns (and no more) of the region provided & - with the picture to spans_for_pic.  - Z - todo: Partition attribute changes into multiple categories according to the serialized - - representation of the various attributes. _Produces the span ops that will render the given picture, possibly cropped or padded, into the  specified region.  Safe-Infered,Provide the bounds of the display context. 3Maximum number of colors supported by the context. ?Reset the display attributes to the default display attributes 1See Graphics.Vty.Terminal.XTermColor.inline_hack z6Text identifier for the terminal. Used for debugging. |NClear the display and initialize the terminal to some initial display state. PThe expectation of a program is that the display starts in some initial state. 2 The initial state would consist of fixed values:  - cursor at top left  - UTF-8 character encoding , - drawing characteristics are the default \ The abstract operation I think all these behaviors are instances of is reserving exclusive  access to a display such that: , - The previous state cannot be determined ] - When exclusive access to a display is release the display returns to the previous state. }7Return the display to the state before reserve_display G If no previous state then set the display state to the initial state. ~$Returns the current display bounds. [Output the byte buffer of the specified size to the terminal device. The size is equal to  end_ptr - start_ptr Handle of output device JThe current terminal display attributes or Nothing if they are not known. ;Acquire display access to the given region of the display. Z Currently all regions have the upper left corner of (0,0) and the lower right corner at H (max display_width provided_width, max display_height provided_height) ZAll terminals serialize UTF8 text to the terminal device exactly as serialized in memory. ZAll terminals serialize UTF8 text to the terminal device exactly as serialized in memory. Displays the given q.  , The image is cropped to the display size. @ Converted into a sequence of attribute changes and text spans.  The cursor is hidden.  Serialized to the display. 9 The cursor is then shown and positioned or kept hidden. &todo: specify possible IO exceptions. / abstract from IO monad to a MonadIO instance. 8wxyz{|}~7wxyz{|}~ wxyz{|}~ Safe-Infered\Uses terminfo for all control codes. While this should provide the most compatible terminal e - terminfo does not support some features that would increase efficiency and improve compatibility: e - * determine the character encoding supported by the terminal. Should this be taken from the LANG  - environment variable? J - * Provide independent string capabilities for all display attributes.  -  - c - todo: Some display attributes like underline and bold have independent string capabilities that ) - should be used instead of the generic sgr string capability.  Safe-Infered Safe-Infered Safe-Infered)Set the background color to the provided  )Set the foreground color to the provided  Attempt to change the  of the following text. _If the terminal does not support the style change no error is produced. The style can still be  removed.  Attempt to remove the specified ) from the display of the following text. SThis will fail if apply_style for the given style has not been previously called. Reset the display attributes >Apply the provided display attribute changes to the terminal. This also flushes the  handle.  Safe-InferedSReturns a TerminalHandle (an abstract Terminal instance) for the current terminal. TThe specific Terminal implementation used is hidden from the API user. All terminal c implementations are assumed to perform more, or less, the same. Currently all implementations use b terminfo for at least some terminal specific information. This is why platforms without terminfo a are not supported. However, as mentioned before, any specifics about it being based on terminfo _ are hidden from the API user. If a terminal implementation is developed for a terminal for a V platform without terminfo support then Vty should work as expected on that terminal. ,Selection of a terminal is done as follows:  If TERM == xterm ` then the terminal might be one of the Mac OS X .app terminals. Check if that might be ) the case and use MacOSX if so. $ otherwise use XTermColor. 1 for any other TERM value TerminfoBased is used. ZThe terminal has to be determined dynamically at runtime. To satisfy this requirement all ` terminals instances are lifted into an abstract terminal handle via existential qualification. U This implies that the only equations that can used are those in the terminal class. ]To differentiate between Mac OS X terminals this uses the TERM_PROGRAM environment variable. Z However, an xterm started by Terminal or iTerm *also* has TERM_PROGRAM defined since the " environment variable is not reset/>cleared by xterm. However a Terminal.app or iTerm.app started a from an xterm under X11 on mac os x will likely be done via open. Since this does not propogate _ environment variables (I think?) this assumes that XTERM_VERSION will never be set for a true $ Terminal.app or iTerm.app session. \The file descriptor used for output will a duplicate of the current stdout file descriptor. `todo: add an implementation for windows that does not depend on terminfo. Should be installable 5 with only what is provided in the haskell platform. Atodo: The Terminal interface does not provide any input support. >Sets the cursor position to the given output column and row. XThis is not necessarially the same as the character position with the same coordinates. : Characters can be a variable number of columns in width. aCurrently, the only way to set the cursor position to a given character coordinate is to specify O the coordinate in the Picture instance provided to output_picture or refresh. Hides the cursor Shows the cursor wxyz{|}~yz{|}~wx Safe-Infered1The main object. At most one should be created. ` An alternative is to use unsafePerformIO to automatically create a singleton Vty instance when  required. _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. Wtodo: Once the Terminal interface encompasses input this interface will be deprecated. T Currently, just using the Terminal interface there is no support for input events. UOutputs the given Picture. Equivalent to output_picture applied to a display context  implicitly managed by Vty. -Get one Event object, blocking if necessary. &Handle to the terminal interface. See y /The use of Vty typically follows this process:   initialize vty 5 use the update equation of Vty to display a picture  repeat  shutdown vty. Utodo: provide a similar abstraction to Graphics.Vty.Terminal for input. Use haskeline's # input backend for implementation. todo: remove explicit  requirement. WRefresh the display. Normally the library takes care of refreshing. Nonetheless, some Y other program might output to the terminal and mess the display. In that case the user  might want to force a refresh. Clean up after vty. KSet up the state object for using vty. At most one state object should be  created at a time. KSet up the state object for using vty. At most one state object should be _ created at a time. The delay, in microseconds, specifies the period of time to wait for a key c following reading ESC from the terminal before considering the ESC key press as a discrete event.   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdfghijklmnopqrstuvwxyz{|}~,Odcba`_^]\[ZYXWVUTSRQPJNMLKFIHGBEDC !"#$%&'()*+,-./0123456789:;<=>?@ A B C D E F G H I J K L M N O P Q RSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwwxyzz{|}}~                           !"#$%&'()*)+),)-).)/010203040506070809:;<=<><?<@<ABCBDBEBFBGBHBIJKLMNOPQRSTUTVTWTXTYTZT[T\T]^_`abcdef g h i jkl m n o p q r s t u v w x y z { | } ~                                  vty-4.7.0.12Graphics.Vty.AttributesGraphics.Vty.PictureGraphics.Vty.LLInputGraphics.Vty.DisplayRegionGraphics.Vty.TerminalGraphics.Vty.Inline Graphics.VtyData.Terminfo.ParseData.MarshallingData.Terminfo.EvalCodec.Binary.UTF8.WidthGraphics.Vty.DisplayAttributesGraphics.Vty.ImageGraphics.Vty.SpanGraphics.Vty.Terminal.Generic#Graphics.Vty.Terminal.TerminfoBasedGraphics.Vty.Terminal.MacOSX Graphics.Vty.Terminal.XTermColorStyleColorColor240ISOColor MaybeDefaultSetTo KeepCurrentDefault FixedAttr fixed_stylefixed_fore_colorfixed_back_colorAttr attr_styleattr_fore_colorattr_back_colorblackredgreenyellowbluemagentacyanwhite bright_black bright_red bright_green bright_yellow bright_bluebright_magenta bright_cyan bright_whitestandout underline reverse_videoblinkdimbolddefault_style_mask style_mask has_stylewith_fore_colorwith_back_color with_styledef_attr current_attrImagebackground_fill image_width image_height<|><-> horiz_catvert_catchariso_10646_stringstring utf8_stringutf8_bytestring char_fill empty_image translatecroppadEventEvResizeEvMouseEvKeyButtonBRightBMiddleBLeftModifierMAltMMetaMCtrlMShiftKeyKEnterKRightKDownKLeftKMenuKUpKNP5KBegin KPageDownKEndKDelKPageUpKHomeKInsKBSKASCIIKPauseKPrtScrKBackTabKFunKEsc initTermInput DisplayRegion region_width region_height Backgroundbackground_charbackground_attrCursorNoCursorPicture pic_cursor pic_imagepic_background pic_for_image DisplayHandleTerminal terminal_IDrelease_terminalreserve_displayrelease_displaydisplay_boundsdisplay_terminal_instanceoutput_byte_buffer output_handleTerminalHandledisplay_contextoutput_pictureInlineM back_color fore_color apply_style remove_style default_allput_attr_changeterminal_handleset_cursor_pos hide_cursor show_cursorVtyupdate next_eventterminalrefreshshutdownmkVty mkVtyEscDelay BuildResultsout_param_count out_cap_ops out_param_ops BuildState next_offset CapParserParamOp IncFirstTwoParamOpsCapOp CompareGt CompareLt CompareEq ArithMinus ArithPlus BitwiseAnd BitwiseXOr BitwiseOr Conditionalconditional_exprconditional_parts PushValue PushParamCharOutDecOutBytesCapOpsCapParam CapExpressioncap_ops cap_bytes source_string param_count param_opsCapBytesparse_cap_expressionconstruct_cap_expressioncap_expression_parserparam_escape_parserliteral_percent_parserparam_op_parserincrement_op_parserpush_op_parserdec_out_parserchar_out_parserconditional_op_parserconditional_true_parserconditional_false_parserconditional_end_parserbitwise_op_parserbitwise_or_parserbitwise_and_parserbitwise_xor_parserarith_op_parserliteral_int_op_parsercompare_op_parserbytes_op_parserchar_const_parser inc_offsetinitial_build_state$fMonoidBuildResults$fNFDataParamOp $fNFDataCapOp$fNFDataCapExpression parsec-3.1.2Text.Parsec.Error ParseError OutputBufferstring_to_bytesserialize_bytesbaseGHC.WordWordWord8Word16Word32Word64GHC.PtrPtrFunPtrGHC.ForeignPtr ForeignPtrForeign.MarshalunsafeLocalStateForeign.Marshal.PoolpooledNewArray0pooledNewArray pooledNewpooledReallocArray0pooledReallocArraypooledMallocArray0pooledMallocArraypooledReallocBytes pooledReallocpooledMallocBytes pooledMallocwithPoolfreePoolnewPoolPoolForeign.Marshal.Array advancePtr lengthArray0 moveArray copyArray withArrayLen0 withArray0 withArrayLen withArray newArray0newArray pokeArray0 pokeArray peekArray0 peekArray reallocArray0 reallocArray allocaArray0 allocaArray mallocArray0 mallocArrayForeign.Marshal.Utils moveBytes copyByteswithMany maybePeek maybeWithmaybeNewtoBoolfromBoolwithnewForeign.Marshal.Errorvoid throwIfNull throwIfNeg_ throwIfNegthrowIf_throwIfForeign.Marshal.Allocfree reallocBytesreallocallocaBytesAligned allocaBytesalloca mallocBytesmalloc finalizerFreeForeign.ForeignPtrunsafeForeignPtrToPtrForeign.ForeignPtr.ImpmallocForeignPtrArray0mallocForeignPtrArraynewForeignPtrEnvwithForeignPtr newForeignPtr Foreign.Ptr intPtrToPtr ptrToIntPtr wordPtrToPtr ptrToWordPtrfreeHaskellFunPtrWordPtrIntPtrfinalizeForeignPtrcastForeignPtrtouchForeignPtrnewForeignPtr_addForeignPtrFinalizerEnvaddForeignPtrFinalizermallocForeignPtrBytesmallocForeignPtr FinalizerPtrFinalizerEnvPtrForeign.Storablepokepeek pokeByteOff peekByteOff pokeElemOff peekElemOff alignmentsizeOfStorablecastPtrToFunPtrcastFunPtrToPtr castFunPtr nullFunPtrminusPtralignPtrplusPtrcastPtrnullPtrcap_expression_required_bytesserialize_cap_expressionwcwidthwcswidth$fMonoidMaybeDefault $fMonoidAttrfix_display_attrStyleStateChange RemoveBold ApplyBold RemoveDimApplyDim RemoveBlink ApplyBlinkRemoveReverseVideoApplyReverseVideoRemoveUnderlineApplyUnderlineRemoveStandout ApplyStandoutDisplayColorDiffSetColor NoColorChangeColorToDefaultDisplayAttrDiff style_diffsfore_color_diffback_color_diffsimplify_style_diffssimplify_color_diffsdisplay_attr_diffs diff_color diff_styles$fMonoidDisplayAttrDiff DisplayString safe_wcwidth safe_wcswidth $fMonoidImageImagePad ImageCrop Translation EmptyImageBGFillVertJoinpart_top part_bottom HorizJoin part_left part_right output_height HorizTextattrtext output_width char_width $fShowImage $fShowPictureSpanOpTextSpan DisplayOps spans_for_picAttributeChangeMSpanOpsSpanOpsMRowOpsRowOpseffected_region display_opsspan_ops_columns span_ops_rowsspan_ops_effected_columnsspan_op_has_widthcolumns_to_char_offset build_spansrow_ops_for_imagesnoc_text_span snoc_bg_fillsnoc_op $fShowSpanOp$fShowDisplayOpscontext_regioncontext_color_countdefault_attr_required_bytes inline_hack known_fattrutf8_text_required_bytesserialize_utf8_textCursorOutputMapchar_to_output_posDisplayTerminalmove_cursor_required_bytesserialize_move_cursorshow_cursor_required_bytesserialize_show_cursorhide_cursor_required_bytesserialize_hide_cursorattr_required_bytesserialize_set_attrserialize_default_attr DisplayStateprevious_output_ref TerminalState state_refnew_terminal_handleinitial_terminal_stateinitial_display_staterequired_bytesspan_ops_required_bytesspan_op_required_bytesserialize_output_opsserialize_span_opsserialize_span_opmarshall_to_terminalcursor_output_mapcursor_column_offsetlimit_attr_for_display$fDisplayTerminalDisplayHandle$fTerminalTerminalHandleterminal_instance$fDisplayTerminalDisplayContext$fTerminalTerm$fTerminalXTermColorGHC.IO.Handle.FDstdout