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 #GtkPaperSize 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 #GtkPaperSize 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 #GtkPaperSize object with the given parameters.

this
this(Variant variant)

Deserialize a paper size from an a{sv} variant in the format produced by gtk_paper_size_to_gvariant().

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

Creates a new #GtkPaperSize 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 #GtkPaperSize object by using PPD information.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

copy
PaperSize copy()

Copies an existing #GtkPaperSize.

free
void free()

Free the given #GtkPaperSize object.

getDefaultBottomMargin
double getDefaultBottomMargin(GtkUnit unit)

Gets the default bottom margin for the #GtkPaperSize.

getDefaultLeftMargin
double getDefaultLeftMargin(GtkUnit unit)

Gets the default left margin for the #GtkPaperSize.

getDefaultRightMargin
double getDefaultRightMargin(GtkUnit unit)

Gets the default right margin for the #GtkPaperSize.

getDefaultTopMargin
double getDefaultTopMargin(GtkUnit unit)

Gets the default top margin for the #GtkPaperSize.

getDisplayName
string getDisplayName()

Gets the human-readable name of the #GtkPaperSize.

getHeight
double getHeight(GtkUnit unit)

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

getName
string getName()

Gets the name of the #GtkPaperSize.

getPaperSizeStruct
GtkPaperSize* getPaperSizeStruct(bool transferOwnership)

Get the main Gtk struct

getPpdName
string getPpdName()

Gets the PPD name of the #GtkPaperSize, 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 #GtkPaperSize, in units of @unit.

isCustom
bool isCustom()

Returns %TRUE if @size is not a standard paper size.

isEqual
bool isEqual(PaperSize size2)

Compares two #GtkPaperSize 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

ownedRef
bool ownedRef;
Undocumented in source.

Meta