monomer-1.5.1.0: A GUI library for writing native Haskell applications.
Copyright(c) 2018 Francisco Vallarino
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Monomer.Main.Handlers

Description

Handlers for WidgetRequests. Functions in this module handle focus, clipboard, overlays and all SystemEvent related operations and updates.

Synopsis

Documentation

type HandlerStep s e = (WidgetEnv s e, WidgetNode s e, Seq (WidgetRequest s e)) Source #

Tuple representing the current widget environment, widget root and accumulated WidgetRequests. These requests have already been processed, they are collected for unit testing purposes.

handleSystemEvents Source #

Arguments

:: MonomerM s e m 
=> WidgetEnv s e

The initial widget environment.

-> WidgetNode s e

The initial widget root.

-> [SystemEvent]

The starting list of events.

-> m (HandlerStep s e)

The resulting "HandlerStep."

Processes a list of SystemEvents dispatching each of the to the corresponding widget based on the current root. At each step the root may change, new events may be generated (which will be processed interleaved with the list of events) and this is handled before returning the latest HandlerStep.

handleResourcesInit :: MonomerM s e m => m () Source #

Initializes system resources (currently only icons).

handleWidgetInit :: MonomerM s e m => WidgetEnv s e -> WidgetNode s e -> m (HandlerStep s e) Source #

Initializes a widget (in general, this is called for root).

handleWidgetDispose :: MonomerM s e m => WidgetEnv s e -> WidgetNode s e -> m (HandlerStep s e) Source #

Disposes a widget (in general, this is called for root).

handleWidgetResult :: MonomerM s e m => WidgetEnv s e -> Bool -> WidgetResult s e -> m (HandlerStep s e) Source #

Handles a WidgetResult instance, processing events and requests, and returning an updated HandlerStep.

handleRequests Source #

Arguments

:: MonomerM s e m 
=> Seq (WidgetRequest s e)

Requests to process.

-> HandlerStep s e

Initial state/HandlerStep.

-> m (HandlerStep s e)

Updated HandlerStep,

Processes a Seq of WidgetRequest, returning the latest HandlerStep.

handleResizeWidgets Source #

Arguments

:: MonomerM s e m 
=> HandlerStep s e

Current state/HandlerStep.

-> m (HandlerStep s e)

Updated state/HandlerStep.

Resizes the current root, and marks the render and resized flags.