Package ch.bailu.gtk.gtk
Klasse PaperSize
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.gtk.PaperSize
- Alle implementierten Schnittstellen:
PointerInterface
`GtkPaperSize` handles paper sizes.
It uses the standard called
[PWG 5101.1-2002 PWG: Standard for Media Standardized Names](http://www.pwg.org/standards.html)
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.
It uses the standard called
[PWG 5101.1-2002 PWG: Standard for Media Standardized Names](http://www.pwg.org/standards.html)
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.
-
Feldübersicht
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungPaperSize
(PointerContainer pointer) Creates a new `GtkPaperSize` object by parsing a
[PWG 5101.1-2002](ftp://ftp.pwg.org/pub/pwg/candidates/cs-pwgmsn10-20020226-5101.1.pdf)
paper name.Creates a new `GtkPaperSize` object by parsing a
[PWG 5101.1-2002](ftp://ftp.pwg.org/pub/pwg/candidates/cs-pwgmsn10-20020226-5101.1.pdf)
paper name. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcopy()
Copies an existing `GtkPaperSize`.void
free()
Free the given `GtkPaperSize` object.static ClassHandler
static Str
Returns the name of the default paper size, which
depends on the current locale.double
getDefaultBottomMargin
(int unit) Gets the default bottom margin for the `GtkPaperSize`.double
getDefaultLeftMargin
(int unit) Gets the default left margin for the `GtkPaperSize`.double
getDefaultRightMargin
(int unit) Gets the default right margin for the `GtkPaperSize`.double
getDefaultTopMargin
(int unit) Gets the default top margin for the `GtkPaperSize`.Gets the human-readable name of the `GtkPaperSize`.double
getHeight
(int unit) Gets the paper height of the `GtkPaperSize`, in
units of @unit.static int
getName()
Gets the name of the `GtkPaperSize`.static List
getPaperSizes
(boolean include_custom) Creates a list of known paper sizes.static long
static TypeSystem.TypeSize
Gets the PPD name of the `GtkPaperSize`, which
may be %NULL.static long
static TypeSystem.TypeSize
double
getWidth
(int unit) Gets the paper width of the `GtkPaperSize`, in
units of @unit.boolean
isCustom()
Returns %TRUE if @size is not a standard paper size.boolean
Compares two `GtkPaperSize` objects.boolean
isIpp()
Returns %TRUE if @size is an IPP standard paper size.static PaperSize
newCustomPaperSize
(Str name, Str display_name, double width, double height, int unit) Creates a new `GtkPaperSize` object with the
given parameters.static PaperSize
newCustomPaperSize
(String name, String display_name, double width, double height, int unit) Creates a new `GtkPaperSize` object with the
given parameters.static PaperSize
newFromGvariantPaperSize
(Variant variant) Deserialize a paper size from a `GVariant`.static PaperSize
newFromIppPaperSize
(Str ipp_name, double width, double height) Creates a new `GtkPaperSize` object by using
IPP information.static PaperSize
newFromIppPaperSize
(String ipp_name, double width, double height) Creates a new `GtkPaperSize` object by using
IPP information.static PaperSize
newFromKeyFilePaperSize
(KeyFile key_file, Str group_name) Reads a paper size from the group @group_name in the key file
@key_file.static PaperSize
newFromKeyFilePaperSize
(KeyFile key_file, String group_name) Reads a paper size from the group @group_name in the key file
@key_file.static PaperSize
newFromPpdPaperSize
(Str ppd_name, Str ppd_display_name, double width, double height) Creates a new `GtkPaperSize` object by using
PPD information.static PaperSize
newFromPpdPaperSize
(String ppd_name, String ppd_display_name, double width, double height) Creates a new `GtkPaperSize` object by using
PPD information.void
setSize
(double width, double height, int unit) Changes the dimensions of a @size to @width x @height.Serialize a paper size to an `a{sv}` variant.void
This function adds the paper size from @size to @key_file.void
This function adds the paper size from @size to @key_file.Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
PaperSize
-
PaperSize
Creates a new `GtkPaperSize` object by parsing a
[PWG 5101.1-2002](ftp://ftp.pwg.org/pub/pwg/candidates/cs-pwgmsn10-20020226-5101.1.pdf)
paper name.
If @name is %NULL, the default paper size is returned,
see [func@Gtk.PaperSize.get_default].- Parameter:
name
- a paper size name
-
PaperSize
Creates a new `GtkPaperSize` object by parsing a
[PWG 5101.1-2002](ftp://ftp.pwg.org/pub/pwg/candidates/cs-pwgmsn10-20020226-5101.1.pdf)
paper name.
If @name is %NULL, the default paper size is returned,
see [func@Gtk.PaperSize.get_default].- Parameter:
name
- a paper size name
-
-
Methodendetails
-
getClassHandler
-
newCustomPaperSize
public static PaperSize newCustomPaperSize(@Nonnull Str name, @Nonnull Str display_name, double width, double height, int unit) Creates a new `GtkPaperSize` object with the
given parameters.- Parameter:
name
- the paper namedisplay_name
- the human-readable namewidth
- the paper width, in units of @unitheight
- the paper height, in units of @unitunit
- the unit for @width and @height. not %GTK_UNIT_NONE.- Gibt zurück:
- a new `GtkPaperSize` object, use [method@Gtk.PaperSize.free] to free it
-
newCustomPaperSize
public static PaperSize newCustomPaperSize(String name, String display_name, double width, double height, int unit) Creates a new `GtkPaperSize` object with the
given parameters.- Parameter:
name
- the paper namedisplay_name
- the human-readable namewidth
- the paper width, in units of @unitheight
- the paper height, in units of @unitunit
- the unit for @width and @height. not %GTK_UNIT_NONE.- Gibt zurück:
- a new `GtkPaperSize` object, use [method@Gtk.PaperSize.free] to free it
-
newFromGvariantPaperSize
Deserialize a paper size from a `GVariant`.
The `GVariant must be in the format produced by
[method@Gtk.PaperSize.to_gvariant].- Parameter:
variant
- an a{sv} `GVariant`- Gibt zurück:
- a new `GtkPaperSize` object
-
newFromIppPaperSize
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.- Parameter:
ipp_name
- an IPP paper namewidth
- the paper width, in pointsheight
- the paper height in points- Gibt zurück:
- a new `GtkPaperSize`, use [method@Gtk.PaperSize.free] to free it
-
newFromIppPaperSize
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.- Parameter:
ipp_name
- an IPP paper namewidth
- the paper width, in pointsheight
- the paper height in points- Gibt zurück:
- a new `GtkPaperSize`, use [method@Gtk.PaperSize.free] to free it
-
newFromKeyFilePaperSize
public static PaperSize newFromKeyFilePaperSize(@Nonnull KeyFile key_file, @Nullable Str group_name) throws AllocationError Reads a paper size from the group @group_name in the key file
@key_file.- Parameter:
key_file
- the `GKeyFile` to retrieve the papersize fromgroup_name
- the name of the group in the key file to read, or %NULL to read the first group- Gibt zurück:
- a new `GtkPaperSize` object with the restored paper size
- Löst aus:
AllocationError
-
newFromKeyFilePaperSize
public static PaperSize newFromKeyFilePaperSize(@Nonnull KeyFile key_file, String group_name) throws AllocationError Reads a paper size from the group @group_name in the key file
@key_file.- Parameter:
key_file
- the `GKeyFile` to retrieve the papersize fromgroup_name
- the name of the group in the key file to read, or %NULL to read the first group- Gibt zurück:
- a new `GtkPaperSize` object with the restored paper size
- Löst aus:
AllocationError
-
newFromPpdPaperSize
public static PaperSize newFromPpdPaperSize(@Nonnull Str ppd_name, @Nonnull Str ppd_display_name, 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.- Parameter:
ppd_name
- a PPD paper nameppd_display_name
- the corresponding human-readable namewidth
- the paper width, in pointsheight
- the paper height in points- Gibt zurück:
- a new `GtkPaperSize`, use [method@Gtk.PaperSize.free] to free it
-
newFromPpdPaperSize
public static PaperSize newFromPpdPaperSize(String ppd_name, String ppd_display_name, 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.- Parameter:
ppd_name
- a PPD paper nameppd_display_name
- the corresponding human-readable namewidth
- the paper width, in pointsheight
- the paper height in points- Gibt zurück:
- a new `GtkPaperSize`, use [method@Gtk.PaperSize.free] to free it
-
copy
Copies an existing `GtkPaperSize`.- Gibt zurück:
- a copy of @other
-
free
public void free()Free the given `GtkPaperSize` object. -
getDefaultBottomMargin
public double getDefaultBottomMargin(int unit) Gets the default bottom margin for the `GtkPaperSize`.- Parameter:
unit
- the unit for the return value, not %GTK_UNIT_NONE- Gibt zurück:
- the default bottom margin
-
getDefaultLeftMargin
public double getDefaultLeftMargin(int unit) Gets the default left margin for the `GtkPaperSize`.- Parameter:
unit
- the unit for the return value, not %GTK_UNIT_NONE- Gibt zurück:
- the default left margin
-
getDefaultRightMargin
public double getDefaultRightMargin(int unit) Gets the default right margin for the `GtkPaperSize`.- Parameter:
unit
- the unit for the return value, not %GTK_UNIT_NONE- Gibt zurück:
- the default right margin
-
getDefaultTopMargin
public double getDefaultTopMargin(int unit) Gets the default top margin for the `GtkPaperSize`.- Parameter:
unit
- the unit for the return value, not %GTK_UNIT_NONE- Gibt zurück:
- the default top margin
-
getDisplayName
Gets the human-readable name of the `GtkPaperSize`.- Gibt zurück:
- the human-readable name of @size
-
getHeight
public double getHeight(int unit) Gets the paper height of the `GtkPaperSize`, in
units of @unit.- Parameter:
unit
- the unit for the return value, not %GTK_UNIT_NONE- Gibt zurück:
- the paper height
-
getName
Gets the name of the `GtkPaperSize`.- Gibt zurück:
- the name of @size
-
getPpdName
Gets the PPD name of the `GtkPaperSize`, which
may be %NULL.- Gibt zurück:
- the PPD name of @size
-
getWidth
public double getWidth(int unit) Gets the paper width of the `GtkPaperSize`, in
units of @unit.- Parameter:
unit
- the unit for the return value, not %GTK_UNIT_NONE- Gibt zurück:
- the paper width
-
isCustom
public boolean isCustom()Returns %TRUE if @size is not a standard paper size.- Gibt zurück:
- whether @size is a custom paper size.
-
isEqual
Compares two `GtkPaperSize` objects.- Parameter:
size2
- another `GtkPaperSize` object- Gibt zurück:
- %TRUE, if @size1 and @size2 represent the same paper size
-
isIpp
public boolean isIpp()Returns %TRUE if @size is an IPP standard paper size.- Gibt zurück:
- whether @size is not an IPP custom paper size.
-
setSize
public void setSize(double width, double height, int unit) Changes the dimensions of a @size to @width x @height.- Parameter:
width
- the new width in units of @unitheight
- the new height in units of @unitunit
- the unit for @width and @height
-
toGvariant
Serialize a paper size to an `a{sv}` variant.- Gibt zurück:
- a new, floating, `GVariant`
-
toKeyFile
This function adds the paper size from @size to @key_file.- Parameter:
key_file
- the `GKeyFile` to save the paper size togroup_name
- the group to add the settings to in @key_file
-
toKeyFile
This function adds the paper size from @size to @key_file.- Parameter:
key_file
- the `GKeyFile` to save the paper size togroup_name
- the group to add the settings to in @key_file
-
getDefault
Returns the name of the default paper size, which
depends on the current locale.- Gibt zurück:
- the name of the default paper size. The string is owned by GTK and should not be modified.
-
getPaperSizes
Creates a list of known paper sizes.- Parameter:
include_custom
- whether to include custom paper sizes as defined in the page setup dialog- Gibt zurück:
- a newly allocated list of newly allocated `GtkPaperSize` objects
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-