@@ -1,9 +1,7 @@
1{-# LANGUAGE BangPatterns #-}
1{-# LANGUAGE BangPatterns #-}
2−-- | The Picture data structure is representative of the final terminal view.
2+-- | The 'Picture' data structure is representative of the final terminal view.
4−-- This module re-exports most of the Graphics.Vty.Image and Graphics.Vty.Attributes modules.
4+-- A 'Picture' is a background paired with a layer of 'Image's.
6−-- Copyright 2009-2010 Corey O'Connor
7module Graphics.Vty.Picture ( module Graphics.Vty.Picture
5module Graphics.Vty.Picture ( module Graphics.Vty.Picture
8 , module Graphics.Vty.Image
6 , module Graphics.Vty.Image
@@ -42,7 +40,7 @@ add_to_bottom :: Picture -> Image -> Picture
42add_to_bottom p i = p {pic_layers = pic_layers p ++ [i]}
40add_to_bottom p i = p {pic_layers = pic_layers p ++ [i]}
44-- | Create a picture for display for the given image. The picture will not have a displayed cursor
42-- | Create a picture for display for the given image. The picture will not have a displayed cursor
45−-- and the background display attribute will be `current_attr`.
43+-- and no background pattern (ClearBackground) will be used.
46pic_for_image :: Image -> Picture
44pic_for_image :: Image -> Picture
47pic_for_image i = Picture
45pic_for_image i = Picture
48 { pic_cursor = NoCursor
46 { pic_cursor = NoCursor
@@ -51,6 +49,9 @@ pic_for_image i = Picture
53-- | Create a picture for display with the given layers. Ordered top to bottom.
51-- | Create a picture for display with the given layers. Ordered top to bottom.
53+-- The picture will not have a displayed cursor and no background apttern (ClearBackgroun) will be
55-- The first 'Image' is the top layer.
56-- The first 'Image' is the top layer.
56pic_for_layers :: [Image] -> Picture
57pic_for_layers :: [Image] -> Picture
@@ -79,8 +80,7 @@ instance NFData Cursor where
79-- | A 'Picture' has a background pattern. The background is either ClearBackground. Which shows the
80-- | A 'Picture' has a background pattern. The background is either ClearBackground. Which shows the
80-- layer below or is blank if the bottom layer. Or the background pattern is a character and a
81-- layer below or is blank if the bottom layer. Or the background pattern is a character and a
81-- display attribute. If the display attribute used previously should be used for a background fill
82-- display attribute. If the display attribute used previously should be used for a background fill
82−-- then use `current_attr` for the background attribute. This is the default background display
83+-- then use `current_attr` for the background attribute.
85-- \todo The current attribute is always set to the default attributes at the start of updating the
85-- \todo The current attribute is always set to the default attributes at the start of updating the
86-- screen to a picture.
86-- screen to a picture.
@@ -89,13 +89,11 @@ data Background
89 { background_char :: Char
89 { background_char :: Char
90 , background_attr :: Attr
90 , background_attr :: Attr
92− -- | The background is:
92+ -- | A ClearBackground is:
94 -- * the space character if there are remaining non-skip ops
94 -- * the space character if there are remaining non-skip ops
95− -- * (?) nothing if there are no remaining non-skip ops.
97− -- Might require the terminal interface to do a line clear?
96+ -- * End of line if there are no remaining non-skip ops.
98− -- Or should the nothing case be switched with crlf?
99 | ClearBackground
97 | ClearBackground
101instance NFData Background where
99instance NFData Background where