monomer-1.4.0.0: A GUI library for writing native Haskell applications.
Copyright(c) 2018 Francisco Vallarino
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Monomer.Widgets.Util.Drawing

Description

Utility drawing functions. Built on top the lower level primitives provided by Monomer.Graphics.Types.Renderer.

Synopsis

Documentation

drawInScissor Source #

Arguments

:: Renderer

The renderer.

-> Bool

Whether to apply the scissor (useful to selectively apply).

-> Rect

Scissor rect, where drawing will be visible.

-> IO ()

Drawing operations.

-> IO ()

The resulting action.

Performs the provided drawing operations with an active scissor, and then | disables it.

drawInTranslation Source #

Arguments

:: Renderer

The renderer.

-> Point

The offset to apply.

-> IO ()

Drawing operations.

-> IO ()

The resulting action.

Performs the provided drawing operations displaced by the given offset.

drawInScale Source #

Arguments

:: Renderer

The renderer.

-> Point

The horizontal and vertical scale factor to apply.

-> IO ()

Drawing operations.

-> IO ()

The resulting action.

Performs the provided drawing operations with the given resize scale.

drawInRotation Source #

Arguments

:: Renderer

The renderer.

-> Double

The angle in degrees.

-> IO ()

Drawing operations.

-> IO ()

The resulting action.

Performs the provided drawing operations with the given rotation angle.

drawInAlpha Source #

Arguments

:: Renderer

The renderer.

-> Double

The global alpha to apply.

-> IO ()

Drawing operations.

-> IO ()

The resulting action.

Performs the provided drawing operations with a global alpha applied.

drawTextLine Source #

Arguments

:: Renderer

The renderer.

-> StyleState

The style to apply.

-> TextLine

The TextLine with the text to render.

-> IO ()

The resulting action.

Draws a TextLine with the provided style. Font and size must be the same | as when the TextLine was created, but color and decorations can change.

drawLine Source #

Arguments

:: Renderer

The renderer.

-> Point

The start point.

-> Point

The end point.

-> Double

The line width.

-> Maybe Color

The color. If Nothing, the line will not be drawn.

-> IO ()

The resulting action.

Draws a line with the given width and color.

drawRect Source #

Arguments

:: Renderer

The renderer.

-> Rect

The rectangle to be drawn.

-> Maybe Color

The color. If Nothing, the rect will not be drawn.

-> Maybe Radius

The optional radius config.

-> IO ()

The resulting action.

Draws a filled rect with the given color and radius.

drawRectBorder Source #

Arguments

:: Renderer

The renderer.

-> Rect

The rectangle to be drawn.

-> Border

The border config.

-> Maybe Radius

The optional radius config.

-> IO ()

The resulting action.

Draws a rect's border, with an optional radius.

drawArc Source #

Arguments

:: Renderer

The renderer.

-> Rect

The rect delimiting the arc area.

-> Double

The start angle in degrees.

-> Double

The end angle in degrees.

-> Winding

The direction in which the arc is drawn.

-> Maybe Color

The color. If Nothing, the arc will not be drawn.

-> IO ()

The resulting action.

Draws a filled arc, delimited by a rect and within the given angles.

drawArcBorder Source #

Arguments

:: Renderer

The renderer.

-> Rect

The rect delimiting the arc area.

-> Double

The start angle in degrees.

-> Double

The end angle in degrees.

-> Winding

The direction in which the arc is drawn.

-> Maybe Color

The color. If Nothing, the arc will not be drawn.

-> Double

The arc width.

-> IO ()

The resulting action.

Draws an arc's border, delimited by a rect and within the given angles.

drawEllipse Source #

Arguments

:: Renderer

The renderer.

-> Rect

The rect delimiting the ellipse.

-> Maybe Color

The color. If Nothing, the ellipse will not be drawn.

-> IO ()

The resulting action.

Draws a filled ellipse, delimited by a rect.

drawEllipseBorder Source #

Arguments

:: Renderer

The renderer.

-> Rect

The rect delimiting the ellipse.

-> Maybe Color

The color. If Nothing, the ellipse will not be drawn.

-> Double

The border width.

-> IO ()

The resulting action.

Draws an ellipse's border, delimited by a rect.

drawArrowUp Source #

Arguments

:: Renderer

The renderer.

-> Rect

The rect delimiting the arrow.

-> Maybe Color

The color. If Nothing, the arrow will not be drawn.

-> IO ()

The resulting action.

Draws a triangular arrow pointing up, delimited by the given rect.

drawArrowDown Source #

Arguments

:: Renderer

The renderer.

-> Rect

The rect delimiting the arrow.

-> Maybe Color

The color. If Nothing, the arrow will not be drawn.

-> IO ()

The resulting action.

Draws a triangular arrow pointing down, delimited by the given rect.

drawTimesX Source #

Arguments

:: Renderer

The renderer.

-> Rect

The rect delimiting the arrow.

-> Double

The width of the lines.

-> Maybe Color

The color. If Nothing, the X will not be drawn.

-> IO ()

The resulting action.

Draws an X, delimited by the given rect.

drawStyledAction Source #

Arguments

:: Renderer

The renderer.

-> Rect

The rect where background and border will be drawn.

-> StyleState

The style defining background and border.

-> (Rect -> IO ())

The drawing actions. They receive the content area.

-> IO ()

The resulting action.

Runs a set of rendering operations after drawing the style's background, and before drawing the style's border.

drawStyledAction_ Source #

Arguments

:: Renderer

The renderer.

-> Bool

Whether background and border should be drawn.

-> Rect

The rect where background and border will be drawn.

-> StyleState

The style defining background and border.

-> (Rect -> IO ())

The drawing actions. They receive the content area.

-> IO ()

The resulting action.

Runs a set of rendering operations after conditionally drawing the style's background, and before drawing the style's border.

drawRoundedRect :: Renderer -> Rect -> Radius -> IO () Source #

Draws a rounded rect with the provided radius config.

drawRoundedRectBorder :: Renderer -> Rect -> Border -> Radius -> IO () Source #

Draws the border of a rounded rect. Borders' widths may not match.