| Maintainer | Toshio Ito <debug.ito@gmail.com> |
|---|---|
| Safe Haskell | None |
| Language | Haskell2010 |
WildBind.Indicator
Contents
Description
This module exports the Indicator, a graphical interface that
explains the current bindings to the user. The Indicator uses
optBindingHook in Option to receive the current bindings from
wild-bind.
- withNumPadIndicator :: (NumPadPosition i, Enum i, Bounded i) => (Indicator s i -> IO ()) -> IO ()
- wildBindWithIndicator :: Ord i => Indicator s i -> Binding s i -> FrontEnd s i -> IO ()
- bindingHook :: Ord i => Indicator s1 i -> FrontEnd s2 i -> [(i, ActionDescription)] -> IO ()
- data Indicator s i
- updateDescription :: Indicator s i -> i -> ActionDescription -> IO ()
- getPresence :: Indicator s i -> IO Bool
- setPresence :: Indicator s i -> Bool -> IO ()
- togglePresence :: Indicator s i -> IO ()
- quit :: Indicator s i -> IO ()
- adaptIndicator :: (i -> i') -> (i' -> Maybe i) -> Indicator s i -> Indicator s i'
- toggleBinding :: (NumPadPosition i, Ord i, Enum i, Bounded i) => Indicator s i -> NumPadLocked -> Binding' bs fs i
- class NumPadPosition a where
Construction
withNumPadIndicator :: (NumPadPosition i, Enum i, Bounded i) => (Indicator s i -> IO ()) -> IO () Source #
Initialize the indicator and run the given action. This function
should be used directly under main function.
main :: IO () main = withNumPadIndicator $ \indicator -> ...
The executable must be compiled by ghc with -threaded option enabled.
Otherwise, it aborts.
Execution
wildBindWithIndicator :: Ord i => Indicator s i -> Binding s i -> FrontEnd s i -> IO () Source #
Run wildBind with the given Indicator. ActionDescriptions
are shown by the Indicator.
Low-level function
bindingHook :: Ord i => Indicator s1 i -> FrontEnd s2 i -> [(i, ActionDescription)] -> IO () Source #
Create an action appropriate for optBindingHook in Option
from Indicator and FrontEnd.
Indicator type and its actions
updateDescription :: Indicator s i -> i -> ActionDescription -> IO () Source #
Update and show the description for the current binding.
getPresence :: Indicator s i -> IO Bool Source #
Get the current presence of the indicator. Returns True if
it's present.
togglePresence :: Indicator s i -> IO () Source #
Toggle the presence of the indicator.
quit :: Indicator s i -> IO () Source #
Destroy the indicator. This usually means quitting the entire application.
Conversion
Binding
Arguments
| :: (NumPadPosition i, Ord i, Enum i, Bounded i) | |
| => Indicator s i | |
| -> NumPadLocked | the button to bind the |
| -> Binding' bs fs i |
A binding that toggles presence of the Indicator.
Since: 0.2.0.0
Generalization of number pad types
class NumPadPosition a where Source #
Something that can be mapped to number pad's key positions.
Minimal complete definition
Methods
toNumPad :: a -> NumPadLocked Source #
Instances