Package ch.bailu.gtk.gtk
Class PrintSettings
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.PrintSettings
- All Implemented Interfaces:
PointerInterface
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.
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
ConstructorDescriptionCreates a new `GtkPrintSettings` object.PrintSettings
(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Copies a `GtkPrintSettings` object.void
foreach
(PrintSettings.OnPrintSettingsFunc func, Pointer user_data) Calls @func for each key-value pair of @settings.Looks up the string value associated with @key.Looks up the string value associated with @key.boolean
Returns the boolean represented by the value
that is associated with @key.boolean
Returns the boolean represented by the value
that is associated with @key.static ClassHandler
boolean
Gets the value of %GTK_PRINT_SETTINGS_COLLATE.Gets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.Gets the value of %GTK_PRINT_SETTINGS_DITHER.double
Returns the double value associated with @key, or 0.double
Returns the double value associated with @key, or 0.double
getDoubleWithDefault
(Str key, double def) Returns the floating point number represented by
the value that is associated with @key, or @default_val
if the value does not represent a floating point number.double
getDoubleWithDefault
(String key, double def) Returns the floating point number represented by
the value that is associated with @key, or @default_val
if the value does not represent a floating point number.int
Gets the value of %GTK_PRINT_SETTINGS_DUPLEX.Gets the value of %GTK_PRINT_SETTINGS_FINISHINGS.static int
int
Returns the integer value of @key, or 0.int
Returns the integer value of @key, or 0.int
getIntWithDefault
(Str key, int def) Returns the value of @key, interpreted as
an integer, or the default value.int
getIntWithDefault
(String key, int def) Returns the value of @key, interpreted as
an integer, or the default value.double
Returns the value associated with @key, interpreted
as a length.double
Returns the value associated with @key, interpreted
as a length.Gets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.int
Gets the value of %GTK_PRINT_SETTINGS_N_COPIES.int
Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.int
Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.int
Get the value of %GTK_PRINT_SETTINGS_ORIENTATION,
converted to a `GtkPageOrientation`.Gets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.int
Gets the value of %GTK_PRINT_SETTINGS_PAGE_SET.double
getPaperHeight
(int unit) Gets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT,
converted to @unit.Gets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT,
converted to a `GtkPaperSize`.double
getPaperWidth
(int unit) Gets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH,
converted to @unit.static long
static TypeSystem.TypeSize
Convenience function to obtain the value of
%GTK_PRINT_SETTINGS_PRINTER.double
Gets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.int
Gets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.int
Gets the value of %GTK_PRINT_SETTINGS_QUALITY.int
Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION.int
Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_X.int
Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_Y.boolean
Gets the value of %GTK_PRINT_SETTINGS_REVERSE.double
getScale()
Gets the value of %GTK_PRINT_SETTINGS_SCALE.static long
static TypeSystem.TypeSize
boolean
Gets the value of %GTK_PRINT_SETTINGS_USE_COLOR.boolean
Returns %TRUE, if a value is associated with @key.boolean
Returns %TRUE, if a value is associated with @key.boolean
Reads the print settings from @file_name.boolean
Reads the print settings from @file_name.boolean
loadKeyFile
(KeyFile key_file, Str group_name) Reads the print settings from the group @group_name in @key_file.boolean
loadKeyFile
(KeyFile key_file, String group_name) Reads the print settings from the group @group_name in @key_file.static PrintSettings
newFromFilePrintSettings
(Str file_name) Reads the print settings from @file_name.static PrintSettings
newFromFilePrintSettings
(String file_name) Reads the print settings from @file_name.static PrintSettings
newFromGvariantPrintSettings
(Variant variant) Deserialize print settings from an a{sv} variant.static PrintSettings
newFromKeyFilePrintSettings
(KeyFile key_file, Str group_name) Reads the print settings from the group @group_name in @key_file.static PrintSettings
newFromKeyFilePrintSettings
(KeyFile key_file, String group_name) Reads the print settings from the group @group_name in @key_file.void
Associates @value with @key.void
Associates @value with @key.void
Sets @key to a boolean value.void
Sets @key to a boolean value.void
setCollate
(boolean collate) Sets the value of %GTK_PRINT_SETTINGS_COLLATE.void
setDefaultSource
(Str default_source) Sets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.void
setDefaultSource
(String default_source) Sets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.void
Sets the value of %GTK_PRINT_SETTINGS_DITHER.void
Sets the value of %GTK_PRINT_SETTINGS_DITHER.void
Sets @key to a double value.void
Sets @key to a double value.void
setDuplex
(int duplex) Sets the value of %GTK_PRINT_SETTINGS_DUPLEX.void
setFinishings
(Str finishings) Sets the value of %GTK_PRINT_SETTINGS_FINISHINGS.void
setFinishings
(String finishings) Sets the value of %GTK_PRINT_SETTINGS_FINISHINGS.void
Sets @key to an integer value.void
Sets @key to an integer value.void
Associates a length in units of @unit with @key.void
Associates a length in units of @unit with @key.void
setMediaType
(Str media_type) Sets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.void
setMediaType
(String media_type) Sets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.void
setNCopies
(int num_copies) Sets the value of %GTK_PRINT_SETTINGS_N_COPIES.void
setNumberUp
(int number_up) Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.void
setNumberUpLayout
(int number_up_layout) Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.void
setOrientation
(int orientation) Sets the value of %GTK_PRINT_SETTINGS_ORIENTATION.void
setOutputBin
(Str output_bin) Sets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.void
setOutputBin
(String output_bin) Sets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.void
setPageSet
(int page_set) Sets the value of %GTK_PRINT_SETTINGS_PAGE_SET.void
setPaperHeight
(double height, int unit) Sets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT.void
setPaperSize
(PaperSize paper_size) Sets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT,
%GTK_PRINT_SETTINGS_PAPER_WIDTH and
%GTK_PRINT_SETTINGS_PAPER_HEIGHT.void
setPaperWidth
(double width, int unit) Sets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH.void
setPrinter
(Str printer) Convenience function to set %GTK_PRINT_SETTINGS_PRINTER
to @printer.void
setPrinter
(String printer) Convenience function to set %GTK_PRINT_SETTINGS_PRINTER
to @printer.void
setPrinterLpi
(double lpi) Sets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.void
setPrintPages
(int pages) Sets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.void
setQuality
(int quality) Sets the value of %GTK_PRINT_SETTINGS_QUALITY.void
setResolution
(int resolution) Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION,
%GTK_PRINT_SETTINGS_RESOLUTION_X and
%GTK_PRINT_SETTINGS_RESOLUTION_Y.void
setResolutionXy
(int resolution_x, int resolution_y) Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION,
%GTK_PRINT_SETTINGS_RESOLUTION_X and
%GTK_PRINT_SETTINGS_RESOLUTION_Y.void
setReverse
(boolean reverse) Sets the value of %GTK_PRINT_SETTINGS_REVERSE.void
setScale
(double scale) Sets the value of %GTK_PRINT_SETTINGS_SCALE.void
setUseColor
(boolean use_color) Sets the value of %GTK_PRINT_SETTINGS_USE_COLOR.boolean
This function saves the print settings from @settings to @file_name.boolean
This function saves the print settings from @settings to @file_name.Serialize print settings to an a{sv} variant.void
This function adds the print settings from @settings to @key_file.void
This function adds the print settings from @settings to @key_file.void
Removes any value associated with @key.void
Removes any value associated with @key.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
PrintSettings
-
PrintSettings
public PrintSettings()Creates a new `GtkPrintSettings` object.
-
-
Method Details
-
getClassHandler
-
newFromFilePrintSettings
Reads the print settings from @file_name.
Returns a new `GtkPrintSettings` object with the restored settings,
or %NULL if an error occurred. If the file could not be loaded then
error is set to either a `GFileError` or `GKeyFileError`.
See [method@Gtk.PrintSettings.to_file].- Parameters:
file_name
- the filename to read the settings from- Returns:
- the restored `GtkPrintSettings`
- Throws:
AllocationError
-
newFromFilePrintSettings
Reads the print settings from @file_name.
Returns a new `GtkPrintSettings` object with the restored settings,
or %NULL if an error occurred. If the file could not be loaded then
error is set to either a `GFileError` or `GKeyFileError`.
See [method@Gtk.PrintSettings.to_file].- Parameters:
file_name
- the filename to read the settings from- Returns:
- the restored `GtkPrintSettings`
- Throws:
AllocationError
-
newFromGvariantPrintSettings
Deserialize print settings from an a{sv} variant.
The variant must be in the format produced by
[method@Gtk.PrintSettings.to_gvariant].- Parameters:
variant
- an a{sv} `GVariant`- Returns:
- a new `GtkPrintSettings` object
-
newFromKeyFilePrintSettings
public static PrintSettings newFromKeyFilePrintSettings(@Nonnull KeyFile key_file, @Nullable Str group_name) throws AllocationError Reads the print settings from the group @group_name in @key_file.
Returns a new `GtkPrintSettings` object with the restored settings,
or %NULL if an error occurred. If the file could not be loaded then
error is set to either `GFileError` or `GKeyFileError`.- Parameters:
key_file
- the `GKeyFile` to retrieve the settings fromgroup_name
- the name of the group to use, or %NULL to use the default “Print Settings”- Returns:
- the restored `GtkPrintSettings`
- Throws:
AllocationError
-
newFromKeyFilePrintSettings
public static PrintSettings newFromKeyFilePrintSettings(@Nonnull KeyFile key_file, String group_name) throws AllocationError Reads the print settings from the group @group_name in @key_file.
Returns a new `GtkPrintSettings` object with the restored settings,
or %NULL if an error occurred. If the file could not be loaded then
error is set to either `GFileError` or `GKeyFileError`.- Parameters:
key_file
- the `GKeyFile` to retrieve the settings fromgroup_name
- the name of the group to use, or %NULL to use the default “Print Settings”- Returns:
- the restored `GtkPrintSettings`
- Throws:
AllocationError
-
copy
Copies a `GtkPrintSettings` object.- Returns:
- a newly allocated copy of @other
-
foreach
Calls @func for each key-value pair of @settings.- Parameters:
func
- the function to calluser_data
- user data for @func
-
get
Looks up the string value associated with @key.- Parameters:
key
- a key- Returns:
- the string value for @key
-
get
Looks up the string value associated with @key.- Parameters:
key
- a key- Returns:
- the string value for @key
-
getBool
Returns the boolean represented by the value
that is associated with @key.
The string “true” represents %TRUE, any other
string %FALSE.- Parameters:
key
- a key- Returns:
- %TRUE, if @key maps to a true value.
-
getBool
Returns the boolean represented by the value
that is associated with @key.
The string “true” represents %TRUE, any other
string %FALSE.- Parameters:
key
- a key- Returns:
- %TRUE, if @key maps to a true value.
-
getCollate
public boolean getCollate()Gets the value of %GTK_PRINT_SETTINGS_COLLATE.- Returns:
- whether to collate the printed pages
-
getDefaultSource
Gets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.- Returns:
- the default source
-
getDither
Gets the value of %GTK_PRINT_SETTINGS_DITHER.- Returns:
- the dithering that is used
-
getDouble
Returns the double value associated with @key, or 0.- Parameters:
key
- a key- Returns:
- the double value of @key
-
getDouble
Returns the double value associated with @key, or 0.- Parameters:
key
- a key- Returns:
- the double value of @key
-
getDoubleWithDefault
Returns the floating point number represented by
the value that is associated with @key, or @default_val
if the value does not represent a floating point number.
Floating point numbers are parsed with g_ascii_strtod().- Parameters:
key
- a keydef
- the default value- Returns:
- the floating point number associated with @key
-
getDoubleWithDefault
Returns the floating point number represented by
the value that is associated with @key, or @default_val
if the value does not represent a floating point number.
Floating point numbers are parsed with g_ascii_strtod().- Parameters:
key
- a keydef
- the default value- Returns:
- the floating point number associated with @key
-
getDuplex
public int getDuplex()Gets the value of %GTK_PRINT_SETTINGS_DUPLEX.- Returns:
- whether to print the output in duplex.
-
getFinishings
Gets the value of %GTK_PRINT_SETTINGS_FINISHINGS.- Returns:
- the finishings
-
getInt
Returns the integer value of @key, or 0.- Parameters:
key
- a key- Returns:
- the integer value of @key
-
getInt
Returns the integer value of @key, or 0.- Parameters:
key
- a key- Returns:
- the integer value of @key
-
getIntWithDefault
Returns the value of @key, interpreted as
an integer, or the default value.- Parameters:
key
- a keydef
- the default value- Returns:
- the integer value of @key
-
getIntWithDefault
Returns the value of @key, interpreted as
an integer, or the default value.- Parameters:
key
- a keydef
- the default value- Returns:
- the integer value of @key
-
getLength
Returns the value associated with @key, interpreted
as a length.
The returned value is converted to @units.- Parameters:
key
- a keyunit
- the unit of the return value- Returns:
- the length value of @key, converted to @unit
-
getLength
Returns the value associated with @key, interpreted
as a length.
The returned value is converted to @units.- Parameters:
key
- a keyunit
- the unit of the return value- Returns:
- the length value of @key, converted to @unit
-
getMediaType
Gets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.
The set of media types is defined in PWG 5101.1-2002 PWG.- Returns:
- the media type
-
getNCopies
public int getNCopies()Gets the value of %GTK_PRINT_SETTINGS_N_COPIES.- Returns:
- the number of copies to print
-
getNumberUp
public int getNumberUp()Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.- Returns:
- the number of pages per sheet
-
getNumberUpLayout
public int getNumberUpLayout()Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.- Returns:
- layout of page in number-up mode
-
getOrientation
public int getOrientation()Get the value of %GTK_PRINT_SETTINGS_ORIENTATION,
converted to a `GtkPageOrientation`.- Returns:
- the orientation
-
getOutputBin
Gets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.- Returns:
- the output bin
-
getPageSet
public int getPageSet()Gets the value of %GTK_PRINT_SETTINGS_PAGE_SET.- Returns:
- the set of pages to print
-
getPaperHeight
public double getPaperHeight(int unit) Gets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT,
converted to @unit.- Parameters:
unit
- the unit for the return value- Returns:
- the paper height, in units of @unit
-
getPaperSize
Gets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT,
converted to a `GtkPaperSize`.- Returns:
- the paper size
-
getPaperWidth
public double getPaperWidth(int unit) Gets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH,
converted to @unit.- Parameters:
unit
- the unit for the return value- Returns:
- the paper width, in units of @unit
-
getPrintPages
public int getPrintPages()Gets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.- Returns:
- which pages to print
-
getPrinter
Convenience function to obtain the value of
%GTK_PRINT_SETTINGS_PRINTER.- Returns:
- the printer name
-
getPrinterLpi
public double getPrinterLpi()Gets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.- Returns:
- the resolution in lpi (lines per inch)
-
getQuality
public int getQuality()Gets the value of %GTK_PRINT_SETTINGS_QUALITY.- Returns:
- the print quality
-
getResolution
public int getResolution()Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION.- Returns:
- the resolution in dpi
-
getResolutionX
public int getResolutionX()Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_X.- Returns:
- the horizontal resolution in dpi
-
getResolutionY
public int getResolutionY()Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_Y.- Returns:
- the vertical resolution in dpi
-
getReverse
public boolean getReverse()Gets the value of %GTK_PRINT_SETTINGS_REVERSE.- Returns:
- whether to reverse the order of the printed pages
-
getScale
public double getScale()Gets the value of %GTK_PRINT_SETTINGS_SCALE.- Returns:
- the scale in percent
-
getUseColor
public boolean getUseColor()Gets the value of %GTK_PRINT_SETTINGS_USE_COLOR.- Returns:
- whether to use color
-
hasKey
Returns %TRUE, if a value is associated with @key.- Parameters:
key
- a key- Returns:
- %TRUE, if @key has a value
-
hasKey
Returns %TRUE, if a value is associated with @key.- Parameters:
key
- a key- Returns:
- %TRUE, if @key has a value
-
loadFile
Reads the print settings from @file_name.
If the file could not be loaded then error is set to either
a `GFileError` or `GKeyFileError`.
See [method@Gtk.PrintSettings.to_file].- Parameters:
file_name
- the filename to read the settings from- Returns:
- %TRUE on success
- Throws:
AllocationError
-
loadFile
Reads the print settings from @file_name.
If the file could not be loaded then error is set to either
a `GFileError` or `GKeyFileError`.
See [method@Gtk.PrintSettings.to_file].- Parameters:
file_name
- the filename to read the settings from- Returns:
- %TRUE on success
- Throws:
AllocationError
-
loadKeyFile
public boolean loadKeyFile(@Nonnull KeyFile key_file, @Nullable Str group_name) throws AllocationError Reads the print settings from the group @group_name in @key_file.
If the file could not be loaded then error is set to either a
`GFileError` or `GKeyFileError`.- Parameters:
key_file
- the `GKeyFile` to retrieve the settings fromgroup_name
- the name of the group to use, or %NULL to use the default “Print Settings”- Returns:
- %TRUE on success
- Throws:
AllocationError
-
loadKeyFile
Reads the print settings from the group @group_name in @key_file.
If the file could not be loaded then error is set to either a
`GFileError` or `GKeyFileError`.- Parameters:
key_file
- the `GKeyFile` to retrieve the settings fromgroup_name
- the name of the group to use, or %NULL to use the default “Print Settings”- Returns:
- %TRUE on success
- Throws:
AllocationError
-
set
Associates @value with @key.- Parameters:
key
- a keyvalue
- a string value
-
set
Associates @value with @key.- Parameters:
key
- a keyvalue
- a string value
-
setBool
Sets @key to a boolean value.- Parameters:
key
- a keyvalue
- a boolean
-
setBool
Sets @key to a boolean value.- Parameters:
key
- a keyvalue
- a boolean
-
setCollate
public void setCollate(boolean collate) Sets the value of %GTK_PRINT_SETTINGS_COLLATE.- Parameters:
collate
- whether to collate the output
-
setDefaultSource
Sets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.- Parameters:
default_source
- the default source
-
setDefaultSource
Sets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.- Parameters:
default_source
- the default source
-
setDither
Sets the value of %GTK_PRINT_SETTINGS_DITHER.- Parameters:
dither
- the dithering that is used
-
setDither
Sets the value of %GTK_PRINT_SETTINGS_DITHER.- Parameters:
dither
- the dithering that is used
-
setDouble
Sets @key to a double value.- Parameters:
key
- a keyvalue
- a double value
-
setDouble
Sets @key to a double value.- Parameters:
key
- a keyvalue
- a double value
-
setDuplex
public void setDuplex(int duplex) Sets the value of %GTK_PRINT_SETTINGS_DUPLEX.- Parameters:
duplex
- a `GtkPrintDuplex` value
-
setFinishings
Sets the value of %GTK_PRINT_SETTINGS_FINISHINGS.- Parameters:
finishings
- the finishings
-
setFinishings
Sets the value of %GTK_PRINT_SETTINGS_FINISHINGS.- Parameters:
finishings
- the finishings
-
setInt
Sets @key to an integer value.- Parameters:
key
- a keyvalue
- an integer
-
setInt
Sets @key to an integer value.- Parameters:
key
- a keyvalue
- an integer
-
setLength
Associates a length in units of @unit with @key.- Parameters:
key
- a keyvalue
- a lengthunit
- the unit of @length
-
setLength
Associates a length in units of @unit with @key.- Parameters:
key
- a keyvalue
- a lengthunit
- the unit of @length
-
setMediaType
Sets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.
The set of media types is defined in PWG 5101.1-2002 PWG.- Parameters:
media_type
- the media type
-
setMediaType
Sets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.
The set of media types is defined in PWG 5101.1-2002 PWG.- Parameters:
media_type
- the media type
-
setNCopies
public void setNCopies(int num_copies) Sets the value of %GTK_PRINT_SETTINGS_N_COPIES.- Parameters:
num_copies
- the number of copies
-
setNumberUp
public void setNumberUp(int number_up) Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.- Parameters:
number_up
- the number of pages per sheet
-
setNumberUpLayout
public void setNumberUpLayout(int number_up_layout) Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.- Parameters:
number_up_layout
- a `GtkNumberUpLayout` value
-
setOrientation
public void setOrientation(int orientation) Sets the value of %GTK_PRINT_SETTINGS_ORIENTATION.- Parameters:
orientation
- a page orientation
-
setOutputBin
Sets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.- Parameters:
output_bin
- the output bin
-
setOutputBin
Sets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.- Parameters:
output_bin
- the output bin
-
setPageSet
public void setPageSet(int page_set) Sets the value of %GTK_PRINT_SETTINGS_PAGE_SET.- Parameters:
page_set
- a `GtkPageSet` value
-
setPaperHeight
public void setPaperHeight(double height, int unit) Sets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT.- Parameters:
height
- the paper heightunit
- the units of @height
-
setPaperSize
Sets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT,
%GTK_PRINT_SETTINGS_PAPER_WIDTH and
%GTK_PRINT_SETTINGS_PAPER_HEIGHT.- Parameters:
paper_size
- a paper size
-
setPaperWidth
public void setPaperWidth(double width, int unit) Sets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH.- Parameters:
width
- the paper widthunit
- the units of @width
-
setPrintPages
public void setPrintPages(int pages) Sets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.- Parameters:
pages
- a `GtkPrintPages` value
-
setPrinter
Convenience function to set %GTK_PRINT_SETTINGS_PRINTER
to @printer.- Parameters:
printer
- the printer name
-
setPrinter
Convenience function to set %GTK_PRINT_SETTINGS_PRINTER
to @printer.- Parameters:
printer
- the printer name
-
setPrinterLpi
public void setPrinterLpi(double lpi) Sets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.- Parameters:
lpi
- the resolution in lpi (lines per inch)
-
setQuality
public void setQuality(int quality) Sets the value of %GTK_PRINT_SETTINGS_QUALITY.- Parameters:
quality
- a `GtkPrintQuality` value
-
setResolution
public void setResolution(int resolution) Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION,
%GTK_PRINT_SETTINGS_RESOLUTION_X and
%GTK_PRINT_SETTINGS_RESOLUTION_Y.- Parameters:
resolution
- the resolution in dpi
-
setResolutionXy
public void setResolutionXy(int resolution_x, int resolution_y) Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION,
%GTK_PRINT_SETTINGS_RESOLUTION_X and
%GTK_PRINT_SETTINGS_RESOLUTION_Y.- Parameters:
resolution_x
- the horizontal resolution in dpiresolution_y
- the vertical resolution in dpi
-
setReverse
public void setReverse(boolean reverse) Sets the value of %GTK_PRINT_SETTINGS_REVERSE.- Parameters:
reverse
- whether to reverse the output
-
setScale
public void setScale(double scale) Sets the value of %GTK_PRINT_SETTINGS_SCALE.- Parameters:
scale
- the scale in percent
-
setUseColor
public void setUseColor(boolean use_color) Sets the value of %GTK_PRINT_SETTINGS_USE_COLOR.- Parameters:
use_color
- whether to use color
-
toFile
This function saves the print settings from @settings to @file_name.
If the file could not be written then error is set to either a
`GFileError` or `GKeyFileError`.- Parameters:
file_name
- the file to save to- Returns:
- %TRUE on success
- Throws:
AllocationError
-
toFile
This function saves the print settings from @settings to @file_name.
If the file could not be written then error is set to either a
`GFileError` or `GKeyFileError`.- Parameters:
file_name
- the file to save to- Returns:
- %TRUE on success
- Throws:
AllocationError
-
toGvariant
Serialize print settings to an a{sv} variant.- Returns:
- a new, floating, `GVariant`
-
toKeyFile
This function adds the print settings from @settings to @key_file.- Parameters:
key_file
- the `GKeyFile` to save the print settings togroup_name
- the group to add the settings to in @key_file, or %NULL to use the default “Print Settings”
-
toKeyFile
This function adds the print settings from @settings to @key_file.- Parameters:
key_file
- the `GKeyFile` to save the print settings togroup_name
- the group to add the settings to in @key_file, or %NULL to use the default “Print Settings”
-
unset
Removes any value associated with @key.
This has the same effect as setting the value to %NULL.- Parameters:
key
- a key
-
unset
Removes any value associated with @key.
This has the same effect as setting the value to %NULL.- Parameters:
key
- a key
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-