Next: , Previous: GtkPrintContext, Up: Top


111 GtkPrintSettings

Stores print settings

111.1 Overview

A GtkPrintSettings object represents the settings of a print dialog in a system-independent way. The main use for this object is that once you've printed you can get a settings object that represents the settings the user chose, and the next time you print you can pass that object in so that the user doesn't have to re-set all his settings.

Its also possible to enumerate the settings so that you can easily save the settings for the next time your app runs, or even store them in a document. The predefined keys try to use shared values as much as possible so that moving such a document between systems still works.

Printing support was added in GTK+ 2.10.

111.2 Usage

— Class: <gtk-print-settings>

Derives from <gobject>.

This class defines no direct slots.

— Function: gtk-print-settings-new ⇒  (ret <gtk-print-settings>)

Creates a new <gtk-print-settings> object.

ret
a new <gtk-print-settings> object

Since 2.10

— Function: gtk-print-settings-has-key (self <gtk-print-settings>) (key mchars) ⇒  (ret bool)
— Method: has-key

Returns ‘#t’, if a value is associated with key.

settings
a <gtk-print-settings>
key
a key
ret
#t’, if key has a value

Since 2.10

— Function: gtk-print-settings-get (self <gtk-print-settings>) (key mchars) ⇒  (ret mchars)
— Method: get

Looks up the string value associated with key.

settings
a <gtk-print-settings>
key
a key
ret
the string value for key

Since 2.10

— Function: gtk-print-settings-set (self <gtk-print-settings>) (key mchars) (value mchars)
— Method: set

Associates value with key.

settings
a <gtk-print-settings>
key
a key
value
a string value, or ‘#f

Since 2.10

— Function: gtk-print-settings-unset (self <gtk-print-settings>) (key mchars)
— Method: unset

Removes any value associated with key. This has the same effect as setting the value to ‘#f’.

settings
a <gtk-print-settings>
key
a key

Since 2.10

— Function: gtk-print-settings-get-bool (self <gtk-print-settings>) (key mchars) ⇒  (ret bool)
— Method: get-bool

Returns the boolean represented by the value that is associated with key.

The string "true" represents ‘#t’, any other string ‘#f’.

settings
a <gtk-print-settings>
key
a key
ret
#t’, if key maps to a true value.

Since 2.10

— Function: gtk-print-settings-set-bool (self <gtk-print-settings>) (key mchars) (value bool)
— Method: set-bool

Sets key to a boolean value.

settings
a <gtk-print-settings>
key
a key
value
a boolean

Since 2.10

— Function: gtk-print-settings-get-double (self <gtk-print-settings>) (key mchars) ⇒  (ret double)
— Method: get-double

Returns the double value associated with key, or 0.

settings
a <gtk-print-settings>
key
a key
ret
the double value of key

Since 2.10

— Function: gtk-print-settings-set-double (self <gtk-print-settings>) (key mchars) (value double)
— Method: set-double

Sets key to a double value.

settings
a <gtk-print-settings>
key
a key
value
a double value

Since 2.10

— Function: gtk-print-settings-get-length (self <gtk-print-settings>) (key mchars) (unit <gtk-unit>) ⇒  (ret double)
— Method: get-length

Returns the value associated with key, interpreted as a length. The returned value is converted to units.

settings
a <gtk-print-settings>
key
a key
unit
the unit of the return value
ret
the length value of key, converted to unit

Since 2.10

— Function: gtk-print-settings-set-length (self <gtk-print-settings>) (key mchars) (value double) (unit <gtk-unit>)
— Method: set-length

Associates a length in units of unit with key.

settings
a <gtk-print-settings>
key
a key
value
a length
unit
the unit of length

Since 2.10

— Function: gtk-print-settings-get-int (self <gtk-print-settings>) (key mchars) ⇒  (ret int)
— Method: get-int

Returns the integer value of key, or 0.

settings
a <gtk-print-settings>
key
a key
ret
the integer value of key

Since 2.10

— Function: gtk-print-settings-set-int (self <gtk-print-settings>) (key mchars) (value int)
— Method: set-int

Sets key to an integer value.

