FULE-0.3.1: Functional UI Layout Engine
Copyright(c) Paul Schnapp 2023
LicenseBSD3
MaintainerPaul Schnapp <paul.schnapp@gmail.com>
Safe HaskellSafe-Inferred
LanguageHaskell2010

FULE.Component

Description

A typeclass which any visual component made by you should implement; related datatypes.

Synopsis

Documentation

class Monad m => Component k m where Source #

A typeclass for specifying the display requirements of a visual component.

A default implementation has been provided meaning you may wish to have your instances use the {-# OVERLAPS #-} or {-# OVERLAPPING #-} pragmas.

You'll need to have the MultiParamTypeClasses language extension enabled to implement this.

Minimal complete definition

Nothing

Methods

requiredWidth :: k -> m (Maybe Int) Source #

The width the component requires on-screen, if any. The default implementation returns Nothing.

requiredHeight :: k -> m (Maybe Int) Source #

The height the compnent requires on-screen, if any. The default implementation returns Nothing.

Instances

Instances details
Monad m => Component k m Source #

A convenience instance for components that have no width or height requirements.

Instance details

Defined in FULE.Component

Methods

requiredWidth :: k -> m (Maybe Int) Source #

requiredHeight :: k -> m (Maybe Int) Source #

Monad m => Component (Reactor i ogadt m) m Source # 
Instance details

Defined in FULE.Reactor

Methods

requiredWidth :: Reactor i ogadt m -> m (Maybe Int) Source #

requiredHeight :: Reactor i ogadt m -> m (Maybe Int) Source #

Monad m => Component (Reactor' i ogadt m) m Source # 
Instance details

Defined in FULE.Reactor

Methods

requiredWidth :: Reactor' i ogadt m -> m (Maybe Int) Source #

requiredHeight :: Reactor' i ogadt m -> m (Maybe Int) Source #

data ComponentInfo k Source #

Meta info about a component along with the component itself.

Constructors

ComponentInfo 

Fields

Instances

Instances details
Functor ComponentInfo Source # 
Instance details

Defined in FULE.Component

Methods

fmap :: (a -> b) -> ComponentInfo a -> ComponentInfo b #

(<$) :: a -> ComponentInfo b -> ComponentInfo a #

HasBoundingGuides (ComponentInfo k) Source # 
Instance details

Defined in FULE.Component

Show k => Show (ComponentInfo k) Source # 
Instance details

Defined in FULE.Component

NFData k => NFData (ComponentInfo k) Source # 
Instance details

Defined in FULE.Component

Methods

rnf :: ComponentInfo k -> () #

type RenderGroup = Maybe Int Source #

A convenience type-wrapper representing the rendering group a component is associated with. Rendering groups are tracked when multiple components overlap (in the z-axis) or are part of containers which overlap. (They are not used internally but are tracked as a convenience for the consumer.)

data Bounds Source #

A collection of Guides representing the bounding rectangle of a visual component.

Constructors

Bounds 

Fields

  • topOf :: GuideID

    The Guide representing the top edge of the bounding rectangle.

  • leftOf :: GuideID

    The Guide representing the left edge of the bounding rectangle.

  • rightOf :: GuideID

    The Guide representing the right edge of the bounding rectangle.

  • bottomOf :: GuideID

    The Guide representing the bottom edge of the bounding rectangle.

  • clippingOf :: Maybe Bounds

    Another Bounds which may cause this one to clip.

Instances

Instances details
HasBoundingGuides Bounds Source # 
Instance details

Defined in FULE.Component

Read Bounds Source # 
Instance details

Defined in FULE.Component

Show Bounds Source # 
Instance details

Defined in FULE.Component

NFData Bounds Source # 
Instance details

Defined in FULE.Component

Methods

rnf :: Bounds -> () #

class HasBoundingGuides a where Source #

A typeclass for retrieving Guides representing a bounding rectangle.

Methods

boundingGuidesFor :: Layout -> a -> [Int] Source #

Retrieves the bounding Guides for a type in the order: top, left, right, bottom.

Instances

Instances details
HasBoundingGuides Bounds Source # 
Instance details

Defined in FULE.Component

HasBoundingGuides (ComponentInfo k) Source # 
Instance details

Defined in FULE.Component

boundingGuidesInCSSOrderFor :: HasBoundingGuides a => Layout -> a -> [Int] Source #

Retrieves the bounding Guides for a type in CSS-order: top, right, bottom, left.