-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | 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.
--
@package eventloop
@version 0.4.0.0
module Eventloop.Utility.Vectors
type Angle = Float
type Radians = Float
type Length = Float
type X = Float
type Y = Float
type Offset = (X, Y)
data PolarCoord
PolarCoord :: (Length, Radians) -> PolarCoord
data Point
Point :: (X, Y) -> Point
degreesToRadians :: Angle -> Radians
radiansToDegrees :: Radians -> Angle
lengthToPoint :: Point -> Length
lengthBetweenPoints :: Point -> Point -> Length
differenceBetweenPoints :: Point -> Point -> (X, Y)
originPoint :: Point
class Translate a
translate :: Translate a => Point -> a -> a
class RotateLeftAround a => Vector2D a
(|+|) :: Vector2D a => a -> a -> a
(|-|) :: Vector2D a => a -> a -> a
negateVector :: Vector2D a => a -> a
class ToPoint a
toPoint :: ToPoint a => a -> Point
class ToPolarCoord a
toPolarCoord :: ToPolarCoord a => a -> PolarCoord
class RotateLeftAround a
rotateLeftAround :: RotateLeftAround a => Point -> Angle -> a -> a
instance Show PolarCoord
instance Eq PolarCoord
instance Show Point
instance Eq Point
instance RotateLeftAround Point
instance RotateLeftAround PolarCoord
instance ToPolarCoord Point
instance ToPoint PolarCoord
instance Vector2D Point
instance Vector2D PolarCoord
module Eventloop.Types.Common
type NamedId = [Char]
type NumericId = Int
module Eventloop.Utility.Trees.GeneralTree
data GeneralTree
GeneralTreeBox :: [GeneralNodeContent] -> [(GeneralLine, GeneralTree)] -> GeneralTree
data GeneralNodeContent
GeneralNodeText :: FillColor -> String -> GeneralNodeContent
GeneralNode :: FillColor -> Radius -> GeneralNodeContent
data GeneralLine
GeneralLine :: StrokeColor -> GeneralLine
type LeftOffset = X
type TopOffset = Y
type RightOffset = X
type BottomOffset = Y
type Middle = GraphicalNumeric
type Pos = (X, Y)
class GeneralizeTree a
generalizeTree :: GeneralizeTree a => a -> GeneralTree
textFont :: [Char]
textHeight :: Float
charWidth :: Float
marginBetweenTrees :: Float
marginBetweenNodeContent :: Float
marginBetweenNodeRows :: Float
marginBetweenNodeColumns :: Float
generalNodeDimension :: GeneralTree -> Dimensions
flattenDimensions :: [Dimensions] -> Dimensions
generalNodeContentDimension :: GeneralNodeContent -> Dimensions
layoutGeneralTree :: LeftOffset -> TopOffset -> GeneralTree -> (LayoutTree, RightOffset, BottomOffset)
layoutGeneralTreeChildren :: LeftOffset -> TopOffset -> [(GeneralLine, GeneralTree)] -> ([(LayoutLine, LayoutTree)], RightOffset, BottomOffset)
layoutLine :: GeneralLine -> LayoutLine
layoutGeneralTrees :: LeftOffset -> TopOffset -> [GeneralTree] -> ([LayoutTree], RightOffset, BottomOffset)
layoutGeneralNodeContentList :: Middle -> Height -> [GeneralNodeContent] -> [LayoutNodeContent]
layoutGeneralNodeContent :: Pos -> GeneralNodeContent -> LayoutNodeContent
textSize :: [Char] -> (Float, Float)
treeIndex :: Int -> Offset -> Shape
instance Show GeneralNodeContent
instance Eq GeneralNodeContent
instance Show GeneralLine
instance Eq GeneralLine
instance Show GeneralTree
instance Eq GeneralTree
instance GeneralizeTree GeneralTree
module Eventloop.Types.EventTypes
type EventloopModuleIdentifier = [Char]
type Initializer = SharedIOState -> IOState -> IO (SharedIOState, IOState)
type EventRetriever = SharedIOState -> IOState -> IO (SharedIOState, IOState, [In])
type PreProcessor = SharedIOState -> IOState -> In -> IO (SharedIOState, IOState, [In])
type PostProcessor = SharedIOState -> IOState -> Out -> IO (SharedIOState, IOState, [Out])
type EventSender = SharedIOState -> IOState -> Out -> IO (SharedIOState, IOState)
type Teardown = SharedIOState -> IOState -> IO (SharedIOState, IOState)
type OutEventRouter = Out -> EventloopModuleIdentifier
data EventloopModuleConfiguration
EventloopModuleConfiguration :: EventloopModuleIdentifier -> IOState -> Maybe Initializer -> Maybe EventRetriever -> Maybe PreProcessor -> Maybe PostProcessor -> Maybe Teardown -> Maybe EventSender -> EventloopModuleConfiguration
moduleIdentifier :: EventloopModuleConfiguration -> EventloopModuleIdentifier
iostate :: EventloopModuleConfiguration -> IOState
initializer :: EventloopModuleConfiguration -> Maybe Initializer
eventRetriever :: EventloopModuleConfiguration -> Maybe EventRetriever
preprocessor :: EventloopModuleConfiguration -> Maybe PreProcessor
postprocessor :: EventloopModuleConfiguration -> Maybe PostProcessor
teardown :: EventloopModuleConfiguration -> Maybe Teardown
eventSender :: EventloopModuleConfiguration -> Maybe EventSender
data EventloopConfiguration progstateT
EventloopConfiguration :: progstateT -> (progstateT -> In -> (progstateT, [Out])) -> OutEventRouter -> SharedIOState -> [EventloopModuleConfiguration] -> EventloopConfiguration progstateT
progState :: EventloopConfiguration progstateT -> progstateT
eventloopFunc :: EventloopConfiguration progstateT -> progstateT -> In -> (progstateT, [Out])
outRouter :: EventloopConfiguration progstateT -> OutEventRouter
sharedIOState :: EventloopConfiguration progstateT -> SharedIOState
moduleConfigurations :: EventloopConfiguration progstateT -> [EventloopModuleConfiguration]
data In
Start :: In
InKeyboard :: Keyboard -> In
InMouse :: MouseIn -> In
InFile :: FileIn -> In
InTimer :: TimerIn -> In
InStdIn :: StdInIn -> In
InCanvas :: CanvasIn -> In
InGraphs :: GraphsIn -> In
data Out
OutFile :: FileOut -> Out
OutTimer :: TimerOut -> Out
OutStdOut :: StdOutOut -> Out
OutStdIn :: StdInOut -> Out
OutCanvas :: CanvasOut -> Out
OutBasicShapes :: BasicShapesOut -> Out
OutDrawTrees :: DrawTreesOut -> Out
OutGraphs :: GraphsOut -> Out
Stop :: Out
data SharedIOState
SharedIOState :: (CanvasText -> IO ScreenDimensions) -> SharedIOState
measureText :: SharedIOState -> CanvasText -> IO ScreenDimensions
data IOState
MouseState :: BufferedReceiveBuffer -> Connection -> Socket -> IOState
receiveBuffer :: IOState -> BufferedReceiveBuffer
clientConnection :: IOState -> Connection
serverSocket :: IOState -> Socket
KeyboardState :: BufferedReceiveBuffer -> Connection -> Socket -> IOState
receiveBuffer :: IOState -> BufferedReceiveBuffer
clientConnection :: IOState -> Connection
serverSocket :: IOState -> Socket
CanvasState :: ReceiveBuffer -> CanvasUserReceiveBuffer -> CanvasSystemReceiveBuffer -> Connection -> Socket -> ThreadId -> IOState
commonReceiveBuffer :: IOState -> ReceiveBuffer
canvasUserReceiveBuffer :: IOState -> CanvasUserReceiveBuffer
canvasSystemReceiveBuffer :: IOState -> CanvasSystemReceiveBuffer
clientConnection :: IOState -> Connection
serverSocket :: IOState -> Socket
routerThreadId :: IOState -> ThreadId
StdInState :: [StdInIn] -> IOState
newStdInInEvents :: IOState -> [StdInIn]
TimerState :: [StartedTimer] -> [StartedTimer] -> IncomingTickBuffer -> IncomingTickBuffer -> IOState
startedIntervalTimers :: IOState -> [StartedTimer]
startedTimers :: IOState -> [StartedTimer]
incomingIntervalTickBuffer :: IOState -> IncomingTickBuffer
incomingTickBuffer :: IOState -> IncomingTickBuffer
FileState :: [FileIn] -> [OpenFile] -> IOState
newFileInEvents :: IOState -> [FileIn]
opened :: IOState -> [OpenFile]
NoState :: IOState
type APIName = [Char]
type Parameter = [Char]
instance Eq In
instance Show In
instance Eq Out
instance Show Out
module Eventloop.Module.Websocket.Canvas
defaultCanvasModuleConfiguration :: EventloopModuleConfiguration
defaultCanvasModuleIOState :: IOState
canvasModuleIdentifier :: EventloopModuleIdentifier
canvasInitializer :: Initializer
canvasEventRetriever :: EventRetriever
canvasEventSender :: EventSender
canvasTeardown :: Teardown
sendRoutedMessageOut :: Connection -> RoutedMessageOut -> IO ()
router :: ReceiveBuffer -> CanvasUserReceiveBuffer -> CanvasSystemReceiveBuffer -> IO ()
measureText :: IOState -> CanvasId -> CanvasText -> IO ScreenDimensions
type CanvasUserReceiveBuffer = MVar [CanvasIn]
type CanvasSystemReceiveBuffer = MVar SystemCanvasIn
type Opcode = Int
type ScreenMetric = Int
type ScreenX = ScreenMetric
type ScreenY = ScreenMetric
type ScreenWidth = ScreenMetric
type ScreenHeight = ScreenMetric
type ScreenRadius = ScreenMetric
type ScreenAngle = ScreenMetric
type ScreenPoint = (ScreenX, ScreenY)
type ScreenDimensions = (ScreenWidth, ScreenHeight)
type ScreenStartingPoint = ScreenPoint
type ScreenControlPoint = ScreenPoint
type ScreenEndPoint = ScreenPoint
type ScreenStartingAngle = ScreenAngle
type ScreenEndAngle = ScreenAngle
type CanvasId = NumericId
type ZIndex = Int
type ScreenColorMetric = Int
type ScreenRed = ScreenColorMetric
type ScreenGreen = ScreenColorMetric
type ScreenBlue = ScreenColorMetric
type ScreenAlpha = Float
type ScreenColor = (ScreenRed, ScreenGreen, ScreenBlue, ScreenAlpha)
type ScreenPixel = ScreenColor
type ColorStopOffset = Float
type ScreenCircle = (ScreenPoint, ScreenRadius)
type ScaleUnit = Float
type ScaleX = ScaleUnit
type ScaleY = ScaleUnit
type ScreenLineThickness = ScreenMetric
type FontFamily = [Char]
type FontSize = Int
data RoutedMessageIn
InUserCanvas :: CanvasIn -> RoutedMessageIn
InSystemCanvas :: SystemCanvasIn -> RoutedMessageIn
data RoutedMessageOut
OutUserCanvas :: CanvasOut -> RoutedMessageOut
OutSystemCanvas :: SystemCanvasOut -> RoutedMessageOut
-- | Opcode: 2100
data SystemCanvasIn
-- | Opcode: 2101
SystemMeasuredText :: CanvasId -> CanvasText -> ScreenDimensions -> SystemCanvasIn
-- | Opcode: 2000
data SystemCanvasOut
-- | Opcode: 2001
SystemMeasureText :: CanvasId -> CanvasText -> SystemCanvasOut
-- | Opcode: 0100
data CanvasIn
-- | Opcode: 0101
MeasuredText :: CanvasId -> CanvasText -> ScreenDimensions -> CanvasIn
-- | Reserved type words Type: t | Opcode Arguments: a | List of arguments
-- for that data type Route: r | Either s for system or
-- u for user Object: o | The object that is beneath
--
-- Example: {r: s, o: {SystemMeasuredText
-- object}}
--
-- SystemMeasuredText object: {t:2102, a:[CanvasId,
-- CanvasText object, ScreenDimensions]}
--
-- Opcode: 0200
data CanvasOut
-- | Opcode: 0201
SetupCanvas :: CanvasId -> ZIndex -> ScreenDimensions -> CSSPosition -> CanvasOut
-- | Opcode: 0202
TeardownCanvas :: CanvasId -> CanvasOut
-- | Opcode: 0203
CanvasOperations :: CanvasId -> [CanvasOperation] -> CanvasOut
-- | Opcode: 0204
MeasureText :: CanvasId -> CanvasText -> CanvasOut
-- | Opcode: 0300
data CanvasOperation
-- | Opcode: 0301
DrawPath :: ScreenStartingPoint -> [ScreenPathPart] -> PathStroke -> PathFill -> CanvasOperation
-- | Opcode: 0302
DrawText :: CanvasText -> ScreenPoint -> TextStroke -> TextFill -> CanvasOperation
-- | Opcode: 0303
DoTransform :: CanvasTransform -> CanvasOperation
-- | Opcode: 0304
Clear :: ClearPart -> CanvasOperation
-- | Opcode: 0400
data ScreenPathPart
-- | Opcode: 0401
MoveTo :: ScreenPoint -> ScreenPathPart
-- | Opcode: 0402
LineTo :: ScreenPoint -> ScreenPathPart
-- | Opcode: 0403
BezierCurveTo :: ScreenControlPoint -> ScreenControlPoint -> ScreenEndPoint -> ScreenPathPart
-- | Opcode: 0404
QuadraticCurveTo :: ScreenControlPoint -> ScreenEndPoint -> ScreenPathPart
-- | Opcode: 0405
ArcTo :: ScreenControlPoint -> ScreenControlPoint -> ScreenRadius -> ScreenPathPart
-- | Opcode: 0406
Arc :: ScreenCircle -> ScreenStartingAngle -> ScreenEndAngle -> ScreenPathPart
-- | Opcode: 0407
Rectangle :: ScreenPoint -> ScreenDimensions -> ScreenPathPart
-- | Opcode: 0500
type PathRenderStrokeStyle = RenderStyle
data PathStroke
-- | Opcode: 0501
PathStroke :: ScreenLineThickness -> PathRenderStrokeStyle -> PathStroke
-- | Opcode: 0502
NoPathStroke :: PathStroke
-- | Opcode: 0600
type PathRenderFillStyle = RenderStyle
data PathFill
-- | Opcode: 0601
PathFill :: PathRenderFillStyle -> PathFill
-- | Opcode: 0602
NoPathFill :: PathFill
-- | Opcode: 0700
type CanvasColorStop = (ColorStopOffset, ScreenColor)
data RenderStyle
-- | Opcode: 0701
CanvasColor :: ScreenColor -> RenderStyle
-- | Opcode:0702
CanvasGradient :: CanvasGradientType -> [CanvasColorStop] -> RenderStyle
-- | Opcode: 0703
CanvasPattern :: CanvasImage -> PatternRepetition -> RenderStyle
-- | Opcode: 0800
data CanvasImage
-- | Opcode: 0801
CanvasElement :: CanvasId -> ScreenPoint -> ScreenDimensions -> CanvasImage
-- | Opcode: 0802 [ScreenPixel] should be as long as width * height * 4
ImageData :: ScreenDimensions -> [ScreenPixel] -> CanvasImage
-- | Opcode: 0900
data PatternRepetition
-- | Opcode: 0901
Repeat :: PatternRepetition
-- | Opcode: 0902
RepeatX :: PatternRepetition
-- | Opcode: 0903
RepeatY :: PatternRepetition
-- | Opcode: 0904
NoRepeat :: PatternRepetition
-- | Opcode: 1000
data CanvasGradientType
-- | Opcode: 1001 First circle = inner circle, Second circle is enclosing
-- circle
RadialGradient :: ScreenCircle -> ScreenCircle -> CanvasGradientType
-- | Opcode: 1002
LinearGradient :: ScreenPoint -> ScreenPoint -> CanvasGradientType
-- | Opcode: 1200
data CanvasText
-- | Opcode: 1201
CanvasText :: [Char] -> Font -> Alignment -> CanvasText
-- | Opcode: 1300
data Font
-- | Opcode: 1301
Font :: FontFamily -> FontSize -> Font
-- | Opcode: 1400
type TextStrokeRenderStyle = RenderStyle
type TextFillRenderStyle = RenderStyle
data TextStroke
-- | Opcode: 1401
TextStroke :: ScreenLineThickness -> TextStrokeRenderStyle -> TextStroke
-- | Opcode: 1402
NoTextStroke :: TextStroke
-- | Opcode: 2400
data TextFill
-- | Opcode: 2401
TextFill :: TextFillRenderStyle -> TextFill
-- | Opcode: 2402
NoTextFill :: TextFill
-- | Opcode: 1500
data Alignment
-- | Opcode: 1501
AlignLeft :: Alignment
-- | Opcode: 1502
AlignRight :: Alignment
-- | Opcode: 1503
AlignCenter :: Alignment
-- | Opcode: 1504
AlignStart :: Alignment
-- | Opcode: 1505
AlignEnd :: Alignment
-- | Opcode: 1600
type TransformUnit = Float
type TransformationMatrix = (TransformUnit, TransformUnit, TransformUnit, TransformUnit, TransformUnit, TransformUnit)
data CanvasTransform
-- | Opcode: 1601
Save :: CanvasTransform
-- | Opcode: 1602
Restore :: CanvasTransform
-- | Opcode: 1603
Translate :: ScreenPoint -> CanvasTransform
-- | Opcode: 1604
Rotate :: ScreenAngle -> CanvasTransform
-- | Opcode: 1605
Scale :: ScaleX -> ScaleY -> CanvasTransform
-- | Opcode: 1606
Transform :: TransformationMatrix -> CanvasTransform
-- | Opcode: 1607
SetTransform :: TransformationMatrix -> CanvasTransform
-- | Opcode: 1608
ResetTransform :: CanvasTransform
-- | Opcode: 2200
type CSSLeftOffset = CSSUnit
type CSSTopOffset = CSSUnit
type CSSMeasurements = (CSSLeftOffset, CSSTopOffset)
data CSSPosition
-- | Opcode: 2201
CSSPosition :: CSSBindPoint -> CSSMeasurements -> CSSPosition
-- | Opcode: 2300
data CSSBindPoint
-- | Opcode: 2301
CSSFromCenter :: CSSBindPoint
-- | Opcode: 2302 Usually this is the top left corner of the element
CSSFromDefault :: CSSBindPoint
-- | Opcode: 1800
data CSSUnit
-- | Opcode: 1801
CSSPixels :: Int -> CSSUnit
-- | Opcode: 1802
CSSPercentage :: Int -> CSSUnit
-- | Opcode: 1900
data ClearPart
-- | Opcode: 1901
ClearRectangle :: ScreenPoint -> ScreenDimensions -> ClearPart
-- | Opcode: 1902
ClearCanvas :: ClearPart
module Eventloop.Module.Websocket.Keyboard
defaultKeyboardModuleConfiguration :: EventloopModuleConfiguration
defaultKeyboardModuleIOState :: IOState
keyboardModuleIdentifier :: EventloopModuleIdentifier
keyboardInitializer :: Initializer
keyboardEventRetriever :: EventRetriever
keyboardTeardown :: Teardown
data Keyboard
Key :: [Char] -> Keyboard
module Eventloop.Module.Websocket.Mouse
defaultMouseModuleConfiguration :: EventloopModuleConfiguration
defaultMouseModuleIOState :: IOState
mouseModuleIdentifier :: EventloopModuleIdentifier
mouseInitializer :: Initializer
mouseEventRetriever :: EventRetriever
mouseTeardown :: Teardown
data MouseIn
Mouse :: MouseType -> NumericId -> MouseEvent -> Point -> MouseIn
data MouseType
MouseCanvas :: MouseType
MouseSVG :: MouseType
data MouseEvent
Click :: MouseButton -> MouseEvent
DoubleClick :: MouseButton -> MouseEvent
MouseMove :: MouseEvent
MouseDown :: MouseButton -> MouseEvent
MouseUp :: MouseButton -> MouseEvent
MouseEnter :: MouseEvent
MouseLeave :: MouseEvent
data MouseButton
MouseLeft :: MouseButton
MouseRight :: MouseButton
MouseMiddle :: MouseButton
module Eventloop.Module.DrawTrees
data DrawTreesOut
DrawTrees :: CanvasId -> [GeneralTree] -> DrawTreesOut
data NodeColor
NodeRed :: NodeColor
NodeBlack :: NodeColor
NodeGrey :: NodeColor
data RBTree
RBNode :: NodeColor -> String -> [RBTree] -> RBTree
data RoseTree
RoseNode :: String -> [RoseTree] -> RoseTree
defaultDrawTreesModuleConfiguration :: EventloopModuleConfiguration
defaultDrawTreesModuleIOState :: IOState
drawTreesModuleIdentifier :: EventloopModuleIdentifier
drawTreesPostProcessor :: PostProcessor
maxWidth :: Int
showGeneralTreeList :: [GeneralTree] -> (Shape, RightOffset, BottomOffset)
showGeneralTreeList' :: LeftOffset -> TopOffset -> Float -> Int -> [GeneralTree] -> (Shape, RightOffset, BottomOffset)
showGeneralTree :: LeftOffset -> TopOffset -> Int -> GeneralTree -> (Shape, RightOffset, BottomOffset)
nodeColorToFillColor :: NodeColor -> FillColor
rbExampleTree :: RBTree
roseExampleTree :: RoseTree
module Eventloop.Module.BasicShapes
defaultBasicShapesModuleConfiguration :: EventloopModuleConfiguration
defaultBasicShapesModuleIOState :: IOState
basicShapesModuleIdentifier :: EventloopModuleIdentifier
basicShapesPostProcessor :: PostProcessor
type GraphicalNumeric = Float
type Translation = Point
type Width = GraphicalNumeric
type Height = GraphicalNumeric
type Dimensions = (Width, Height)
type Radius = GraphicalNumeric
type Red = GraphicalNumeric
type Green = GraphicalNumeric
type Blue = GraphicalNumeric
type Alpha = GraphicalNumeric
type Color = (Red, Green, Blue, Alpha)
type FillColor = Color
type StrokeColor = Color
type StrokeLineThickness = GraphicalNumeric
type UpperLeft = Point
type UpperRight = Point
type LowerLeft = Point
type LowerRight = Point
type AmountOfPoints = Int
type FontFamily = [Char]
type FontSize = GraphicalNumeric
data BasicShapesOut
DrawShapes :: CanvasId -> [Shape] -> BasicShapesOut
data Shape
BaseShape :: Primitive -> StrokeLineThickness -> StrokeColor -> (Maybe Rotation) -> Shape
primitive :: Shape -> Primitive
strokeLineThickness :: Shape -> StrokeLineThickness
strokeColor :: Shape -> StrokeColor
rotationM :: Shape -> (Maybe Rotation)
-- | Should contain atleast 1 shape
CompositeShape :: [Shape] -> (Maybe Translation) -> (Maybe Rotation) -> Shape
shapes :: Shape -> [Shape]
translationM :: Shape -> (Maybe Translation)
rotationM :: Shape -> (Maybe Rotation)
data Primitive
-- | Translation is upperleftcorner
Rectangle :: Translation -> Dimensions -> FillColor -> Primitive
-- | | Translation is the corner closes to origin. Visually in canvas, this
-- is top left. In a Cartesian coördinate system, this is bottom left.
translation :: Primitive -> Translation
dimensions :: Primitive -> Dimensions
fillColor :: Primitive -> FillColor
-- | Translation is center
Circle :: Translation -> Radius -> FillColor -> Primitive
-- | | Translation is the corner closes to origin. Visually in canvas, this
-- is top left. In a Cartesian coördinate system, this is bottom left.
translation :: Primitive -> Translation
radius :: Primitive -> Radius
fillColor :: Primitive -> FillColor
-- | The first point of the polygon, always starts in the direction from
-- the x-axis.(Towards x-infinity)
Polygon :: AmountOfPoints -> Translation -> Radius -> FillColor -> Primitive
amountOfPoints :: Primitive -> AmountOfPoints
-- | | Translation is the corner closes to origin. Visually in canvas, this
-- is top left. In a Cartesian coördinate system, this is bottom left.
translation :: Primitive -> Translation
radius :: Primitive -> Radius
fillColor :: Primitive -> FillColor
-- | Translation is center, does not have a boundingbox due to technical
-- limitations
Text :: [Char] -> FontFamily -> FontSize -> Translation -> FillColor -> Primitive
text :: Primitive -> [Char]
fontFamily :: Primitive -> FontFamily
fontSize :: Primitive -> FontSize
-- | | Translation is the corner closes to origin. Visually in canvas, this
-- is top left. In a Cartesian coördinate system, this is bottom left.
translation :: Primitive -> Translation
fillColor :: Primitive -> FillColor
Line :: Point -> Point -> Primitive
point1 :: Primitive -> Point
point2 :: Primitive -> Point
MultiLine :: Point -> Point -> [Point] -> Primitive
point1 :: Primitive -> Point
point2 :: Primitive -> Point
otherPoints :: Primitive -> [Point]
data Rotation
-- | | 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.
Rotation :: RotatePoint -> Angle -> Rotation
data RotatePoint
AroundCenter :: RotatePoint
AroundPoint :: Point -> RotatePoint
data BoundingBox
-- | | The point indications are from the perspective of a regular
-- Cartesian coördinate system.
BoundingBox :: LowerLeft -> UpperLeft -> UpperRight -> LowerRight -> BoundingBox
type CanvasId = NumericId
addBoundingBox :: BoundingBox -> BoundingBox -> BoundingBox
foldBoundingBoxes :: (BoundingBox -> BoundingBox -> BoundingBox) -> [BoundingBox] -> BoundingBox
opOnBoundingBox :: (Point -> Point) -> BoundingBox -> BoundingBox
allPolygonPoints :: AmountOfPoints -> Point -> Radius -> [Point]
roundPoint :: Point -> ScreenPoint
roundColor :: Color -> ScreenColor
class ToBoundingBox a => ToCenter a
toCenter :: ToCenter a => a -> Point
class ToBoundingBox a
toBoundingBox :: ToBoundingBox a => a -> BoundingBox
findRotationPoint :: ToCenter a => a -> Rotation -> Point
class ToCanvasOut a
toCanvasOut :: ToCanvasOut a => a -> CanvasOut
class ToCanvasOperations a
toCanvasOperations :: ToCanvasOperations a => a -> [CanvasOperation]
class ToScreenPathPart a
toScreenPathParts :: ToScreenPathPart a => a -> ([ScreenPathPart], ScreenStartingPoint, Maybe FillColor)
module Eventloop.Module.File
defaultFileModuleConfiguration :: EventloopModuleConfiguration
defaultFileModuleIOState :: IOState
fileModuleIdentifier :: EventloopModuleIdentifier
fileEventRetriever :: EventRetriever
fileEventSender :: EventSender
fileTeardown :: Teardown
type OpenFile = (FilePath, Handle, IOMode)
data FileIn
FileOpened :: FilePath -> Bool -> FileIn
FileClosed :: FilePath -> Bool -> FileIn
RetrievedContents :: FilePath -> [[Char]] -> FileIn
RetrievedLine :: FilePath -> [Char] -> FileIn
RetrievedChar :: FilePath -> Char -> FileIn
IsEOF :: FilePath -> Bool -> FileIn
WroteTo :: FilePath -> Bool -> FileIn
data FileOut
OpenFile :: FilePath -> IOMode -> FileOut
CloseFile :: FilePath -> FileOut
RetrieveContents :: FilePath -> FileOut
RetrieveLine :: FilePath -> FileOut
RetrieveChar :: FilePath -> FileOut
IfEOF :: FilePath -> FileOut
WriteTo :: FilePath -> [Char] -> FileOut
module Eventloop.Module.StdIn
defaultStdInModuleConfiguration :: EventloopModuleConfiguration
defaultStdInModuleIOState :: IOState
stdInModuleIdentifier :: EventloopModuleIdentifier
stdInEventRetriever :: EventRetriever
stdInEventSender :: EventSender
data StdInIn
StdInReceivedContents :: [[Char]] -> StdInIn
StdInReceivedLine :: [Char] -> StdInIn
StdInReceivedChar :: Char -> StdInIn
data StdInOut
StdInReceiveContents :: StdInOut
StdInReceiveLine :: StdInOut
StdInReceiveChar :: StdInOut
module Eventloop.Module.StdOut
defaultStdOutModuleConfiguration :: EventloopModuleConfiguration
stdOutModuleIdentifier :: EventloopModuleIdentifier
stdOutEventSender :: EventSender
data StdOutOut
StdOutMessage :: [Char] -> StdOutOut
module Eventloop.Module.Timer
defaultTimerModuleConfiguration :: EventloopModuleConfiguration
defaultTimerModuleIOState :: IOState
timerModuleIdentifier :: EventloopModuleIdentifier
timerInitializer :: Initializer
timerEventRetriever :: EventRetriever
timerEventSender :: EventSender
timerTeardown :: Teardown
type MicroSecondDelay = Int
type TimerId = [Char]
type IncomingTickBuffer = MVar [TimerIn]
type StartedTimer = (TimerId, TimerIO)
type TimerStartFunction = TimerIO -> IO () -> Delay -> IO Bool
data TimerIn
Tick :: TimerId -> TimerIn
data TimerOut
SetTimer :: TimerId -> MicroSecondDelay -> TimerOut
SetIntervalTimer :: TimerId -> MicroSecondDelay -> TimerOut
UnsetTimer :: TimerId -> TimerOut
module Eventloop.RouteEvent
routeOutEvent :: OutEventRouter
module Eventloop.Module.Graphs
defaultGraphsModuleConfiguration :: EventloopModuleConfiguration
defaultGraphsModuleIOState :: IOState
graphsModuleIdentifier :: EventloopModuleIdentifier
nodeRadius :: Float
textSize :: Float
textFont :: [Char]
xArrowSize :: Float
yArrowSize :: Float
weightHeight :: Float
dimCanvasGraphs :: (Float, Float)
roundDimCanvasGraphs :: (Int, Int)
canvasGraphsWidth :: Float
canvasGraphsHeight :: Float
instructionsHeight :: Float
instructionsBeginAt :: Float
canvasInstrWidth :: Float
canvasInstrHeight :: Float
dimCanvasInstr :: (Float, Float)
roundDimCanvasInstr :: (Int, Int)
canvasIdGraphs :: CanvasId
canvasIdInstructions :: CanvasId
-- | Checkes to see if there is a node on a certain position
onNode :: [Node] -> Pos -> Maybe Node
-- | Abstracts the standardized EventTypes to GraphsIn
graphsPreProcessor :: PreProcessor
-- | Abstracts GraphsOut back to BasicShapes and
-- Canvas events
graphsPostProcessor :: PostProcessor
-- | Translates color datatype to RGBA codes
colorToRGBAColor :: Color -> Color
-- | Translates the thickness to a float
thicknessToFloat :: Thickness -> StrokeLineThickness
findNode :: [Node] -> Label -> Node
graphToShapes :: Graph -> [Shape]
nodeToShapes :: Node -> [Shape]
edgeToShapes :: Node -> Node -> Edge -> Directed -> Weighted -> [Shape]
-- | Returns the point when making a step f long from the point start in
-- the direction of the vector. The length between start pos and result
-- pos is always f.
posOnVector :: Float -> Vector -> Pos -> Pos
-- | Vector from p1 to p2
vectorize :: Pos -> Pos -> Vector
-- | Returns the vector perpendicular on the given vector between the 2
-- points. Always has positive y and vector length 1; y is inverted in
-- canvas
downPerpendicularTo :: Pos -> Pos -> Vector
-- | Returns the vector perpendicular on the given vector between the 2
-- points. Always has negative y and vector length 1; y is inverted in
-- canvas
upPerpendicularTo :: Pos -> Pos -> Vector
-- | Returns the size of the vector
vectorSize :: Vector -> Float
type Pos = (Float, Float)
type Vector = (Float, Float)
data GraphsIn
Mouse :: MouseEvent -> Pos -> GraphsIn
Key :: [Char] -> GraphsIn
data GraphsOut
SetupGraphs :: GraphsOut
DrawGraph :: Graph -> GraphsOut
Instructions :: [String] -> GraphsOut
type Label = Char
type Weight = Float
type Node = (Label, Pos, Color)
type Edge = (Label, Label, Color, Weight, Thickness)
data Graph
Graph :: [Node] -> [Edge] -> Directed -> Weighted -> Graph
nodes :: Graph -> [Node]
edges :: Graph -> [Edge]
directed :: Graph -> Directed
weighted :: Graph -> Weighted
data Color
Red :: Color
Blue :: Color
Green :: Color
Purple :: Color
Grey :: Color
Yellow :: Color
Orange :: Color
Black :: Color
White :: Color
data Thickness
Thin :: Thickness
Thick :: Thickness
data Directed
Directed :: Directed
Undirected :: Directed
data Weighted
Weighted :: Weighted
Unweighted :: Weighted
data MouseEvent
Click :: MouseButton -> MouseEvent
DoubleClick :: MouseButton -> MouseEvent
MouseMove :: MouseEvent
MouseDown :: MouseButton -> MouseEvent
MouseUp :: MouseButton -> MouseEvent
MouseEnter :: MouseEvent
MouseLeave :: MouseEvent
data MouseButton
MouseLeft :: MouseButton
MouseRight :: MouseButton
MouseMiddle :: MouseButton
module Eventloop.EventloopCore
startMainloop :: EventloopConfiguration progstateT -> IO ()
module Eventloop.DefaultConfiguration
allModulesEventloopConfiguration :: progstateT -> (progstateT -> In -> (progstateT, [Out])) -> EventloopConfiguration progstateT
defaultSharedIOState :: SharedIOState