-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Graphical indicator for WildBind
--   
--   Graphical indicator for WildBind. See
--   <a>https://github.com/debug-ito/wild-bind</a>
@package wild-bind-indicator
@version 0.1.0.1


-- | This module exports the <a>Indicator</a>, a graphical interface that
--   explains the current bindings to the user. The <a>Indicator</a> uses
--   <a>optBindingHook</a> in <a>Option</a> to receive the current bindings
--   from wild-bind.
module WildBind.Indicator

-- | Initialize the indicator and run the given action. This function
--   should be used directly under <tt>main</tt> function.
--   
--   <pre>
--   main :: IO ()
--   main = withNumPadIndicator $ \indicator -&gt; ...
--   </pre>
--   
--   The executable must be compiled by ghc with <b><tt>-threaded</tt>
--   option enabled.</b> Otherwise, it aborts.
withNumPadIndicator :: NumPadPosition i => (Indicator s i -> IO ()) -> IO ()

-- | Run <a>wildBind</a> with the given <a>Indicator</a>.
--   <a>ActionDescription</a>s are shown by the <a>Indicator</a>.
wildBindWithIndicator :: (Ord i, Enum i, Bounded i) => Indicator s i -> Binding s i -> FrontEnd s i -> IO ()

-- | Create an action appropriate for <a>optBindingHook</a> in
--   <a>Option</a> from <a>Indicator</a> and <a>FrontEnd</a>.
bindingHook :: (Ord i, Enum i, Bounded i) => Indicator s1 i -> FrontEnd s2 i -> [(i, ActionDescription)] -> IO ()

-- | Indicator interface. <tt>s</tt> is the front-end state, <tt>i</tt> is
--   the input type.
data Indicator s i

-- | Update and show the description for the current binding.
updateDescription :: Indicator s i -> i -> ActionDescription -> IO ()

-- | Get the current presence of the indicator. Returns <a>True</a> if it's
--   present.
getPresence :: Indicator s i -> IO Bool

-- | Set the presence of the indicator.
setPresence :: Indicator s i -> Bool -> IO ()

-- | Toggle the presence of the indicator.
togglePresence :: Indicator s i -> IO ()

-- | Destroy the indicator. This usually means quitting the entire
--   application.
quit :: Indicator s i -> IO ()

-- | Something that can be mapped to number pad's key positions.
class NumPadPosition a
toNumPad :: NumPadPosition a => a -> NumPadLocked
instance WildBind.Indicator.NumPadPosition WildBind.Input.NumPad.NumPadLocked
instance WildBind.Indicator.NumPadPosition WildBind.Input.NumPad.NumPadUnlocked