settings
a <gtk-print-settings>
key
a key
value
an integer

Since 2.10

— Function: gtk-print-settings-get-printer (self <gtk-print-settings>) ⇒  (ret mchars)
— Method: get-printer

Convenience function to obtain the value of ‘GTK_PRINT_SETTINGS_PRINTER’.

settings
a <gtk-print-settings>
ret
the printer name

Since 2.10

— Function: gtk-print-settings-set-printer (self <gtk-print-settings>) (printer mchars)
— Method: set-printer

Convenience function to set ‘GTK_PRINT_SETTINGS_PRINTER’ to printer.

settings
a <gtk-print-settings>
printer
the printer name

Since 2.10

— Function: gtk-print-settings-get-orientation (self <gtk-print-settings>) ⇒  (ret <gtk-page-orientation>)
— Method: get-orientation

Get the value of ‘GTK_PRINT_SETTINGS_ORIENTATION’, converted to a <gtk-page-orientation>.

settings
a <gtk-print-settings>
ret
the orientation

Since 2.10

— Function: gtk-print-settings-set-orientation (self <gtk-print-settings>) (orientation <gtk-page-orientation>)
— Method: set-orientation

Sets the value of ‘GTK_PRINT_SETTINGS_ORIENTATION’.

settings
a <gtk-print-settings>
orientation
a page orientation

Since 2.10

— Function: gtk-print-settings-get-paper-size (self <gtk-print-settings>) ⇒  (ret <gtk-paper-size>)
— Method: get-paper-size

Gets the value of ‘GTK_PRINT_SETTINGS_PAPER_FORMAT’, converted to a <gtk-paper-size>.

settings
a <gtk-print-settings>
ret
the paper size

Since 2.10

— Function: gtk-print-settings-set-paper-size (self <gtk-print-settings>) (paper_size <gtk-paper-size>)
— Method: set-paper-size

Sets the value of ‘GTK_PRINT_SETTINGS_PAPER_FORMAT’, ‘GTK_PRINT_SETTINGS_PAPER_WIDTH’ and ‘GTK_PRINT_SETTINGS_PAPER_HEIGHT’.

settings
a <gtk-print-settings>
paper-size
a paper size

Since 2.10

— Function: gtk-print-settings-get-paper-width (self <gtk-print-settings>) (unit <gtk-unit>) ⇒  (ret double)
— Method: get-paper-width

Gets the value of ‘GTK_PRINT_SETTINGS_PAPER_WIDTH’, converted to unit.

settings
a <gtk-print-settings>
unit
the unit for the return value
ret
the paper width, in units of unit

Since 2.10

— Function: gtk-print-settings-set-paper-width (self <gtk-print-settings>) (width double) (unit <gtk-unit>)
— Method: set-paper-width

Sets the value of ‘GTK_PRINT_SETTINGS_PAPER_WIDTH’.

settings
a <gtk-print-settings>
width
the paper width
unit
the units of width

Since 2.10

— Function: gtk-print-settings-get-paper-height (self <gtk-print-settings>) (unit <gtk-unit>) ⇒  (ret double)
— Method: get-paper-height

Gets the value of ‘GTK_PRINT_SETTINGS_PAPER_HEIGHT’, converted to unit.

settings
a <gtk-print-settings>
unit
the unit for the return value
ret
the paper height, in units of unit

Since 2.10

— Function: gtk-print-settings-set-paper-height (self <gtk-print-settings>) (height double) (unit <gtk-unit>)
— Method: set-paper-height

Sets the value of ‘GTK_PRINT_SETTINGS_PAPER_HEIGHT’.

settings
a <gtk-print-settings>
height
the paper height
unit
the units of height

Since 2.10

— Function: gtk-print-settings-get-use-color (self <gtk-print-settings>) ⇒  (ret bool)
— Method: get-use-color

Gets the value of ‘GTK_PRINT_SETTINGS_USE_COLOR’.

settings
a <gtk-print-settings>
ret
whether to use color

Since 2.10

— Function: gtk-print-settings-set-use-color (self <gtk-print-settings>) (use_color bool)
— Method: set-use-color

