class Graphic a where measureGraphicK :: FudgetIO k => a -> GCtx -> Cont (k i o) MeasuredGraphics measureGraphicListK :: FudgetIO k => [a] -> GCtx -> Cont (k i o) MeasuredGraphics instance Graphic MeasuredGraphics instance Graphic Char instance Graphic Int instance Graphic Integer instance Graphic Bool instance Graphic Float instance Graphic Double instance (Graphic a, Graphic b) => Graphic (a ⊕ b) instance Graphic a => Graphic (Maybe a) instance Graphic BitmapFile instance Graphic leaf => Graphic (Drawing annot leaf) instance Graphic FixedDrawing instance Graphic FixedColorDrawing instance Graphic ImageString instance Graphic FlexibleDrawing instance Graphic Gfx instance Graphic PixmapImage instance Graphic (Item a) instance Graphic SmileyMode
The class Graphic
collects types whose values have graphical representations
(just like the class Show
collects types whose values have textual
representations). Most basic types belong to this class. The library
also provides some new types for graphics.
The standard way to make a new type T
an instance of the
Graphic
class is to define a function, draw_T
say, that convert
values of type T
into a type that is already in the Graphic
class
and then define the instance in the following way:
instance Graphic T where measureGraphicK = measureGraphicK . draw_T
The class methods are normally not used directly by the application programmer in any other way.
Types for graphics: Drawing, FixedDrawing, FlexibleDrawing, BitmapFile.
Fudgets that display graphics: hyperGraphicsF, displayF, labelF, buttonF, ...