reflex-vty-0.2.0.1: Reflex FRP host and widgets for VTY applications

Safe HaskellNone
LanguageHaskell2010

Reflex.Vty.Widget

Contents

Description

 
Synopsis

Running a vty application

mainWidgetWithHandle :: Vty -> (forall t m. (MonadVtyApp t m, HasImageWriter t m, MonadNodeId m, HasDisplayRegion t m, HasFocusReader t m, HasInput t m, HasTheme t m) => m (Event t ())) -> IO () Source #

Sets up the top-level context for a vty widget and runs it with that context

data VtyWidgetOut t Source #

The output of a vty widget

Constructors

VtyWidgetOut 

mainWidget :: (forall t m. (MonadVtyApp t m, HasImageWriter t m, MonadNodeId m, HasDisplayRegion t m, HasFocusReader t m, HasTheme t m, HasInput t m) => m (Event t ())) -> IO () Source #

Like mainWidgetWithHandle, but uses a default vty configuration

Input Events

class HasInput t m | m -> t where Source #

A class for things that can receive vty events as input

Minimal complete definition

Nothing

Methods

input :: m (Event t VtyEvent) Source #

input :: (f m' ~ m, Monad m', MonadTrans f, HasInput t m') => m (Event t VtyEvent) Source #

localInput :: (Event t VtyEvent -> Event t VtyEvent) -> m a -> m a Source #

User input events that the widget's parent chooses to share. These will generally be filtered for relevance.

localInput :: (f m' ~ m, Monad m', MFunctor f, HasInput t m') => (Event t VtyEvent -> Event t VtyEvent) -> m a -> m a Source #

User input events that the widget's parent chooses to share. These will generally be filtered for relevance.

Instances
(Reflex t, Monad m) => HasInput (t :: k) (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

input :: Input t m (Event t VtyEvent) Source #

localInput :: (Event t VtyEvent -> Event t VtyEvent) -> Input t m a -> Input t m a Source #

(HasInput t m, HasDisplayRegion t m, MonadFix m, Reflex t) => HasInput (t :: Type) (Layout t m) Source # 
Instance details

Defined in Reflex.Vty.Widget.Layout

Methods

input :: Layout t m (Event t VtyEvent) Source #

localInput :: (Event t VtyEvent -> Event t VtyEvent) -> Layout t m a -> Layout t m a Source #

(Reflex t, MonadFix m, HasInput t m) => HasInput (t :: Type) (Focus t m) Source # 
Instance details

Defined in Reflex.Vty.Widget.Layout

Methods

input :: Focus t m (Event t VtyEvent) Source #

localInput :: (Event t VtyEvent -> Event t VtyEvent) -> Focus t m a -> Focus t m a Source #

newtype Input t m a Source #

A widget that can receive input events. See Event

Constructors

Input 

Fields

Instances
MonadSample t m => MonadSample (t :: k) (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

sample :: Behavior t a -> Input t m a #

MonadHold t m => MonadHold (t :: k) (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

hold :: a -> Event t a -> Input t m (Behavior t a) #

holdDyn :: a -> Event t a -> Input t m (Dynamic t a) #

holdIncremental :: Patch p => PatchTarget p -> Event t p -> Input t m (Incremental t p) #

buildDynamic :: PushM t a -> Event t a -> Input t m (Dynamic t a) #

headE :: Event t a -> Input t m (Event t a) #

now :: Input t m (Event t ()) #

HasTheme t m => HasTheme (t :: k) (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

theme :: Input t m (Behavior t Attr) Source #

localTheme :: (Behavior t Attr -> Behavior t Attr) -> Input t m a -> Input t m a Source #

HasImageWriter t m => HasImageWriter (t :: k) (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

tellImages :: Behavior t [Image] -> Input t m () Source #

mapImages :: (Behavior t [Image] -> Behavior t [Image]) -> Input t m a -> Input t m a Source #

HasFocusReader t m => HasFocusReader (t :: k) (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

focus :: Input t m (Dynamic t Bool) Source #

localFocus :: (Dynamic t Bool -> Dynamic t Bool) -> Input t m a -> Input t m a Source #

HasDisplayRegion t m => HasDisplayRegion (t :: k) (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

askRegion :: Input t m (Dynamic t Region) Source #

localRegion :: (Dynamic t Region -> Dynamic t Region) -> Input t m a -> Input t m a Source #

(Reflex t, Monad m) => HasInput (t :: k) (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

input :: Input t m (Event t VtyEvent) Source #

localInput :: (Event t VtyEvent -> Event t VtyEvent) -> Input t m a -> Input t m a Source #

NotReady t m => NotReady t (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

notReadyUntil :: Event t a -> Input t m () #

notReady :: Input t m () #

PerformEvent t m => PerformEvent t (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Associated Types

type Performable (Input t m) :: Type -> Type #

Methods

performEvent :: Event t (Performable (Input t m) a) -> Input t m (Event t a) #

performEvent_ :: Event t (Performable (Input t m) ()) -> Input t m () #

TriggerEvent t m => TriggerEvent t (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

newTriggerEvent :: Input t m (Event t a, a -> IO ()) #

newTriggerEventWithOnComplete :: Input t m (Event t a, a -> IO () -> IO ()) #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> Input t m (Event t a) #

PostBuild t m => PostBuild t (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

getPostBuild :: Input t m (Event t ()) #

MonadReflexCreateTrigger t m => MonadReflexCreateTrigger t (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

newEventWithTrigger :: (EventTrigger t a -> IO (IO ())) -> Input t m (Event t a) #

newFanEventWithTrigger :: GCompare k => (forall a. k a -> EventTrigger t a -> IO (IO ())) -> Input t m (EventSelector t k) #

(Adjustable t m, MonadHold t m, Reflex t) => Adjustable t (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

runWithReplace :: Input t m a -> Event t (Input t m b) -> Input t m (a, Event t b) #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> Input t m v') -> IntMap v -> Event t (PatchIntMap v) -> Input t m (IntMap v', Event t (PatchIntMap v')) #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> Input t m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> Input t m (DMap k v', Event t (PatchDMap k v')) #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> Input t m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> Input t m (DMap k v', Event t (PatchDMapWithMove k v')) #

MFunctor (Input t :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

hoist :: Monad m => (forall a. m a -> n a) -> Input t m b -> Input t n b #

MonadTrans (Input t) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

lift :: Monad m => m a -> Input t m a #

Monad m => Monad (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

(>>=) :: Input t m a -> (a -> Input t m b) -> Input t m b #

(>>) :: Input t m a -> Input t m b -> Input t m b #

return :: a -> Input t m a #

fail :: String -> Input t m a #

Functor m => Functor (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

fmap :: (a -> b) -> Input t m a -> Input t m b #

(<$) :: a -> Input t m b -> Input t m a #

MonadFix m => MonadFix (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

mfix :: (a -> Input t m a) -> Input t m a #

Applicative m => Applicative (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

pure :: a -> Input t m a #

(<*>) :: Input t m (a -> b) -> Input t m a -> Input t m b #

liftA2 :: (a -> b -> c) -> Input t m a -> Input t m b -> Input t m c #

(*>) :: Input t m a -> Input t m b -> Input t m b #

(<*) :: Input t m a -> Input t m b -> Input t m a #

MonadIO m => MonadIO (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

liftIO :: IO a -> Input t m a #

MonadRef m => MonadRef (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Associated Types

type Ref (Input t m) :: Type -> Type #

Methods

newRef :: a -> Input t m (Ref (Input t m) a) #

readRef :: Ref (Input t m) a -> Input t m a #

writeRef :: Ref (Input t m) a -> a -> Input t m () #

modifyRef :: Ref (Input t m) a -> (a -> a) -> Input t m () #

modifyRef' :: Ref (Input t m) a -> (a -> a) -> Input t m () #

MonadNodeId m => MonadNodeId (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

type Ref (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

type Ref (Input t m) = Ref (ReaderT (Event t VtyEvent) m)
type Performable (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

runInput :: Reflex t => Event t VtyEvent -> Input t m a -> m a Source #

Runs an Input with a given context

Filtering input

type KeyCombo = (Key, [Modifier]) Source #

Type synonym for a key and modifier combination

key :: (Monad m, Reflex t, HasInput t m) => Key -> m (Event t KeyCombo) Source #

Emits an event that fires on a particular key press (without modifiers)

keys :: (Monad m, Reflex t, HasInput t m) => [Key] -> m (Event t KeyCombo) Source #

Emits an event that fires on particular key presses (without modifiers)

keyCombo :: (Reflex t, Monad m, HasInput t m) => KeyCombo -> m (Event t KeyCombo) Source #

Emit an event that fires whenever the provided key combination occurs

keyCombos :: (Reflex t, Monad m, HasInput t m) => Set KeyCombo -> m (Event t KeyCombo) Source #

Emit an event that fires whenever any of the provided key combinations occur

filterKeys :: (Reflex t, HasInput t m) => (KeyCombo -> Bool) -> m a -> m a Source #

Filter the keyboard input that a child widget may receive

mouseInRegion :: Region -> VtyEvent -> Maybe VtyEvent Source #

Filter mouse input events based on whether they target a particular region and translate them to the internal coordinate system of that region.

NB: Non-mouse events are passed through unfiltered and unchanged

inputInFocusedRegion :: (HasDisplayRegion t m, HasFocusReader t m, HasInput t m) => m (Event t VtyEvent) Source #

Filter mouse input outside the current display region and all input if the region is not focused

Getting and setting the display region

data Region Source #

A chunk of the display area

Instances
Eq Region Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

(==) :: Region -> Region -> Bool #

(/=) :: Region -> Region -> Bool #

Ord Region Source # 
Instance details

Defined in Reflex.Vty.Widget

Read Region Source # 
Instance details

Defined in Reflex.Vty.Widget

Show Region Source # 
Instance details

Defined in Reflex.Vty.Widget

nilRegion :: Region Source #

A region that occupies no space.

regionSize :: Region -> (Int, Int) Source #

The width and height of a Region

regionBlankImage :: Attr -> Region -> Image Source #

Produces an Image that fills a region with space characters

class (Reflex t, Monad m) => HasDisplayRegion t m | m -> t where Source #

A class for things that know their own display size dimensions

Minimal complete definition

Nothing

Methods

askRegion :: m (Dynamic t Region) Source #

Retrieve the display region

askRegion :: (f m' ~ m, MonadTrans f, HasDisplayRegion t m') => m (Dynamic t Region) Source #

Retrieve the display region

localRegion :: (Dynamic t Region -> Dynamic t Region) -> m a -> m a Source #

Run an action in a local region, by applying a transformation to the region

localRegion :: (f m' ~ m, Monad m', MFunctor f, HasDisplayRegion t m') => (Dynamic t Region -> Dynamic t Region) -> m a -> m a Source #

Run an action in a local region, by applying a transformation to the region

Instances
HasDisplayRegion t m => HasDisplayRegion (t :: k) (NodeIdT m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasDisplayRegion t m => HasDisplayRegion (t :: k) (ReaderT x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasDisplayRegion t m => HasDisplayRegion (t :: k) (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

askRegion :: Input t m (Dynamic t Region) Source #

localRegion :: (Dynamic t Region -> Dynamic t Region) -> Input t m a -> Input t m a Source #

(Monad m, Reflex t) => HasDisplayRegion (t :: k) (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasDisplayRegion t m => HasDisplayRegion (t :: Type) (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasDisplayRegion t m => HasDisplayRegion (t :: Type) (Layout t m) Source # 
Instance details

Defined in Reflex.Vty.Widget.Layout

Methods

askRegion :: Layout t m (Dynamic t Region) Source #

localRegion :: (Dynamic t Region -> Dynamic t Region) -> Layout t m a -> Layout t m a Source #

HasDisplayRegion t m => HasDisplayRegion (t :: Type) (Focus t m) Source # 
Instance details

Defined in Reflex.Vty.Widget.Layout

Methods

askRegion :: Focus t m (Dynamic t Region) Source #

localRegion :: (Dynamic t Region -> Dynamic t Region) -> Focus t m a -> Focus t m a Source #

HasDisplayRegion t m => HasDisplayRegion (t :: Type) (EventWriterT t x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasDisplayRegion t m => HasDisplayRegion (t :: Type) (DynamicWriterT t x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasDisplayRegion t m => HasDisplayRegion (t :: Type) (BehaviorWriterT t x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

displayWidth :: HasDisplayRegion t m => m (Dynamic t Int) Source #

Retrieve the display width

displayHeight :: HasDisplayRegion t m => m (Dynamic t Int) Source #

Retrieve the display height

newtype DisplayRegion t m a Source #

A widget that has access to a particular region of the vty display

Constructors

DisplayRegion 
Instances
MonadSample t m => MonadSample (t :: k) (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

sample :: Behavior t a -> DisplayRegion t m a #

MonadHold t m => MonadHold (t :: k) (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

hold :: a -> Event t a -> DisplayRegion t m (Behavior t a) #

holdDyn :: a -> Event t a -> DisplayRegion t m (Dynamic t a) #

holdIncremental :: Patch p => PatchTarget p -> Event t p -> DisplayRegion t m (Incremental t p) #

buildDynamic :: PushM t a -> Event t a -> DisplayRegion t m (Dynamic t a) #

headE :: Event t a -> DisplayRegion t m (Event t a) #

now :: DisplayRegion t m (Event t ()) #

HasTheme t m => HasTheme (t :: k) (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasImageWriter t m => HasImageWriter (t :: k) (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasFocusReader t m => HasFocusReader (t :: k) (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

(Monad m, Reflex t) => HasDisplayRegion (t :: k) (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

NotReady t m => NotReady t (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

notReadyUntil :: Event t a -> DisplayRegion t m () #

notReady :: DisplayRegion t m () #

PerformEvent t m => PerformEvent t (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Associated Types

type Performable (DisplayRegion t m) :: Type -> Type #

TriggerEvent t m => TriggerEvent t (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

newTriggerEvent :: DisplayRegion t m (Event t a, a -> IO ()) #

newTriggerEventWithOnComplete :: DisplayRegion t m (Event t a, a -> IO () -> IO ()) #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> DisplayRegion t m (Event t a) #

PostBuild t m => PostBuild t (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

getPostBuild :: DisplayRegion t m (Event t ()) #

MonadReflexCreateTrigger t m => MonadReflexCreateTrigger t (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

newEventWithTrigger :: (EventTrigger t a -> IO (IO ())) -> DisplayRegion t m (Event t a) #

newFanEventWithTrigger :: GCompare k => (forall a. k a -> EventTrigger t a -> IO (IO ())) -> DisplayRegion t m (EventSelector t k) #

(Adjustable t m, MonadFix m, MonadHold t m) => Adjustable t (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

runWithReplace :: DisplayRegion t m a -> Event t (DisplayRegion t m b) -> DisplayRegion t m (a, Event t b) #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> DisplayRegion t m v') -> IntMap v -> Event t (PatchIntMap v) -> DisplayRegion t m (IntMap v', Event t (PatchIntMap v')) #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> DisplayRegion t m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> DisplayRegion t m (DMap k v', Event t (PatchDMap k v')) #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> DisplayRegion t m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> DisplayRegion t m (DMap k v', Event t (PatchDMapWithMove k v')) #

MFunctor (DisplayRegion t :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

hoist :: Monad m => (forall a. m a -> n a) -> DisplayRegion t m b -> DisplayRegion t n b #

MonadTrans (DisplayRegion t) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

lift :: Monad m => m a -> DisplayRegion t m a #

Monad m => Monad (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

(>>=) :: DisplayRegion t m a -> (a -> DisplayRegion t m b) -> DisplayRegion t m b #

(>>) :: DisplayRegion t m a -> DisplayRegion t m b -> DisplayRegion t m b #

return :: a -> DisplayRegion t m a #

fail :: String -> DisplayRegion t m a #

Functor m => Functor (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

fmap :: (a -> b) -> DisplayRegion t m a -> DisplayRegion t m b #

(<$) :: a -> DisplayRegion t m b -> DisplayRegion t m a #

MonadFix m => MonadFix (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

mfix :: (a -> DisplayRegion t m a) -> DisplayRegion t m a #

Applicative m => Applicative (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

pure :: a -> DisplayRegion t m a #

(<*>) :: DisplayRegion t m (a -> b) -> DisplayRegion t m a -> DisplayRegion t m b #

liftA2 :: (a -> b -> c) -> DisplayRegion t m a -> DisplayRegion t m b -> DisplayRegion t m c #

(*>) :: DisplayRegion t m a -> DisplayRegion t m b -> DisplayRegion t m b #

(<*) :: DisplayRegion t m a -> DisplayRegion t m b -> DisplayRegion t m a #

MonadIO m => MonadIO (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

liftIO :: IO a -> DisplayRegion t m a #

MonadRef m => MonadRef (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Associated Types

type Ref (DisplayRegion t m) :: Type -> Type #

Methods

newRef :: a -> DisplayRegion t m (Ref (DisplayRegion t m) a) #

readRef :: Ref (DisplayRegion t m) a -> DisplayRegion t m a #

writeRef :: Ref (DisplayRegion t m) a -> a -> DisplayRegion t m () #

modifyRef :: Ref (DisplayRegion t m) a -> (a -> a) -> DisplayRegion t m () #

modifyRef' :: Ref (DisplayRegion t m) a -> (a -> a) -> DisplayRegion t m () #

MonadNodeId m => MonadNodeId (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

type Ref (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

type Ref (DisplayRegion t m) = Ref (ReaderT (Dynamic t Region) m)
type Performable (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

runDisplayRegion :: (Reflex t, Monad m) => Dynamic t Region -> DisplayRegion t m a -> m a Source #

Run a DisplayRegion action with a given Region

Getting focus state

class (Reflex t, Monad m) => HasFocusReader t m | m -> t where Source #

A class for things that can dynamically gain and lose focus

Minimal complete definition

Nothing

Methods

focus :: m (Dynamic t Bool) Source #

focus :: (f m' ~ m, Monad m', MonadTrans f, HasFocusReader t m') => m (Dynamic t Bool) Source #

localFocus :: (Dynamic t Bool -> Dynamic t Bool) -> m a -> m a Source #

localFocus :: (f m' ~ m, Monad m', MFunctor f, HasFocusReader t m') => (Dynamic t Bool -> Dynamic t Bool) -> m a -> m a Source #

Instances
HasFocusReader t m => HasFocusReader (t :: k) (NodeIdT m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasFocusReader t m => HasFocusReader (t :: k) (ReaderT x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

focus :: ReaderT x m (Dynamic t Bool) Source #

localFocus :: (Dynamic t Bool -> Dynamic t Bool) -> ReaderT x m a -> ReaderT x m a Source #

HasFocusReader t m => HasFocusReader (t :: k) (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasFocusReader t m => HasFocusReader (t :: k) (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

focus :: Input t m (Dynamic t Bool) Source #

localFocus :: (Dynamic t Bool -> Dynamic t Bool) -> Input t m a -> Input t m a Source #

(Monad m, Reflex t) => HasFocusReader (t :: k) (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasFocusReader t m => HasFocusReader (t :: Type) (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

(HasFocusReader t m, Monad m) => HasFocusReader (t :: Type) (Layout t m) Source # 
Instance details

Defined in Reflex.Vty.Widget.Layout

Methods

focus :: Layout t m (Dynamic t Bool) Source #

localFocus :: (Dynamic t Bool -> Dynamic t Bool) -> Layout t m a -> Layout t m a Source #

(HasFocusReader t m, Monad m) => HasFocusReader (t :: Type) (Focus t m) Source # 
Instance details

Defined in Reflex.Vty.Widget.Layout

Methods

focus :: Focus t m (Dynamic t Bool) Source #

localFocus :: (Dynamic t Bool -> Dynamic t Bool) -> Focus t m a -> Focus t m a Source #

HasFocusReader t m => HasFocusReader (t :: Type) (EventWriterT t x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

focus :: EventWriterT t x m (Dynamic t Bool) Source #

localFocus :: (Dynamic t Bool -> Dynamic t Bool) -> EventWriterT t x m a -> EventWriterT t x m a Source #

HasFocusReader t m => HasFocusReader (t :: Type) (DynamicWriterT t x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasFocusReader t m => HasFocusReader (t :: Type) (BehaviorWriterT t x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

newtype FocusReader t m a Source #

A widget that has access to information about whether it is focused

Constructors

FocusReader 

Fields

Instances
MonadSample t m => MonadSample (t :: k) (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

sample :: Behavior t a -> FocusReader t m a #

MonadHold t m => MonadHold (t :: k) (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

hold :: a -> Event t a -> FocusReader t m (Behavior t a) #

holdDyn :: a -> Event t a -> FocusReader t m (Dynamic t a) #

holdIncremental :: Patch p => PatchTarget p -> Event t p -> FocusReader t m (Incremental t p) #

buildDynamic :: PushM t a -> Event t a -> FocusReader t m (Dynamic t a) #

headE :: Event t a -> FocusReader t m (Event t a) #

now :: FocusReader t m (Event t ()) #

HasTheme t m => HasTheme (t :: k) (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasImageWriter t m => HasImageWriter (t :: k) (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

tellImages :: Behavior t [Image] -> FocusReader t m () Source #

mapImages :: (Behavior t [Image] -> Behavior t [Image]) -> FocusReader t m a -> FocusReader t m a Source #

(Monad m, Reflex t) => HasFocusReader (t :: k) (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

NotReady t m => NotReady t (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

notReadyUntil :: Event t a -> FocusReader t m () #

notReady :: FocusReader t m () #

PerformEvent t m => PerformEvent t (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Associated Types

type Performable (FocusReader t m) :: Type -> Type #

Methods

performEvent :: Event t (Performable (FocusReader t m) a) -> FocusReader t m (Event t a) #

performEvent_ :: Event t (Performable (FocusReader t m) ()) -> FocusReader t m () #

TriggerEvent t m => TriggerEvent t (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

newTriggerEvent :: FocusReader t m (Event t a, a -> IO ()) #

newTriggerEventWithOnComplete :: FocusReader t m (Event t a, a -> IO () -> IO ()) #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> FocusReader t m (Event t a) #

PostBuild t m => PostBuild t (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

getPostBuild :: FocusReader t m (Event t ()) #

MonadReflexCreateTrigger t m => MonadReflexCreateTrigger t (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

newEventWithTrigger :: (EventTrigger t a -> IO (IO ())) -> FocusReader t m (Event t a) #

newFanEventWithTrigger :: GCompare k => (forall a. k a -> EventTrigger t a -> IO (IO ())) -> FocusReader t m (EventSelector t k) #

(Adjustable t m, MonadFix m, MonadHold t m) => Adjustable t (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

runWithReplace :: FocusReader t m a -> Event t (FocusReader t m b) -> FocusReader t m (a, Event t b) #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> FocusReader t m v') -> IntMap v -> Event t (PatchIntMap v) -> FocusReader t m (IntMap v', Event t (PatchIntMap v')) #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> FocusReader t m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> FocusReader t m (DMap k v', Event t (PatchDMap k v')) #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> FocusReader t m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> FocusReader t m (DMap k v', Event t (PatchDMapWithMove k v')) #

MFunctor (FocusReader t :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

hoist :: Monad m => (forall a. m a -> n a) -> FocusReader t m b -> FocusReader t n b #

MonadTrans (FocusReader t) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

lift :: Monad m => m a -> FocusReader t m a #

Monad m => Monad (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

(>>=) :: FocusReader t m a -> (a -> FocusReader t m b) -> FocusReader t m b #

(>>) :: FocusReader t m a -> FocusReader t m b -> FocusReader t m b #

return :: a -> FocusReader t m a #

fail :: String -> FocusReader t m a #

Functor m => Functor (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

fmap :: (a -> b) -> FocusReader t m a -> FocusReader t m b #

(<$) :: a -> FocusReader t m b -> FocusReader t m a #

MonadFix m => MonadFix (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

mfix :: (a -> FocusReader t m a) -> FocusReader t m a #

Applicative m => Applicative (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

pure :: a -> FocusReader t m a #

(<*>) :: FocusReader t m (a -> b) -> FocusReader t m a -> FocusReader t m b #

liftA2 :: (a -> b -> c) -> FocusReader t m a -> FocusReader t m b -> FocusReader t m c #

(*>) :: FocusReader t m a -> FocusReader t m b -> FocusReader t m b #

(<*) :: FocusReader t m a -> FocusReader t m b -> FocusReader t m a #

MonadIO m => MonadIO (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

liftIO :: IO a -> FocusReader t m a #

MonadRef m => MonadRef (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Associated Types

type Ref (FocusReader t m) :: Type -> Type #

Methods

newRef :: a -> FocusReader t m (Ref (FocusReader t m) a) #

readRef :: Ref (FocusReader t m) a -> FocusReader t m a #

writeRef :: Ref (FocusReader t m) a -> a -> FocusReader t m () #

modifyRef :: Ref (FocusReader t m) a -> (a -> a) -> FocusReader t m () #

modifyRef' :: Ref (FocusReader t m) a -> (a -> a) -> FocusReader t m () #

MonadNodeId m => MonadNodeId (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

type Ref (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

type Ref (FocusReader t m) = Ref (ReaderT (Dynamic t Bool) m)
type Performable (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

runFocusReader :: (Reflex t, Monad m) => Dynamic t Bool -> FocusReader t m a -> m a Source #

Run a FocusReader action with the given focus value

Image output

class (Reflex t, Monad m) => HasImageWriter t m | m -> t where Source #

A class for widgets that can produce images to draw to the display

Minimal complete definition

Nothing

Methods

tellImages :: Behavior t [Image] -> m () Source #

Send images upstream for rendering

tellImages :: (f m' ~ m, Monad m', MonadTrans f, HasImageWriter t m') => Behavior t [Image] -> m () Source #

Send images upstream for rendering

mapImages :: (Behavior t [Image] -> Behavior t [Image]) -> m a -> m a Source #

Apply a transformation to the images produced by the child actions

mapImages :: (f m' ~ m, Monad m', MFunctor f, HasImageWriter t m') => (Behavior t [Image] -> Behavior t [Image]) -> m a -> m a Source #

Apply a transformation to the images produced by the child actions

Instances
HasImageWriter t m => HasImageWriter (t :: k) (NodeIdT m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

tellImages :: Behavior t [Image] -> NodeIdT m () Source #

mapImages :: (Behavior t [Image] -> Behavior t [Image]) -> NodeIdT m a -> NodeIdT m a Source #

HasImageWriter t m => HasImageWriter (t :: k) (ReaderT x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

tellImages :: Behavior t [Image] -> ReaderT x m () Source #

mapImages :: (Behavior t [Image] -> Behavior t [Image]) -> ReaderT x m a -> ReaderT x m a Source #

HasImageWriter t m => HasImageWriter (t :: k) (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

tellImages :: Behavior t [Image] -> FocusReader t m () Source #

mapImages :: (Behavior t [Image] -> Behavior t [Image]) -> FocusReader t m a -> FocusReader t m a Source #

HasImageWriter t m => HasImageWriter (t :: k) (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasImageWriter t m => HasImageWriter (t :: k) (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

tellImages :: Behavior t [Image] -> Input t m () Source #

mapImages :: (Behavior t [Image] -> Behavior t [Image]) -> Input t m a -> Input t m a Source #

HasImageWriter t m => HasImageWriter (t :: k) (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

tellImages :: Behavior t [Image] -> ThemeReader t m () Source #

mapImages :: (Behavior t [Image] -> Behavior t [Image]) -> ThemeReader t m a -> ThemeReader t m a Source #

(Monad m, Reflex t) => HasImageWriter (t :: Type) (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

tellImages :: Behavior t [Image] -> ImageWriter t m () Source #

mapImages :: (Behavior t [Image] -> Behavior t [Image]) -> ImageWriter t m a -> ImageWriter t m a Source #

(HasDisplayRegion t m, HasImageWriter t m, MonadFix m) => HasImageWriter (t :: Type) (Layout t m) Source # 
Instance details

Defined in Reflex.Vty.Widget.Layout

Methods

tellImages :: Behavior t [Image] -> Layout t m () Source #

mapImages :: (Behavior t [Image] -> Behavior t [Image]) -> Layout t m a -> Layout t m a Source #

(HasImageWriter t m, MonadFix m) => HasImageWriter (t :: Type) (Focus t m) Source # 
Instance details

Defined in Reflex.Vty.Widget.Layout

Methods

tellImages :: Behavior t [Image] -> Focus t m () Source #

mapImages :: (Behavior t [Image] -> Behavior t [Image]) -> Focus t m a -> Focus t m a Source #

HasImageWriter t m => HasImageWriter (t :: Type) (EventWriterT t x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

tellImages :: Behavior t [Image] -> EventWriterT t x m () Source #

mapImages :: (Behavior t [Image] -> Behavior t [Image]) -> EventWriterT t x m a -> EventWriterT t x m a Source #

HasImageWriter t m => HasImageWriter (t :: Type) (DynamicWriterT t x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

tellImages :: Behavior t [Image] -> DynamicWriterT t x m () Source #

mapImages :: (Behavior t [Image] -> Behavior t [Image]) -> DynamicWriterT t x m a -> DynamicWriterT t x m a Source #

HasImageWriter t m => HasImageWriter (t :: Type) (BehaviorWriterT t x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

newtype ImageWriter t m a Source #

A widget that can produce images to draw onto the display

Constructors

ImageWriter 
Instances
NotReady t m => NotReady t (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

notReadyUntil :: Event t a -> ImageWriter t m () #

notReady :: ImageWriter t m () #

PerformEvent t m => PerformEvent t (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Associated Types

type Performable (ImageWriter t m) :: Type -> Type #

Methods

performEvent :: Event t (Performable (ImageWriter t m) a) -> ImageWriter t m (Event t a) #

performEvent_ :: Event t (Performable (ImageWriter t m) ()) -> ImageWriter t m () #

TriggerEvent t m => TriggerEvent t (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

newTriggerEvent :: ImageWriter t m (Event t a, a -> IO ()) #

newTriggerEventWithOnComplete :: ImageWriter t m (Event t a, a -> IO () -> IO ()) #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> ImageWriter t m (Event t a) #

PostBuild t m => PostBuild t (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

getPostBuild :: ImageWriter t m (Event t ()) #

MonadReflexCreateTrigger t m => MonadReflexCreateTrigger t (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

newEventWithTrigger :: (EventTrigger t a -> IO (IO ())) -> ImageWriter t m (Event t a) #

newFanEventWithTrigger :: GCompare k => (forall a. k a -> EventTrigger t a -> IO (IO ())) -> ImageWriter t m (EventSelector t k) #

(Adjustable t m, MonadFix m, MonadHold t m) => Adjustable t (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

runWithReplace :: ImageWriter t m a -> Event t (ImageWriter t m b) -> ImageWriter t m (a, Event t b) #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> ImageWriter t m v') -> IntMap v -> Event t (PatchIntMap v) -> ImageWriter t m (IntMap v', Event t (PatchIntMap v')) #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> ImageWriter t m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> ImageWriter t m (DMap k v', Event t (PatchDMap k v')) #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> ImageWriter t m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> ImageWriter t m (DMap k v', Event t (PatchDMapWithMove k v')) #

MonadTrans (ImageWriter t) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

lift :: Monad m => m a -> ImageWriter t m a #

MonadSample t m => MonadSample (t :: Type) (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

sample :: Behavior t a -> ImageWriter t m a #

MonadHold t m => MonadHold (t :: Type) (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

hold :: a -> Event t a -> ImageWriter t m (Behavior t a) #

holdDyn :: a -> Event t a -> ImageWriter t m (Dynamic t a) #

holdIncremental :: Patch p => PatchTarget p -> Event t p -> ImageWriter t m (Incremental t p) #

buildDynamic :: PushM t a -> Event t a -> ImageWriter t m (Dynamic t a) #

headE :: Event t a -> ImageWriter t m (Event t a) #

now :: ImageWriter t m (Event t ()) #

HasTheme t m => HasTheme (t :: Type) (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

(Monad m, Reflex t) => HasImageWriter (t :: Type) (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

tellImages :: Behavior t [Image] -> ImageWriter t m () Source #

mapImages :: (Behavior t [Image] -> Behavior t [Image]) -> ImageWriter t m a -> ImageWriter t m a Source #

HasFocusReader t m => HasFocusReader (t :: Type) (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasDisplayRegion t m => HasDisplayRegion (t :: Type) (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

MFunctor (ImageWriter t :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

hoist :: Monad m => (forall a. m a -> n a) -> ImageWriter t m b -> ImageWriter t n b #

Monad m => Monad (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

(>>=) :: ImageWriter t m a -> (a -> ImageWriter t m b) -> ImageWriter t m b #

(>>) :: ImageWriter t m a -> ImageWriter t m b -> ImageWriter t m b #

return :: a -> ImageWriter t m a #

fail :: String -> ImageWriter t m a #

Functor m => Functor (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

fmap :: (a -> b) -> ImageWriter t m a -> ImageWriter t m b #

(<$) :: a -> ImageWriter t m b -> ImageWriter t m a #

MonadFix m => MonadFix (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

mfix :: (a -> ImageWriter t m a) -> ImageWriter t m a #

Monad m => Applicative (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

pure :: a -> ImageWriter t m a #

(<*>) :: ImageWriter t m (a -> b) -> ImageWriter t m a -> ImageWriter t m b #

liftA2 :: (a -> b -> c) -> ImageWriter t m a -> ImageWriter t m b -> ImageWriter t m c #

(*>) :: ImageWriter t m a -> ImageWriter t m b -> ImageWriter t m b #

(<*) :: ImageWriter t m a -> ImageWriter t m b -> ImageWriter t m a #

MonadIO m => MonadIO (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

liftIO :: IO a -> ImageWriter t m a #

MonadRef m => MonadRef (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Associated Types

type Ref (ImageWriter t m) :: Type -> Type #

Methods

newRef :: a -> ImageWriter t m (Ref (ImageWriter t m) a) #

readRef :: Ref (ImageWriter t m) a -> ImageWriter t m a #

writeRef :: Ref (ImageWriter t m) a -> a -> ImageWriter t m () #

modifyRef :: Ref (ImageWriter t m) a -> (a -> a) -> ImageWriter t m () #

modifyRef' :: Ref (ImageWriter t m) a -> (a -> a) -> ImageWriter t m () #

type Ref (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

type Ref (ImageWriter t m) = Ref (BehaviorWriterT t [Image] m)
type Performable (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

runImageWriter :: (Reflex t, Monad m) => ImageWriter t m a -> m (a, Behavior t [Image]) Source #

Run a widget that can produce images

Theming

class (Reflex t, Monad m) => HasTheme t m | m -> t where Source #

A class for things that can be visually styled

Minimal complete definition

Nothing

Methods

theme :: m (Behavior t Attr) Source #

theme :: (f m' ~ m, Monad m', MonadTrans f, HasTheme t m') => m (Behavior t Attr) Source #

localTheme :: (Behavior t Attr -> Behavior t Attr) -> m a -> m a Source #

localTheme :: (f m' ~ m, Monad m', MFunctor f, HasTheme t m') => (Behavior t Attr -> Behavior t Attr) -> m a -> m a Source #

Instances
HasTheme t m => HasTheme (t :: k) (NodeIdT m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasTheme t m => HasTheme (t :: k) (ReaderT x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

theme :: ReaderT x m (Behavior t Attr) Source #

localTheme :: (Behavior t Attr -> Behavior t Attr) -> ReaderT x m a -> ReaderT x m a Source #

HasTheme t m => HasTheme (t :: k) (FocusReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasTheme t m => HasTheme (t :: k) (DisplayRegion t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasTheme t m => HasTheme (t :: k) (Input t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

theme :: Input t m (Behavior t Attr) Source #

localTheme :: (Behavior t Attr -> Behavior t Attr) -> Input t m a -> Input t m a Source #

(Monad m, Reflex t) => HasTheme (t :: k) (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasTheme t m => HasTheme (t :: Type) (ImageWriter t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

(HasTheme t m, Monad m) => HasTheme (t :: Type) (Layout t m) Source # 
Instance details

Defined in Reflex.Vty.Widget.Layout

Methods

theme :: Layout t m (Behavior t Attr) Source #

localTheme :: (Behavior t Attr -> Behavior t Attr) -> Layout t m a -> Layout t m a Source #

(HasTheme t m, Monad m) => HasTheme (t :: Type) (Focus t m) Source # 
Instance details

Defined in Reflex.Vty.Widget.Layout

Methods

theme :: Focus t m (Behavior t Attr) Source #

localTheme :: (Behavior t Attr -> Behavior t Attr) -> Focus t m a -> Focus t m a Source #

HasTheme t m => HasTheme (t :: Type) (EventWriterT t x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasTheme t m => HasTheme (t :: Type) (DynamicWriterT t x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasTheme t m => HasTheme (t :: Type) (BehaviorWriterT t x m) Source # 
Instance details

Defined in Reflex.Vty.Widget

newtype ThemeReader t m a Source #

A widget that has access to theme information

Constructors

ThemeReader 

Fields

Instances
MonadSample t m => MonadSample (t :: k) (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

sample :: Behavior t a -> ThemeReader t m a #

MonadHold t m => MonadHold (t :: k) (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

hold :: a -> Event t a -> ThemeReader t m (Behavior t a) #

holdDyn :: a -> Event t a -> ThemeReader t m (Dynamic t a) #

holdIncremental :: Patch p => PatchTarget p -> Event t p -> ThemeReader t m (Incremental t p) #

buildDynamic :: PushM t a -> Event t a -> ThemeReader t m (Dynamic t a) #

headE :: Event t a -> ThemeReader t m (Event t a) #

now :: ThemeReader t m (Event t ()) #

(Monad m, Reflex t) => HasTheme (t :: k) (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

HasImageWriter t m => HasImageWriter (t :: k) (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

tellImages :: Behavior t [Image] -> ThemeReader t m () Source #

mapImages :: (Behavior t [Image] -> Behavior t [Image]) -> ThemeReader t m a -> ThemeReader t m a Source #

NotReady t m => NotReady t (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

notReadyUntil :: Event t a -> ThemeReader t m () #

notReady :: ThemeReader t m () #

PerformEvent t m => PerformEvent t (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Associated Types

type Performable (ThemeReader t m) :: Type -> Type #

Methods

performEvent :: Event t (Performable (ThemeReader t m) a) -> ThemeReader t m (Event t a) #

performEvent_ :: Event t (Performable (ThemeReader t m) ()) -> ThemeReader t m () #

TriggerEvent t m => TriggerEvent t (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

newTriggerEvent :: ThemeReader t m (Event t a, a -> IO ()) #

newTriggerEventWithOnComplete :: ThemeReader t m (Event t a, a -> IO () -> IO ()) #

newEventWithLazyTriggerWithOnComplete :: ((a -> IO () -> IO ()) -> IO (IO ())) -> ThemeReader t m (Event t a) #

PostBuild t m => PostBuild t (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

getPostBuild :: ThemeReader t m (Event t ()) #

MonadReflexCreateTrigger t m => MonadReflexCreateTrigger t (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

newEventWithTrigger :: (EventTrigger t a -> IO (IO ())) -> ThemeReader t m (Event t a) #

newFanEventWithTrigger :: GCompare k => (forall a. k a -> EventTrigger t a -> IO (IO ())) -> ThemeReader t m (EventSelector t k) #

(Adjustable t m, MonadFix m, MonadHold t m) => Adjustable t (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

runWithReplace :: ThemeReader t m a -> Event t (ThemeReader t m b) -> ThemeReader t m (a, Event t b) #

traverseIntMapWithKeyWithAdjust :: (Key -> v -> ThemeReader t m v') -> IntMap v -> Event t (PatchIntMap v) -> ThemeReader t m (IntMap v', Event t (PatchIntMap v')) #

traverseDMapWithKeyWithAdjust :: GCompare k => (forall a. k a -> v a -> ThemeReader t m (v' a)) -> DMap k v -> Event t (PatchDMap k v) -> ThemeReader t m (DMap k v', Event t (PatchDMap k v')) #

traverseDMapWithKeyWithAdjustWithMove :: GCompare k => (forall a. k a -> v a -> ThemeReader t m (v' a)) -> DMap k v -> Event t (PatchDMapWithMove k v) -> ThemeReader t m (DMap k v', Event t (PatchDMapWithMove k v')) #

MFunctor (ThemeReader t :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

hoist :: Monad m => (forall a. m a -> n a) -> ThemeReader t m b -> ThemeReader t n b #

MonadTrans (ThemeReader t) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

lift :: Monad m => m a -> ThemeReader t m a #

Monad m => Monad (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

(>>=) :: ThemeReader t m a -> (a -> ThemeReader t m b) -> ThemeReader t m b #

(>>) :: ThemeReader t m a -> ThemeReader t m b -> ThemeReader t m b #

return :: a -> ThemeReader t m a #

fail :: String -> ThemeReader t m a #

Functor m => Functor (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

fmap :: (a -> b) -> ThemeReader t m a -> ThemeReader t m b #

(<$) :: a -> ThemeReader t m b -> ThemeReader t m a #

MonadFix m => MonadFix (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

mfix :: (a -> ThemeReader t m a) -> ThemeReader t m a #

Applicative m => Applicative (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

pure :: a -> ThemeReader t m a #

(<*>) :: ThemeReader t m (a -> b) -> ThemeReader t m a -> ThemeReader t m b #

liftA2 :: (a -> b -> c) -> ThemeReader t m a -> ThemeReader t m b -> ThemeReader t m c #

(*>) :: ThemeReader t m a -> ThemeReader t m b -> ThemeReader t m b #

(<*) :: ThemeReader t m a -> ThemeReader t m b -> ThemeReader t m a #

MonadIO m => MonadIO (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Methods

liftIO :: IO a -> ThemeReader t m a #

MonadRef m => MonadRef (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

Associated Types

type Ref (ThemeReader t m) :: Type -> Type #

Methods

newRef :: a -> ThemeReader t m (Ref (ThemeReader t m) a) #

readRef :: Ref (ThemeReader t m) a -> ThemeReader t m a #

writeRef :: Ref (ThemeReader t m) a -> a -> ThemeReader t m () #

modifyRef :: Ref (ThemeReader t m) a -> (a -> a) -> ThemeReader t m () #

modifyRef' :: Ref (ThemeReader t m) a -> (a -> a) -> ThemeReader t m () #

MonadNodeId m => MonadNodeId (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

type Ref (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

type Ref (ThemeReader t m) = Ref (ReaderT (Behavior t Attr) m)
type Performable (ThemeReader t m) Source # 
Instance details

Defined in Reflex.Vty.Widget

runThemeReader :: (Reflex t, Monad m) => Behavior t Attr -> ThemeReader t m a -> m a Source #

Run a ThemeReader action with the given focus value

Manipulating images

withinImage :: Region -> Image -> Image Source #

Translates and crops an Image so that it is contained by the given Region.

imagesInRegion :: Reflex t => Behavior t Region -> Behavior t [Image] -> Behavior t [Image] Source #

Crop a behavior of images to a behavior of regions. See withinImage.

Running sub-widgets

pane Source #

Arguments

:: (Reflex t, Monad m, HasInput t m, HasImageWriter t m, HasDisplayRegion t m, HasFocusReader t m) 
=> Dynamic t Region 
-> Dynamic t Bool

Whether the widget should be focused when the parent is.

-> m a 
-> m a 

Low-level widget combinator that runs a child widget within a given region and context. This widget filters and modifies the input that the child widget receives such that: * unfocused widgets receive no key events * mouse inputs outside the region are ignored * mouse inputs inside the region have their coordinates translated such that (0,0) is the top-left corner of the region

Misc

blank :: Monad m => m () Source #

A widget that draws nothing