Sets the value of ‘GTK_PRINT_SETTINGS_USE_COLOR’.

settings
a <gtk-print-settings>
use-color
whether to use color

Since 2.10

— Function: gtk-print-settings-get-collate (self <gtk-print-settings>) ⇒  (ret bool)
— Method: get-collate

Gets the value of ‘GTK_PRINT_SETTINGS_COLLATE’.

settings
a <gtk-print-settings>
ret
whether to collate the printed pages

Since 2.10

— Function: gtk-print-settings-set-collate (self <gtk-print-settings>) (collate bool)
— Method: set-collate

Sets the value of ‘GTK_PRINT_SETTINGS_COLLATE’.

settings
a <gtk-print-settings>
collate
whether to collate the output

Since 2.10

— Function: gtk-print-settings-get-reverse (self <gtk-print-settings>) ⇒  (ret bool)
— Method: get-reverse

Gets the value of ‘GTK_PRINT_SETTINGS_REVERSE’.

settings
a <gtk-print-settings>
ret
whether to reverse the order of the printed pages

Since 2.10

— Function: gtk-print-settings-set-reverse (self <gtk-print-settings>) (reverse bool)
— Method: set-reverse

Sets the value of ‘GTK_PRINT_SETTINGS_REVERSE’.

settings
a <gtk-print-settings>
reverse
whether to reverse the output

Since 2.10

— Function: gtk-print-settings-get-duplex (self <gtk-print-settings>) ⇒  (ret <gtk-print-duplex>)
— Method: get-duplex

Gets the value of ‘GTK_PRINT_SETTINGS_DUPLEX’.

settings
a <gtk-print-settings>
ret
whether to print the output in duplex.

Since 2.10

— Function: gtk-print-settings-set-duplex (self <gtk-print-settings>) (duplex <gtk-print-duplex>)
— Method: set-duplex

Sets the value of ‘GTK_PRINT_SETTINGS_DUPLEX’.

settings
a <gtk-print-settings>
duplex
a <gtk-print-duplex> value

Since 2.10

— Function: gtk-print-settings-get-quality (self <gtk-print-settings>) ⇒  (ret <gtk-print-quality>)
— Method: get-quality

Gets the value of ‘GTK_PRINT_SETTINGS_QUALITY’.

settings
a <gtk-print-settings>
ret
the print quality

Since 2.10

— Function: gtk-print-settings-set-quality (self <gtk-print-settings>) (quality <gtk-print-quality>)
— Method: set-quality

Sets the value of ‘GTK_PRINT_SETTINGS_QUALITY’.

settings
a <gtk-print-settings>
quality
a <gtk-print-quality> value

Since 2.10

— Function: gtk-print-settings-get-n-copies (self <gtk-print-settings>) ⇒  (ret int)
— Method: get-n-copies

Gets the value of ‘GTK_PRINT_SETTINGS_N_COPIES’.

settings
a <gtk-print-settings>
ret
the number of copies to print

Since 2.10

— Function: gtk-print-settings-set-n-copies (self <gtk-print-settings>) (num_copies int)
— Method: set-n-copies

Sets the value of ‘GTK_PRINT_SETTINGS_N_COPIES’.

settings
a <gtk-print-settings>
num-copies
the number of copies

Since 2.10

— Function: gtk-print-settings-get-number-up (self <gtk-print-settings>) ⇒  (ret int)
— Method: get-number-up

Gets the value of ‘GTK_PRINT_SETTINGS_NUMBER_UP’.

settings
a <gtk-print-settings>
ret
the number of pages per sheet

Since 2.10

— Function: gtk-print-settings-set-number-up (self <gtk-print-settings>) (number_up int)
— Method: set-number-up

Sets the value of ‘GTK_PRINT_SETTINGS_NUMBER_UP’.

settings
a <gtk-print-settings>
number-up
the number of pages per sheet

Since 2.10

— Function: gtk-print-settings-get-resolution (self <gtk-print-settings>) ⇒  (ret int)
— Method: get-resolution

Gets the value of ‘GTK_PRINT_SETTINGS_RESOLUTION’.

