@@ -15,18 +15,18 @@ import Data.Bits ( (.&.), complement )
15import Data.IORef
15import Data.IORef
16import Data.Monoid ( mappend )
16import Data.Monoid ( mappend )
18−type AttrChange v = State Attr v
18+type InlineM v = State Attr v
20−back_color :: Color -> AttrChange ()
20+back_color :: Color -> InlineM ()
21back_color c = modify $ flip mappend ( current_attr `with_back_color` c )
21back_color c = modify $ flip mappend ( current_attr `with_back_color` c )
23−fore_color :: Color -> AttrChange ()
23+fore_color :: Color -> InlineM ()
24fore_color c = modify $ flip mappend ( current_attr `with_fore_color` c )
24fore_color c = modify $ flip mappend ( current_attr `with_fore_color` c )
26−apply_style :: Style -> AttrChange ()
26+apply_style :: Style -> InlineM ()
27apply_style s = modify $ flip mappend ( current_attr `with_style` s )
27apply_style s = modify $ flip mappend ( current_attr `with_style` s )
29−remove_style :: Style -> AttrChange ()
29+remove_style :: Style -> InlineM ()
30remove_style s_mask = modify $ \attr ->
30remove_style s_mask = modify $ \attr ->
31 let style' = case attr_style attr of
31 let style' = case attr_style attr of
32 Default -> error $ "Graphics.Vty.Inline: Cannot remove_style if apply_style never used."
32 Default -> error $ "Graphics.Vty.Inline: Cannot remove_style if apply_style never used."
@@ -34,10 +34,10 @@ remove_style s_mask = modify $ \attr ->
34 SetTo s -> s .&. complement s_mask
34 SetTo s -> s .&. complement s_mask
35 in attr { attr_style = SetTo style' }
35 in attr { attr_style = SetTo style' }
37−default_all :: AttrChange ()
37+default_all :: InlineM ()
38default_all = put def_attr
38default_all = put def_attr
40−put_attr_change :: ( Applicative m, MonadIO m ) => TerminalHandle -> AttrChange () -> m ()
40+put_attr_change :: ( Applicative m, MonadIO m ) => TerminalHandle -> InlineM () -> m ()
41put_attr_change t c = do
41put_attr_change t c = do
42 bounds <- display_bounds t
42 bounds <- display_bounds t
43 d <- display_context t bounds
43 d <- display_context t bounds