Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Hook
- type Hooks = Map TypeRep [Hook]
- onEveryTrigger :: forall a. Typeable a => (a -> Action ()) -> Action HookId
- onEveryTrigger_ :: forall a. Typeable a => (a -> Action ()) -> Action ()
- onNextEvent :: forall a. Typeable a => (a -> Action ()) -> Action ()
- onInit :: Action () -> Action ()
- beforeEveryEvent :: Action () -> Action HookId
- beforeEveryEvent_ :: Action () -> Action ()
- beforeNextEvent :: Action () -> Action ()
- beforeEveryRender :: Action () -> Action HookId
- beforeEveryRender_ :: Action () -> Action ()
- beforeNextRender :: Action () -> Action ()
- onEveryRender :: Action () -> Action HookId
- onEveryRender_ :: Action () -> Action ()
- onNextRender :: Action () -> Action ()
- afterEveryRender :: Action () -> Action HookId
- afterEveryRender_ :: Action () -> Action ()
- afterNextRender :: Action () -> Action ()
- dispatchEvent :: Typeable a => a -> Action ()
- onExit :: Action () -> Action ()
- removeListener :: HookId -> Action ()
- matchingHooks :: forall a. Typeable a => Hooks -> [a -> Action ()]
- onBufAdded :: (BufRef -> Action ()) -> Action HookId
Documentation
onEveryTrigger :: forall a. Typeable a => (a -> Action ()) -> Action HookId Source #
This registers an event listener hook, as long as the listener is well-typed similar to this:
MyEventType -> Action ()
then it will be triggered on all dispatched events of that type.
It returns an ID which may be used with removeListener
to cancel the listener
onNextEvent :: forall a. Typeable a => (a -> Action ()) -> Action () Source #
This acts as onEveryTrigger
but listens only for the first event of a given type.
onInit :: Action () -> Action () Source #
Registers an action to be performed during the Initialization phase.
This phase occurs exactly ONCE when the editor starts up. Though arbitrary actions may be performed in the configuration block; it's recommended to embed such actions in the onInit event listener so that all event listeners are registered before anything Actions occur.
beforeEveryEvent :: Action () -> Action HookId Source #
Registers an action to be performed BEFORE each event phase.
beforeEveryEvent_ :: Action () -> Action () Source #
beforeNextEvent :: Action () -> Action () Source #
beforeEveryRender :: Action () -> Action HookId Source #
Registers an action to be performed BEFORE each render phase.
This is a good spot to add information useful to the renderer since all actions have been performed. Only cosmetic changes should occur during this phase.
beforeEveryRender_ :: Action () -> Action () Source #
beforeNextRender :: Action () -> Action () Source #
onEveryRender :: Action () -> Action HookId Source #
Registers an action to be performed during each render phase.
This phase should only be used by extensions which actually render something.
onEveryRender_ :: Action () -> Action () Source #
onNextRender :: Action () -> Action () Source #
afterEveryRender :: Action () -> Action HookId Source #
Registers an action to be performed AFTER each render phase.
This is useful for cleaning up extension state that was registered for the renderer, but needs to be cleared before the next iteration.
afterEveryRender_ :: Action () -> Action () Source #
afterNextRender :: Action () -> Action () Source #
dispatchEvent :: Typeable a => a -> Action () Source #
Use this to dispatch an event of any type, any hooks which are listening for this event will be triggered with the provided event. Use this within an Action.
onExit :: Action () -> Action () Source #
Registers an action to be performed during the exit phase.
This is only triggered exactly once when the editor is shutting down. It allows an opportunity to do clean-up, kill any processes you've started, or save any data before the editor terminates.
removeListener :: HookId -> Action () Source #
This removes a listener and prevents it from responding to any more events.