Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- data Purity
- data EventHandlerReturn m gtkReturn event where
- OnlyEvent :: m e -> EventHandlerReturn m () e
- ReturnAndEvent :: m (Bool, e) -> EventHandlerReturn m Bool e
- data EventHandler gtkEventHandler widget (purity :: Purity) event where
- PureEventHandler :: EventHandlerReturn Identity ret e -> EventHandler (IO ret) w Pure e
- ImpureEventHandler :: (w -> EventHandlerReturn IO ret e) -> EventHandler (IO ret) w Impure e
- EventHandlerFunction :: (a -> EventHandler b w p e) -> EventHandler (a -> b) w p e
- type family UserEventHandler gtkCallback widget (purity :: Purity) event where ...
- class ToEventHandler gtkEventHandler widget purity where
- toEventHandler :: UserEventHandler gtkEventHandler widget purity event -> EventHandler gtkEventHandler widget purity event
Documentation
data EventHandlerReturn m gtkReturn event where Source #
The two supported types of return values in user event handlers are encoded
by the EventHandlerReturn
type; either you can return only an event
, or if
the underlying GTK+ callback needs to return a Bool
, you return
a (Bool, event)
tuple.
OnlyEvent :: m e -> EventHandlerReturn m () e | |
ReturnAndEvent :: m (Bool, e) -> EventHandlerReturn m Bool e |
Instances
Functor m => Functor (EventHandlerReturn m gtkEventHandler) Source # | |
Defined in GI.Gtk.Declarative.Attributes.Internal.EventHandler fmap :: (a -> b) -> EventHandlerReturn m gtkEventHandler a -> EventHandlerReturn m gtkEventHandler b # (<$) :: a -> EventHandlerReturn m gtkEventHandler b -> EventHandlerReturn m gtkEventHandler a # |
data EventHandler gtkEventHandler widget (purity :: Purity) event where Source #
Encodes the user event handler in such a way that we can have
a Functor
instance for arity-polymorphic event handlers.
PureEventHandler :: EventHandlerReturn Identity ret e -> EventHandler (IO ret) w Pure e | |
ImpureEventHandler :: (w -> EventHandlerReturn IO ret e) -> EventHandler (IO ret) w Impure e | |
EventHandlerFunction :: (a -> EventHandler b w p e) -> EventHandler (a -> b) w p e |
Instances
Functor (EventHandler gtkEventHandler widget purity) Source # | |
Defined in GI.Gtk.Declarative.Attributes.Internal.EventHandler fmap :: (a -> b) -> EventHandler gtkEventHandler widget purity a -> EventHandler gtkEventHandler widget purity b # (<$) :: a -> EventHandler gtkEventHandler widget purity b -> EventHandler gtkEventHandler widget purity a # |
type family UserEventHandler gtkCallback widget (purity :: Purity) event where ... Source #
Convert from a GTK+ callback type to a user event handler type (the ones
you'd apply on
and onM
with) based on the given widget, purity, and event
types.
UserEventHandler (IO ()) widget Pure event = event | |
UserEventHandler (IO Bool) widget Pure event = (Bool, event) | |
UserEventHandler (IO ()) widget Impure event = widget -> IO event | |
UserEventHandler (IO Bool) widget Impure event = widget -> IO (Bool, event) | |
UserEventHandler (a -> b) widget purity event = a -> UserEventHandler b widget purity event |
class ToEventHandler gtkEventHandler widget purity where Source #
Internal class for converting user event handlers to encoded EventHandler
values.
toEventHandler :: UserEventHandler gtkEventHandler widget purity event -> EventHandler gtkEventHandler widget purity event Source #
Convert from a user event handler to an EventHandler
.