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 |
GI.Gtk.Structs.PaperSize
Contents
- 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
Description
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 tPaperSize
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.
Instances
Eq PaperSize Source # | |
BoxedObject PaperSize Source # | |
Defined in GI.Gtk.Structs.PaperSize | |
IsGValue PaperSize Source # | Convert |
Defined in GI.Gtk.Structs.PaperSize |
noPaperSize :: Maybe PaperSize Source #
A convenience alias for Nothing
:: Maybe
PaperSize
.
Methods
Overloaded methods
copy
Arguments
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m PaperSize | Returns: a copy of |
Copies an existing tPaperSize
.
Since: 2.10
free
Free the given tPaperSize
object.
Since: 2.10
getDefault
Arguments
:: (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 #
Arguments
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the default bottom margin |
Gets the default bottom margin for the tPaperSize
.
Since: 2.10
getDefaultLeftMargin
paperSizeGetDefaultLeftMargin Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the default left margin |
Gets the default left margin for the tPaperSize
.
Since: 2.10
getDefaultRightMargin
paperSizeGetDefaultRightMargin Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the default right margin |
Gets the default right margin for the tPaperSize
.
Since: 2.10
getDefaultTopMargin
paperSizeGetDefaultTopMargin Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the default top margin |
Gets the default top margin for the tPaperSize
.
Since: 2.10
getDisplayName
paperSizeGetDisplayName Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m Text | Returns: the human-readable name of |
Gets the human-readable name of the tPaperSize
.
Since: 2.10
getHeight
Arguments
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the paper height |
Gets the paper height of the tPaperSize
, in
units of unit
.
Since: 2.10
getName
Arguments
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m Text | Returns: the name of |
Gets the name of the tPaperSize
.
Since: 2.10
getPaperSizes
paperSizeGetPaperSizes Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Bool |
|
-> m [PaperSize] | Returns: a newly allocated list of newly
allocated t |
Creates a list of known paper sizes.
Since: 2.12
getPpdName
Arguments
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m Text | Returns: the PPD name of |
Gets the PPD name of the tPaperSize
, which
may be Nothing
.
Since: 2.10
getWidth
Arguments
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the paper width |
Gets the paper width of the tPaperSize
, in
units of unit
.
Since: 2.10
isCustom
Arguments
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m Bool | Returns: whether |
Returns True
if size
is not a standard paper size.
isEqual
Arguments
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> PaperSize |
|
-> m Bool | Returns: |
Compares two tPaperSize
objects.
Since: 2.10
isIpp
Arguments
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m Bool | Returns: whether |
Returns True
if size
is an IPP standard paper size.
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> Maybe Text |
|
-> m PaperSize | Returns: a new t |
Creates a new tPaperSize
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
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Text |
|
-> Double |
|
-> Double |
|
-> Unit |
|
-> m PaperSize | Returns: a new t |
Creates a new tPaperSize
object with the
given parameters.
Since: 2.10
newFromGvariant
paperSizeNewFromGvariant Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> GVariant |
|
-> m PaperSize | Returns: a new t |
Deserialize a paper size from an a{sv} variant in
the format produced by paperSizeToGvariant
.
Since: 3.22
newFromIpp
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Double |
|
-> Double |
|
-> m PaperSize | Returns: a new t |
newFromKeyFile
paperSizeNewFromKeyFile Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> KeyFile |
|
-> Maybe Text |
|
-> m PaperSize | Returns: a new t |
Reads a paper size from the group groupName
in the key file
keyFile
.
Since: 2.12
newFromPpd
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Text |
|
-> Double |
|
-> Double |
|
-> m PaperSize | Returns: a new t |
setSize
Arguments
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Double |
|
-> Double |
|
-> Unit |
|
-> m () |
Changes the dimensions of a size
to width
x height
.
Since: 2.10
toGvariant
Arguments
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m GVariant | Returns: a new, floating, t |
Serialize a paper size to an a{sv} variant.
Since: 3.22