Package ch.bailu.gtk.gtk
Klasse PageSetup
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gtk.PageSetup
- Alle implementierten Schnittstellen:
PointerInterface
Stores page size, orientation and margins for printing.
The idea is that you can get one of these from the page setup dialog
and then pass it to the `GtkPrintOperation` when printing.
The benefit of splitting this out of the `GtkPrintSettings` is that
these affect the actual layout of the page, and thus need to be set
long before user prints.
## Margins
The margins specified in this object are the “print margins”, i.e. the
parts of the page that the printer cannot print on. These are different
from the layout margins that a word processor uses; they are typically
used to determine the minimal size for the layout margins.
To obtain a `GtkPageSetup` use [ctor@Gtk.PageSetup.new] to get the defaults,
or use [func@Gtk.print_run_page_setup_dialog] to show the page setup dialog
and receive the resulting page setup.
## A page setup dialog
```c
static GtkPrintSettings *settings = NULL;
static GtkPageSetup *page_setup = NULL;
static void
do_page_setup (void)
{
GtkPageSetup *new_page_setup;
if (settings == NULL)
settings = gtk_print_settings_new ();
new_page_setup = gtk_print_run_page_setup_dialog (GTK_WINDOW (main_window),
page_setup, settings);
if (page_setup)
g_object_unref (page_setup);
page_setup = new_page_setup;
}
```
The idea is that you can get one of these from the page setup dialog
and then pass it to the `GtkPrintOperation` when printing.
The benefit of splitting this out of the `GtkPrintSettings` is that
these affect the actual layout of the page, and thus need to be set
long before user prints.
## Margins
The margins specified in this object are the “print margins”, i.e. the
parts of the page that the printer cannot print on. These are different
from the layout margins that a word processor uses; they are typically
used to determine the minimal size for the layout margins.
To obtain a `GtkPageSetup` use [ctor@Gtk.PageSetup.new] to get the defaults,
or use [func@Gtk.print_run_page_setup_dialog] to show the page setup dialog
and receive the resulting page setup.
## A page setup dialog
```c
static GtkPrintSettings *settings = NULL;
static GtkPageSetup *page_setup = NULL;
static void
do_page_setup (void)
{
GtkPageSetup *new_page_setup;
if (settings == NULL)
settings = gtk_print_settings_new ();
new_page_setup = gtk_print_run_page_setup_dialog (GTK_WINDOW (main_window),
page_setup, settings);
if (page_setup)
g_object_unref (page_setup);
page_setup = new_page_setup;
}
```
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify -
Feldübersicht
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcopy()Copies a `GtkPageSetup`.doublegetBottomMargin(int unit) Gets the bottom margin in units of @unit.static ClassHandlerstatic intdoublegetLeftMargin(int unit) Gets the left margin in units of @unit.intGets the page orientation of the `GtkPageSetup`.doublegetPageHeight(int unit) Returns the page height in units of @unit.doublegetPageWidth(int unit) Returns the page width in units of @unit.doublegetPaperHeight(int unit) Returns the paper height in units of @unit.Gets the paper size of the `GtkPageSetup`.doublegetPaperWidth(int unit) Returns the paper width in units of @unit.static longstatic TypeSystem.TypeSizedoublegetRightMargin(int unit) Gets the right margin in units of @unit.doublegetTopMargin(int unit) Gets the top margin in units of @unit.static longstatic TypeSystem.TypeSizebooleanReads the page setup from the file @file_name.booleanReads the page setup from the file @file_name.booleanloadKeyFile(KeyFile key_file, Str group_name) Reads the page setup from the group @group_name in the key file
@key_file.booleanloadKeyFile(KeyFile key_file, String group_name) Reads the page setup from the group @group_name in the key file
@key_file.static PageSetupnewFromFilePageSetup(Str file_name) Reads the page setup from the file @file_name.static PageSetupnewFromFilePageSetup(String file_name) Reads the page setup from the file @file_name.static PageSetupnewFromGvariantPageSetup(Variant variant) Desrialize a page setup from an a{sv} variant.static PageSetupnewFromKeyFilePageSetup(KeyFile key_file, Str group_name) Reads the page setup from the group @group_name in the key file
@key_file.static PageSetupnewFromKeyFilePageSetup(KeyFile key_file, String group_name) Reads the page setup from the group @group_name in the key file
@key_file.voidsetBottomMargin(double margin, int unit) Sets the bottom margin of the `GtkPageSetup`.voidsetLeftMargin(double margin, int unit) Sets the left margin of the `GtkPageSetup`.voidsetOrientation(int orientation) Sets the page orientation of the `GtkPageSetup`.voidsetPaperSize(PaperSize size) Sets the paper size of the `GtkPageSetup` without
changing the margins.voidSets the paper size of the `GtkPageSetup` and modifies
the margins according to the new paper size.voidsetRightMargin(double margin, int unit) Sets the right margin of the `GtkPageSetup`.voidsetTopMargin(double margin, int unit) Sets the top margin of the `GtkPageSetup`.booleanThis function saves the information from @setup to @file_name.booleanThis function saves the information from @setup to @file_name.Serialize page setup to an a{sv} variant.voidThis function adds the page setup from @setup to @key_file.voidThis function adds the page setup from @setup to @key_file.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrPropertyVon Klasse geerbte Methoden 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, weakUnrefVon Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacksVon Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNullVon Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Konstruktordetails
-
PageSetup
-
PageSetup
public PageSetup()Creates a new `GtkPageSetup`.
-
-
Methodendetails
-
getClassHandler
-
newFromFilePageSetup
Reads the page setup from the file @file_name.
Returns a new `GtkPageSetup` object with the restored
page setup, or %NULL if an error occurred.
See [method@Gtk.PageSetup.to_file].- Parameter:
file_name- the filename to read the page setup from- Gibt zurück:
- the restored `GtkPageSetup`
- Löst aus:
AllocationError
-
newFromFilePageSetup
Reads the page setup from the file @file_name.
Returns a new `GtkPageSetup` object with the restored
page setup, or %NULL if an error occurred.
See [method@Gtk.PageSetup.to_file].- Parameter:
file_name- the filename to read the page setup from- Gibt zurück:
- the restored `GtkPageSetup`
- Löst aus:
AllocationError
-
newFromGvariantPageSetup
Desrialize a page setup from an a{sv} variant.
The variant must be in the format produced by
[method@Gtk.PageSetup.to_gvariant].- Parameter:
variant- an a{sv} `GVariant`- Gibt zurück:
- a new `GtkPageSetup` object
-
newFromKeyFilePageSetup
public static PageSetup newFromKeyFilePageSetup(@Nonnull KeyFile key_file, @Nullable Str group_name) throws AllocationError Reads the page setup from the group @group_name in the key file
@key_file.
Returns a new `GtkPageSetup` object with the restored
page setup, or %NULL if an error occurred.- Parameter:
key_file- the `GKeyFile` to retrieve the page_setup fromgroup_name- the name of the group in the key_file to read to use the default name “Page Setup”- Gibt zurück:
- the restored `GtkPageSetup`
- Löst aus:
AllocationError
-
newFromKeyFilePageSetup
public static PageSetup newFromKeyFilePageSetup(@Nonnull KeyFile key_file, String group_name) throws AllocationError Reads the page setup from the group @group_name in the key file
@key_file.
Returns a new `GtkPageSetup` object with the restored
page setup, or %NULL if an error occurred.- Parameter:
key_file- the `GKeyFile` to retrieve the page_setup fromgroup_name- the name of the group in the key_file to read to use the default name “Page Setup”- Gibt zurück:
- the restored `GtkPageSetup`
- Löst aus:
AllocationError
-
copy
Copies a `GtkPageSetup`.- Gibt zurück:
- a copy of @other
-
getBottomMargin
public double getBottomMargin(int unit) Gets the bottom margin in units of @unit.- Parameter:
unit- the unit for the return value- Gibt zurück:
- the bottom margin
-
getLeftMargin
public double getLeftMargin(int unit) Gets the left margin in units of @unit.- Parameter:
unit- the unit for the return value- Gibt zurück:
- the left margin
-
getOrientation
public int getOrientation()Gets the page orientation of the `GtkPageSetup`.- Gibt zurück:
- the page orientation
-
getPageHeight
public double getPageHeight(int unit) Returns the page height in units of @unit.
Note that this function takes orientation
and margins into consideration.
See [method@Gtk.PageSetup.get_paper_height].- Parameter:
unit- the unit for the return value- Gibt zurück:
- the page height.
-
getPageWidth
public double getPageWidth(int unit) Returns the page width in units of @unit.
Note that this function takes orientation
and margins into consideration.
See [method@Gtk.PageSetup.get_paper_width].- Parameter:
unit- the unit for the return value- Gibt zurück:
- the page width.
-
getPaperHeight
public double getPaperHeight(int unit) Returns the paper height in units of @unit.
Note that this function takes orientation,
but not margins into consideration.
See [method@Gtk.PageSetup.get_page_height].- Parameter:
unit- the unit for the return value- Gibt zurück:
- the paper height.
-
getPaperSize
Gets the paper size of the `GtkPageSetup`.- Gibt zurück:
- the paper size
-
getPaperWidth
public double getPaperWidth(int unit) Returns the paper width in units of @unit.
Note that this function takes orientation,
but not margins into consideration.
See [method@Gtk.PageSetup.get_page_width].- Parameter:
unit- the unit for the return value- Gibt zurück:
- the paper width.
-
getRightMargin
public double getRightMargin(int unit) Gets the right margin in units of @unit.- Parameter:
unit- the unit for the return value- Gibt zurück:
- the right margin
-
getTopMargin
public double getTopMargin(int unit) Gets the top margin in units of @unit.- Parameter:
unit- the unit for the return value- Gibt zurück:
- the top margin
-
loadFile
Reads the page setup from the file @file_name.
See [method@Gtk.PageSetup.to_file].- Parameter:
file_name- the filename to read the page setup from- Gibt zurück:
- %TRUE on success
- Löst aus:
AllocationError
-
loadFile
Reads the page setup from the file @file_name.
See [method@Gtk.PageSetup.to_file].- Parameter:
file_name- the filename to read the page setup from- Gibt zurück:
- %TRUE on success
- Löst aus:
AllocationError
-
loadKeyFile
public boolean loadKeyFile(@Nonnull KeyFile key_file, @Nullable Str group_name) throws AllocationError Reads the page setup from the group @group_name in the key file
@key_file.- Parameter:
key_file- the `GKeyFile` to retrieve the page_setup fromgroup_name- the name of the group in the key_file to read to use the default name “Page Setup”- Gibt zurück:
- %TRUE on success
- Löst aus:
AllocationError
-
loadKeyFile
Reads the page setup from the group @group_name in the key file
@key_file.- Parameter:
key_file- the `GKeyFile` to retrieve the page_setup fromgroup_name- the name of the group in the key_file to read to use the default name “Page Setup”- Gibt zurück:
- %TRUE on success
- Löst aus:
AllocationError
-
setBottomMargin
public void setBottomMargin(double margin, int unit) Sets the bottom margin of the `GtkPageSetup`.- Parameter:
margin- the new bottom margin in units of @unitunit- the units for @margin
-
setLeftMargin
public void setLeftMargin(double margin, int unit) Sets the left margin of the `GtkPageSetup`.- Parameter:
margin- the new left margin in units of @unitunit- the units for @margin
-
setOrientation
public void setOrientation(int orientation) Sets the page orientation of the `GtkPageSetup`.- Parameter:
orientation- a `GtkPageOrientation` value
-
setPaperSize
Sets the paper size of the `GtkPageSetup` without
changing the margins.
See [method@Gtk.PageSetup.set_paper_size_and_default_margins].- Parameter:
size- a `GtkPaperSize`
-
setPaperSizeAndDefaultMargins
Sets the paper size of the `GtkPageSetup` and modifies
the margins according to the new paper size.- Parameter:
size- a `GtkPaperSize`
-
setRightMargin
public void setRightMargin(double margin, int unit) Sets the right margin of the `GtkPageSetup`.- Parameter:
margin- the new right margin in units of @unitunit- the units for @margin
-
setTopMargin
public void setTopMargin(double margin, int unit) Sets the top margin of the `GtkPageSetup`.- Parameter:
margin- the new top margin in units of @unitunit- the units for @margin
-
toFile
This function saves the information from @setup to @file_name.- Parameter:
file_name- the file to save to- Gibt zurück:
- %TRUE on success
- Löst aus:
AllocationError
-
toFile
This function saves the information from @setup to @file_name.- Parameter:
file_name- the file to save to- Gibt zurück:
- %TRUE on success
- Löst aus:
AllocationError
-
toGvariant
Serialize page setup to an a{sv} variant.- Gibt zurück:
- a new, floating, `GVariant`
-
toKeyFile
This function adds the page setup from @setup to @key_file.- Parameter:
key_file- the `GKeyFile` to save the page setup togroup_name- the group to add the settings to in @key_file, or %NULL to use the default name “Page Setup”
-
toKeyFile
This function adds the page setup from @setup to @key_file.- Parameter:
key_file- the `GKeyFile` to save the page setup togroup_name- the group to add the settings to in @key_file, or %NULL to use the default name “Page Setup”
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-