Portability | portable (depends on GHC) |
---|---|
Stability | provisional |
Maintainer | gtk2hs-users@lists.sourceforge.net |
Safe Haskell | Safe-Infered |
Encapsulates context for drawing pages
- Module available since Gtk+ version 2.10
- data PrintContext
- class GObjectClass o => PrintContextClass o
- castToPrintContext :: GObjectClass obj => obj -> PrintContext
- toPrintContext :: PrintContextClass o => o -> PrintContext
- printContextGetCairoContext :: PrintContextClass self => self -> IO Cairo
- printContextSetCairoContext :: PrintContextClass self => self -> Cairo -> Double -> Double -> IO ()
- printContextGetPageSetup :: PrintContextClass self => self -> IO PageSetup
- printContextGetWidth :: PrintContextClass self => self -> IO Double
- printContextGetHeight :: PrintContextClass self => self -> IO Double
- printContextGetDpiX :: PrintContextClass self => self -> IO Double
- printContextGetDpiY :: PrintContextClass self => self -> IO Double
- printContextGetPangoFontmap :: PrintContextClass self => self -> IO FontMap
- printContextCreatePangoContext :: PrintContextClass self => self -> IO PangoContext
- printContextCreatePangoLayout :: PrintContextClass self => self -> IO PangoLayout
- printContextGetHardMargins :: PrintContextClass self => self -> IO (Maybe (Double, Double, Double, Double))
Detail
A PrintContext
encapsulates context information that is required when
drawing pages for printing, such as the cairo context and important
parameters like page size and resolution. It also lets you easily create
PangoLayout
and Context
objects that match the font metrics of the cairo
surface.
PrintContext
objects gets passed to the beginPrint
, endPrint
,
requestPageSetup
and drawPage
signals on the PrintOperation
.
Printing support was added in Gtk+ 2.10.
Class Hierarchy
| GObject
| +----PrintContext
Types
data PrintContext Source
class GObjectClass o => PrintContextClass o Source
castToPrintContext :: GObjectClass obj => obj -> PrintContextSource
toPrintContext :: PrintContextClass o => o -> PrintContextSource
Methods
printContextGetCairoContextSource
:: PrintContextClass self | |
=> self | |
-> IO Cairo | returns the cairo context of |
Obtains the cairo context that is associated with the PrintContext
.
printContextSetCairoContextSource
:: PrintContextClass self | |
=> self | |
-> Cairo |
|
-> Double |
|
-> Double |
|
-> IO () |
Sets a new cairo context on a print context.
This function is intended to be used when implementing an internal print preview, it is not needed for printing, since Gtk+ itself creates a suitable cairo context in that case.
printContextGetPageSetupSource
:: PrintContextClass self | |
=> self | |
-> IO PageSetup | returns the page setup of |
Obtains the PageSetup
that determines the page dimensions of the
PrintContext
.
:: PrintContextClass self | |
=> self | |
-> IO Double | returns the width of |
Obtains the width of the PrintContext
, in pixels.
:: PrintContextClass self | |
=> self | |
-> IO Double | returns the height of |
Obtains the height of the PrintContext
, in pixels.
:: PrintContextClass self | |
=> self | |
-> IO Double | returns the horizontal resolution of |
Obtains the horizontal resolution of the PrintContext
, in dots per
inch.
:: PrintContextClass self | |
=> self | |
-> IO Double | returns the vertical resolution of |
Obtains the vertical resolution of the PrintContext
, in dots per inch.
printContextGetPangoFontmapSource
:: PrintContextClass self | |
=> self | |
-> IO FontMap | returns the font map of |
Returns a FontMap
that is suitable for use with the PrintContext
.
printContextCreatePangoContextSource
:: PrintContextClass self | |
=> self | |
-> IO PangoContext | returns a new Pango context for |
Creates a new Context
that can be used with the PrintContext
.
printContextCreatePangoLayoutSource
:: PrintContextClass self | |
=> self | |
-> IO PangoLayout | returns a new Pango layout for |
Creates a new PangoLayout
that is suitable for use with the
PrintContext
.