Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
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.
- newtype PaperSize = PaperSize (ManagedPtr PaperSize)
- noPaperSize :: Maybe PaperSize
- data PaperSizeCopyMethodInfo
- paperSizeCopy :: (HasCallStack, MonadIO m) => PaperSize -> m PaperSize
- data PaperSizeFreeMethodInfo
- paperSizeFree :: (HasCallStack, MonadIO m) => PaperSize -> m ()
- paperSizeGetDefault :: (HasCallStack, MonadIO m) => m Text
- data PaperSizeGetDefaultBottomMarginMethodInfo
- paperSizeGetDefaultBottomMargin :: (HasCallStack, MonadIO m) => PaperSize -> Unit -> m Double
- data PaperSizeGetDefaultLeftMarginMethodInfo
- paperSizeGetDefaultLeftMargin :: (HasCallStack, MonadIO m) => PaperSize -> Unit -> m Double
- data PaperSizeGetDefaultRightMarginMethodInfo
- paperSizeGetDefaultRightMargin :: (HasCallStack, MonadIO m) => PaperSize -> Unit -> m Double
- data PaperSizeGetDefaultTopMarginMethodInfo
- paperSizeGetDefaultTopMargin :: (HasCallStack, MonadIO m) => PaperSize -> Unit -> m Double
- data PaperSizeGetDisplayNameMethodInfo
- paperSizeGetDisplayName :: (HasCallStack, MonadIO m) => PaperSize -> m Text
- data PaperSizeGetHeightMethodInfo
- paperSizeGetHeight :: (HasCallStack, MonadIO m) => PaperSize -> Unit -> m Double
- data PaperSizeGetNameMethodInfo
- paperSizeGetName :: (HasCallStack, MonadIO m) => PaperSize -> m Text
- paperSizeGetPaperSizes :: (HasCallStack, MonadIO m) => Bool -> m [PaperSize]
- data PaperSizeGetPpdNameMethodInfo
- paperSizeGetPpdName :: (HasCallStack, MonadIO m) => PaperSize -> m Text
- data PaperSizeGetWidthMethodInfo
- paperSizeGetWidth :: (HasCallStack, MonadIO m) => PaperSize -> Unit -> m Double
- data PaperSizeIsCustomMethodInfo
- paperSizeIsCustom :: (HasCallStack, MonadIO m) => PaperSize -> m Bool
- data PaperSizeIsEqualMethodInfo
- paperSizeIsEqual :: (HasCallStack, MonadIO m) => PaperSize -> PaperSize -> m Bool
- data PaperSizeIsIppMethodInfo
- 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 -> Text -> m PaperSize
- paperSizeNewFromPpd :: (HasCallStack, MonadIO m) => Text -> Text -> Double -> Double -> m PaperSize
- data PaperSizeSetSizeMethodInfo
- paperSizeSetSize :: (HasCallStack, MonadIO m) => PaperSize -> Double -> Double -> Unit -> m ()
- data PaperSizeToGvariantMethodInfo
- paperSizeToGvariant :: (HasCallStack, MonadIO m) => PaperSize -> m GVariant
- data PaperSizeToKeyFileMethodInfo
- paperSizeToKeyFile :: (HasCallStack, MonadIO m) => PaperSize -> KeyFile -> Text -> m ()
Exported types
Methods
copy
data PaperSizeCopyMethodInfo Source #
((~) * signature (m PaperSize), MonadIO m) => MethodInfo * PaperSizeCopyMethodInfo PaperSize signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m PaperSize | Returns: a copy of |
Copies an existing PaperSize
.
Since: 2.10
free
data PaperSizeFreeMethodInfo Source #
((~) * signature (m ()), MonadIO m) => MethodInfo * PaperSizeFreeMethodInfo PaperSize signature Source # | |
:: (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
data PaperSizeGetDefaultBottomMarginMethodInfo Source #
((~) * signature (Unit -> m Double), MonadIO m) => MethodInfo * PaperSizeGetDefaultBottomMarginMethodInfo PaperSize signature Source # | |
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
data PaperSizeGetDefaultLeftMarginMethodInfo Source #
((~) * signature (Unit -> m Double), MonadIO m) => MethodInfo * PaperSizeGetDefaultLeftMarginMethodInfo PaperSize signature Source # | |
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
data PaperSizeGetDefaultRightMarginMethodInfo Source #
((~) * signature (Unit -> m Double), MonadIO m) => MethodInfo * PaperSizeGetDefaultRightMarginMethodInfo PaperSize signature Source # | |
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
data PaperSizeGetDefaultTopMarginMethodInfo Source #
((~) * signature (Unit -> m Double), MonadIO m) => MethodInfo * PaperSizeGetDefaultTopMarginMethodInfo PaperSize signature Source # | |
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
data PaperSizeGetDisplayNameMethodInfo Source #
((~) * signature (m Text), MonadIO m) => MethodInfo * PaperSizeGetDisplayNameMethodInfo PaperSize signature Source # | |
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
data PaperSizeGetHeightMethodInfo Source #
((~) * signature (Unit -> m Double), MonadIO m) => MethodInfo * PaperSizeGetHeightMethodInfo PaperSize signature Source # | |
:: (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
data PaperSizeGetNameMethodInfo Source #
((~) * signature (m Text), MonadIO m) => MethodInfo * PaperSizeGetNameMethodInfo PaperSize signature Source # | |
:: (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
data PaperSizeGetPpdNameMethodInfo Source #
((~) * signature (m Text), MonadIO m) => MethodInfo * PaperSizeGetPpdNameMethodInfo PaperSize signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m Text | Returns: the PPD name of |
getWidth
data PaperSizeGetWidthMethodInfo Source #
((~) * signature (Unit -> m Double), MonadIO m) => MethodInfo * PaperSizeGetWidthMethodInfo PaperSize signature Source # | |
:: (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
data PaperSizeIsCustomMethodInfo Source #
((~) * signature (m Bool), MonadIO m) => MethodInfo * PaperSizeIsCustomMethodInfo PaperSize signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m Bool | Returns: whether |
Returns True
if size
is not a standard paper size.
isEqual
data PaperSizeIsEqualMethodInfo Source #
((~) * signature (PaperSize -> m Bool), MonadIO m) => MethodInfo * PaperSizeIsEqualMethodInfo PaperSize signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> PaperSize |
|
-> m Bool | Returns: |
Compares two PaperSize
objects.
Since: 2.10
isIpp
data PaperSizeIsIppMethodInfo Source #
((~) * signature (m Bool), MonadIO m) => MethodInfo * PaperSizeIsIppMethodInfo PaperSize signature Source # | |
:: (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 |
|
-> 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
data PaperSizeToGvariantMethodInfo Source #
((~) * signature (m GVariant), MonadIO m) => MethodInfo * PaperSizeToGvariantMethodInfo PaperSize signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m GVariant | Returns: a new, floating, |
Serialize a paper size to an a{sv} variant.
Since: 3.22
toKeyFile
data PaperSizeToKeyFileMethodInfo Source #
((~) * signature (KeyFile -> Text -> m ()), MonadIO m) => MethodInfo * PaperSizeToKeyFileMethodInfo PaperSize signature Source # | |