gtk3-0.15.9: Binding to the Gtk+ 3 graphical user interface library
Maintainergtk2hs-users@lists.sourceforge.net
Stabilityprovisional
Portabilityportable (depends on GHC)
Safe HaskellNone
LanguageHaskell98

Graphics.UI.Gtk.Cairo

Description

Gtk specific functions to for rendering with Cairo.

Cairo is a graphics library that supports vector graphics and image compositing that can be used with Gdk. The Cairo API is an addition to Gdk/Gtk (rather than a replacement). Cairo rendering can be performed on any Drawable by calling renderWithDrawable. The functions in this module provide ways of drawing Gtk specific elements, such as Pixbufs or text laid out with Pango.

All functions in this module are only available in Gtk 2.8 or higher.

Synopsis

Global Cairo settings.

cairoFontMapSetResolution :: FontMap -> Double -> IO () #

cairoContextSetFontOptions :: PangoContext -> FontOptions -> IO () #

Functions for the Render monad.

getClipRectangle :: Render (Maybe Rectangle) Source #

Compute a bounding box in user coordinates covering the area inside the current clip. It rounds the bounding box to integer coordinates. Returns Nothing indicating if a clip area doesn't exist.

renderWithDrawWindow Source #

Arguments

:: DrawWindowClass drawWindow 
=> drawWindow

drawWindow - a DrawWindow

-> Render a

A newly created Cairo context.

-> IO a 

Creates a Cairo context for drawing to a DrawWindow.

region :: Region -> Render () Source #

Adds the given region to the current path of the Render context.

setSourceColor :: Color -> Render () #

setSourcePixbuf Source #

Arguments

:: Pixbuf 
-> Double

x

-> Double

y

-> Render () 

Sets the given pixbuf as the source pattern for the Cairo context. The pattern has an extend mode of ExtendNone and is aligned so that the origin of pixbuf is (x, y).

rectangle :: Rectangle -> Render () Source #

Adds the given region to the current path of the Render context.

updateContext :: PangoContext -> Render () #

createLayout :: GlibString string => string -> Render PangoLayout #

updateLayout :: PangoLayout -> Render () #

showGlyphString :: GlyphItem -> Render () #

showLayoutLine :: LayoutLine -> Render () #

showLayout :: PangoLayout -> Render () #

glyphStringPath :: GlyphItem -> Render () #

layoutLinePath :: LayoutLine -> Render () #

layoutPath :: PangoLayout -> Render () #