The WComm data type contain all the window system commands possible on a component:
data WComm
=
{-
Identifies which part of the widget is visible
on the screen (region in *local* coords).
Parts might be invisible because of viewports, or to
support widget overlap.
region == None => component invisible
== Some r => region r is visible.
== All => component fully visible.
-}
ClipRegion (Portion Region)
{-
resizes could be handled as part of Draw, but we opt
to distribute them separately.
Also distribute the new transforms local-to-global transform
that should now be in effect.
-}
| Resize Int Int -- Set size in *local* coords
Transform -- Local to global
{-
Draw a component using a different Painter.
The Painter has encoded in it the mapping from the Window
c. system to whatever it is using.
The component is *responsible* for applying whatever clipping
region it currently has.
-}
| Draw Painter
{-
Damage repair, a region of the component has been exposed
and needs redrawing.
-}
| Repair (Portion Region)
-- Area to be redrawn in local coordinates.
--
-- region == None => no drawing (a nop.)
-- == Some r => damage region r
-- == All => damage region is the components extent.
{-
Get to bed! Command from parent to shut down activity *NOW*.
-}
| CloseWidget
{-
True => component has input focus
False => lost focus.
-}
| Focus Bool
{- Link to parent -}
| ParentContext UpHandler