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 GtkPrintUnixDialog.
The typical way to use the high-level printing API is to create
a GtkPrintOperation object with gtk_print_operation_new() when
the user selects to print. Then you set some properties on it,
e.g. the page size, any GtkPrintSettings from previous print
operations, the number of pages, the current page, etc.
Then you start the print operation by calling gtk_print_operation_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
GtkPrintOperation::draw-page, which you are supposed to catch
and render the page on the provided GtkPrintContext using Cairo.
The high-level printing API
(C Language Example):
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
gtk_print_operation_preview_render_page(),
gtk_print_operation_preview_end_preview() and
gtk_print_operation_preview_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
GtkPrintOperation::custom-widget-applysignal 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: { (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, or
nil -
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 theGtkPrintContextand paginate the document accordingly, and then set the number of pages withgtk_print_operation_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
GtkPrintOperation::begin-printif you added a custom widget in theGtkPrintOperation::create-custom-widgethandler. When you get this signal you should read the information from the custom widgets, as the widgets are not guaraneed 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-widget
handlerThe 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 callgtk_print_operation_get_error()for more information.If you enabled print status tracking then
gtk_print_operation_is_finished()may still returnfalseafterGtkPrintOperation::donewas 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 fromcontextusinggtk_print_context_get_cairo_context(). (C Language Example):static void draw_page (GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer user_data) { cairo_t *cr; PangoLayout *layout; gdouble width, text_height; gint 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 = (gdouble)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
gtk_print_operation_set_use_full_page()andgtk_print_operation_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
GtkPrintOperation::begin-printhandler.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
GtkPrintOperation::begin-printsignal, but before the actual rendering starts. It keeps getting emitted until a connected signal handler returnstrue.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 usinggtk_print_operation_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 withgtk_print_context_set_cairo_context().The custom preview implementation can use
gtk_print_operation_preview_is_selected()andgtk_print_operation_preview_render_page()to find pages which are selected for print and render them. The preview must be finished by callinggtk_print_operation_preview_end_preview()(typically in response to the user clicking a close button).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 parent, ornilhandlertrueif 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, to give 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
GtkPrintStatusfor the phases that are being discriminated. Usegtk_print_operation_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-widget
setupactual 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
GtkPrintOperation::begin-print,GtkPrintOperation::paginateorGtkPrintOperation::draw-pagesignal handler to stop the currently running print operation.Declaration
Swift
@inlinable func cancel() -
drawPageFinish()Extension methodSignalize that drawing of particular page is complete.
It is called after completion of page drawing (e.g. drawing in another thread). If
gtk_print_operation_set_defer_drawing()was called before, then this function has to be called by application. In another case it is called by the library itself.Declaration
Swift
@inlinable func drawPageFinish() -
getDefaultPageSetup()Extension methodReturns the default page setup, see
gtk_print_operation_set_default_page_setup().Declaration
Swift
@inlinable func getDefaultPageSetup() -> PageSetupRef! -
getEmbedPageSetup()Extension methodGets the value of
GtkPrintOperation:embed-page-setupproperty.Declaration
Swift
@inlinable func getEmbedPageSetup() -> Bool -
getError()Extension methodCall this when the result of a print operation is
GTK_PRINT_OPERATION_RESULT_ERROR, either as returned bygtk_print_operation_run(), or in theGtkPrintOperation::donesignal handler. The returnedGErrorwill contain more details on what went wrong.Declaration
Swift
@inlinable func getError() throws -
getHasSelection()Extension methodGets the value of
GtkPrintOperation:has-selectionproperty.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 theGtkPrintOperation::status-changedsignal 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 eithergtk_print_operation_set_print_settings()orgtk_print_operation_run()have been called.Declaration
Swift
@inlinable func getPrintSettings() -> PrintSettingsRef! -
getStatus()Extension methodReturns the status of the print operation. Also see
gtk_print_operation_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
gtk_print_operation_get_status()to obtain a status value that is suitable for programmatic use.Declaration
Swift
@inlinable func getStatusString() -> String! -
getSupportSelection()Extension methodGets the value of
GtkPrintOperation:support-selectionproperty.Declaration
Swift
@inlinable func getSupportSelection() -> Bool -
run(action:Extension methodparent: ) Runs the print operation, by first letting the user modify print settings in the print dialog, and then print the document.
Normally that this function does not return until the rendering of all pages is complete. You can connect to the
GtkPrintOperation::status-changedsignal 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 call
gtk_print_operation_set_allow_async()or set theGtkPrintOperation:allow-asyncproperty the operation will run asynchronously if this is supported on the platform. TheGtkPrintOperation::donesignal 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). (C Language Example):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_widget_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, by first letting the user modify print settings in the print dialog, and then print the document.
Normally that this function does not return until the rendering of all pages is complete. You can connect to the
GtkPrintOperation::status-changedsignal 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 call
gtk_print_operation_set_allow_async()or set theGtkPrintOperation:allow-asyncproperty the operation will run asynchronously if this is supported on the platform. TheGtkPrintOperation::donesignal 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). (C Language Example):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_widget_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 the
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
gtk_print_operation_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<gchar>? = nil) -
set(defaultPageSetup:Extension method) Makes
default_page_setupthe default page setup forop.This page setup will be used by
gtk_print_operation_run(), but it can be overridden on a per-page basis by connecting to theGtkPrintOperation::request-page-setupsignal.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
gtk_print_operation_run(), but it can be overridden on a per-page basis by connecting to theGtkPrintOperation::request-page-setupsignal.Declaration
Swift
@inlinable func set<PageSetupT>(defaultPageSetup: PageSetupT?) where PageSetupT : PageSetupProtocol -
setDeferDrawing()Extension methodSets up the
GtkPrintOperationto wait for calling ofgtk_print_operation_draw_page_finish()from application. It can be used for drawing page in another thread.This function must be called in the callback of “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 indended 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<gchar>!) -
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
gtk_print_operation_set_n_pages()in a callback ofGtkPrintOperation::begin-print.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<gchar>!) -
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
GtkPrintOperation::begin-printsignal hander.Note that the page numbers passed to the
GtkPrintOperation::request-page-setupandGtkPrintOperation::draw-pagesignals 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, seegtk_print_operation_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, seegtk_print_operation_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 (which 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, see
gtk_print_operation_set_default_page_setup().Declaration
Swift
@inlinable var defaultPageSetup: PageSetupRef! { get nonmutating set } -
embedPageSetupExtension methodGets the value of
GtkPrintOperation:embed-page-setupproperty.Declaration
Swift
@inlinable var embedPageSetup: Bool { get nonmutating set } -
hasSelectionExtension methodGets the value of
GtkPrintOperation:has-selectionproperty.Declaration
Swift
@inlinable var hasSelection: Bool { get nonmutating set } -
isFinishedExtension methodA convenience function to find out if the print operation is finished, either successfully (
GTK_PRINT_STATUS_FINISHED) or unsuccessfully (GTK_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 theGtkPrintOperation::status-changedsignal 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 eithergtk_print_operation_set_print_settings()orgtk_print_operation_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
gtk_print_operation_get_status()to obtain a status value that is suitable for programmatic use.Declaration
Swift
@inlinable var statusString: String! { get } -
supportSelectionExtension methodGets the value of
GtkPrintOperation:support-selectionproperty.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