3.11 <GtkPaperSize>

Structure: <GtkPaperSize>

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

Procedures

Method: paper-size:copy self ⇒ %return
Method: copy self ⇒ %return

Copies an existing <GtkPaperSize>.

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize>

%return

Returned: a <GtkPaperSize>.

a copy of self

Method: paper-size:free self
Method: free self

Free the given <GtkPaperSize> object.

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize>

Procedure: paper-size:get-default ⇒ %return

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

%return

Returned: a string.

the name of the default paper size. The string is owned by GTK and should not be modified.

Method: paper-size:get-default-bottom-margin self unit ⇒ %return
Method: get-default-bottom-margin self unit ⇒ %return

Gets the default bottom margin for the <GtkPaperSize>.

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize> object

unit

Passed: a <GtkUnit>, or one of its symbols.

the unit for the return value, not none

%return

Returned: a real number.

the default bottom margin

Method: paper-size:get-default-left-margin self unit ⇒ %return
Method: get-default-left-margin self unit ⇒ %return

Gets the default left margin for the <GtkPaperSize>.

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize> object

unit

Passed: a <GtkUnit>, or one of its symbols.

the unit for the return value, not none

%return

Returned: a real number.

the default left margin

Method: paper-size:get-default-right-margin self unit ⇒ %return
Method: get-default-right-margin self unit ⇒ %return

Gets the default right margin for the <GtkPaperSize>.

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize> object

unit

Passed: a <GtkUnit>, or one of its symbols.

the unit for the return value, not none

%return

Returned: a real number.

the default right margin

Method: paper-size:get-default-top-margin self unit ⇒ %return
Method: get-default-top-margin self unit ⇒ %return

Gets the default top margin for the <GtkPaperSize>.

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize> object

unit

Passed: a <GtkUnit>, or one of its symbols.

the unit for the return value, not none

%return

Returned: a real number.

the default top margin

Method: paper-size:get-display-name self ⇒ %return
Method: get-display-name self ⇒ %return

Gets the human-readable name of the <GtkPaperSize>.

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize> object

%return

Returned: a string.

the human-readable name of self

Method: paper-size:get-height self unit ⇒ %return
Method: get-height self unit ⇒ %return

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

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize> object

unit

Passed: a <GtkUnit>, or one of its symbols.

the unit for the return value, not none

%return

Returned: a real number.

the paper height

Method: paper-size:get-name self ⇒ %return
Method: get-name self ⇒ %return

Gets the name of the <GtkPaperSize>.

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize> object

%return

Returned: a string.

the name of self

Procedure: paper-size:get-paper-sizes include-custom ⇒ %return

Creates a list of known paper sizes.

include-custom

Passed: a boolean.

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

%return

Returned: a list, each a <GtkPaperSize>.

a newly allocated list of newly allocated <GtkPaperSize> objects

Method: paper-size:get-ppd-name self ⇒ %return
Method: get-ppd-name self ⇒ %return

Gets the PPD name of the <GtkPaperSize>, which may be #f.

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize> object

%return

Returned: a string.

the PPD name of self

Method: paper-size:get-width self unit ⇒ %return
Method: get-width self unit ⇒ %return

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

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize> object

unit

Passed: a <GtkUnit>, or one of its symbols.

the unit for the return value, not none

%return

Returned: a real number.

the paper width

Method: paper-size:is-custom? self ⇒ %return
Method: is-custom? self ⇒ %return

Returns #t if self is not a standard paper size.

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize> object

%return

Returned: a boolean.

whether self is a custom paper size.

Method: paper-size:is-equal? self size2 ⇒ %return
Method: is-equal? self size2 ⇒ %return

Compares two <GtkPaperSize> objects.

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize> object

size2

Passed: a <GtkPaperSize>.

another <GtkPaperSize> object

%return

Returned: a boolean.

#t, if self and size2 represent the same paper size

Method: paper-size:is-ipp? self ⇒ %return
Method: is-ipp? self ⇒ %return

Returns #t if self is an IPP standard paper size.

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize> object

%return

Returned: a boolean.

whether self is not an IPP custom paper size.

Procedure: paper-size:new [name] ⇒ %return

Creates a new <GtkPaperSize> object by parsing a PWG 5101.1-2002 paper name.

If name is #f, the default paper size is returned, see paper-size:get-default.

name

Passed, or left out: a string, or #f.

a paper size name

%return

Returned: a <GtkPaperSize>.

a new <GtkPaperSize>, use paper-size:free to free it

Procedure: paper-size:new-custom name display-name width height unit ⇒ %return

Creates a new <GtkPaperSize> object with the given parameters.

name

Passed: a string.

the paper name

display-name

Passed: a string.

the human-readable name

width

Passed: a real number.

the paper width, in units of unit

height

Passed: a real number.

the paper height, in units of unit

unit

Passed: a <GtkUnit>, or one of its symbols.

the unit for width and height. not none.

%return

Returned: a <GtkPaperSize>.

a new <GtkPaperSize> object, use paper-size:free to free it

Procedure: paper-size:new-from-gvariant variant ⇒ %return

Deserialize a paper size from a <GVariant>.

The ‘GVariant must be in the format produced by paper-size:to-gvariant.

variant

Passed: a <GVariant>.

an a{sv} <GVariant>

%return

Returned: a <GtkPaperSize>.

a new <GtkPaperSize> object

Procedure: paper-size:new-from-ipp ipp-name width height ⇒ %return

Creates a new <GtkPaperSize> object by using IPP information.

If ipp-name is not a recognized paper name, width and height are used to construct a custom <GtkPaperSize> object.

ipp-name

Passed: a string.

an IPP paper name

width

Passed: a real number.

the paper width, in points

height

Passed: a real number.

the paper height in points

%return

Returned: a <GtkPaperSize>.

a new <GtkPaperSize>, use paper-size:free to free it

Procedure: paper-size:new-from-key-file key-file [group-name] ⇒ %return

Reads a paper size from the group group-name in the key file key-file.

key-file

Passed: a <GKeyFile>.

the <GKeyFile> to retrieve the papersize from

group-name

Passed, or left out: a string, or #f.

the name of the group in the key file to read, or #f to read the first group

%return

Returned: a <GtkPaperSize>.

a new <GtkPaperSize> object with the restored paper size

Procedure: paper-size:new-from-ppd ppd-name ppd-display-name width height ⇒ %return

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.

ppd-name

Passed: a string.

a PPD paper name

ppd-display-name

Passed: a string.

the corresponding human-readable name

width

Passed: a real number.

the paper width, in points

height

Passed: a real number.

the paper height in points

%return

Returned: a <GtkPaperSize>.

a new <GtkPaperSize>, use paper-size:free to free it

Method: paper-size:set-size self width height unit
Method: set-size self width height unit

Changes the dimensions of a self to width x height.

self

Passed: a <GtkPaperSize>.

a custom <GtkPaperSize> object

width

Passed: a real number.

the new width in units of unit

height

Passed: a real number.

the new height in units of unit

unit

Passed: a <GtkUnit>, or one of its symbols.

the unit for width and height

Method: paper-size:to-gvariant self ⇒ %return
Method: to-gvariant self ⇒ %return

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

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize>

%return

Returned: a <GVariant>.

a new, floating, <GVariant>

Method: paper-size:to-key-file self key-file group-name
Method: to-key-file self key-file group-name

This function adds the paper size from self to key-file.

self

Passed: a <GtkPaperSize>.

a <GtkPaperSize>

key-file

Passed: a <GKeyFile>.

the <GKeyFile> to save the paper size to

group-name

Passed: a string.

the group to add the settings to in key-file