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.

Printing support has been added in GTK+ 2.10.

Constructors

this
this(GtkPaperSize* gtkPaperSize)

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. If name is NULL, the default paper size is returned, see gtk_paper_size_get_default(). Since 2.10

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

Creates a new GtkPaperSize object by using PPD information. If ppd_name is not a recognized PPD paper name, ppd_display_name, width and height are used to construct a custom GtkPaperSize object. Since 2.10

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

Creates a new GtkPaperSize object with the given parameters. Since 2.10

this
this(KeyFile keyFile, string groupName)

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

Members

Functions

copy
PaperSize copy()

Copies an existing GtkPaperSize. Since 2.10

free
void free()

Free the given GtkPaperSize object. Since 2.10

getDefaultBottomMargin
double getDefaultBottomMargin(GtkUnit unit)

Gets the default bottom margin for the GtkPaperSize. Since 2.10

getDefaultLeftMargin
double getDefaultLeftMargin(GtkUnit unit)

Gets the default left margin for the GtkPaperSize. Since 2.10

getDefaultRightMargin
double getDefaultRightMargin(GtkUnit unit)

Gets the default right margin for the GtkPaperSize. Since 2.10

getDefaultTopMargin
double getDefaultTopMargin(GtkUnit unit)

Gets the default top margin for the GtkPaperSize. Since 2.10

getDisplayName
string getDisplayName()

Gets the human-readable name of the GtkPaperSize. Since 2.10

getHeight
double getHeight(GtkUnit unit)

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

getName
string getName()

Gets the name of the GtkPaperSize. Since 2.10

getPaperSizeStruct
GtkPaperSize* getPaperSizeStruct()
Undocumented in source. Be warned that the author may not have intended to support it.
getPpdName
string getPpdName()

Gets the PPD name of the GtkPaperSize, which may be NULL. Since 2.10

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. Since 2.10

isCustom
int isCustom()

Returns TRUE if size is not a standard paper size.

isEqual
int isEqual(PaperSize size2)

Compares two GtkPaperSize objects. Since 2.10

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

Changes the dimensions of a size to width x height. Since 2.10

toKeyFile
void toKeyFile(KeyFile keyFile, string groupName)

This function adds the paper size from size to key_file. Since 2.12

Static functions

getDefault
string getDefault()

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

getPaperSizes
ListG getPaperSizes(int includeCustom)

Creates a list of known paper sizes. Since 2.12

Variables

gtkPaperSize
GtkPaperSize* gtkPaperSize;

the main Gtk struct

Inherited Members

From Boxed

boxedCopy
void* boxedCopy(GType boxedType, void* srcBoxed)

Provide a copy of a boxed structure src_boxed which is of type boxed_type.

boxedFree
void boxedFree(GType boxedType, void* boxed)

Free the boxed structure boxed which is of type boxed_type.

boxedTypeRegisterStatic
GType boxedTypeRegisterStatic(string name, GBoxedCopyFunc boxedCopy, GBoxedFreeFunc boxedFree)

This function creates a new G_TYPE_BOXED derived type id for a new boxed type with name name. Boxed type handling functions have to be provided to copy and free opaque boxed structures of this type.

pointerTypeRegisterStatic
GType pointerTypeRegisterStatic(string name)

Creates a new G_TYPE_POINTER derived type id for a new pointer type with name name.

Meta