settings
a <gtk-print-settings>
ret
the resolution in dpi

Since 2.10

— Function: gtk-print-settings-set-resolution (self <gtk-print-settings>) (resolution int)
— Method: set-resolution

Sets the value of ‘GTK_PRINT_SETTINGS_RESOLUTION’.

settings
a <gtk-print-settings>
resolution
the resolution in dpi

Since 2.10

— Function: gtk-print-settings-get-scale (self <gtk-print-settings>) ⇒  (ret double)
— Method: get-scale

Gets the value of ‘GTK_PRINT_SETTINGS_SCALE’.

settings
a <gtk-print-settings>
ret
the scale in percent

Since 2.10

— Function: gtk-print-settings-set-scale (self <gtk-print-settings>) (scale double)
— Method: set-scale

Sets the value of ‘GTK_PRINT_SETTINGS_SCALE’.

settings
a <gtk-print-settings>
scale
the scale in percent

Since 2.10

— Function: gtk-print-settings-get-page-set (self <gtk-print-settings>) ⇒  (ret <gtk-page-set>)
— Method: get-page-set

Gets the value of ‘GTK_PRINT_SETTINGS_PAGE_SET’.

settings
a <gtk-print-settings>
ret
the set of pages to print

Since 2.10

— Function: gtk-print-settings-set-page-set (self <gtk-print-settings>) (page_set <gtk-page-set>)
— Method: set-page-set

Sets the value of ‘GTK_PRINT_SETTINGS_PAGE_SET’.

settings
a <gtk-print-settings>
page-set
a <gtk-page-set> value

Since 2.10

— Function: gtk-print-settings-get-media-type (self <gtk-print-settings>) ⇒  (ret mchars)
— Method: get-media-type

Gets the value of ‘GTK_PRINT_SETTINGS_MEDIA_TYPE’.

The set of media types is defined in PWG 5101.1-2002 PWG.

settings
a <gtk-print-settings>
ret
the media type

Since 2.10

— Function: gtk-print-settings-set-media-type (self <gtk-print-settings>) (media_type mchars)
— Method: set-media-type

Sets the value of ‘GTK_PRINT_SETTINGS_MEDIA_TYPE’.

The set of media types is defined in PWG 5101.1-2002 PWG.

settings
a <gtk-print-settings>
media-type
the media type

Since 2.10

— Function: gtk-print-settings-get-dither (self <gtk-print-settings>) ⇒  (ret mchars)
— Method: get-dither

Gets the value of ‘GTK_PRINT_SETTINGS_DITHER’.

settings
a <gtk-print-settings>
ret
the dithering that is used

Since 2.10

— Function: gtk-print-settings-set-dither (self <gtk-print-settings>) (dither mchars)
— Method: set-dither

Sets the value of ‘GTK_PRINT_SETTINGS_DITHER’.

settings
a <gtk-print-settings>
dither
the dithering that is used

Since 2.10

— Function: gtk-print-settings-get-finishings (self <gtk-print-settings>) ⇒  (ret mchars)
— Method: get-finishings

Gets the value of ‘GTK_PRINT_SETTINGS_FINISHINGS’.

settings
a <gtk-print-settings>
ret
the finishings

Since 2.10

— Function: gtk-print-settings-set-finishings (self <gtk-print-settings>) (finishings mchars)
— Method: set-finishings

Sets the value of ‘GTK_PRINT_SETTINGS_FINISHINGS’.

settings
a <gtk-print-settings>
finishings
the finishings

Since 2.10

— Function: gtk-print-settings-get-output-bin (self <gtk-print-settings>) ⇒  (ret mchars)
— Method: get-output-bin

Gets the value of ‘GTK_PRINT_SETTINGS_OUTPUT_BIN’.

settings
a <gtk-print-settings>
ret
the output bin

Since 2.10

— Function: gtk-print-settings-set-output-bin (self <gtk-print-settings>) (output_bin mchars)
— Method: set-output-bin

Sets the value of ‘GTK_PRINT_SETTINGS_OUTPUT_BIN’.

settings
a <gtk-print-settings>
output-bin
the output bin

Since 2.10