Optionalproperties: Partial<Gtk.PrintOperation.ConstructorProps>Internal$signalsCompile-time signal type information.
This instance property is generated only for TypeScript type checking. It is not defined at runtime and should not be accessed in JS code.
Static$gtypeDetermines whether the print operation may run asynchronously or not.
Some systems don't support asynchronous printing, but those that do
will return Gtk.PrintOperationResult.IN_PROGRESS as the status, and
emit the Gtk.PrintOperation::done signal when the operation
is actually done.
The Windows port does not support asynchronous operation at all (this is unlikely to change). On other platforms, all actions except for Gtk.PrintOperationAction.EXPORT support asynchronous operation.
Determines whether the print operation may run asynchronously or not.
Some systems don't support asynchronous printing, but those that do
will return Gtk.PrintOperationResult.IN_PROGRESS as the status, and
emit the Gtk.PrintOperation::done signal when the operation
is actually done.
The Windows port does not support asynchronous operation at all (this is unlikely to change). On other platforms, all actions except for Gtk.PrintOperationAction.EXPORT support asynchronous operation.
The current page in the document.
If this is set before Gtk.PrintOperation.run, the user will be able to select to print only the current page.
Note that this only makes sense for pre-paginated documents.
The current page in the document.
If this is set before Gtk.PrintOperation.run, the user will be able to select to print only the current page.
Note that this only makes sense for pre-paginated documents.
Used as the label of the tab containing custom widgets.
Note that this property may be ignored on some platforms.
If this is null, GTK uses a default label.
Used as the label of the tab containing custom widgets.
Note that this property may be ignored on some platforms.
If this is null, GTK uses a default label.
The Gtk.PageSetup used by default.
This page setup will be used by Gtk.PrintOperation.run,
but it can be overridden on a per-page basis by connecting
to the Gtk.PrintOperation::request-page-setup signal.
The Gtk.PageSetup used by default.
This page setup will be used by Gtk.PrintOperation.run,
but it can be overridden on a per-page basis by connecting
to the Gtk.PrintOperation::request-page-setup signal.
If true, page size combo box and orientation combo box
are embedded into page setup page.
If true, page size combo box and orientation combo box
are embedded into page setup page.
The name of a file to generate instead of showing the print dialog.
Currently, PDF is the only supported format.
The intended use of this property is for implementing “Export to PDF” actions.
“Print to PDF” support is independent of this and is done by letting the user pick the “Print to PDF” item from the list of printers in the print dialog.
The name of a file to generate instead of showing the print dialog.
Currently, PDF is the only supported format.
The intended use of this property is for implementing “Export to PDF” actions.
“Print to PDF” support is independent of this and is done by letting the user pick the “Print to PDF” item from the list of printers in the print dialog.
Determines whether there is a selection in your application.
This can allow your application to print the selection. This is typically used to make a "Selection" button sensitive.
Determines whether there is a selection in your application.
This can allow your application to print the selection. This is typically used to make a "Selection" button sensitive.
A string used to identify the job (e.g. in monitoring applications like eggcups).
If you don't set a job name, GTK picks a default one by numbering successive print jobs.
A string used to identify the job (e.g. in monitoring applications like eggcups).
If you don't set a job name, GTK picks a default one by numbering successive print jobs.
The number of pages in the document.
This must be set to a positive number before the rendering
starts. It may be set in a Gtk.PrintOperation::begin-print
signal handler.
Note that the page numbers passed to the
Gtk.PrintOperation::request-page-setup and
Gtk.PrintOperation::draw-page signals are 0-based, i.e.
if the user chooses to print all pages, the last ::draw-page signal
will be for page n_pages - 1.
Read-Onlyn_The number of pages that will be printed.
Note that this value is set during print preparation phase
(Gtk.PrintStatus.PREPARING), so this value should never be
get before the data generation phase (Gtk.PrintStatus.GENERATING_DATA).
You can connect to the Gtk.PrintOperation::status-changed signal
and call Gtk.PrintOperation.get_n_pages_to_print when
print status is Gtk.PrintStatus.GENERATING_DATA.
This is typically used to track the progress of print operation.
The number of pages in the document.
This must be set to a positive number before the rendering
starts. It may be set in a Gtk.PrintOperation::begin-print
signal handler.
Note that the page numbers passed to the
Gtk.PrintOperation::request-page-setup and
Gtk.PrintOperation::draw-page signals are 0-based, i.e.
if the user chooses to print all pages, the last ::draw-page signal
will be for page n_pages - 1.
Read-OnlynThe number of pages that will be printed.
Note that this value is set during print preparation phase
(Gtk.PrintStatus.PREPARING), so this value should never be
get before the data generation phase (Gtk.PrintStatus.GENERATING_DATA).
You can connect to the Gtk.PrintOperation::status-changed signal
and call Gtk.PrintOperation.get_n_pages_to_print when
print status is Gtk.PrintStatus.GENERATING_DATA.
This is typically used to track the progress of print operation.
The Gtk.PrintSettings used for initializing the dialog.
Setting this property is typically used to re-establish print settings from a previous print operation, see Gtk.PrintOperation.run.
The Gtk.PrintSettings used for initializing the dialog.
Setting this property is typically used to re-establish print settings from a previous print operation, see Gtk.PrintOperation.run.
Determines whether to show a progress dialog during the print operation.
Determines whether to show a progress dialog during the print operation.
Read-OnlystatusThe status of the print operation.
Read-Onlystatus_A string representation of the status of the print operation.
The string is translated and suitable for displaying the print status e.g. in a Gtk.Statusbar.
See the Gtk.PrintOperation.status property for a status value that is suitable for programmatic use.
Read-OnlystatusA string representation of the status of the print operation.
The string is translated and suitable for displaying the print status e.g. in a Gtk.Statusbar.
See the Gtk.PrintOperation.status property for a status value that is suitable for programmatic use.
If true, the print operation will support print of selection.
This allows the print dialog to show a "Selection" button.
If true, the print operation will support print of selection.
This allows the print dialog to show a "Selection" button.
If true, the print operation will try to continue report on
the status of the print job in the printer queues and printer.
This can allow your application to show things like “out of paper” issues, and when the print job actually reaches the printer. However, this is often implemented using polling, and should not be enabled unless needed.
If true, the print operation will try to continue report on
the status of the print job in the printer queues and printer.
This can allow your application to show things like “out of paper” issues, and when the print job actually reaches the printer. However, this is often implemented using polling, and should not be enabled unless needed.
The transformation for the cairo context obtained from
Gtk.PrintContext is set up in such a way that distances
are measured in units of unit.
If true, the transformation for the cairo context obtained
from Gtk.PrintContext puts the origin at the top left corner
of the page.
This may not be the top left corner of the sheet, depending on page orientation and the number of pages per sheet. Otherwise, the origin is at the top left corner of the imageable area (i.e. inside the margins).
If true, the transformation for the cairo context obtained
from Gtk.PrintContext puts the origin at the top left corner
of the page.
This may not be the top left corner of the sheet, depending on page orientation and the number of pages per sheet. Otherwise, the origin is at the top left corner of the imageable area (i.e. inside the margins).
Creates a binding between source_property on source and target_property
on target.
Whenever the source_property is changed the target_property is
updated using the same value. For instance:
g_object_bind_property (action, "active", widget, "sensitive", 0);
Will result in the "sensitive" property of the widget GObject.Object instance to be updated with the same value of the "active" property of the action GObject.Object instance.
If flags contains GObject.BindingFlags.BIDIRECTIONAL then the binding will be mutual:
if target_property on target changes then the source_property on source
will be updated as well.
The binding will automatically be removed when either the source or the
target instances are finalized. To remove the binding without affecting the
source and the target you can just call g_object_unref() on the returned
GObject.Binding instance.
Removing the binding by calling g_object_unref() on it must only be done if
the binding, source and target are only used from a single thread and it
is clear that both source and target outlive the binding. Especially it
is not safe to rely on this if the binding, source or target can be
finalized from different threads. Keep another reference to the binding and
use g_binding_unbind() instead to be on the safe side.
A GObject.Object can have multiple bindings.
the property on source to bind
the target GObject.Object
the property on target to bind
flags to pass to GObject.Binding
the GObject.Binding instance representing the binding between the two GObject.Object instances. The binding is released whenever the GObject.Binding reference count reaches zero.
Complete version of g_object_bind_property().
Creates a binding between source_property on source and target_property
on target, allowing you to set the transformation functions to be used by
the binding.
If flags contains GObject.BindingFlags.BIDIRECTIONAL then the binding will be mutual:
if target_property on target changes then the source_property on source
will be updated as well. The transform_from function is only used in case
of bidirectional bindings, otherwise it will be ignored
The binding will automatically be removed when either the source or the
target instances are finalized. This will release the reference that is
being held on the GObject.Binding instance; if you want to hold on to the
GObject.Binding instance, you will need to hold a reference to it.
To remove the binding, call g_binding_unbind().
A GObject.Object can have multiple bindings.
The same user_data parameter will be used for both transform_to
and transform_from transformation functions; the notify function will
be called once, when the binding is removed. If you need different data
for each transformation function, please use
g_object_bind_property_with_closures() instead.
the property on source to bind
the target GObject.Object
the property on target to bind
flags to pass to GObject.Binding
Optionaltransform_to: BindingTransformFuncthe transformation function from the source to the target, or null to use the default
Optionaltransform_from: BindingTransformFuncthe transformation function from the target to the source, or null to use the default
Optionalnotify: DestroyNotifya function to call when disposing the binding, to free resources used by the transformation functions, or null if not required
the GObject.Binding instance representing the binding between the two GObject.Object instances. The binding is released whenever the GObject.Binding reference count reaches zero.
Creates a binding between source_property on source and target_property
on target, allowing you to set the transformation functions to be used by
the binding.
This function is the language bindings friendly version of
g_object_bind_property_full(), using GClosures instead of
function pointers.
the property on source to bind
the GObject.Binding instance representing the binding between the two GObject.Object instances. The binding is released whenever the GObject.Binding reference count reaches zero.
Blocks a handler of an instance so it will not be called during any signal emissions
Handler ID of the handler to be blocked
Cancels a running print operation.
This function may be called from a Gtk.PrintOperation::begin-print,
Gtk.PrintOperation::paginate or Gtk.PrintOperation::draw-page
signal handler to stop the currently running print operation.
SignalconnectSignalconnect_Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
Handler ID of the handler to be disconnected
Signal that drawing of particular page is complete.
It is called after completion of page drawing (e.g. drawing in another thread). If Gtk.PrintOperation.set_defer_drawing was called before, then this function has to be called by application. Otherwise it is called by GTK itself.
SignalemitEnds a preview.
This function must be called to finish a custom print preview.
This function is intended for GObject.Object implementations to re-enforce
a [floating][floating-ref] object reference. Doing this is seldom
required: all GInitiallyUnowneds are created with a floating reference
which usually just needs to be sunken by calling g_object_ref_sink().
Increases the freeze count on object. If the freeze count is
non-zero, the emission of "notify" signals on object is
stopped. The signals are queued until the freeze count is decreased
to zero. Duplicate notifications are squashed so that at most one
GObject.Object::notify signal is emitted for each property modified while the
object is frozen.
This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.
Gets a named field from the objects table of associations (see g_object_set_data()).
name of the key for that association
the data if found, or null if no such data exists.
Gets whether page setup selection combos are embedded
whether page setup selection combos are embedded
Call this when the result of a print operation is Gtk.PrintOperationResult.ERROR.
It can be called either after Gtk.PrintOperation.run
returns, or in the Gtk.PrintOperation::done signal
handler.
The returned GLib.Error will contain more details on what went wrong.
Gets whether there is a selection.
whether there is a selection
Returns the number of pages that will be printed.
Note that this value is set during print preparation phase
(Gtk.PrintStatus.PREPARING), so this function should never be
called before the data generation phase (Gtk.PrintStatus.GENERATING_DATA).
You can connect to the Gtk.PrintOperation::status-changed
signal and call gtk_print_operation_get_n_pages_to_print() when
print status is Gtk.PrintStatus.GENERATING_DATA.
This is typically used to track the progress of print operation.
the number of pages that will be printed
Returns the current print settings.
Note that the return value is null until either
Gtk.PrintOperation.set_print_settings or
Gtk.PrintOperation.run have been called.
the current print settings of op.
Gets a property of an object.
The value can be:
In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
The name of the property to get
Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
This function gets back user data pointers stored via
g_object_set_qdata().
A GLib.Quark, naming the user data pointer
The user data pointer set, or null
Returns the status of the print operation.
Also see Gtk.PrintOperation.get_status_string.
the status of the print operation
Returns a string representation of the status of the print operation.
The string is translated and suitable for displaying the print status e.g. in a Gtk.Statusbar.
Use Gtk.PrintOperation.get_status to obtain a status value that is suitable for programmatic use.
a string representation of the status of the print operation
Gets whether the application supports print of selection
whether the application supports print of selection
Gets n_properties properties for an object.
Obtained properties will be set to values. All properties must be valid.
Warnings will be emitted and undefined behaviour may result if invalid
properties are passed in.
the names of each property to get
the values of each property to get
A convenience function to find out if the print operation is finished.
a print operation is finished if its status is either Gtk.PrintStatus.FINISHED or Gtk.PrintStatus.FINISHED_ABORTED.
Note: when you enable print status tracking the print operation can be in a non-finished state even after done has been called, as the operation status then tracks the print job status on the printer.
true, if the print operation is finished.
Checks whether object has a [floating][floating-ref] reference.
true if object has a floating reference
Returns whether the given page is included in the set of pages that have been selected for printing.
a page number
true if the page has been selected for printing
Emits a "notify" signal for the property property_name on object.
When possible, eg. when signaling a property change from within the class
that registered the property, you should use g_object_notify_by_pspec()
instead.
Note that emission of the notify signal may be blocked with
g_object_freeze_notify(). In this case, the signal emissions are queued
and will be emitted (in reverse order) when g_object_thaw_notify() is
called.
the name of a property installed on the class of object.
Emits a "notify" signal for the property specified by pspec on object.
This function omits the property name lookup, hence it is faster than
g_object_notify().
One way to avoid using g_object_notify() from within the
class that registered the properties, and using g_object_notify_by_pspec()
instead, is to store the GParamSpec used with
g_object_class_install_property() inside a static array, e.g.:
typedef enum
{
PROP_FOO = 1,
PROP_LAST
} MyObjectProperty;
static GParamSpec *properties[PROP_LAST];
static void
my_object_class_init (MyObjectClass *klass)
{
properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
0, 100,
50,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (gobject_class,
PROP_FOO,
properties[PROP_FOO]);
}
and then notify a change on the "foo" property with:
g_object_notify_by_pspec (self, properties[PROP_FOO]);
the GObject.ParamSpec of a property installed on the class of object.
Increases the reference count of object.
Since GLib 2.56, if GLIB_VERSION_MAX_ALLOWED is 2.56 or greater, the type
of object will be propagated to the return type (using the GCC typeof()
extension), so any casting the caller needs to do on the return type must be
explicit.
the same object
Increase the reference count of object, and possibly remove the
[floating][floating-ref] reference, if object has a floating reference.
In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one.
Since GLib 2.56, the type of object will be propagated to the return type
under the same conditions as for g_object_ref().
object
Renders a page to the preview.
This is using the print context that was passed to the
Gtk.PrintOperation::preview handler together
with preview.
A custom print preview should use this function to render the currently selected page.
Note that this function requires a suitable cairo context to be associated with the print context.
the page to render
Runs the print operation.
Normally that this function does not return until the rendering
of all pages is complete. You can connect to the
Gtk.PrintOperation::status-changed signal on op to obtain
some information about the progress of the print operation.
Furthermore, it may use a recursive mainloop to show the print dialog.
If you set the [Gtk.PrintOperation:allow-async] property, the operation
will run asynchronously if this is supported on the platform. The
Gtk.PrintOperation::done signal will be emitted with the result
of the operation when the it is done (i.e. when the dialog is canceled,
or when the print succeeds or fails).
if (settings != NULL)
gtk_print_operation_set_print_settings (print, settings);
if (page_setup != NULL)
gtk_print_operation_set_default_page_setup (print, page_setup);
g_signal_connect (print, "begin-print",
G_CALLBACK (begin_print), &data);
g_signal_connect (print, "draw-page",
G_CALLBACK (draw_page), &data);
res = gtk_print_operation_run (print,
GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
parent,
&error);
if (res == GTK_PRINT_OPERATION_RESULT_ERROR)
{
error_dialog = gtk_message_dialog_new (GTK_WINDOW (parent),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"Error printing file:\n%s",
error->message);
g_signal_connect (error_dialog, "response",
G_CALLBACK (gtk_window_destroy), NULL);
gtk_window_present (GTK_WINDOW (error_dialog));
g_error_free (error);
}
else if (res == GTK_PRINT_OPERATION_RESULT_APPLY)
{
if (settings != NULL)
g_object_unref (settings);
settings = g_object_ref (gtk_print_operation_get_print_settings (print));
}
Note that gtk_print_operation_run() can only be called once on a
given Gtk.PrintOperation.
the action to start
Optionalparent: Gtk.WindowTransient parent of the dialog
the result of the print operation. A return value of Gtk.PrintOperationResult.APPLY indicates that the printing was completed successfully. In this case, it is a good idea to obtain the used print settings with Gtk.PrintOperation.get_print_settings and store them for reuse with the next print operation. A value of Gtk.PrintOperationResult.IN_PROGRESS means the operation is running asynchronously, and will emit the Gtk.PrintOperation::done signal when done.
Releases all references to other objects. This can be used to break reference cycles.
This function should only be called from object system implementations.
Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
Object containing the properties to set
Sets whether gtk_print_operation_run() may return
before the print operation is completed.
Note that some platforms may not allow asynchronous operation.
true to allow asynchronous operation
Sets the current page.
If this is called before Gtk.PrintOperation.run, the user will be able to select to print only the current page.
Note that this only makes sense for pre-paginated documents.
the current page, 0-based
Sets the label for the tab holding custom widgets.
Optionallabel: stringthe label to use, or null to use the default label
Each object carries around a table of associations from strings to pointers. This function lets you set an association.
If the object already had an association with that name, the old association will be destroyed.
Internally, the key is converted to a GLib.Quark using g_quark_from_string().
This means a copy of key is kept permanently (even after object has been
finalized) — so it is recommended to only use a small, bounded set of values
for key in your program, to avoid the GLib.Quark storage growing unbounded.
name of the key
Optionaldata: anydata to associate with that key
Makes default_page_setup the default page setup for op.
This page setup will be used by Gtk.PrintOperation.run,
but it can be overridden on a per-page basis by connecting
to the Gtk.PrintOperation::request-page-setup signal.
Sets up the Gtk.PrintOperation to wait for calling of [method@Gtk.PrintOperation.draw_page_finish from application.
This can be used for drawing page in another thread.
This function must be called in the callback of the
Gtk.PrintOperation::draw-page signal.
Embed page size combo box and orientation combo box into page setup page.
Selected page setup is stored as default page setup in Gtk.PrintOperation.
true to embed page setup selection in the Gtk.PrintUnixDialog
Sets up the Gtk.PrintOperation to generate a file instead of showing the print dialog.
The intended use of this function is for implementing “Export to PDF” actions. Currently, PDF is the only supported format.
“Print to PDF” support is independent of this and is done by letting the user pick the “Print to PDF” item from the list of printers in the print dialog.
the filename for the exported file
Sets whether there is a selection to print.
Application has to set number of pages to which the selection
will draw by Gtk.PrintOperation.set_n_pages in a handler
for the Gtk.PrintOperation::begin-print signal.
true indicates that a selection exists
Sets the name of the print job.
The name is used to identify the job (e.g. in monitoring applications like eggcups).
If you don’t set a job name, GTK picks a default one by numbering successive print jobs.
a string that identifies the print job
Sets the number of pages in the document.
This must be set to a positive number before the rendering
starts. It may be set in a Gtk.PrintOperation::begin-print
signal handler.
Note that the page numbers passed to the
Gtk.PrintOperation::request-page-setup
and Gtk.PrintOperation::draw-page signals are 0-based, i.e.
if the user chooses to print all pages, the last ::draw-page signal
will be for page n_pages - 1.
the number of pages
Sets the print settings for op.
This is typically used to re-establish print settings from a previous print operation, see Gtk.PrintOperation.run.
Optionalprint_settings: Gtk.PrintSettingsSets a property on an object.
The name of the property to set
The value to set the property to
If show_progress is true, the print operation will show
a progress dialog during the print operation.
true to show a progress dialog
Sets whether selection is supported by Gtk.PrintOperation.
true to support selection
If track_status is true, the print operation will try to continue
report on the status of the print job in the printer queues and printer.
This can allow your application to show things like “out of paper” issues, and when the print job actually reaches the printer.
This function is often implemented using some form of polling, so it should not be enabled unless needed.
true to track status after printing
Sets up the transformation for the cairo context obtained from
Gtk.PrintContext in such a way that distances are measured in
units of unit.
If full_page is true, the transformation for the cairo context
obtained from Gtk.PrintContext puts the origin at the top left
corner of the page.
This may not be the top left corner of the sheet, depending on page orientation and the number of pages per sheet). Otherwise, the origin is at the top left corner of the imageable area (i.e. inside the margins).
true to set up the Gtk.PrintContext for the full page
Remove a specified datum from the object's data associations, without invoking the association's destroy handler.
name of the key
the data if found, or null if no such data exists.
This function gets back user data pointers stored via
g_object_set_qdata() and removes the data from object
without invoking its destroy() function (if any was
set).
Usually, calling this function is only required to update
user data pointers with a destroy notifier, for example:
void
object_add_to_user_list (GObject *object,
const gchar *new_string)
{
// the quark, naming the object data
GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
// retrieve the old string list
GList *list = g_object_steal_qdata (object, quark_string_list);
// prepend new string
list = g_list_prepend (list, g_strdup (new_string));
// this changed 'list', so we need to set it again
g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
}
static void
free_string_list (gpointer data)
{
GList *node, *list = data;
for (node = list; node; node = node->next)
g_free (node->data);
g_list_free (list);
}
Using g_object_get_qdata() in the above example, instead of
g_object_steal_qdata() would have left the destroy function set,
and thus the partial string list would have been freed upon
g_object_set_qdata_full().
A GLib.Quark, naming the user data pointer
The user data pointer set, or null
Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
Name of the signal to stop emission of
Reverts the effect of a previous call to
g_object_freeze_notify(). The freeze count is decreased on object
and when it reaches zero, queued "notify" signals are emitted.
Duplicate notifications for each property are squashed so that at most one GObject.Object::notify signal is emitted for each property, in the reverse order in which they have been queued.
It is an error to call this function when the freeze count is zero.
Unblocks a handler so it will be called again during any signal emissions
Handler ID of the handler to be unblocked
Decreases the reference count of object. When its reference count
drops to 0, the object is finalized (i.e. its memory is freed).
If the pointer to the GObject.Object may be reused in future (for example, if it is
an instance variable of another object), it is recommended to clear the
pointer to null rather than retain a dangling pointer to a potentially
invalid GObject.Object instance. Use g_clear_object() for this.
Virtualvfunc_Signal emitted after the user has finished changing print settings in the dialog, before the actual rendering starts.
Virtualvfunc_the constructed function is called by g_object_new() as the
final step of the object creation process. At the point of the call, all
construction properties have been set on the object. The purpose of this
call is to allow for object initialisation steps that can only be performed
after construction properties have been set. constructed implementors
should chain up to the constructed call of their parent class to allow it
to complete its initialisation.
Virtualvfunc_Virtualvfunc_Virtualvfunc_the dispose function is supposed to drop all references to other
objects, but keep the instance otherwise intact, so that client method
invocations still work. It may be run multiple times (due to reference
loops). Before returning, dispose should chain up to the dispose method
of the parent class.
Virtualvfunc_Signal emitted when the print operation run has finished doing everything required for printing.
Virtualvfunc_Signal emitted for every page that is printed.
Virtualvfunc_Ends a preview.
This function must be called to finish a custom print preview.
Virtualvfunc_Virtualvfunc_instance finalization function, should finish the finalization of
the instance begun in dispose and chain up to the finalize method of the
parent class.
Virtualvfunc_Virtualvfunc_Virtualvfunc_Returns whether the given page is included in the set of pages that have been selected for printing.
a page number
Virtualvfunc_Emits a "notify" signal for the property property_name on object.
When possible, eg. when signaling a property change from within the class
that registered the property, you should use g_object_notify_by_pspec()
instead.
Note that emission of the notify signal may be blocked with
g_object_freeze_notify(). In this case, the signal emissions are queued
and will be emitted (in reverse order) when g_object_thaw_notify() is
called.
Virtualvfunc_Signal emitted after the “begin-print” signal, but before the actual rendering starts.
Virtualvfunc_Signal emitted when a preview is requested from the native dialog.
Virtualvfunc_Virtualvfunc_Renders a page to the preview.
This is using the print context that was passed to the
Gtk.PrintOperation::preview handler together
with preview.
A custom print preview should use this function to render the currently selected page.
Note that this function requires a suitable cairo context to be associated with the print context.
the page to render
Virtualvfunc_Emitted once for every page that is printed, to give the application a chance to modify the page setup.
Virtualvfunc_the generic setter for all properties of this type. Should be
overridden for every type with properties. If implementations of
set_property don't emit property change notification explicitly, this will
be done implicitly by the type system. However, if the notify signal is
emitted explicitly, the type system will not emit it a second time.
Virtualvfunc_Emitted at between the various phases of the print operation.
Virtualvfunc_This function essentially limits the life time of the closure to
the life time of the object. That is, when the object is finalized,
the closure is invalidated by calling g_closure_invalidate() on
it, in order to prevent invocations of the closure with a finalized
(nonexisting) object. Also, g_object_ref() and g_object_unref() are
added as marshal guards to the closure, to ensure that an extra
reference count is held on object during invocation of the
closure. Usually, this function will be called on closures that
use this object as closure data.
GObject.Closure to watch
StaticnewStatic_Staticcompat_Optionaldata: anyStaticfind_Staticinstall_Staticinstall_the id for the new property
the GObject.ParamSpec for the new property
Staticinterface_Find the GObject.ParamSpec with the given name for an
interface. Generally, the interface vtable passed in as g_iface
will be the default vtable from g_type_default_interface_ref(), or,
if you know the interface has already been loaded,
g_type_default_interface_peek().
any interface vtable for the interface, or the default vtable for the interface
name of a property to look up.
Staticinterface_Add a property to an interface; this is only useful for interfaces
that are added to GObject-derived types. Adding a property to an
interface forces all objects classes with that interface to have a
compatible property. The compatible property could be a newly
created GObject.ParamSpec, but normally
g_object_class_override_property() will be used so that the object
class only needs to provide an implementation and inherits the
property description, default value, bounds, and so forth from the
interface property.
This function is meant to be called from the interface's default
vtable initialization function (the class_init member of
GObject.TypeInfo.) It must not be called after after class_init has
been called for any object types implementing this interface.
If pspec is a floating reference, it will be consumed.
any interface vtable for the interface, or the default vtable for the interface.
the GObject.ParamSpec for the new property
Staticinterface_Lists the properties of an interface.Generally, the interface
vtable passed in as g_iface will be the default vtable from
g_type_default_interface_ref(), or, if you know the interface has
already been loaded, g_type_default_interface_peek().
any interface vtable for the interface, or the default vtable for the interface
Staticlist_StaticnewvStaticoverride_the new property ID
the name of a property registered in a parent class or in an interface of this class.
High-level, portable printing API.
It looks a bit different than other GTK dialogs such as the Gtk.FileChooser, since some platforms don’t expose enough infrastructure to implement a good print dialog. On such platforms, Gtk.PrintOperation uses the native print dialog. On platforms which do not provide a native print dialog, GTK uses its own, see Gtk.PrintUnixDialog.
The typical way to use the high-level printing API is to create a Gtk.PrintOperation object with Gtk.PrintOperation.new when the user selects to print. Then you set some properties on it, e.g. the page size, any Gtk.PrintSettings from previous print operations, the number of pages, the current page, etc.
Then you start the print operation by calling Gtk.PrintOperation.run. It will then show a dialog, let the user select a printer and options. When the user finished the dialog, various signals will be emitted on the Gtk.PrintOperation, the main one being
Gtk.PrintOperation::draw-page, which you are supposed to handle and render the page on the provided Gtk.PrintContext using Cairo.The high-level printing API
By default Gtk.PrintOperation uses an external application to do print preview. To implement a custom print preview, an application must connect to the preview signal. The functions Gtk.PrintOperationPreview.render_page, Gtk.PrintOperationPreview.end_preview and Gtk.PrintOperationPreview.is_selected are useful when implementing a print preview.