@@ -14,6 +14,7 @@ import Graphics.Vty.Image
1414import Control.DeepSeq
1515
1616-- | The type of images to be displayed using 'update'.
17+--
1718-- Can be constructed directly or using `pic_for_image`. Which provides an initial instance with
1819-- reasonable defaults for pic_cursor and pic_background.
1920data Picture = Picture
@@ -28,12 +29,15 @@ instance Show Picture where
2829instance NFData Picture where
2930 rnf (Picture c l b) = c `deepseq` l `deepseq` b `deepseq` ()
3031
32+-- | a picture with no cursor, background or image layers
3133empty_picture :: Picture
3234empty_picture = Picture NoCursor [] ClearBackground
3335
36+-- | The given 'Image' is added as the top layer of the 'Picture'
3437add_to_top :: Picture -> Image -> Picture
3538add_to_top p i = p {pic_layers = i : pic_layers p}
3639
40+-- | The given 'Image' is added as the bottom layer of the 'Picture'
3741add_to_bottom :: Picture -> Image -> Picture
3842add_to_bottom p i = p {pic_layers = pic_layers p ++ [i]}
3943
@@ -48,7 +52,7 @@ pic_for_image i = Picture
4852
4953-- | Create a picture for display with the given layers. Ordered top to bottom.
5054--
51−-- The first image is the top layer.
55+-- The first 'Image' is the top layer.
5256pic_for_layers :: [Image] -> Picture
5357pic_for_layers is = Picture
5458 { pic_cursor = NoCursor
@@ -72,10 +76,11 @@ instance NFData Cursor where
7276 rnf NoCursor = ()
7377 rnf (Cursor w h) = w `seq` h `seq` ()
7478
75−-- | Unspecified regions are filled with the picture's background pattern. The background pattern
76−-- can specify a character and a display attribute. If the display attribute used previously should
77−-- be used for a background fill then use `current_attr` for the background attribute. This is the
78−-- default background display attribute.
79+-- | 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+-- 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+-- attribute.
7984--
8085-- \todo The current attribute is always set to the default attributes at the start of updating the
8186-- screen to a picture.