butler-0.0.1.0: At your service.
Safe HaskellSafe-Inferred
LanguageGHC2021

Butler.App

Description

This module contains the logic for graphical app definition.

Synopsis

Documentation

data Display #

data DisplayEvent #

newtype AppTag #

Application tag.

Constructors

AppTag Text 

Instances

Instances details
FromJSON AppTag # 
Instance details

Defined in Butler.App

ToJSON AppTag # 
Instance details

Defined in Butler.App

IsString AppTag # 
Instance details

Defined in Butler.App

Methods

fromString :: String -> AppTag #

Semigroup AppTag # 
Instance details

Defined in Butler.App

Generic AppTag # 
Instance details

Defined in Butler.App

Associated Types

type Rep AppTag :: Type -> Type #

Methods

from :: AppTag -> Rep AppTag x #

to :: Rep AppTag x -> AppTag #

Show AppTag # 
Instance details

Defined in Butler.App

Eq AppTag # 
Instance details

Defined in Butler.App

Methods

(==) :: AppTag -> AppTag -> Bool #

(/=) :: AppTag -> AppTag -> Bool #

Ord AppTag # 
Instance details

Defined in Butler.App

ToHtml AppTag # 
Instance details

Defined in Butler.App

Methods

toHtml :: forall (m :: Type -> Type). Monad m => AppTag -> HtmlT m () #

toHtmlRaw :: forall (m :: Type -> Type). Monad m => AppTag -> HtmlT m () #

Serialise AppTag # 
Instance details

Defined in Butler.App

type Rep AppTag # 
Instance details

Defined in Butler.App

type Rep AppTag = D1 ('MetaData "AppTag" "Butler.App" "butler-0.0.1.0-inplace" 'True) (C1 ('MetaCons "AppTag" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data AppEvent #

The type of event an app receive

Constructors

AppDisplay DisplayEvent

A display event (e.g. to mount the UI)

AppTrigger GuiEvent

A trigger event (e.g. onclick)

AppData DataEvent

A data event (e.g. for raw data)

AppFile Directory (Maybe File)

A file event (e.g. a new file opened)

data App #

A graphical application definition.

Constructors

App 

Fields

data AppContext #

The application context

Constructors

AppContext 

Fields

  • clients :: DisplayClients

    the list of all the connected clients. To send update, app should uses `sendsHtml clients ""`

  • wid :: WinID

    the instance identifier. The app should mount its UI with `with div_ [wid_ wid] "body"`, and the trigger must container the WinID suffix too.

  • pipe :: Pipe AppEvent

    the channel to receive events.

  • shared :: AppSharedContext
     

newtype Apps #

Constructors

Apps (TVar (Map WinID AppInstance)) 

data AppInstance #

Constructors

AppInstance 

Fields

Instances

Instances details
Generic AppInstance # 
Instance details

Defined in Butler.App

Associated Types

type Rep AppInstance :: Type -> Type #

type Rep AppInstance # 
Instance details

Defined in Butler.App

newtype AppSet #

Constructors

AppSet (Map ProgramName App) 

sendHtmlOnConnect :: HtmlT STM () -> AppEvent -> ProcessIO () #

A convenient helper to mount the UI when a new user connect.

appSetHtml :: Monad m => WinID -> AppSet -> HtmlT m () #