Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
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 GtkPaperSize
object stores not only the dimensions (width
and height) of a paper size and its name, it also provides
default print margins.
Synopsis
- newtype PaperSize = PaperSize (ManagedPtr 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 # | |
GBoxed PaperSize Source # | |
Defined in GI.Gtk.Structs.PaperSize | |
ManagedPtrNewtype PaperSize Source # | |
Defined in GI.Gtk.Structs.PaperSize toManagedPtr :: PaperSize -> ManagedPtr PaperSize | |
TypedObject PaperSize Source # | |
Defined in GI.Gtk.Structs.PaperSize | |
HasParentTypes PaperSize Source # | |
Defined in GI.Gtk.Structs.PaperSize | |
IsGValue (Maybe PaperSize) Source # | Convert |
Defined in GI.Gtk.Structs.PaperSize gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe PaperSize -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe PaperSize) | |
type ParentTypes PaperSize Source # | |
Defined in GI.Gtk.Structs.PaperSize |
Methods
Click to display all available methods, including inherited ones
Methods
copy, free, isCustom, isEqual, isIpp, toGvariant, toKeyFile.
Getters
getDefaultBottomMargin, getDefaultLeftMargin, getDefaultRightMargin, getDefaultTopMargin, getDisplayName, getHeight, getName, getPpdName, getWidth.
Setters
copy
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m PaperSize | Returns: a copy of |
Copies an existing GtkPaperSize
.
free
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m () |
Free the given GtkPaperSize
object.
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.
getDefaultBottomMargin
paperSizeGetDefaultBottomMargin Source #
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the default bottom margin |
Gets the default bottom margin for the GtkPaperSize
.
getDefaultLeftMargin
paperSizeGetDefaultLeftMargin Source #
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the default left margin |
Gets the default left margin for the GtkPaperSize
.
getDefaultRightMargin
paperSizeGetDefaultRightMargin Source #
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the default right margin |
Gets the default right margin for the GtkPaperSize
.
getDefaultTopMargin
paperSizeGetDefaultTopMargin Source #
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the default top margin |
Gets the default top margin for the GtkPaperSize
.
getDisplayName
paperSizeGetDisplayName Source #
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m Text | Returns: the human-readable name of |
Gets the human-readable name of the GtkPaperSize
.
getHeight
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the paper height |
Gets the paper height of the GtkPaperSize
, in
units of unit
.
getName
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m Text | Returns: the name of |
Gets the name of the GtkPaperSize
.
getPaperSizes
paperSizeGetPaperSizes Source #
:: (HasCallStack, MonadIO m) | |
=> Bool |
|
-> m [PaperSize] | Returns: a newly allocated list of newly
allocated |
Creates a list of known paper sizes.
getPpdName
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m Text | Returns: the PPD name of |
Gets the PPD name of the GtkPaperSize
, which
may be Nothing
.
getWidth
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Unit |
|
-> m Double | Returns: the paper width |
Gets the paper width of the GtkPaperSize
, in
units of unit
.
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 GtkPaperSize
objects.
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 GtkPaperSize
object by parsing a
PWG 5101.1-2002
paper name.
If name
is Nothing
, the default paper size is returned,
see [funcgtk
.PaperSize.get_default].
newCustom
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Text |
|
-> Double |
|
-> Double |
|
-> Unit |
|
-> m PaperSize | Returns: a new |
Creates a new GtkPaperSize
object with the
given parameters.
newFromGvariant
paperSizeNewFromGvariant Source #
:: (HasCallStack, MonadIO m) | |
=> GVariant |
|
-> m PaperSize | Returns: a new |
Deserialize a paper size from a GVariant
.
The `GVariant must be in the format produced by
paperSizeToGvariant
.
newFromIpp
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Double |
|
-> Double |
|
-> m PaperSize | Returns: a new |
Creates a new GtkPaperSize
object by using
IPP information.
If ippName
is not a recognized paper name,
width
and height
are used to
construct a custom GtkPaperSize
object.
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
.
newFromPpd
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Text |
|
-> Double |
|
-> Double |
|
-> m PaperSize | Returns: a new |
Creates a new GtkPaperSize
object by using
PPD information.
If ppdName
is not a recognized PPD paper name,
ppdDisplayName
, width
and height
are used to
construct a custom GtkPaperSize
object.
setSize
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> Double |
|
-> Double |
|
-> Unit |
|
-> m () |
Changes the dimensions of a size
to width
x height
.
toGvariant
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> m GVariant | Returns: a new, floating, |
Serialize a paper size to an a{sv}
variant.
toKeyFile
:: (HasCallStack, MonadIO m) | |
=> PaperSize |
|
-> KeyFile |
|
-> Text |
|
-> m () |
This function adds the paper size from size
to keyFile
.