PrintOperationProtocol
public protocol PrintOperationProtocol : ObjectProtocol, PrintOperationPreviewProtocol
GtkPrintOperation is the high-level, portable printing API.
It looks a bit different than other GTK dialogs such as the
GtkFileChooser, since some platforms don’t expose enough
infrastructure to implement a good print dialog. On such
platforms, GtkPrintOperation uses the native print dialog.
On platforms which do not provide a native print dialog, GTK
uses its own, see [classGtk.PrintUnixDialog].
The typical way to use the high-level printing API is to create
a GtkPrintOperation object with [ctorGtk.PrintOperation.new]
when the user selects to print. Then you set some properties on it,
e.g. the page size, any [classGtk.PrintSettings] from previous print
operations, the number of pages, the current page, etc.
Then you start the print operation by calling [methodGtk.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 GtkPrintOperation, the main one being
[signalGtk.PrintOperation::draw-page], which you are supposed to handle
and render the page on the provided [classGtk.PrintContext] using Cairo.
The high-level printing API
static GtkPrintSettings *settings = NULL;
static void
do_print (void)
{
GtkPrintOperation *print;
GtkPrintOperationResult res;
print = gtk_print_operation_new ();
if (settings != NULL)
gtk_print_operation_set_print_settings (print, settings);
g_signal_connect (print, "begin_print", G_CALLBACK (begin_print), NULL);
g_signal_connect (print, "draw_page", G_CALLBACK (draw_page), NULL);
res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
GTK_WINDOW (main_window), NULL);
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));
}
g_object_unref (print);
}
By default GtkPrintOperation uses an external application to do
print preview. To implement a custom print preview, an application
must connect to the preview signal. The functions
[methodGtk.PrintOperationPreview.render_page],
[methodGtk.PrintOperationPreview.end_preview] and
[methodGtk.PrintOperationPreview.is_selected]
are useful when implementing a print preview.
The PrintOperationProtocol protocol exposes the methods and properties of an underlying GtkPrintOperation instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see PrintOperation.
Alternatively, use PrintOperationRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkPrintOperationinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
print_operation_ptrDefault implementationTyped pointer to the underlying
GtkPrintOperationinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkPrintOperationinstance.Declaration
Swift
var print_operation_ptr: UnsafeMutablePointer<GtkPrintOperation>! { get } -
Required Initialiser for types conforming to
PrintOperationProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
PrintOperationPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: PrintOperationPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a PrintOperation property
Declaration
Swift
@inlinable func get(property: PrintOperationPropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) Set the value of a PrintOperation property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: PrintOperationPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
PrintOperationSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: PrintOperationSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
PrintOperationSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: PrintOperationSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
createCustomWidgetSignalExtension methodEmitted when displaying the print dialog.
If you return a widget in a handler for this signal it will be added to a custom tab in the print dialog. You typically return a container widget with multiple widgets in it.
The print dialog owns the returned widget, and its lifetime is not controlled by the application. However, the widget is guaranteed to stay around until the [signal
Gtk.PrintOperation::custom-widget-apply] signal is emitted on the operation. Then you can read out any information you need from the widgets.Note
This represents the underlyingcreate-custom-widgetsignalWarning
aonCreateCustomWidgetwrapper for this signal could not be generated because it contains unimplemented features: { (8) nullable argument or return type is not allowed, (9) Record return type is not yet supported }Note
Instead, you can connectcreateCustomWidgetSignalusing theconnect(signal:)methodsDeclaration
Swift
static var createCustomWidgetSignal: PrintOperationSignalName { get }Parameters
flagsFlags
unownedSelfReference to instance of self
handlerA custom widget that gets embedded in the print dialog
-
onBeginPrint(flags:Extension methodhandler: ) Emitted after the user has finished changing print settings in the dialog, before the actual rendering starts.
A typical use for
begin-printis to use the parameters from the [classGtk.PrintContext] and paginate the document accordingly, and then set the number of pages with [methodGtk.PrintOperation.set_n_pages].Note
This represents the underlyingbegin-printsignalDeclaration
Swift
@discardableResult @inlinable func onBeginPrint(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ context: PrintContextRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
contextthe
GtkPrintContextfor the current operationhandlerThe signal handler to call Run the given callback whenever the
beginPrintsignal is emitted -
beginPrintSignalExtension methodTyped
begin-printsignal for using theconnect(signal:)methodsDeclaration
Swift
static var beginPrintSignal: PrintOperationSignalName { get } -
onCustomWidgetApply(flags:Extension methodhandler: ) Emitted right before
begin-printif you added a custom widget in thecreate-custom-widgethandler.When you get this signal you should read the information from the custom widgets, as the widgets are not guaranteed to be around at a later time.
Note
This represents the underlyingcustom-widget-applysignalDeclaration
Swift
@discardableResult @inlinable func onCustomWidgetApply(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ widget: WidgetRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
widgetthe custom widget added in
create-custom-widgethandlerThe signal handler to call Run the given callback whenever the
customWidgetApplysignal is emitted -
customWidgetApplySignalExtension methodTyped
custom-widget-applysignal for using theconnect(signal:)methodsDeclaration
Swift
static var customWidgetApplySignal: PrintOperationSignalName { get } -
onDone(flags:Extension methodhandler: ) Emitted when the print operation run has finished doing everything required for printing.
resultgives you information about what happened during the run. IfresultisGTK_PRINT_OPERATION_RESULT_ERRORthen you can call [methodGtk.PrintOperation.get_error] for more information.If you enabled print status tracking then [method
Gtk.PrintOperation.is_finished] may still returnfalseafter thedonesignal was emitted.Note
This represents the underlyingdonesignalDeclaration
Swift
@discardableResult @inlinable func onDone(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ result: PrintOperationResult) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
resultthe result of the print operation
handlerThe signal handler to call Run the given callback whenever the
donesignal is emitted -
doneSignalExtension methodTyped
donesignal for using theconnect(signal:)methodsDeclaration
Swift
static var doneSignal: PrintOperationSignalName { get } -
onDrawPage(flags:Extension methodhandler: ) Emitted for every page that is printed.
The signal handler must render the
page_nr‘s page onto the cairo context obtained fromcontextusing [methodGtk.PrintContext.get_cairo_context].static void draw_page (GtkPrintOperation *operation, GtkPrintContext *context, int page_nr, gpointer user_data) { cairo_t *cr; PangoLayout *layout; double width, text_height; int layout_height; PangoFontDescription *desc; cr = gtk_print_context_get_cairo_context (context); width = gtk_print_context_get_width (context); cairo_rectangle (cr, 0, 0, width, HEADER_HEIGHT); cairo_set_source_rgb (cr, 0.8, 0.8, 0.8); cairo_fill (cr); layout = gtk_print_context_create_pango_layout (context); desc = pango_font_description_from_string ("sans 14"); pango_layout_set_font_description (layout, desc); pango_font_description_free (desc); pango_layout_set_text (layout, "some text", -1); pango_layout_set_width (layout, width * PANGO_SCALE); pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER); pango_layout_get_size (layout, NULL, &layout_height); text_height = (double)layout_height / PANGO_SCALE; cairo_move_to (cr, width / 2, (HEADER_HEIGHT - text_height) / 2); pango_cairo_show_layout (cr, layout); g_object_unref (layout); }Use [method
Gtk.PrintOperation.set_use_full_page] and [methodGtk.PrintOperation.set_unit] before starting the print operation to set up the transformation of the cairo context according to your needs.Note
This represents the underlyingdraw-pagesignalDeclaration
Swift
@discardableResult @inlinable func onDrawPage(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ context: PrintContextRef, _ pageNr: Int) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
contextthe
GtkPrintContextfor the current operationpageNrthe number of the currently printed page (0-based)
handlerThe signal handler to call Run the given callback whenever the
drawPagesignal is emitted -
drawPageSignalExtension methodTyped
draw-pagesignal for using theconnect(signal:)methodsDeclaration
Swift
static var drawPageSignal: PrintOperationSignalName { get } -
onEndPrint(flags:Extension methodhandler: ) Emitted after all pages have been rendered.
A handler for this signal can clean up any resources that have been allocated in the [signal
Gtk.PrintOperation::begin-print] handler.Note
This represents the underlyingend-printsignalDeclaration
Swift
@discardableResult @inlinable func onEndPrint(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ context: PrintContextRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
contextthe
GtkPrintContextfor the current operationhandlerThe signal handler to call Run the given callback whenever the
endPrintsignal is emitted -
endPrintSignalExtension methodTyped
end-printsignal for using theconnect(signal:)methodsDeclaration
Swift
static var endPrintSignal: PrintOperationSignalName { get } -
onPaginate(flags:Extension methodhandler: ) Emitted after the
begin-printsignal, but before the actual rendering starts.It keeps getting emitted until a connected signal handler returns
true.The
paginatesignal is intended to be used for paginating a document in small chunks, to avoid blocking the user interface for a long time. The signal handler should update the number of pages using [methodGtk.PrintOperation.set_n_pages], and returntrueif the document has been completely paginated.If you don’t need to do pagination in chunks, you can simply do it all in the
begin-printhandler, and set the number of pages from there.Note
This represents the underlyingpaginatesignalDeclaration
Swift
@discardableResult @inlinable func onPaginate(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ context: PrintContextRef) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
contextthe
GtkPrintContextfor the current operationhandlertrueif pagination is complete Run the given callback whenever thepaginatesignal is emitted -
paginateSignalExtension methodTyped
paginatesignal for using theconnect(signal:)methodsDeclaration
Swift
static var paginateSignal: PrintOperationSignalName { get } -
onPreview(flags:Extension methodhandler: ) Gets emitted when a preview is requested from the native dialog.
The default handler for this signal uses an external viewer application to preview.
To implement a custom print preview, an application must return
truefrom its handler for this signal. In order to use the providedcontextfor the preview implementation, it must be given a suitable cairo context with [methodGtk.PrintContext.set_cairo_context].The custom preview implementation can use [method
Gtk.PrintOperationPreview.is_selected] and [methodGtk.PrintOperationPreview.render_page] to find pages which are selected for print and render them. The preview must be finished by calling methodGtk.PrintOperationPreview.end_preview.Note
This represents the underlyingpreviewsignalDeclaration
Swift
@discardableResult @inlinable func onPreview(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ preview: PrintOperationPreviewRef, _ context: PrintContextRef, _ parent: WindowRef?) -> Bool) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
previewthe
GtkPrintOperationPreviewfor the current operationcontextthe
GtkPrintContextthat will be usedparentthe
GtkWindowto use as window parenthandlertrueif the listener wants to take over control of the preview Run the given callback whenever thepreviewsignal is emitted -
previewSignalExtension methodTyped
previewsignal for using theconnect(signal:)methodsDeclaration
Swift
static var previewSignal: PrintOperationSignalName { get } -
onRequestPageSetup(flags:Extension methodhandler: ) Emitted once for every page that is printed.
This gives the application a chance to modify the page setup. Any changes done to
setupwill be in force only for printing this page.Note
This represents the underlyingrequest-page-setupsignalDeclaration
Swift
@discardableResult @inlinable func onRequestPageSetup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ context: PrintContextRef, _ pageNr: Int, _ setup: PageSetupRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
contextthe
GtkPrintContextfor the current operationpageNrthe number of the currently printed page (0-based)
setupthe
GtkPageSetuphandlerThe signal handler to call Run the given callback whenever the
requestPageSetupsignal is emitted -
requestPageSetupSignalExtension methodTyped
request-page-setupsignal for using theconnect(signal:)methodsDeclaration
Swift
static var requestPageSetupSignal: PrintOperationSignalName { get } -
onStatusChanged(flags:Extension methodhandler: ) Emitted at between the various phases of the print operation.
See [enum
Gtk.PrintStatus] for the phases that are being discriminated. Use [methodGtk.PrintOperation.get_status] to find out the current status.Note
This represents the underlyingstatus-changedsignalDeclaration
Swift
@discardableResult @inlinable func onStatusChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
statusChangedsignal is emitted -
statusChangedSignalExtension methodTyped
status-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var statusChangedSignal: PrintOperationSignalName { get } -
onUpdateCustomWidget(flags:Extension methodhandler: ) Emitted after change of selected printer.
The actual page setup and print settings are passed to the custom widget, which can actualize itself according to this change.
Note
This represents the underlyingupdate-custom-widgetsignalDeclaration
Swift
@discardableResult @inlinable func onUpdateCustomWidget(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ widget: WidgetRef, _ setup: PageSetupRef, _ settings: PrintSettingsRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
widgetthe custom widget added in
create-custom-widgetsetupactual page setup
settingsactual print settings
handlerThe signal handler to call Run the given callback whenever the
updateCustomWidgetsignal is emitted -
updateCustomWidgetSignalExtension methodTyped
update-custom-widgetsignal for using theconnect(signal:)methodsDeclaration
Swift
static var updateCustomWidgetSignal: PrintOperationSignalName { get } -
onNotifyAllowAsync(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::allow-asyncsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyAllowAsync(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyAllowAsyncsignal is emitted -
notifyAllowAsyncSignalExtension methodTyped
notify::allow-asyncsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyAllowAsyncSignal: PrintOperationSignalName { get } -
onNotifyCurrentPage(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::current-pagesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyCurrentPage(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyCurrentPagesignal is emitted -
notifyCurrentPageSignalExtension methodTyped
notify::current-pagesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyCurrentPageSignal: PrintOperationSignalName { get } -
onNotifyCustomTabLabel(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::custom-tab-labelsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyCustomTabLabel(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyCustomTabLabelsignal is emitted -
notifyCustomTabLabelSignalExtension methodTyped
notify::custom-tab-labelsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyCustomTabLabelSignal: PrintOperationSignalName { get } -
onNotifyDefaultPageSetup(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::default-page-setupsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyDefaultPageSetup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyDefaultPageSetupsignal is emitted -
notifyDefaultPageSetupSignalExtension methodTyped
notify::default-page-setupsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyDefaultPageSetupSignal: PrintOperationSignalName { get } -
onNotifyEmbedPageSetup(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::embed-page-setupsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyEmbedPageSetup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyEmbedPageSetupsignal is emitted -
notifyEmbedPageSetupSignalExtension methodTyped
notify::embed-page-setupsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyEmbedPageSetupSignal: PrintOperationSignalName { get } -
onNotifyExportFilename(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::export-filenamesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyExportFilename(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyExportFilenamesignal is emitted -
notifyExportFilenameSignalExtension methodTyped
notify::export-filenamesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyExportFilenameSignal: PrintOperationSignalName { get } -
onNotifyHasSelection(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::has-selectionsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasSelection(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyHasSelectionsignal is emitted -
notifyHasSelectionSignalExtension methodTyped
notify::has-selectionsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyHasSelectionSignal: PrintOperationSignalName { get } -
onNotifyJobName(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::job-namesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyJobName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyJobNamesignal is emitted -
notifyJobNameSignalExtension methodTyped
notify::job-namesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyJobNameSignal: PrintOperationSignalName { get } -
onNotifyNPages(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::n-pagessignalDeclaration
Swift
@discardableResult @inlinable func onNotifyNPages(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyNPagessignal is emitted -
notifyNPagesSignalExtension methodTyped
notify::n-pagessignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyNPagesSignal: PrintOperationSignalName { get } -
onNotifyNPagesToPrint(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::n-pages-to-printsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyNPagesToPrint(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyNPagesToPrintsignal is emitted -
notifyNPagesToPrintSignalExtension methodTyped
notify::n-pages-to-printsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyNPagesToPrintSignal: PrintOperationSignalName { get } -
onNotifyPrintSettings(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::print-settingssignalDeclaration
Swift
@discardableResult @inlinable func onNotifyPrintSettings(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyPrintSettingssignal is emitted -
notifyPrintSettingsSignalExtension methodTyped
notify::print-settingssignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyPrintSettingsSignal: PrintOperationSignalName { get } -
onNotifyShowProgress(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-progresssignalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowProgress(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyShowProgresssignal is emitted -
notifyShowProgressSignalExtension methodTyped
notify::show-progresssignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyShowProgressSignal: PrintOperationSignalName { get } -
onNotifyStatus(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::statussignalDeclaration
Swift
@discardableResult @inlinable func onNotifyStatus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyStatussignal is emitted -
notifyStatusSignalExtension methodTyped
notify::statussignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyStatusSignal: PrintOperationSignalName { get } -
onNotifyStatusString(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::status-stringsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyStatusString(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyStatusStringsignal is emitted -
notifyStatusStringSignalExtension methodTyped
notify::status-stringsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyStatusStringSignal: PrintOperationSignalName { get } -
onNotifySupportSelection(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::support-selectionsignalDeclaration
Swift
@discardableResult @inlinable func onNotifySupportSelection(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifySupportSelectionsignal is emitted -
notifySupportSelectionSignalExtension methodTyped
notify::support-selectionsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifySupportSelectionSignal: PrintOperationSignalName { get } -
onNotifyTrackPrintStatus(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::track-print-statussignalDeclaration
Swift
@discardableResult @inlinable func onNotifyTrackPrintStatus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyTrackPrintStatussignal is emitted -
notifyTrackPrintStatusSignalExtension methodTyped
notify::track-print-statussignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyTrackPrintStatusSignal: PrintOperationSignalName { get } -
onNotifyUnit(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::unitsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyUnit(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyUnitsignal is emitted -
notifyUnitSignalExtension methodTyped
notify::unitsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyUnitSignal: PrintOperationSignalName { get } -
onNotifyUseFullPage(flags:Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property(),g_object_set(), et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY, then any call tog_object_set_property()results innotifybeing emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly callg_object_notify()org_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::use-full-pagesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyUseFullPage(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyUseFullPagesignal is emitted -
notifyUseFullPageSignalExtension methodTyped
notify::use-full-pagesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyUseFullPageSignal: PrintOperationSignalName { get }
-
cancel()Extension methodCancels a running print operation.
This function may be called from a [signal
Gtk.PrintOperation::begin-print], [signalGtk.PrintOperation::paginate] or [signalGtk.PrintOperation::draw-page] signal handler to stop the currently running print operation.Declaration
Swift
@inlinable func cancel() -
drawPageFinish()Extension methodSignal that drawing of particular page is complete.
It is called after completion of page drawing (e.g. drawing in another thread). If [method
Gtk.PrintOperation.set_defer_drawing] was called before, then this function has to be called by application. Otherwise it is called by GTK itself.Declaration
Swift
@inlinable func drawPageFinish() -
getDefaultPageSetup()Extension methodReturns the default page setup.
Declaration
Swift
@inlinable func getDefaultPageSetup() -> PageSetupRef! -
getEmbedPageSetup()Extension methodGets whether page setup selection combos are embedded
Declaration
Swift
@inlinable func getEmbedPageSetup() -> Bool -
getError()Extension methodCall this when the result of a print operation is
GTK_PRINT_OPERATION_RESULT_ERROR.It can be called either after [method
Gtk.PrintOperation.run] returns, or in the [signalGtk.PrintOperation::done] signal handler.The returned
GErrorwill contain more details on what went wrong.Declaration
Swift
@inlinable func getError() throws -
getHasSelection()Extension methodGets whether there is a selection.
Declaration
Swift
@inlinable func getHasSelection() -> Bool -
getNPagesToPrint()Extension methodReturns the number of pages that will be printed.
Note that this value is set during print preparation phase (
GTK_PRINT_STATUS_PREPARING), so this function should never be called before the data generation phase (GTK_PRINT_STATUS_GENERATING_DATA). You can connect to the [signalGtk.PrintOperation::status-changed] signal and callgtk_print_operation_get_n_pages_to_print()when print status isGTK_PRINT_STATUS_GENERATING_DATA.This is typically used to track the progress of print operation.
Declaration
Swift
@inlinable func getNPagesToPrint() -> Int -
getPrintSettings()Extension methodReturns the current print settings.
Note that the return value is
niluntil either [methodGtk.PrintOperation.set_print_settings] or [methodGtk.PrintOperation.run] have been called.Declaration
Swift
@inlinable func getPrintSettings() -> PrintSettingsRef! -
getStatus()Extension methodReturns the status of the print operation.
Also see [method
Gtk.PrintOperation.get_status_string].Declaration
Swift
@inlinable func getStatus() -> GtkPrintStatus -
getStatusString()Extension methodReturns 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
GtkStatusbar.Use [method
Gtk.PrintOperation.get_status] to obtain a status value that is suitable for programmatic use.Declaration
Swift
@inlinable func getStatusString() -> String! -
getSupportSelection()Extension methodGets whether the application supports print of selection
Declaration
Swift
@inlinable func getSupportSelection() -> Bool -
run(action:Extension methodparent: ) Runs the print operation.
Normally that this function does not return until the rendering of all pages is complete. You can connect to the [signal
Gtk.PrintOperation::status-changed] signal onopto 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 [signal
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_widget_show (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 givenGtkPrintOperation.Declaration
Swift
@inlinable func run(action: GtkPrintOperationAction, parent: WindowRef? = nil) throws -> GtkPrintOperationResult -
run(action:Extension methodparent: ) Runs the print operation.
Normally that this function does not return until the rendering of all pages is complete. You can connect to the [signal
Gtk.PrintOperation::status-changed] signal onopto 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 [signal
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_widget_show (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 givenGtkPrintOperation.Declaration
Swift
@inlinable func run<WindowT>(action: GtkPrintOperationAction, parent: WindowT?) throws -> GtkPrintOperationResult where WindowT : WindowProtocol -
set(allowAsync:Extension method) Sets whether
gtk_print_operation_run()may return before the print operation is completed.Note that some platforms may not allow asynchronous operation.
Declaration
Swift
@inlinable func set(allowAsync: Bool) -
set(currentPage:Extension method) Sets the current page.
If this is called before [method
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.
Declaration
Swift
@inlinable func set(currentPage: Int) -
setCustomTab(label:Extension method) Sets the label for the tab holding custom widgets.
Declaration
Swift
@inlinable func setCustomTab(label: UnsafePointer<CChar>? = nil) -
set(defaultPageSetup:Extension method) Makes
default_page_setupthe default page setup forop.This page setup will be used by [method
Gtk.PrintOperation.run], but it can be overridden on a per-page basis by connecting to the [signalGtk.PrintOperation::request-page-setup] signal.Declaration
Swift
@inlinable func set(defaultPageSetup: PageSetupRef? = nil) -
set(defaultPageSetup:Extension method) Makes
default_page_setupthe default page setup forop.This page setup will be used by [method
Gtk.PrintOperation.run], but it can be overridden on a per-page basis by connecting to the [signalGtk.PrintOperation::request-page-setup] signal.Declaration
Swift
@inlinable func set<PageSetupT>(defaultPageSetup: PageSetupT?) where PageSetupT : PageSetupProtocol -
setDeferDrawing()Extension methodSets up the
GtkPrintOperationto wait for calling of [methodGtk.PrintOperation.draw_page_finishfrom application.This can be used for drawing page in another thread.
This function must be called in the callback of the [signal
Gtk.PrintOperation::draw-page] signal.Declaration
Swift
@inlinable func setDeferDrawing() -
setEmbedPageSetup(embed:Extension method) Embed page size combo box and orientation combo box into page setup page.
Selected page setup is stored as default page setup in
GtkPrintOperation.Declaration
Swift
@inlinable func setEmbedPageSetup(embed: Bool) -
setExport(filename:Extension method) Sets up the
GtkPrintOperationto 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.
Declaration
Swift
@inlinable func setExport(filename: UnsafePointer<CChar>!) -
set(hasSelection:Extension method) Sets whether there is a selection to print.
Application has to set number of pages to which the selection will draw by [method
Gtk.PrintOperation.set_n_pages] in a handler for the [signalGtk.PrintOperation::begin-print] signal.Declaration
Swift
@inlinable func set(hasSelection: Bool) -
set(jobName:Extension method) 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.
Declaration
Swift
@inlinable func set(jobName: UnsafePointer<CChar>!) -
set(nPages:Extension method) 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 [signal
Gtk.PrintOperation::begin-print] signal handler.Note that the page numbers passed to the [signal
Gtk.PrintOperation::request-page-setup] and [signalGtk.PrintOperation::draw-page] signals are 0-based, i.e. if the user chooses to print all pages, the lastdraw-pagesignal will be for pagen_pages- 1.Declaration
Swift
@inlinable func set(nPages: Int) -
set(printSettings:Extension method) Sets the print settings for
op.This is typically used to re-establish print settings from a previous print operation, see [method
Gtk.PrintOperation.run].Declaration
Swift
@inlinable func set(printSettings: PrintSettingsRef? = nil) -
set(printSettings:Extension method) Sets the print settings for
op.This is typically used to re-establish print settings from a previous print operation, see [method
Gtk.PrintOperation.run].Declaration
Swift
@inlinable func set<PrintSettingsT>(printSettings: PrintSettingsT?) where PrintSettingsT : PrintSettingsProtocol -
set(showProgress:Extension method) If
show_progressistrue, the print operation will show a progress dialog during the print operation.Declaration
Swift
@inlinable func set(showProgress: Bool) -
set(supportSelection:Extension method) Sets whether selection is supported by
GtkPrintOperation.Declaration
Swift
@inlinable func set(supportSelection: Bool) -
setTrackPrintStatus(trackStatus:Extension method) 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.
Declaration
Swift
@inlinable func setTrackPrintStatus(trackStatus: Bool) -
set(unit:Extension method) Sets up the transformation for the cairo context obtained from
GtkPrintContextin such a way that distances are measured in units ofunit.Declaration
Swift
@inlinable func set(unit: GtkUnit) -
setUse(fullPage:Extension method) If
full_pageistrue, the transformation for the cairo context obtained fromGtkPrintContextputs 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).
Declaration
Swift
@inlinable func setUse(fullPage: Bool) -
defaultPageSetupExtension methodReturns the default page setup.
Declaration
Swift
@inlinable var defaultPageSetup: PageSetupRef! { get nonmutating set } -
embedPageSetupExtension methodGets whether page setup selection combos are embedded
Declaration
Swift
@inlinable var embedPageSetup: Bool { get nonmutating set } -
hasSelectionExtension methodGets whether there is a selection.
Declaration
Swift
@inlinable var hasSelection: Bool { get nonmutating set } -
isFinishedExtension methodA convenience function to find out if the print operation is finished.
a print operation is finished if its status is either
GTK_PRINT_STATUS_FINISHEDorGTK_PRINT_STATUS_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.
Declaration
Swift
@inlinable var isFinished: Bool { get } -
nPagesToPrintExtension methodReturns the number of pages that will be printed.
Note that this value is set during print preparation phase (
GTK_PRINT_STATUS_PREPARING), so this function should never be called before the data generation phase (GTK_PRINT_STATUS_GENERATING_DATA). You can connect to the [signalGtk.PrintOperation::status-changed] signal and callgtk_print_operation_get_n_pages_to_print()when print status isGTK_PRINT_STATUS_GENERATING_DATA.This is typically used to track the progress of print operation.
Declaration
Swift
@inlinable var nPagesToPrint: Int { get } -
printSettingsExtension methodReturns the current print settings.
Note that the return value is
niluntil either [methodGtk.PrintOperation.set_print_settings] or [methodGtk.PrintOperation.run] have been called.Declaration
Swift
@inlinable var printSettings: PrintSettingsRef! { get nonmutating set } -
statusExtension methodThe status of the print operation.
Declaration
Swift
@inlinable var status: GtkPrintStatus { get } -
statusStringExtension methodReturns 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
GtkStatusbar.Use [method
Gtk.PrintOperation.get_status] to obtain a status value that is suitable for programmatic use.Declaration
Swift
@inlinable var statusString: String! { get } -
supportSelectionExtension methodGets whether the application supports print of selection
Declaration
Swift
@inlinable var supportSelection: Bool { get nonmutating set } -
parentInstanceExtension methodUndocumented
Declaration
Swift
@inlinable var parentInstance: GObject { get }
View on GitHub
Install in Dash
PrintOperationProtocol Protocol Reference