eventloop-0.8.2.4: A different take on an IO system. Based on Amanda's IO loop, this eventloop takes a function that maps input events to output events. It can easily be extended by modules that represent IO devices or join multiple modules together.

Safe HaskellNone
LanguageHaskell2010

Eventloop.Module.BasicShapes

Synopsis

Documentation

data Shape Source #

Constructors

CompositeShape

Should contain atleast 1 shape. Rotation before Position

Rectangle

| Position is upperleftcorner. Position is the corner closes to origin. Visually in canvas, this is top left. In a Cartesian coördinate system, this is bottom left.

Circle

| Position is center

RegularPolygon

The first point of the regular polygon, always starts in the direction from the x-axis.(Towards x-infinity). Position is the the centre of the regular polygon

Text 
Line 
MultiLine 

Fields

FilledMultiLine 
Polygon 

Instances

Eq Shape Source # 

Methods

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

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

Show Shape Source # 

Methods

showsPrec :: Int -> Shape -> ShowS #

show :: Shape -> String #

showList :: [Shape] -> ShowS #

Generic Shape Source # 

Associated Types

type Rep Shape :: * -> * #

Methods

from :: Shape -> Rep Shape x #

to :: Rep Shape x -> Shape #

NFData Shape Source # 

Methods

rnf :: Shape -> () #

ToScreenPathPart Shape Source # 
ToCanvasOperations Shape Source # 
Overlaps Shape Source # 

Methods

overlaps :: Overlaps b => Shape -> b -> Bool Source #

contains :: Overlaps b => Shape -> b -> Bool Source #

touches :: Overlaps b => Shape -> b -> Bool Source #

ToBoundingBox Shape Source # 
ToCenter Shape Source # 

Methods

toCenter :: Shape -> Point Source #

