eventloop-0.8.2.8: 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 BoundingBox Source #

Constructors

BoundingBox LowerLeft UpperLeft UpperRight LowerRight

| The point indications are from the perspective of a regular Cartesian coördinate system.

Instances
Eq BoundingBox Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

Show BoundingBox Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

RotateLeftAround BoundingBox Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Classes

ExtremaCoord BoundingBox Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Classes

Overlaps BoundingBox Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Classes

ToBoundingBox BoundingBox Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Classes

ToCenter BoundingBox Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Classes

ToPrimitives BoundingBox Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Classes

data RotatePoint Source #

Instances
Eq RotatePoint Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

Show RotatePoint Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

Generic RotatePoint Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

Associated Types

type Rep RotatePoint :: Type -> Type #

NFData RotatePoint Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

Methods

rnf :: RotatePoint -> () #

type Rep RotatePoint Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

type Rep RotatePoint = D1 (MetaData "RotatePoint" "Eventloop.Module.BasicShapes.Types" "eventloop-0.8.2.8-inplace" False) (C1 (MetaCons "AroundCenter" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "AroundPoint" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Point)))

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 # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

Show Rotation Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

Generic Rotation Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

Associated Types

type Rep Rotation :: Type -> Type #

Methods

from :: Rotation -> Rep Rotation x #

to :: Rep Rotation x -> Rotation #

NFData Rotation Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

Methods

rnf :: Rotation -> () #

type Rep Rotation Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

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 # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

Methods

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

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

Show Shape Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

Methods

showsPrec :: Int -> Shape -> ShowS #

show :: Shape -> String #

showList :: [Shape] -> ShowS #

Generic Shape Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

Associated Types

type Rep Shape :: Type -> Type #

Methods

from :: Shape -> Rep Shape x #

to :: Rep Shape x -> Shape #

NFData Shape Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

Methods

rnf :: Shape -> () #

Translate Shape Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Classes

Methods

translate :: Point -> Shape -> Shape Source #

ToScreenPathPart Shape Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Classes

ToCanvasOperations Shape Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Classes

Overlaps Shape Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Classes

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 # 
Instance details

Defined in Eventloop.Module.BasicShapes.Classes

ToCenter Shape Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Classes

Methods

toCenter :: Shape -> Point Source #

ToPrimitives Shape Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Classes

type Rep Shape Source # 
Instance details

Defined in Eventloop.Module.BasicShapes.Types

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

data BasicShapesOut Source #

Constructors

DrawShapes CanvasId [Shape] 

data Alignment Source #

Opcode: 1500

Constructors

AlignLeft

Opcode: 1501

AlignRight

Opcode: 1502

AlignCenter

Opcode: 1503

Instances
Eq Alignment Source # 
Instance details

Defined in Eventloop.Module.Websocket.Canvas.Types

Show Alignment Source # 
Instance details

Defined in Eventloop.Module.Websocket.Canvas.Types

Generic Alignment Source # 
Instance details

Defined in Eventloop.Module.Websocket.Canvas.Types

Associated Types

type Rep Alignment :: Type -> Type #

NFData Alignment Source # 
Instance details

Defined in Eventloop.Module.Websocket.Canvas.Types

Methods

rnf :: Alignment -> () #

FromJSON Alignment 
Instance details

Defined in Eventloop.Module.Websocket.Canvas.JSONEncoding

Methods

parseJSON :: Value -> Parser Alignment

parseJSONList :: Value -> Parser [Alignment]

ToJSON Alignment 
Instance details

Defined in Eventloop.Module.Websocket.Canvas.JSONEncoding

Methods

toJSON :: Alignment -> Value

toEncoding :: Alignment -> Encoding

toJSONList :: [Alignment] -> Value

toEncodingList :: [Alignment] -> Encoding

type Rep Alignment Source # 
Instance details

Defined in Eventloop.Module.Websocket.Canvas.Types

type Rep Alignment = D1 (MetaData "Alignment" "Eventloop.Module.Websocket.Canvas.Types" "eventloop-0.8.2.8-inplace" False) (C1 (MetaCons "AlignLeft" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "AlignRight" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "AlignCenter" PrefixI False) (U1 :: Type -> Type)))

class ToCenter a where Source #

Methods

toCenter :: a -> Point Source #

class ToBoundingBox a => Overlaps a where Source #

Minimal complete definition

Nothing

Methods

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

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

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