PrintJobProtocol
public protocol PrintJobProtocol : ObjectProtocol
A GtkPrintJob object represents a job that is sent to a printer.
You only need to deal directly with print jobs if you use the
non-portable [classGtk.PrintUnixDialog] API.
Use [methodGtk.PrintJob.get_surface] to obtain the cairo surface
onto which the pages must be drawn. Use [methodGtk.PrintJob.send]
to send the finished job to the printer. If you don’t use cairo
GtkPrintJob also supports printing of manually generated PostScript,
via [methodGtk.PrintJob.set_source_file].
The PrintJobProtocol protocol exposes the methods and properties of an underlying GtkPrintJob 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 PrintJob.
Alternatively, use PrintJobRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkPrintJobinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
print_job_ptrDefault implementationTyped pointer to the underlying
GtkPrintJobinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkPrintJobinstance.Declaration
Swift
var print_job_ptr: UnsafeMutablePointer<GtkPrintJob>! { get } -
Required Initialiser for types conforming to
PrintJobProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
PrintJobPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: PrintJobPropertyName, 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 PrintJob property
Declaration
Swift
@inlinable func get(property: PrintJobPropertyName) -> 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 PrintJob property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: PrintJobPropertyName, 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
PrintJobSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: PrintJobSignalName, 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
PrintJobSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: PrintJobSignalName, 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)
-
onStatusChanged(flags:Extension methodhandler: ) Emitted when the status of a job changes.
The signal handler can use [method
Gtk.PrintJob.get_status] to obtain the new status.Note
This represents the underlyingstatus-changedsignalDeclaration
Swift
@discardableResult @inlinable func onStatusChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintJobRef) -> 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: PrintJobSignalName { get } -
onNotifyPageSetup(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::page-setupsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyPageSetup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintJobRef, _ 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
notifyPageSetupsignal is emitted -
notifyPageSetupSignalExtension methodTyped
notify::page-setupsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyPageSetupSignal: PrintJobSignalName { get } -
onNotifyPrinter(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::printersignalDeclaration
Swift
@discardableResult @inlinable func onNotifyPrinter(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintJobRef, _ 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
notifyPrintersignal is emitted -
notifyPrinterSignalExtension methodTyped
notify::printersignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyPrinterSignal: PrintJobSignalName { get } -
onNotifySettings(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::settingssignalDeclaration
Swift
@discardableResult @inlinable func onNotifySettings(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintJobRef, _ 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
notifySettingssignal is emitted -
notifySettingsSignalExtension methodTyped
notify::settingssignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifySettingsSignal: PrintJobSignalName { get } -
onNotifyTitle(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::titlesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyTitle(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: PrintJobRef, _ 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
notifyTitlesignal is emitted -
notifyTitleSignalExtension methodTyped
notify::titlesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyTitleSignal: PrintJobSignalName { 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: PrintJobRef, _ 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: PrintJobSignalName { get }
-
getCollate()Extension methodGets whether this job is printed collated.
Declaration
Swift
@inlinable func getCollate() -> Bool -
getNUp()Extension methodGets the n-up setting for this job.
Declaration
Swift
@inlinable func getNUp() -> Int -
getNUpLayout()Extension methodGets the n-up layout setting for this job.
Declaration
Swift
@inlinable func getNUpLayout() -> GtkNumberUpLayout -
getNumCopies()Extension methodGets the number of copies of this job.
Declaration
Swift
@inlinable func getNumCopies() -> Int -
getPageRanges(nRanges:Extension method) Gets the page ranges for this job.
Declaration
Swift
@inlinable func getPageRanges(nRanges: UnsafeMutablePointer<gint>!) -> UnsafeMutablePointer<GtkPageRange>! -
getPageSet()Extension methodGets the
GtkPageSetsetting for this job.Declaration
Swift
@inlinable func getPageSet() -> GtkPageSet -
getPages()Extension methodGets the
GtkPrintPagessetting for this job.Declaration
Swift
@inlinable func getPages() -> GtkPrintPages -
getPrinter()Extension methodGets the
GtkPrinterof the print job.Declaration
Swift
@inlinable func getPrinter() -> PrinterRef! -
getReverse()Extension methodGets whether this job is printed reversed.
Declaration
Swift
@inlinable func getReverse() -> Bool -
getRotate()Extension methodGets whether the job is printed rotated.
Declaration
Swift
@inlinable func getRotate() -> Bool -
getScale()Extension methodGets the scale for this job.
Declaration
Swift
@inlinable func getScale() -> CDouble -
getSettings()Extension methodGets the
GtkPrintSettingsof the print job.Declaration
Swift
@inlinable func getSettings() -> PrintSettingsRef! -
getStatus()Extension methodGets the status of the print job.
Declaration
Swift
@inlinable func getStatus() -> GtkPrintStatus -
getSurface()Extension methodGets a cairo surface onto which the pages of the print job should be rendered.
Declaration
Swift
@inlinable func getSurface() throws -> Cairo.SurfaceRef! -
getTitle()Extension methodGets the job title.
Declaration
Swift
@inlinable func getTitle() -> String! -
getTrackPrintStatus()Extension methodReturns whether jobs will be tracked after printing.
For details, see [method
Gtk.PrintJob.set_track_print_status].Declaration
Swift
@inlinable func getTrackPrintStatus() -> Bool -
send(callback:Extension methoduserData: dnotify: ) Sends the print job off to the printer.
Declaration
Swift
@inlinable func send(callback: GtkPrintJobCompleteFunc?, userData: gpointer! = nil, dnotify: GDestroyNotify?) -
set(collate:Extension method) Sets whether this job is printed collated.
Declaration
Swift
@inlinable func set(collate: Bool) -
set(nUp:Extension method) Sets the n-up setting for this job.
Declaration
Swift
@inlinable func set(nUp: Int) -
setNUp(layout:Extension method) Sets the n-up layout setting for this job.
Declaration
Swift
@inlinable func setNUp(layout: GtkNumberUpLayout) -
set(numCopies:Extension method) Sets the number of copies for this job.
Declaration
Swift
@inlinable func set(numCopies: Int) -
setPage(ranges:Extension methodnRanges: ) Sets the page ranges for this job.
Declaration
Swift
@inlinable func setPage(ranges: UnsafeMutablePointer<GtkPageRange>!, nRanges: Int) -
set(pageSet:Extension method) Sets the
GtkPageSetsetting for this job.Declaration
Swift
@inlinable func set(pageSet: GtkPageSet) -
set(pages:Extension method) Sets the
GtkPrintPagessetting for this job.Declaration
Swift
@inlinable func set(pages: GtkPrintPages) -
set(reverse:Extension method) Sets whether this job is printed reversed.
Declaration
Swift
@inlinable func set(reverse: Bool) -
set(rotate:Extension method) Sets whether this job is printed rotated.
Declaration
Swift
@inlinable func set(rotate: Bool) -
set(scale:Extension method) Sets the scale for this job.
1.0 means unscaled.
Declaration
Swift
@inlinable func set(scale: CDouble) -
setSource(fd:Extension method) Make the
GtkPrintJobsend an existing document to the printing system.The file can be in any format understood by the platforms printing system (typically PostScript, but on many platforms PDF may work too). See [method
Gtk.Printer.accepts_pdf] and [methodGtk.Printer.accepts_ps].This is similar to [method
Gtk.PrintJob.set_source_file], but takes expects an open file descriptor for the file, instead of a filename.Declaration
Swift
@inlinable func setSource(fd: Int) throws -> Bool -
setSourceFile(filename:Extension method) Make the
GtkPrintJobsend an existing document to the printing system.The file can be in any format understood by the platforms printing system (typically PostScript, but on many platforms PDF may work too). See [method
Gtk.Printer.accepts_pdf] and [methodGtk.Printer.accepts_ps].Declaration
Swift
@inlinable func setSourceFile(filename: UnsafePointer<CChar>!) throws -> Bool -
setTrackPrintStatus(trackStatus:Extension method) If track_status is
true, the print job 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) -
collateExtension methodGets whether this job is printed collated.
Declaration
Swift
@inlinable var collate: Bool { get nonmutating set } -
nUpExtension methodGets the n-up setting for this job.
Declaration
Swift
@inlinable var nUp: Int { get nonmutating set } -
nUpLayoutExtension methodGets the n-up layout setting for this job.
Declaration
Swift
@inlinable var nUpLayout: GtkNumberUpLayout { get nonmutating set } -
numCopiesExtension methodGets the number of copies of this job.
Declaration
Swift
@inlinable var numCopies: Int { get nonmutating set } -
pageSetExtension methodGets the
GtkPageSetsetting for this job.Declaration
Swift
@inlinable var pageSet: GtkPageSet { get nonmutating set } -
pagesExtension methodGets the
GtkPrintPagessetting for this job.Declaration
Swift
@inlinable var pages: GtkPrintPages { get nonmutating set } -
printerExtension methodThe printer to send the job to.
Declaration
Swift
@inlinable var printer: PrinterRef! { get } -
reverseExtension methodGets whether this job is printed reversed.
Declaration
Swift
@inlinable var reverse: Bool { get nonmutating set } -
rotateExtension methodGets whether the job is printed rotated.
Declaration
Swift
@inlinable var rotate: Bool { get nonmutating set } -
scaleExtension methodGets the scale for this job.
Declaration
Swift
@inlinable var scale: CDouble { get nonmutating set } -
settingsExtension methodPrinter settings.
Declaration
Swift
@inlinable var settings: PrintSettingsRef! { get } -
statusExtension methodGets the status of the print job.
Declaration
Swift
@inlinable var status: GtkPrintStatus { get } -
surfaceExtension methodGets a cairo surface onto which the pages of the print job should be rendered.
Declaration
Swift
@inlinable var surface: Cairo.SurfaceRef! { get } -
titleExtension methodThe title of the print job.
Declaration
Swift
@inlinable var title: String! { get } -
trackPrintStatusExtension methodReturns whether jobs will be tracked after printing.
For details, see [method
Gtk.PrintJob.set_track_print_status].Declaration
Swift
@inlinable var trackPrintStatus: Bool { get nonmutating set }
View on GitHub
Install in Dash
PrintJobProtocol Protocol Reference