ToPrimitives Shape Source # 
type Rep Shape Source # 
type Rep Shape = D1 (MetaData "Shape" "Eventloop.Module.BasicShapes.Types" "eventloop-0.8.2.4-2MIopGNjKqMCPJYv8aNWr2" False) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "CompositeShape" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "shapes") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Shape])) ((:*:) (S1 (MetaSel (Just Symbol "positionM") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Position))) (S1 (MetaSel (Just Symbol "rotationM") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Rotation)))))) (C1 (MetaCons "Rectangle" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "position") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Position)) ((:*:) (S1 (MetaSel (Just Symbol "dimensions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Dimensions)) (S1 (MetaSel (Just Symbol "fillColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FillColor)))) ((:*:) (S1 (MetaSel (Just Symbol "strokeLineThickness") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeLineThickness)) ((:*:) (S1 (MetaSel (Just Symbol "strokeColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeColor)) (S1 (MetaSel (Just Symbol "rotationM") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Rotation)))))))) ((:+:) (C1 (MetaCons "Circle" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "position") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Position)) ((:*:) (S1 (MetaSel (Just Symbol "radius") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Radius)) (S1 (MetaSel (Just Symbol "fillColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FillColor)))) ((:*:) (S1 (MetaSel (Just Symbol "strokeLineThickness") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeLineThickness)) ((:*:) (S1 (MetaSel (Just Symbol "strokeColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeColor)) (S1 (MetaSel (Just Symbol "rotationM") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Rotation))))))) (C1 (MetaCons "RegularPolygon" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "position") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Position)) ((:*:) (S1 (MetaSel (Just Symbol "numberOfPoints") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 NumberOfPoints)) (S1 (MetaSel (Just Symbol "radius") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Radius)))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "fillColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FillColor)) (S1 (MetaSel (Just Symbol "strokeLineThickness") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeLineThickness))) ((:*:) (S1 (MetaSel (Just Symbol "strokeColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeColor)) (S1 (MetaSel (Just Symbol "rotationM") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Rotation))))))))) ((:+:) ((:+:) (C1 (MetaCons "Text" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "text") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Char])) (S1 (MetaSel (Just Symbol "fontFamily") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FontFamily))) ((:*:) (S1 (MetaSel (Just Symbol "fontSize") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FontSize)) (S1 (MetaSel (Just Symbol "position") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Position)))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "alignment") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Alignment)) (S1 (MetaSel (Just Symbol "fillColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FillColor))) ((:*:) (S1 (MetaSel (Just Symbol "strokeLineThickness") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeLineThickness)) ((:*:) (S1 (MetaSel (Just Symbol "strokeColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeColor)) (S1 (MetaSel (Just Symbol "rotationM") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Rotation)))))))) (C1 (MetaCons "Line" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "point1") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Point)) (S1 (MetaSel (Just Symbol "point2") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Point))) ((:*:) (S1 (MetaSel (Just Symbol "strokeLineThickness") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeLineThickness)) ((:*:) (S1 (MetaSel (Just Symbol "strokeColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeColor)) (S1 (MetaSel (Just Symbol "rotationM") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Rotation)))))))) ((:+:) (C1 (MetaCons "MultiLine" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "points") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Point])) (S1 (MetaSel (Just Symbol "strokeLineThickness") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeLineThickness))) ((:*:) (S1 (MetaSel (Just Symbol "strokeColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeColor)) (S1 (MetaSel (Just Symbol "rotationM") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Rotation)))))) ((:+:) (C1 (MetaCons "FilledMultiLine" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "points") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Point])) ((:*:) (S1 (MetaSel (Just Symbol "fillWidth") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FillThickness)) (S1 (MetaSel (Just Symbol "fillColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FillColor)))) ((:*:) (S1 (MetaSel (Just Symbol "strokeLineThickness") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeLineThickness)) ((:*:) (S1 (MetaSel (Just Symbol "strokeColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeColor)) (S1 (MetaSel (Just Symbol "rotationM") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Rotation))))))) (C1 (MetaCons "Polygon" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "points") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Point])) (S1 (MetaSel (Just Symbol "fillColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FillColor))) ((:*:) (S1 (MetaSel (Just Symbol "strokeLineThickness") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeLineThickness)) ((:*:) (S1 (MetaSel (Just Symbol "strokeColor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 StrokeColor)) (S1 (MetaSel (Just Symbol "rotationM") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Rotation)))))))))))

data Rotation Source #

Constructors

Rotation RotatePoint Angle

| Rotation is around a point on the canvas. May be the centre of the boundingbox (enclosing rectangle) or an arbitrary point. Angle is in degrees and counter-clockwise in the coördinate system(from the x-axis to the y-axis) and visually on canvas clock-wise.

Instances

Eq Rotation Source # 
Show Rotation Source # 
Generic Rotation Source # 

Associated Types

type Rep Rotation :: * -> * #

Methods

from :: Rotation -> Rep Rotation x #

to :: Rep Rotation x -> Rotation #

NFData Rotation Source # 

Methods

rnf :: Rotation -> () #

type Rep Rotation Source # 
type Rep Rotation = D1 (MetaData "Rotation" "Eventloop.Module.BasicShapes.Types" "eventloop-0.8.2.4-2MIopGNjKqMCPJYv8aNWr2" False) (C1 (MetaCons "Rotation" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 RotatePoint)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Angle))))

data RotatePoint Source #

Instances

Eq RotatePoint Source # 
Show RotatePoint Source # 
Generic RotatePoint Source # 

Associated Types

type Rep RotatePoint :: * -> * #

NFData RotatePoint Source # 

Methods

rnf :: RotatePoint -> () #

type Rep RotatePoint Source # 
type Rep RotatePoint = D1 (MetaData "RotatePoint" "Eventloop.Module.BasicShapes.Types" "eventloop-0.8.2.4-2MIopGNjKqMCPJYv8aNWr2" False) ((:+:) (C1 (MetaCons "AroundCenter" PrefixI False) U1) (C1 (MetaCons "AroundPoint" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Point))))

data Alignment Source #

Opcode: 1500

Constructors

AlignLeft

Opcode: 1501

AlignRight

Opcode: 1502

AlignCenter

Opcode: 1503

Instances

Eq Alignment Source # 
Show Alignment Source # 
Generic Alignment Source # 

Associated Types

type Rep Alignment :: * -> * #

NFData Alignment Source # 

Methods

rnf :: Alignment -> () #

type Rep Alignment Source # 
type Rep Alignment = D1 (MetaData "Alignment" "Eventloop.Module.Websocket.Canvas.Types" "eventloop-0.8.2.4-2MIopGNjKqMCPJYv8aNWr2" False) ((:+:) (C1 (MetaCons "AlignLeft" PrefixI False) U1) ((:+:) (C1 (MetaCons "AlignRight" PrefixI False) U1) (C1 (MetaCons "AlignCenter" PrefixI False) U1)))

class ToCenter a where Source #

Minimal complete definition

toCenter

Methods

toCenter :: a -> Point Source #

class ToCanvasOut a where Source #

Minimal complete definition

toCanvasOut

Methods

toCanvasOut :: a -> CanvasOut Source #