gi-gtk-4.0.8: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Structs.PaperSize

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 GtkPaperSize object stores not only the dimensions (width and height) of a paper size and its name, it also provides default print margins.

Synopsis

Exported types

newtype PaperSize Source #

Memory-managed wrapper type.

Constructors

PaperSize (ManagedPtr PaperSize) 

Instances

Instances details
Eq PaperSize Source # 
Instance details

Defined in GI.Gtk.Structs.PaperSize

GBoxed PaperSize Source # 
Instance details

Defined in GI.Gtk.Structs.PaperSize

ManagedPtrNewtype PaperSize Source # 
Instance details

Defined in GI.Gtk.Structs.PaperSize

Methods

toManagedPtr :: PaperSize -> ManagedPtr PaperSize

TypedObject PaperSize Source # 
Instance details

Defined in GI.Gtk.Structs.PaperSize

Methods

glibType :: IO GType

HasParentTypes PaperSize Source # 
Instance details

Defined in GI.Gtk.Structs.PaperSize

IsGValue (Maybe PaperSize) Source #

Convert PaperSize to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Structs.PaperSize

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe PaperSize -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe PaperSize)

type ParentTypes PaperSize Source # 
Instance details

Defined in GI.Gtk.Structs.PaperSize

type ParentTypes PaperSize = '[] :: [Type]

Methods

copy

paperSizeCopy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

other: a GtkPaperSize

-> m PaperSize

Returns: a copy of other

Copies an existing GtkPaperSize.

free

paperSizeFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a GtkPaperSize

-> m () 

Free the given GtkPaperSize object.

getDefault

paperSizeGetDefault Source #

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.

getDefaultBottomMargin

paperSizeGetDefaultBottomMargin Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a GtkPaperSize object

-> Unit

unit: the unit for the return value, not UnitNone

-> m Double

Returns: the default bottom margin

Gets the default bottom margin for the GtkPaperSize.

getDefaultLeftMargin

paperSizeGetDefaultLeftMargin Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a GtkPaperSize object

-> Unit

unit: the unit for the return value, not UnitNone

-> m Double

Returns: the default left margin

Gets the default left margin for the GtkPaperSize.

getDefaultRightMargin

paperSizeGetDefaultRightMargin Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a GtkPaperSize object

-> Unit

unit: the unit for the return value, not UnitNone

-> m Double

Returns: the default right margin

Gets the default right margin for the GtkPaperSize.

getDefaultTopMargin

paperSizeGetDefaultTopMargin Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a GtkPaperSize object

-> Unit

unit: the unit for the return value, not UnitNone

-> m Double

Returns: the default top margin

Gets the default top margin for the GtkPaperSize.

getDisplayName

paperSizeGetDisplayName Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a GtkPaperSize object

-> m Text

Returns: the human-readable name of size

Gets the human-readable name of the GtkPaperSize.

getHeight

paperSizeGetHeight Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a GtkPaperSize object

-> Unit

unit: the unit for the return value, not UnitNone

-> m Double

Returns: the paper height

Gets the paper height of the GtkPaperSize, in units of unit.

getName

paperSizeGetName Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a GtkPaperSize object

-> m Text

Returns: the name of size

Gets the name of the GtkPaperSize.

getPaperSizes

paperSizeGetPaperSizes Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Bool

includeCustom: whether to include custom paper sizes as defined in the page setup dialog

-> m [PaperSize]

Returns: a newly allocated list of newly allocated GtkPaperSize objects

Creates a list of known paper sizes.

getPpdName

paperSizeGetPpdName Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a GtkPaperSize object

-> m Text

Returns: the PPD name of size

Gets the PPD name of the GtkPaperSize, which may be Nothing.

getWidth

paperSizeGetWidth Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a GtkPaperSize object

-> Unit

unit: the unit for the return value, not UnitNone

-> m Double

Returns: the paper width

Gets the paper width of the GtkPaperSize, in units of unit.

isCustom

paperSizeIsCustom Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a GtkPaperSize object

-> m Bool

Returns: whether size is a custom paper size.

Returns True if size is not a standard paper size.

isEqual

paperSizeIsEqual Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size1: a GtkPaperSize object

-> PaperSize

size2: another GtkPaperSize object

-> m Bool

Returns: True, if size1 and size2 represent the same paper size

Compares two GtkPaperSize objects.

isIpp

paperSizeIsIpp Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a GtkPaperSize object

-> m Bool

Returns: whether size is not an IPP custom paper size.

Returns True if size is an IPP standard paper size.

new

paperSizeNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe Text

name: a paper size name

-> m PaperSize

Returns: a new GtkPaperSize, use paperSizeFree to free it

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

paperSizeNewCustom Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

name: the paper name

-> Text

displayName: the human-readable name

-> Double

width: the paper width, in units of unit

-> Double

height: the paper height, in units of unit

-> Unit

unit: the unit for width and height. not UnitNone.

-> m PaperSize

Returns: a new GtkPaperSize object, use paperSizeFree to free it

Creates a new GtkPaperSize object with the given parameters.

newFromGvariant

paperSizeNewFromGvariant Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GVariant

variant: an a{sv} GVariant

-> m PaperSize

Returns: a new GtkPaperSize object

Deserialize a paper size from a GVariant.

The `GVariant must be in the format produced by paperSizeToGvariant.

newFromIpp

paperSizeNewFromIpp Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

ippName: an IPP paper name

-> Double

width: the paper width, in points

-> Double

height: the paper height in points

-> m PaperSize

Returns: a new GtkPaperSize, use paperSizeFree to free it

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 #

Arguments

:: (HasCallStack, MonadIO m) 
=> KeyFile

keyFile: the GKeyFile to retrieve the papersize from

-> Maybe Text

groupName: the name of the group in the key file to read, or Nothing to read the first group

-> m PaperSize

Returns: a new GtkPaperSize object with the restored paper size (Can throw GError)

Reads a paper size from the group groupName in the key file keyFile.

newFromPpd

paperSizeNewFromPpd Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

ppdName: a PPD paper name

-> Text

ppdDisplayName: the corresponding human-readable name

-> Double

width: the paper width, in points

-> Double

height: the paper height in points

-> m PaperSize

Returns: a new GtkPaperSize, use paperSizeFree to free it

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

paperSizeSetSize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a custom GtkPaperSize object

-> Double

width: the new width in units of unit

-> Double

height: the new height in units of unit

-> Unit

unit: the unit for width and height

-> m () 

Changes the dimensions of a size to width x height.

toGvariant

paperSizeToGvariant Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

paperSize: a GtkPaperSize

-> m GVariant

Returns: a new, floating, GVariant

Serialize a paper size to an a{sv} variant.

toKeyFile

paperSizeToKeyFile Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a GtkPaperSize

-> KeyFile

keyFile: the GKeyFile to save the paper size to

-> Text

groupName: the group to add the settings to in keyFile

-> m () 

This function adds the paper size from size to keyFile.