| Maintainer | gtk2hs-users@lists.sourceforge.net |
|---|---|
| Stability | provisional |
| Portability | portable (depends on GHC) |
| Safe Haskell | Safe-Inferred |
| Language | Haskell98 |
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
- cairoFontMapGetDefault :: IO FontMap
- cairoFontMapSetResolution :: FontMap -> Double -> IO ()
- cairoFontMapGetResolution :: FontMap -> IO Double
- cairoCreateContext :: Maybe FontMap -> IO PangoContext
- cairoContextSetResolution :: PangoContext -> Double -> IO ()
- cairoContextGetResolution :: PangoContext -> IO Double
- cairoContextSetFontOptions :: PangoContext -> FontOptions -> IO ()
- cairoContextGetFontOptions :: PangoContext -> IO FontOptions
- getClipRectangle :: Render (Maybe Rectangle)
- renderWithDrawWindow :: DrawWindowClass drawWindow => drawWindow -> Render a -> IO a
- region :: Region -> Render ()
- setSourceColor :: Color -> Render ()
- setSourcePixbuf :: Pixbuf -> Double -> Double -> Render ()
- rectangle :: Rectangle -> Render ()
- 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 ()
Global Cairo settings.
cairoFontMapGetDefault :: IO FontMap #
cairoFontMapSetResolution :: FontMap -> Double -> IO () #
cairoFontMapGetResolution :: FontMap -> IO Double #
cairoCreateContext :: Maybe FontMap -> IO PangoContext #
cairoContextSetResolution :: PangoContext -> Double -> IO () #
cairoContextGetResolution :: PangoContext -> IO Double #
cairoContextSetFontOptions :: PangoContext -> FontOptions -> IO () #
cairoContextGetFontOptions :: PangoContext -> IO FontOptions #
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.
Arguments
| :: DrawWindowClass drawWindow | |
| => 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 () #
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 () #