Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class ComponentUnit c where
- update :: (HasLightEnv env, MonadIO m, MonadMask m) => c -> LightT env m c
- figures :: (HasLightEnv env, MonadIO m, MonadMask m) => c -> LightT env m [Figure]
- draw :: (HasLightEnv env, MonadIO m, MonadMask m) => c -> LightT env m ()
- useCache :: c -> c -> Bool
- onSignal :: (HasLightEnv env, MonadIO m, MonadMask m) => Event -> c -> LightT env m c
- data Component
- newComponent :: (ComponentUnit c, HasLightEnv env, MonadIO m, MonadMask m) => c -> LightT env m Component
- getComponentSize :: (ComponentUnit c, HasLightEnv env, MonadIO m, MonadMask m) => c -> LightT env m (Rectangle Int)
- propagate :: Component -> Component
Documentation
class ComponentUnit c where Source #
CompoonentUnit typeclass provides a way to define a new component.
Any ComponentUnit
instance can be embedded into Component
type.
update :: (HasLightEnv env, MonadIO m, MonadMask m) => c -> LightT env m c Source #
Updating a model.
figures :: (HasLightEnv env, MonadIO m, MonadMask m) => c -> LightT env m [Figure] Source #
Descirbes a view. The figures here would be cached. See also useCache
for the cache configuration.
draw :: (HasLightEnv env, MonadIO m, MonadMask m) => c -> LightT env m () Source #
Drawing a figures.
:: c | A model value in the previous frame |
-> c | A model value in the current frame |
-> Bool |
Return True
if a cache stored in the previous frame should be used.
onSignal :: (HasLightEnv env, MonadIO m, MonadMask m) => Event -> c -> LightT env m c Source #
Event handlers
Instances
A wrapper for ComponentUnit
instances.
Instances
ComponentUnit Component Source # | |
Defined in MiniLight.Component.Types update :: (HasLightEnv env, MonadIO m, MonadMask m) => Component -> LightT env m Component Source # figures :: (HasLightEnv env, MonadIO m, MonadMask m) => Component -> LightT env m [Figure] Source # draw :: (HasLightEnv env, MonadIO m, MonadMask m) => Component -> LightT env m () Source # useCache :: Component -> Component -> Bool Source # onSignal :: (HasLightEnv env, MonadIO m, MonadMask m) => Event -> Component -> LightT env m Component Source # |
newComponent :: (ComponentUnit c, HasLightEnv env, MonadIO m, MonadMask m) => c -> LightT env m Component Source #
Create a new component.
getComponentSize :: (ComponentUnit c, HasLightEnv env, MonadIO m, MonadMask m) => c -> LightT env m (Rectangle Int) Source #
Get the size of a component.