twentefp-eventloop-graphics-0.1.0.4: Used as Lab Assignments Environment at Univeriteit Twente

Safe HaskellNone
LanguageHaskell98

EventLoop.Output

Synopsis

Documentation

data SystemMessageOut Source

The different possible SystemMessageOuts.

Constructors

CanvasSetup Dimension

Answer to the Setup containing the dimensions of the canvas that will be used.

Timer TimeData

Request to create a timer at the clientside that will generate a Time message each 'tick'.

Close

A request for the client to completely close the connection to the server.

data TimeData Source

Constructors

On Int

Tells that the timer should be on with the time in ms

Off

Tells that the timer should be off

data Graphical Source

Graphical Responses Out

Constructors

Draw GObject Groupname

Draw the graphical object with the given groupname.

MoveGroup Groupname Pos Relative

Move an entire group to a new position possibly relative to the old position.

MoveElement Name Pos Relative

Move a single element to a new position possibly relative to the old position.

RemoveGroup Groupname

Remove a group.

RemoveElement Name

Remove an element.

ClearAll

Clears all from the canvas.

data GObject Source

A general graphical object containing the common attributes of each Primitive.

Constructors

GObject

Graphical Object

Fields

name :: Name

Name of the graphical object/element

prim :: Primitive

The graphical primitive that should be drawn

children :: [GObject]

Children of the graphical primitive. Can be used to create composited graphical components containing multiple GObjects.

Container

A container for Graphical Objects

Fields

children :: [GObject]

Children of the graphical primitive. Can be used to create composited graphical components containing multiple GObjects.

Instances

data Primitive Source

Primitive graphical structures

Constructors

Text

The text graphical primitive

Fields

edgeColor :: Color

Color of the edges of the text

edgeThickness :: Float

The edge thickness of the text (Should be 1 most of the time)

color :: Color

The Color of the fill of the text

position :: Pos

The position on the screen of the text

size :: Float

The height of the text in pixels

font :: Font

Which font to be used

text :: [Char]

The actual text to be displayed

fromCenter :: Bool

Is the position the topleft corner of the text or the center of the text

Line

The line graphical primitive

Fields

edgeColor :: Color

Color of the edges of the text

edgeThickness :: Float

The edge thickness of the text (Should be 1 most of the time)

positions :: [Pos]

The list of positions the line should go through. A line will be drawn from point 1 to point 2 to point...

Rect

The rectangle graphical primitive

Fields

edgeColor :: Color

Color of the edges of the text

edgeThickness :: Float

The edge thickness of the text (Should be 1 most of the time)

color :: Color

The Color of the fill of the text

position :: Pos

The position on the screen of the text

dimensions :: Dimension

The dimensions of the rectangle

Arc

The arc graphical primitive. This is the part of a circle. When startAng=0 and endAng=360 you get a full circle.

Fields

edgeColor :: Color

Color of the edges of the text

edgeThickness :: Float

The edge thickness of the text (Should be 1 most of the time)

color :: Color

The Color of the fill of the text

position :: Pos

The position on the screen of the text

radius :: Float

The radius of the arc

startAng :: Float

The starting angle of the arc in degrees.

endAng :: Float

The ending angle of the arc in degrees.

type Name = [Char] Source

The name of a graphical object. Another synonym in the package used for this is Element.

type Groupname = [Char] Source

The groupname of a set of graphical objects.

type Color = (Float, Float, Float) Source

The color expressed in (red, green, blue) code where each value is between 0 <= 255.

type Font = [Char] Source

The font associated with a Text primitive.

type Relative = Bool Source

A boolean expressing if an event should be carried out relative to the old situation or to the absolute situation Example of this is when moving an element. Should the move be relative to the old Pos or to the absolute Pos on the screen.

outSingle :: OutputEvent -> IO () Source

Outputs a single OutputEvent. Right now only Draw events are implemented. The server automatically determines the maximum Dimensions of the picture and sends a Setup containing those Dimensions.