gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.Printing.PrintContext

Contents

- Detail
- Class Hierarchy
- Types
- Methods

Description

Encapsulates context for drawing pages

- Module available since Gtk+ version 2.10

Synopsis

- 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 #

#### Instances

Instances details

Eq PrintContext Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: PrintContext -> PrintContext -> Bool Source # (/=) :: PrintContext -> PrintContext -> Bool Source #
Ord PrintContext Source # |

Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: PrintContext -> PrintContext -> Ordering Source #

(<) :: PrintContext -> PrintContext -> Bool Source #

(<=) :: PrintContext -> PrintContext -> Bool Source #

(>) :: PrintContext -> PrintContext -> Bool Source #

(>=) :: PrintContext -> PrintContext -> Bool Source #

max :: PrintContext -> PrintContext -> PrintContext Source #

min :: PrintContext -> PrintContext -> PrintContext Source #

GObjectClass PrintContext Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: PrintContext -> GObject Source # unsafeCastGObject :: GObject -> PrintContext Source #
PrintContextClass PrintContext Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class GObjectClass o => PrintContextClass o Source #

#### Instances

Instances details

PrintContextClass PrintContext Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToPrintContext :: GObjectClass obj => obj -> PrintContext Source #

toPrintContext :: PrintContextClass o => o -> PrintContext Source #

# Methods

printContextGetCairoContext Source #

Arguments

:: PrintContextClass self |
=> self |
-> IO Cairo | returns the cairo context of `context`

Obtains the cairo context that is associated with the `PrintContext`.

printContextSetCairoContext Source #

Arguments

:: PrintContextClass self |
=> self |
-> Cairo | `cr` - the cairo context
-> Double | `dpiX` - the horizontal resolution to use with `cr`
-> Double | `dpiY` - the vertical resolution to use with `cr`
-> 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.

printContextGetPageSetup Source #

Arguments

:: PrintContextClass self |
=> self |
-> IO PageSetup | returns the page setup of `context`

Obtains the `PageSetup` that determines the page dimensions of the `PrintContext`.

printContextGetWidth Source #

Arguments

:: PrintContextClass self |
=> self |
-> IO Double | returns the width of `context`

Obtains the width of the `PrintContext`, in pixels.

printContextGetHeight Source #

Arguments

:: PrintContextClass self |
=> self |
-> IO Double | returns the height of `context`

Obtains the height of the `PrintContext`, in pixels.

printContextGetDpiX Source #

Arguments

:: PrintContextClass self |
=> self |
-> IO Double | returns the horizontal resolution of `context`

Obtains the horizontal resolution of the `PrintContext`, in dots per inch.

printContextGetDpiY Source #

Arguments

:: PrintContextClass self |
=> self |
-> IO Double | returns the vertical resolution of `context`

Obtains the vertical resolution of the `PrintContext`, in dots per inch.

printContextGetPangoFontmap Source #

Arguments

:: PrintContextClass self |
=> self |
-> IO FontMap | returns the font map of `context`

Returns a `FontMap` that is suitable for use with the `PrintContext`.

printContextCreatePangoContext Source #

Arguments

:: PrintContextClass self |
=> self |
-> IO PangoContext | returns a new Pango context for `context`

Creates a new `Context` that can be used with the `PrintContext`.

printContextCreatePangoLayout Source #

Arguments

:: PrintContextClass self |
=> self |
-> IO PangoLayout | returns a new Pango layout for `context`

Creates a new `PangoLayout` that is suitable for use with the `PrintContext`.

printContextGetHardMargins Source #

Arguments

:: PrintContextClass self |
=> self |
-> IO (Maybe (Double, Double, Double, Double)) | returns `(top, bottom, left, right)` `top` top hardware printer margin `bottom` bottom hardware printer margin `left` left hardware printer margin `right` right hardware printer margin