Maintainer | gtk2hs-users@lists.sourceforge.net |
---|---|
Stability | provisional |
Portability | portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell98 |
Support for named paper sizes
- newtype PaperSize = PaperSize (ForeignPtr PaperSize)
- mkPaperSize :: Ptr PaperSize -> IO PaperSize
- data Unit
- = UnitNone
- | UnitPoints
- | UnitInch
- | UnitMm
- paperSizeNew :: GlibString string => Maybe string -> IO PaperSize
- paperSizeNewFromPpd :: GlibString string => string -> string -> Double -> Double -> IO PaperSize
- paperSizeNewCustom :: GlibString string => string -> string -> Double -> Double -> Unit -> IO PaperSize
- paperSizeCopy :: PaperSize -> IO PaperSize
- paperSizeIsEqual :: PaperSize -> PaperSize -> IO Bool
- paperSizeGetName :: GlibString string => PaperSize -> IO string
- paperSizeGetDisplayName :: GlibString string => PaperSize -> IO string
- paperSizeGetPpdName :: GlibString string => PaperSize -> IO (Maybe string)
- paperSizeGetWidth :: PaperSize -> Unit -> IO Double
- paperSizeGetHeight :: PaperSize -> Unit -> IO Double
- paperSizeIsCustom :: PaperSize -> IO Bool
- paperSizeSetSize :: PaperSize -> Double -> Double -> Unit -> IO ()
- paperSizeGetDefaultTopMargin :: PaperSize -> Unit -> IO Double
- paperSizeGetDefaultBottomMargin :: PaperSize -> Unit -> IO Double
- paperSizeGetDefaultLeftMargin :: PaperSize -> Unit -> IO Double
- paperSizeGetDefaultRightMargin :: PaperSize -> Unit -> IO Double
- paperSizeGetDefault :: GlibString string => IO string
- paperSizeGetPaperSizes :: Bool -> IO [PaperSize]
Detail
PaperSize
handles paper sizes. It uses the
standard called "PWG 5101.1-2002 PWG: Standard for Media Standardized
Names" to name the paper sizes (and to get the data for the page sizes). In
addition to standard paper sizes, PaperSize
allows
to construct custom paper sizes with arbitrary dimensions.
The PaperSize
object stores not only the
dimensions (width and height) of a paper size and its name, it also provides
default print margins.
Printing support has been added in Gtk+ 2.10.
Types
Enums
Constructors
:: GlibString string | |
=> Maybe string |
|
-> IO PaperSize |
Creates a new PaperSize
object by parsing a PWG
5101.1-2002 paper name.
If name
is Nothing, the default paper size is returned, see paperSizeGetDefault
.
- Available since Gtk+ version 2.10
:: GlibString string | |
=> string |
|
-> string |
|
-> Double |
|
-> Double |
|
-> IO PaperSize |
:: GlibString string | |
=> string |
|
-> string |
|
-> Double |
|
-> Double |
|
-> Unit |
|
-> IO PaperSize |
Creates a new PaperSize
object with the given
parameters.
- Available since Gtk+ version 2.10
Methods
Copies an existing PaperSize
.
- Available since Gtk+ version 2.10
:: PaperSize | |
-> PaperSize |
|
-> IO Bool | returns |
Compares two PaperSize
objects.
- Available since Gtk+ version 2.10
:: GlibString string | |
=> PaperSize | |
-> IO string | returns the name of |
Gets the name of the PaperSize
.
- Available since Gtk+ version 2.10
paperSizeGetDisplayName Source
:: GlibString string | |
=> PaperSize | |
-> IO string | returns the human-readable name of |
Gets the human-readable name of the PaperSize
.
- Available since Gtk+ version 2.10
:: GlibString string | |
=> PaperSize | |
-> IO (Maybe string) | returns the PPD name of |
Gets the PPD name of the PaperSize
, which may be
- Available since Gtk+ version 2.10
Gets the paper width of the PaperSize
, in units
of unit
.
- Available since Gtk+ version 2.10
Gets the paper height of the PaperSize
, in units
of unit
.
- Available since Gtk+ version 2.10
Returns True
if size
is not a standard paper size.
:: PaperSize | |
-> Double |
|
-> Double |
|
-> Unit |
|
-> IO () |
Changes the dimensions of a size
to width
x height
.
- Available since Gtk+ version 2.10
paperSizeGetDefaultTopMargin Source
Gets the default top margin for the PaperSize
.
- Available since Gtk+ version 2.10
paperSizeGetDefaultBottomMargin Source
:: PaperSize | |
-> Unit |
|
-> IO Double | returns the default bottom margin |
Gets the default bottom margin for the PaperSize
.
- Available since Gtk+ version 2.10
paperSizeGetDefaultLeftMargin Source
Gets the default left margin for the PaperSize
.
- Available since Gtk+ version 2.10
paperSizeGetDefaultRightMargin Source
:: PaperSize | |
-> Unit |
|
-> IO Double | returns the default right margin |
Gets the default right margin for the PaperSize
.
- Available since Gtk+ version 2.10
:: GlibString string | |
=> IO string | returns the name of the default paper size. |
Returns the name of the default paper size, which depends on the current locale.
- Available since Gtk+ version 2.10