PaperSize

gtk.paper_size.PaperSize 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, gtk.paper_size.PaperSize allows to construct custom paper sizes with arbitrary dimensions.

The gtk.paper_size.PaperSize object stores not only the dimensions (width and height) of a paper size and its name, it also provides default print margins.

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this(string name)

Creates a new gtk.paper_size.PaperSize object by parsing a PWG 5101.1-2002

paper name.

Members

Functions

cPtr
void* cPtr(Flag!"Dup" dup)
copy
gtk.paper_size.PaperSize copy()

Copies an existing gtk.paper_size.PaperSize.

getDefaultBottomMargin
double getDefaultBottomMargin(gtk.types.Unit unit)

Gets the default bottom margin for the gtk.paper_size.PaperSize.

getDefaultLeftMargin
double getDefaultLeftMargin(gtk.types.Unit unit)

Gets the default left margin for the gtk.paper_size.PaperSize.

getDefaultRightMargin
double getDefaultRightMargin(gtk.types.Unit unit)

Gets the default right margin for the gtk.paper_size.PaperSize.

getDefaultTopMargin
double getDefaultTopMargin(gtk.types.Unit unit)

Gets the default top margin for the gtk.paper_size.PaperSize.

getDisplayName
string getDisplayName()

Gets the human-readable name of the gtk.paper_size.PaperSize.

getHeight
double getHeight(gtk.types.Unit unit)

Gets the paper height of the gtk.paper_size.PaperSize, in units of unit.

getName
string getName()

Gets the name of the gtk.paper_size.PaperSize.

getPpdName
string getPpdName()

Gets the PPD name of the gtk.paper_size.PaperSize, which may be null.

getWidth
double getWidth(gtk.types.Unit unit)

Gets the paper width of the gtk.paper_size.PaperSize, in units of unit.

isCustom
bool isCustom()

Returns true if size is not a standard paper size.

isEqual
bool isEqual(gtk.paper_size.PaperSize size2)

Compares two gtk.paper_size.PaperSize objects.

isIpp
bool isIpp()

Returns true if size is an IPP standard paper size.

self
PaperSize self()

Returns this, for use in with statements.

setSize
void setSize(double width, double height, gtk.types.Unit unit)

Changes the dimensions of a size to width x height.

toGvariant
glib.variant.VariantG toGvariant()

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

toKeyFile
void toKeyFile(glib.key_file.KeyFile keyFile, string groupName)

This function adds the paper size from size to key_file.

Properties

gType
GType gType [@property getter]

Static functions

getDefault
string getDefault()

Returns the name of the default paper size, which depends on the current locale.

getGType
GType getGType()
getPaperSizes
gtk.paper_size.PaperSize[] getPaperSizes(bool includeCustom)

Creates a list of known paper sizes.

newCustom
gtk.paper_size.PaperSize newCustom(string name, string displayName, double width, double height, gtk.types.Unit unit)

Creates a new gtk.paper_size.PaperSize object with the given parameters.

newFromGvariant
gtk.paper_size.PaperSize newFromGvariant(glib.variant.VariantG variant)

Deserialize a paper size from a glib.variant.VariantG.

newFromIpp
gtk.paper_size.PaperSize newFromIpp(string ippName, double width, double height)

Creates a new gtk.paper_size.PaperSize object by using IPP information.

newFromKeyFile
gtk.paper_size.PaperSize newFromKeyFile(glib.key_file.KeyFile keyFile, string groupName)

Reads a paper size from the group group_name in the key file key_file.

newFromPpd
gtk.paper_size.PaperSize newFromPpd(string ppdName, string ppdDisplayName, double width, double height)

Creates a new gtk.paper_size.PaperSize object by using PPD information.

Inherited Members

From Boxed

cInstancePtr
void* cInstancePtr;

Pointer to the C boxed value

getType
GType getType()

Get the GType of this boxed type.

gType
GType gType [@property getter]

Boxed GType property.

self
Boxed self()

Convenience method to return this cast to a type. For use in D with statements.

copy_
void* copy_()

Make a copy of the wrapped C boxed data.

boxedCopy
void* boxedCopy(void* cBoxed)

Copy a C boxed value using g_boxed_copy.

boxedFree
void boxedFree(void* cBoxed)

Free a C boxed value using g_boxed_free.