PaperSize

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 gtk.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.

Constructors

this
this(GtkPaperSize* gtkPaperSize, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(string name)

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

paper name.

this
this(string name, string displayName, double width, double height, GtkUnit unit)

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

this
this(Variant variant)

Deserialize a paper size from an a{sv} variant in the format produced by PaperSize.toGvariant.

this
this(string ippName, double width, double height)

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

this
this(KeyFile keyFile, string groupName)

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

this
this(string ppdName, string ppdDisplayName, double width, double height)

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

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

copy
PaperSize copy()

Copies an existing gtk.PaperSize

free
void free()

Free the given gtk.PaperSize object.

getDefaultBottomMargin
double getDefaultBottomMargin(GtkUnit unit)

Gets the default bottom margin for the gtk.PaperSize

getDefaultLeftMargin
double getDefaultLeftMargin(GtkUnit unit)

Gets the default left margin for the gtk.PaperSize

getDefaultRightMargin
double getDefaultRightMargin(GtkUnit unit)

Gets the default right margin for the gtk.PaperSize

getDefaultTopMargin
double getDefaultTopMargin(GtkUnit unit)

Gets the default top margin for the gtk.PaperSize

getDisplayName
string getDisplayName()

Gets the human-readable name of the gtk.PaperSize

getHeight
double getHeight(GtkUnit unit)

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

getName
string getName()

Gets the name of the gtk.PaperSize

getPaperSizeStruct
GtkPaperSize* getPaperSizeStruct(bool transferOwnership)

Get the main Gtk struct

getPpdName
string getPpdName()

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

getStruct
void* getStruct()

the main Gtk struct as a void*

getWidth
double getWidth(GtkUnit unit)

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

isCustom
bool isCustom()

Returns TRUE if size is not a standard paper size.

isEqual
bool isEqual(PaperSize size2)

Compares two gtk.PaperSize objects.

isIpp
bool isIpp()

Returns TRUE if size is an IPP standard paper size.

setSize
void setSize(double width, double height, GtkUnit unit)

Changes the dimensions of a size to width x height.

toGvariant
Variant toGvariant()

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

toKeyFile
void toKeyFile(KeyFile keyFile, string groupName)

This function adds the paper size from size to key_file.

Static functions

getDefault
string getDefault()

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

getPaperSizes
ListG getPaperSizes(bool includeCustom)

Creates a list of known paper sizes.

getType
GType getType()

Variables

gtkPaperSize
GtkPaperSize* gtkPaperSize;

the main Gtk struct