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.

  • ptr

    Untyped pointer to the underlying GtkPrintOperation instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • print_operation_ptr Default implementation

    Typed pointer to the underlying GtkPrintOperation instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkPrintOperation instance.

    Declaration

    Swift

    var print_operation_ptr: UnsafeMutablePointer<GtkPrintOperation>! { get }
  • Required Initialiser for types conforming to PrintOperationProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

PrintOperation Class

  • Bind a PrintOperationPropertyName source 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 : ObjectProtocol

    Parameters

    source_property

    the source property to bind

    target

    the target object to bind to

    target_property

    the target property to bind to

    flags

    the flags to pass to the Binding

    transform_from

    ValueTransformer to use for forward transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return Value

    binding reference or nil in case of an error

  • get(property:) Extension method

    Get the value of a PrintOperation property

    Declaration

    Swift

    @inlinable
    func get(property: PrintOperationPropertyName) -> GLibObject.Value

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

  • set(property:value:) Extension method

    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

    property

    the property to get the value for

    Return Value

    the value of the named property

PrintOperation signals

  • Connect a Swift signal handler to the given, typed PrintOperationSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: PrintOperationSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    handler

    The 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 a C signal handler to the given, typed PrintOperationSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: PrintOperationSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    signalHandler

    The C function to be called on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • createCustomWidgetSignal Extension method

    Emitted 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 [signalGtk.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 underlying create-custom-widget signal

    Warning

    a onCreateCustomWidget wrapper 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 connect createCustomWidgetSignal using the connect(signal:) methods

    Declaration

    Swift

    static var createCustomWidgetSignal: PrintOperationSignalName { get }

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    A custom widget that gets embedded in the print dialog

  • onBeginPrint(flags:handler:) Extension method

    Emitted after the user has finished changing print settings in the dialog, before the actual rendering starts.

    A typical use for begin-print is 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 underlying begin-print signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onBeginPrint(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ context: PrintContextRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    context

    the GtkPrintContext for the current operation

    handler

    The signal handler to call Run the given callback whenever the beginPrint signal is emitted

  • beginPrintSignal Extension method

    Typed begin-print signal for using the connect(signal:) methods

    Declaration

    Swift

    static var beginPrintSignal: PrintOperationSignalName { get }
  • Emitted right before begin-print if you added a custom widget in the create-custom-widget handler.

    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 underlying custom-widget-apply signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onCustomWidgetApply(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ widget: WidgetRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    widget

    the custom widget added in create-custom-widget

    handler

    The signal handler to call Run the given callback whenever the customWidgetApply signal is emitted

  • customWidgetApplySignal Extension method

    Typed custom-widget-apply signal for using the connect(signal:) methods

    Declaration

    Swift

    static var customWidgetApplySignal: PrintOperationSignalName { get }
  • onDone(flags:handler:) Extension method

    Emitted when the print operation run has finished doing everything required for printing.

    result gives you information about what happened during the run. If result is GTK_PRINT_OPERATION_RESULT_ERROR then you can call [methodGtk.PrintOperation.get_error] for more information.

    If you enabled print status tracking then [methodGtk.PrintOperation.is_finished] may still return false after the done signal was emitted.

    Note

    This represents the underlying done signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onDone(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ result: PrintOperationResult) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    result

    the result of the print operation

    handler

    The signal handler to call Run the given callback whenever the done signal is emitted

  • doneSignal Extension method

    Typed done signal for using the connect(signal:) methods

    Declaration

    Swift

    static var doneSignal: PrintOperationSignalName { get }
  • onDrawPage(flags:handler:) Extension method

    Emitted for every page that is printed.

    The signal handler must render the page_nr‘s page onto the cairo context obtained from context using [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 [methodGtk.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 underlying draw-page signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onDrawPage(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ context: PrintContextRef, _ pageNr: Int) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    context

    the GtkPrintContext for the current operation

    pageNr

    the number of the currently printed page (0-based)

    handler

    The signal handler to call Run the given callback whenever the drawPage signal is emitted

  • drawPageSignal Extension method

    Typed draw-page signal for using the connect(signal:) methods

    Declaration

    Swift

    static var drawPageSignal: PrintOperationSignalName { get }
  • onEndPrint(flags:handler:) Extension method

    Emitted after all pages have been rendered.

    A handler for this signal can clean up any resources that have been allocated in the [signalGtk.PrintOperation::begin-print] handler.

    Note

    This represents the underlying end-print signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onEndPrint(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ context: PrintContextRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    context

    the GtkPrintContext for the current operation

    handler

    The signal handler to call Run the given callback whenever the endPrint signal is emitted

  • endPrintSignal Extension method

    Typed end-print signal for using the connect(signal:) methods

    Declaration

    Swift

    static var endPrintSignal: PrintOperationSignalName { get }
  • onPaginate(flags:handler:) Extension method

    Emitted after the begin-print signal, but before the actual rendering starts.

    It keeps getting emitted until a connected signal handler returns true.

    The paginate signal 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 return true if 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-print handler, and set the number of pages from there.

    Note

    This represents the underlying paginate signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onPaginate(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ context: PrintContextRef) -> Bool) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    context

    the GtkPrintContext for the current operation

    handler

    true if pagination is complete Run the given callback whenever the paginate signal is emitted

  • paginateSignal Extension method

    Typed paginate signal for using the connect(signal:) methods

    Declaration

    Swift

    static var paginateSignal: PrintOperationSignalName { get }
  • onPreview(flags:handler:) Extension method

    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 true from its handler for this signal. In order to use the provided context for the preview implementation, it must be given a suitable cairo context with [methodGtk.PrintContext.set_cairo_context].

    The custom preview implementation can use [methodGtk.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 underlying preview signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onPreview(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ preview: PrintOperationPreviewRef, _ context: PrintContextRef, _ parent: WindowRef?) -> Bool) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    preview

    the GtkPrintOperationPreview for the current operation

    context

    the GtkPrintContext that will be used

    parent

    the GtkWindow to use as window parent

    handler

    true if the listener wants to take over control of the preview Run the given callback whenever the preview signal is emitted

  • previewSignal Extension method

    Typed preview signal for using the connect(signal:) methods

    Declaration

    Swift

    static var previewSignal: PrintOperationSignalName { get }
  • Emitted once for every page that is printed.

    This gives the application a chance to modify the page setup. Any changes done to setup will be in force only for printing this page.

    Note

    This represents the underlying request-page-setup signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onRequestPageSetup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ context: PrintContextRef, _ pageNr: Int, _ setup: PageSetupRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    context

    the GtkPrintContext for the current operation

    pageNr

    the number of the currently printed page (0-based)

    setup

    the GtkPageSetup

    handler

    The signal handler to call Run the given callback whenever the requestPageSetup signal is emitted

  • requestPageSetupSignal Extension method

    Typed request-page-setup signal for using the connect(signal:) methods

    Declaration

    Swift

    static var requestPageSetupSignal: PrintOperationSignalName { get }
  • Emitted at between the various phases of the print operation.

    See [enumGtk.PrintStatus] for the phases that are being discriminated. Use [methodGtk.PrintOperation.get_status] to find out the current status.

    Note

    This represents the underlying status-changed signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onStatusChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the statusChanged signal is emitted

  • statusChangedSignal Extension method

    Typed status-changed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var statusChangedSignal: PrintOperationSignalName { get }
  • 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 underlying update-custom-widget signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onUpdateCustomWidget(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ widget: WidgetRef, _ setup: PageSetupRef, _ settings: PrintSettingsRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    widget

    the custom widget added in create-custom-widget

    setup

    actual page setup

    settings

    actual print settings

    handler

    The signal handler to call Run the given callback whenever the updateCustomWidget signal is emitted

  • updateCustomWidgetSignal Extension method

    Typed update-custom-widget signal for using the connect(signal:) methods

    Declaration

    Swift

    static var updateCustomWidgetSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::allow-async signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyAllowAsync(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyAllowAsync signal is emitted

  • notifyAllowAsyncSignal Extension method

    Typed notify::allow-async signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyAllowAsyncSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::current-page signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyCurrentPage(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyCurrentPage signal is emitted

  • notifyCurrentPageSignal Extension method

    Typed notify::current-page signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyCurrentPageSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::custom-tab-label signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyCustomTabLabel(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyCustomTabLabel signal is emitted

  • notifyCustomTabLabelSignal Extension method

    Typed notify::custom-tab-label signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyCustomTabLabelSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::default-page-setup signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyDefaultPageSetup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyDefaultPageSetup signal is emitted

  • notifyDefaultPageSetupSignal Extension method

    Typed notify::default-page-setup signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyDefaultPageSetupSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::embed-page-setup signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyEmbedPageSetup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyEmbedPageSetup signal is emitted

  • notifyEmbedPageSetupSignal Extension method

    Typed notify::embed-page-setup signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyEmbedPageSetupSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::export-filename signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyExportFilename(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyExportFilename signal is emitted

  • notifyExportFilenameSignal Extension method

    Typed notify::export-filename signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyExportFilenameSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::has-selection signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyHasSelection(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyHasSelection signal is emitted

  • notifyHasSelectionSignal Extension method

    Typed notify::has-selection signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyHasSelectionSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::job-name signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyJobName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyJobName signal is emitted

  • notifyJobNameSignal Extension method

    Typed notify::job-name signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyJobNameSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::n-pages signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyNPages(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyNPages signal is emitted

  • notifyNPagesSignal Extension method

    Typed notify::n-pages signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyNPagesSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::n-pages-to-print signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyNPagesToPrint(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyNPagesToPrint signal is emitted

  • notifyNPagesToPrintSignal Extension method

    Typed notify::n-pages-to-print signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyNPagesToPrintSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::print-settings signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyPrintSettings(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyPrintSettings signal is emitted

  • notifyPrintSettingsSignal Extension method

    Typed notify::print-settings signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyPrintSettingsSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::show-progress signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyShowProgress(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyShowProgress signal is emitted

  • notifyShowProgressSignal Extension method

    Typed notify::show-progress signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyShowProgressSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::status signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyStatus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyStatus signal is emitted

  • notifyStatusSignal Extension method

    Typed notify::status signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyStatusSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::status-string signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyStatusString(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyStatusString signal is emitted

  • notifyStatusStringSignal Extension method

    Typed notify::status-string signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyStatusStringSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::support-selection signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifySupportSelection(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifySupportSelection signal is emitted

  • notifySupportSelectionSignal Extension method

    Typed notify::support-selection signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifySupportSelectionSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::track-print-status signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyTrackPrintStatus(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyTrackPrintStatus signal is emitted

  • notifyTrackPrintStatusSignal Extension method

    Typed notify::track-print-status signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyTrackPrintStatusSignal: PrintOperationSignalName { get }
  • onNotifyUnit(flags:handler:) Extension method

    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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::unit signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyUnit(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyUnit signal is emitted

  • notifyUnitSignal Extension method

    Typed notify::unit signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyUnitSignal: PrintOperationSignalName { get }
  • 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 to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_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 underlying notify::use-full-page signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyUseFullPage(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintOperationRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyUseFullPage signal is emitted

  • notifyUseFullPageSignal Extension method

    Typed notify::use-full-page signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyUseFullPageSignal: PrintOperationSignalName { get }

PrintOperation Class: PrintOperationProtocol extension (methods and fields)

  • cancel() Extension method

    Cancels a running print operation.

    This function may be called from a [signalGtk.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 method

    Signal that drawing of particular page is complete.

    It is called after completion of page drawing (e.g. drawing in another thread). If [methodGtk.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 method

    Returns the default page setup.

    Declaration

    Swift

    @inlinable
    func getDefaultPageSetup() -> PageSetupRef!
  • getEmbedPageSetup() Extension method

    Gets whether page setup selection combos are embedded

    Declaration

    Swift

    @inlinable
    func getEmbedPageSetup() -> Bool
  • getError() Extension method

    Call this when the result of a print operation is GTK_PRINT_OPERATION_RESULT_ERROR.

    It can be called either after [methodGtk.PrintOperation.run] returns, or in the [signalGtk.PrintOperation::done] signal handler.

    The returned GError will contain more details on what went wrong.

    Declaration

    Swift

    @inlinable
    func getError() throws
  • getHasSelection() Extension method

    Gets whether there is a selection.

    Declaration

    Swift

    @inlinable
    func getHasSelection() -> Bool
  • getNPagesToPrint() Extension method

    Returns 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 call gtk_print_operation_get_n_pages_to_print() when print status is GTK_PRINT_STATUS_GENERATING_DATA.

    This is typically used to track the progress of print operation.

    Declaration

    Swift

    @inlinable
    func getNPagesToPrint() -> Int
  • getPrintSettings() Extension method

    Returns the current print settings.

    Note that the return value is nil until either [methodGtk.PrintOperation.set_print_settings] or [methodGtk.PrintOperation.run] have been called.

    Declaration

    Swift

    @inlinable
    func getPrintSettings() -> PrintSettingsRef!
  • getStatus() Extension method

    Returns the status of the print operation.

    Also see [methodGtk.PrintOperation.get_status_string].

    Declaration

    Swift

    @inlinable
    func getStatus() -> GtkPrintStatus
  • getStatusString() Extension method

    Returns a string representation of the status of the print operation.

    The string is translated and suitable for displaying the print status e.g. in a GtkStatusbar.

    Use [methodGtk.PrintOperation.get_status] to obtain a status value that is suitable for programmatic use.

    Declaration

    Swift

    @inlinable
    func getStatusString() -> String!
  • getSupportSelection() Extension method

    Gets whether the application supports print of selection

    Declaration

    Swift

    @inlinable
    func getSupportSelection() -> Bool
  • run(action:parent:) Extension method

    Runs the print operation.

    Normally that this function does not return until the rendering of all pages is complete. You can connect to the [signalGtk.PrintOperation::status-changed] signal on op to obtain some information about the progress of the print operation.

    Furthermore, it may use a recursive mainloop to show the print dialog.

    If you set the [Gtk.PrintOperation:allow-async] property, the operation will run asynchronously if this is supported on the platform. The [signalGtk.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-&gt;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 given GtkPrintOperation.

    Declaration

    Swift

    @inlinable
    func run(action: GtkPrintOperationAction, parent: WindowRef? = nil) throws -> GtkPrintOperationResult
  • run(action:parent:) Extension method

    Runs the print operation.

    Normally that this function does not return until the rendering of all pages is complete. You can connect to the [signalGtk.PrintOperation::status-changed] signal on op to obtain some information about the progress of the print operation.

    Furthermore, it may use a recursive mainloop to show the print dialog.

    If you set the [Gtk.PrintOperation:allow-async] property, the operation will run asynchronously if this is supported on the platform. The [signalGtk.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-&gt;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 given GtkPrintOperation.

    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 [methodGtk.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_setup the default page setup for op.

    This page setup will be used by [methodGtk.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_setup the default page setup for op.

    This page setup will be used by [methodGtk.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 method

    Sets up the GtkPrintOperation to wait for calling of [methodGtk.PrintOperation.draw_page_finish from application.

    This can be used for drawing page in another thread.

    This function must be called in the callback of the [signalGtk.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 GtkPrintOperation to generate a file instead of showing the print dialog.

    The intended use of this function is for implementing “Export to PDF” actions. Currently, PDF is the only supported format.

    “Print to PDF” support is independent of this and is done by letting the user pick the “Print to PDF” item from the list of printers in the print dialog.

    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 [methodGtk.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 [signalGtk.PrintOperation::begin-print] signal handler.

    Note that the page numbers passed to the [signalGtk.PrintOperation::request-page-setup] and [signalGtk.PrintOperation::draw-page] signals are 0-based, i.e. if the user chooses to print all pages, the last draw-page signal will be for page n_pages - 1.

    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 [methodGtk.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 [methodGtk.PrintOperation.run].

    Declaration

    Swift

    @inlinable
    func set<PrintSettingsT>(printSettings: PrintSettingsT?) where PrintSettingsT : PrintSettingsProtocol
  • set(showProgress:) Extension method

    If show_progress is true, 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)
  • 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 GtkPrintContext in such a way that distances are measured in units of unit.

    Declaration

    Swift

    @inlinable
    func set(unit: GtkUnit)
  • setUse(fullPage:) Extension method

    If full_page is true, the transformation for the cairo context obtained from GtkPrintContext puts the origin at the top left corner of the page.

    This may not be the top left corner of the sheet, depending on page orientation and the number of pages per sheet). Otherwise, the origin is at the top left corner of the imageable area (i.e. inside the margins).

    Declaration

    Swift

    @inlinable
    func setUse(fullPage: Bool)
  • defaultPageSetup Extension method

    Returns the default page setup.

    Declaration

    Swift

    @inlinable
    var defaultPageSetup: PageSetupRef! { get nonmutating set }
  • embedPageSetup Extension method

    Gets whether page setup selection combos are embedded

    Declaration

    Swift

    @inlinable
    var embedPageSetup: Bool { get nonmutating set }
  • hasSelection Extension method

    Gets whether there is a selection.

    Declaration

    Swift

    @inlinable
    var hasSelection: Bool { get nonmutating set }
  • isFinished Extension method

    A convenience function to find out if the print operation is finished.

    a print operation is finished if its status is either GTK_PRINT_STATUS_FINISHED or 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 }
  • nPagesToPrint Extension method

    Returns 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 call gtk_print_operation_get_n_pages_to_print() when print status is GTK_PRINT_STATUS_GENERATING_DATA.

    This is typically used to track the progress of print operation.

    Declaration

    Swift

    @inlinable
    var nPagesToPrint: Int { get }
  • printSettings Extension method

    Returns the current print settings.

    Note that the return value is nil until either [methodGtk.PrintOperation.set_print_settings] or [methodGtk.PrintOperation.run] have been called.

    Declaration

    Swift

    @inlinable
    var printSettings: PrintSettingsRef! { get nonmutating set }
  • status Extension method

    The status of the print operation.

    Declaration

    Swift

    @inlinable
    var status: GtkPrintStatus { get }
  • statusString Extension method

    Returns a string representation of the status of the print operation.

    The string is translated and suitable for displaying the print status e.g. in a GtkStatusbar.

    Use [methodGtk.PrintOperation.get_status] to obtain a status value that is suitable for programmatic use.

    Declaration

    Swift

    @inlinable
    var statusString: String! { get }
  • supportSelection Extension method

    Gets whether the application supports print of selection

    Declaration

    Swift

    @inlinable
    var supportSelection: Bool { get nonmutating set }
  • parentInstance Extension method

    Undocumented

    Declaration

    Swift

    @inlinable
    var parentInstance: GObject { get }