Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- Overloaded methods
- copy
- free
- getDefault
- getDefaultBottomMargin
- getDefaultLeftMargin
- getDefaultRightMargin
- getDefaultTopMargin
- getDisplayName
- getHeight
- getName
- getPaperSizes
- getPpdName
- getWidth
- isCustom
- isEqual
- isIpp
- new
- newCustom
- newFromGvariant
- newFromIpp
- newFromKeyFile
- newFromPpd
- setSize
- toGvariant
- toKeyFile
GtkPaperSize 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, GtkPaperSize 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][print-margins].
Printing support has been added in GTK+ 2.10.
Synopsis
- newtype PaperSize = PaperSize (ManagedPtr PaperSize)
- noPaperSize :: Maybe PaperSize
- paperSizeCopy :: (HasCallStack, MonadIO m) => PaperSize -> m PaperSize
- paperSizeFree :: (HasCallStack, MonadIO m) => PaperSize -> m ()
- paperSizeGetDefault :: (HasCallStack, MonadIO m) => m Text
- paperSizeGetDefaultBottomMargin :: (HasCallStack, MonadIO m) => PaperSize -> Unit -> m Double
- paperSizeGetDefaultLeftMargin :: (HasCallStack, MonadIO m) => PaperSize -> Unit -> m Double
- paperSizeGetDefaultRightMargin :: (HasCallStack, MonadIO m) => PaperSize -> Unit -> m Double
- paperSizeGetDefaultTopMargin :: (HasCallStack, MonadIO m) => PaperSize -> Unit -> m Double
- paperSizeGetDisplayName :: (HasCallStack, MonadIO m) => PaperSize -> m Text
- paperSizeGetHeight :: (HasCallStack, MonadIO m) => PaperSize -> Unit -> m Double
- paperSizeGetName :: (HasCallStack, MonadIO m) => PaperSize -> m Text
- paperSizeGetPaperSizes :: (HasCallStack, MonadIO m) => Bool -> m [PaperSize]
- paperSizeGetPpdName :: (HasCallStack, MonadIO m) => PaperSize -> m Text
- paperSizeGetWidth :: (HasCallStack, MonadIO m) => PaperSize -> Unit -> m Double
- paperSizeIsCustom :: (HasCallStack, MonadIO m) => PaperSize -> m Bool
- paperSizeIsEqual :: (HasCallStack, MonadIO m) => PaperSize -> PaperSize -> m Bool
- paperSizeIsIpp :: (HasCallStack, MonadIO m) => PaperSize -> m Bool
- paperSizeNew :: (HasCallStack, MonadIO m) => Maybe Text -> m PaperSize
- paperSizeNewCustom :: (HasCallStack, MonadIO m) => Text -> Text -> Double -> Double -> Unit -> m PaperSize
- paperSizeNewFromGvariant :: (HasCallStack, MonadIO m) => GVariant -> m PaperSize
- paperSizeNewFromIpp :: (HasCallStack, MonadIO m) => Text -> Double -> Double -> m PaperSize
- paperSizeNewFromKeyFile :: (HasCallStack, MonadIO m) => KeyFile -> Maybe Text -> m PaperSize
- paperSizeNewFromPpd :: (HasCallStack, MonadIO m) => Text -> Text -> Double -> Double -> m PaperSize
- paperSizeSetSize :: (HasCallStack, MonadIO m) => PaperSize -> Double -> Double -> Unit -> m ()
- paperSizeToGvariant :: (HasCallStack, MonadIO m) => PaperSize -> m GVariant
- paperSizeToKeyFile :: (HasCallStack, MonadIO m) => PaperSize -> KeyFile -> Text -> m ()
Exported types
Memory-managed wrapper type.
Methods
Overloaded methods
copy
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m PaperSize | Returns: a copy of |
Copies an existing PaperSize
.
Since: 2.10
free
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m () |
Free the given PaperSize
object.
Since: 2.10
getDefault
:: (HasCallStack, MonadIO m) | |
=> m Text | Returns: the name of the default paper size. The string is owned by GTK+ and should not be modified. |
Returns the name of the default paper size, which depends on the current locale.
Since: 2.10
getDefaultBottomMargin
paperSizeGetDefaultBottomMargin Source #
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the default bottom margin |
Gets the default bottom margin for the PaperSize
.
Since: 2.10
getDefaultLeftMargin
paperSizeGetDefaultLeftMargin Source #
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the default left margin |
Gets the default left margin for the PaperSize
.
Since: 2.10
getDefaultRightMargin
paperSizeGetDefaultRightMargin Source #
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the default right margin |
Gets the default right margin for the PaperSize
.
Since: 2.10
getDefaultTopMargin
paperSizeGetDefaultTopMargin Source #
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the default top margin |
Gets the default top margin for the PaperSize
.
Since: 2.10
getDisplayName
paperSizeGetDisplayName Source #
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m Text | Returns: the human-readable name of |
Gets the human-readable name of the PaperSize
.
Since: 2.10
getHeight
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the paper height |
Gets the paper height of the PaperSize
, in
units of unit
.
Since: 2.10
getName
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m Text | Returns: the name of |
Gets the name of the PaperSize
.
Since: 2.10
getPaperSizes
paperSizeGetPaperSizes Source #
:: (HasCallStack, MonadIO m) | |
=> Bool |
|
-> m [PaperSize] | Returns: a newly allocated list of newly
allocated |
Creates a list of known paper sizes.
Since: 2.12
getPpdName
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m Text | Returns: the PPD name of |
getWidth
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the paper width |
Gets the paper width of the PaperSize
, in
units of unit
.
Since: 2.10
isCustom
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m Bool | Returns: whether |
Returns True
if size
is not a standard paper size.
isEqual
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> PaperSize |
|
-> m Bool | Returns: |
Compares two PaperSize
objects.
Since: 2.10
isIpp
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m Bool | Returns: whether |
Returns True
if size
is an IPP standard paper size.
new
:: (HasCallStack, MonadIO m) | |
=> Maybe Text |
|
-> m PaperSize | Returns: a new |
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
.
Since: 2.10
newCustom
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Text |
|
-> Double |
|
-> Double |
|
-> Unit |
|
-> m PaperSize | Returns: a new |
Creates a new PaperSize
object with the
given parameters.
Since: 2.10
newFromGvariant
paperSizeNewFromGvariant Source #
:: (HasCallStack, MonadIO m) | |
=> GVariant |
|
-> m PaperSize | Returns: a new |
Deserialize a paper size from an a{sv} variant in
the format produced by paperSizeToGvariant
.
Since: 3.22
newFromIpp
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Double |
|
-> Double |
|
-> m PaperSize | Returns: a new |
newFromKeyFile
paperSizeNewFromKeyFile Source #
:: (HasCallStack, MonadIO m) | |
=> KeyFile |
|
-> Maybe Text |
|
-> m PaperSize | Returns: a new |
Reads a paper size from the group groupName
in the key file
keyFile
.
Since: 2.12
newFromPpd
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Text |
|
-> Double |
|
-> Double |
|
-> m PaperSize | Returns: a new |
setSize
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Double |
|
-> Double |
|
-> Unit |
|
-> m () |
Changes the dimensions of a size
to width
x height
.
Since: 2.10
toGvariant
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m GVariant | Returns: a new, floating, |
Serialize a paper size to an a{sv} variant.
Since: 3.22