Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- cancel
- drawPageFinish
- getDefaultPageSetup
- getEmbedPageSetup
- getError
- getHasSelection
- getNPagesToPrint
- getPrintSettings
- getStatus
- getStatusString
- getSupportSelection
- isFinished
- new
- run
- setAllowAsync
- setCurrentPage
- setCustomTabLabel
- setDefaultPageSetup
- setDeferDrawing
- setEmbedPageSetup
- setExportFilename
- setHasSelection
- setJobName
- setNPages
- setPrintSettings
- setShowProgress
- setSupportSelection
- setTrackPrintStatus
- setUnit
- setUseFullPage
- Properties
- Signals
GtkPrintOperation is the high-level, portable printing API.
It looks a bit different than other GTK+ dialogs such as the
FileChooser
, since some platforms don’t expose enough
infrastructure to implement a good print dialog. On such
platforms, GtkPrintOperation uses the native print dialog.
On platforms which do not provide a native print dialog, GTK+
uses its own, see GtkPrintUnixDialog
.
The typical way to use the high-level printing API is to create
a GtkPrintOperation object with printOperationNew
when
the user selects to print. Then you set some properties on it,
e.g. the page size, any PrintSettings
from previous print
operations, the number of pages, the current page, etc.
Then you start the print operation by calling printOperationRun
.
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 PrintOperation
, the main one being
PrintOperation
::draw-page
, which you are supposed to catch
and render the page on the provided PrintContext
using Cairo.
The high-level printing API
C code
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
printOperationPreviewRenderPage
,
printOperationPreviewEndPreview
and
printOperationPreviewIsSelected
are useful when implementing a print preview.
Synopsis
- newtype PrintOperation = PrintOperation (ManagedPtr PrintOperation)
- class GObject o => IsPrintOperation o
- toPrintOperation :: (MonadIO m, IsPrintOperation o) => o -> m PrintOperation
- noPrintOperation :: Maybe PrintOperation
- printOperationCancel :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m ()
- printOperationDrawPageFinish :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m ()
- printOperationGetDefaultPageSetup :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m PageSetup
- printOperationGetEmbedPageSetup :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m Bool
- printOperationGetError :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m ()
- printOperationGetHasSelection :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m Bool
- printOperationGetNPagesToPrint :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m Int32
- printOperationGetPrintSettings :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m PrintSettings
- printOperationGetStatus :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m PrintStatus
- printOperationGetStatusString :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m Text
- printOperationGetSupportSelection :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m Bool
- printOperationIsFinished :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m Bool
- printOperationNew :: (HasCallStack, MonadIO m) => m PrintOperation
- printOperationRun :: (HasCallStack, MonadIO m, IsPrintOperation a, IsWindow b) => a -> PrintOperationAction -> Maybe b -> m PrintOperationResult
- printOperationSetAllowAsync :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> Bool -> m ()
- printOperationSetCurrentPage :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> Int32 -> m ()
- printOperationSetCustomTabLabel :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> Maybe Text -> m ()
- printOperationSetDefaultPageSetup :: (HasCallStack, MonadIO m, IsPrintOperation a, IsPageSetup b) => a -> Maybe b -> m ()
- printOperationSetDeferDrawing :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> m ()
- printOperationSetEmbedPageSetup :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> Bool -> m ()
- printOperationSetExportFilename :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> [Char] -> m ()
- printOperationSetHasSelection :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> Bool -> m ()
- printOperationSetJobName :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> Text -> m ()
- printOperationSetNPages :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> Int32 -> m ()
- printOperationSetPrintSettings :: (HasCallStack, MonadIO m, IsPrintOperation a, IsPrintSettings b) => a -> Maybe b -> m ()
- printOperationSetShowProgress :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> Bool -> m ()
- printOperationSetSupportSelection :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> Bool -> m ()
- printOperationSetTrackPrintStatus :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> Bool -> m ()
- printOperationSetUnit :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> Unit -> m ()
- printOperationSetUseFullPage :: (HasCallStack, MonadIO m, IsPrintOperation a) => a -> Bool -> m ()
- constructPrintOperationAllowAsync :: IsPrintOperation o => Bool -> IO (GValueConstruct o)
- getPrintOperationAllowAsync :: (MonadIO m, IsPrintOperation o) => o -> m Bool
- setPrintOperationAllowAsync :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m ()
- constructPrintOperationCurrentPage :: IsPrintOperation o => Int32 -> IO (GValueConstruct o)
- getPrintOperationCurrentPage :: (MonadIO m, IsPrintOperation o) => o -> m Int32
- setPrintOperationCurrentPage :: (MonadIO m, IsPrintOperation o) => o -> Int32 -> m ()
- clearPrintOperationCustomTabLabel :: (MonadIO m, IsPrintOperation o) => o -> m ()
- constructPrintOperationCustomTabLabel :: IsPrintOperation o => Text -> IO (GValueConstruct o)
- getPrintOperationCustomTabLabel :: (MonadIO m, IsPrintOperation o) => o -> m (Maybe Text)
- setPrintOperationCustomTabLabel :: (MonadIO m, IsPrintOperation o) => o -> Text -> m ()
- clearPrintOperationDefaultPageSetup :: (MonadIO m, IsPrintOperation o) => o -> m ()
- constructPrintOperationDefaultPageSetup :: (IsPrintOperation o, IsPageSetup a) => a -> IO (GValueConstruct o)
- getPrintOperationDefaultPageSetup :: (MonadIO m, IsPrintOperation o) => o -> m PageSetup
- setPrintOperationDefaultPageSetup :: (MonadIO m, IsPrintOperation o, IsPageSetup a) => o -> a -> m ()
- constructPrintOperationEmbedPageSetup :: IsPrintOperation o => Bool -> IO (GValueConstruct o)
- getPrintOperationEmbedPageSetup :: (MonadIO m, IsPrintOperation o) => o -> m Bool
- setPrintOperationEmbedPageSetup :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m ()
- clearPrintOperationExportFilename :: (MonadIO m, IsPrintOperation o) => o -> m ()
- constructPrintOperationExportFilename :: IsPrintOperation o => Text -> IO (GValueConstruct o)
- getPrintOperationExportFilename :: (MonadIO m, IsPrintOperation o) => o -> m (Maybe Text)
- setPrintOperationExportFilename :: (MonadIO m, IsPrintOperation o) => o -> Text -> m ()
- constructPrintOperationHasSelection :: IsPrintOperation o => Bool -> IO (GValueConstruct o)
- getPrintOperationHasSelection :: (MonadIO m, IsPrintOperation o) => o -> m Bool
- setPrintOperationHasSelection :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m ()
- constructPrintOperationJobName :: IsPrintOperation o => Text -> IO (GValueConstruct o)
- getPrintOperationJobName :: (MonadIO m, IsPrintOperation o) => o -> m (Maybe Text)
- setPrintOperationJobName :: (MonadIO m, IsPrintOperation o) => o -> Text -> m ()
- constructPrintOperationNPages :: IsPrintOperation o => Int32 -> IO (GValueConstruct o)
- getPrintOperationNPages :: (MonadIO m, IsPrintOperation o) => o -> m Int32
- setPrintOperationNPages :: (MonadIO m, IsPrintOperation o) => o -> Int32 -> m ()
- getPrintOperationNPagesToPrint :: (MonadIO m, IsPrintOperation o) => o -> m Int32
- clearPrintOperationPrintSettings :: (MonadIO m, IsPrintOperation o) => o -> m ()
- constructPrintOperationPrintSettings :: (IsPrintOperation o, IsPrintSettings a) => a -> IO (GValueConstruct o)
- getPrintOperationPrintSettings :: (MonadIO m, IsPrintOperation o) => o -> m PrintSettings
- setPrintOperationPrintSettings :: (MonadIO m, IsPrintOperation o, IsPrintSettings a) => o -> a -> m ()
- constructPrintOperationShowProgress :: IsPrintOperation o => Bool -> IO (GValueConstruct o)
- getPrintOperationShowProgress :: (MonadIO m, IsPrintOperation o) => o -> m Bool
- setPrintOperationShowProgress :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m ()
- getPrintOperationStatus :: (MonadIO m, IsPrintOperation o) => o -> m PrintStatus
- getPrintOperationStatusString :: (MonadIO m, IsPrintOperation o) => o -> m Text
- constructPrintOperationSupportSelection :: IsPrintOperation o => Bool -> IO (GValueConstruct o)
- getPrintOperationSupportSelection :: (MonadIO m, IsPrintOperation o) => o -> m Bool
- setPrintOperationSupportSelection :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m ()
- constructPrintOperationTrackPrintStatus :: IsPrintOperation o => Bool -> IO (GValueConstruct o)
- getPrintOperationTrackPrintStatus :: (MonadIO m, IsPrintOperation o) => o -> m Bool
- setPrintOperationTrackPrintStatus :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m ()
- constructPrintOperationUnit :: IsPrintOperation o => Unit -> IO (GValueConstruct o)
- getPrintOperationUnit :: (MonadIO m, IsPrintOperation o) => o -> m Unit
- setPrintOperationUnit :: (MonadIO m, IsPrintOperation o) => o -> Unit -> m ()
- constructPrintOperationUseFullPage :: IsPrintOperation o => Bool -> IO (GValueConstruct o)
- getPrintOperationUseFullPage :: (MonadIO m, IsPrintOperation o) => o -> m Bool
- setPrintOperationUseFullPage :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m ()
- type C_PrintOperationBeginPrintCallback = Ptr () -> Ptr PrintContext -> Ptr () -> IO ()
- type PrintOperationBeginPrintCallback = PrintContext -> IO ()
- afterPrintOperationBeginPrint :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationBeginPrintCallback -> m SignalHandlerId
- genClosure_PrintOperationBeginPrint :: PrintOperationBeginPrintCallback -> IO Closure
- mk_PrintOperationBeginPrintCallback :: C_PrintOperationBeginPrintCallback -> IO (FunPtr C_PrintOperationBeginPrintCallback)
- noPrintOperationBeginPrintCallback :: Maybe PrintOperationBeginPrintCallback
- onPrintOperationBeginPrint :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationBeginPrintCallback -> m SignalHandlerId
- wrap_PrintOperationBeginPrintCallback :: PrintOperationBeginPrintCallback -> C_PrintOperationBeginPrintCallback
- type C_PrintOperationCreateCustomWidgetCallback = Ptr () -> Ptr () -> IO (Ptr Object)
- type PrintOperationCreateCustomWidgetCallback = IO Object
- afterPrintOperationCreateCustomWidget :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationCreateCustomWidgetCallback -> m SignalHandlerId
- genClosure_PrintOperationCreateCustomWidget :: PrintOperationCreateCustomWidgetCallback -> IO Closure
- mk_PrintOperationCreateCustomWidgetCallback :: C_PrintOperationCreateCustomWidgetCallback -> IO (FunPtr C_PrintOperationCreateCustomWidgetCallback)
- noPrintOperationCreateCustomWidgetCallback :: Maybe PrintOperationCreateCustomWidgetCallback
- onPrintOperationCreateCustomWidget :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationCreateCustomWidgetCallback -> m SignalHandlerId
- wrap_PrintOperationCreateCustomWidgetCallback :: PrintOperationCreateCustomWidgetCallback -> C_PrintOperationCreateCustomWidgetCallback
- type C_PrintOperationCustomWidgetApplyCallback = Ptr () -> Ptr Widget -> Ptr () -> IO ()
- type PrintOperationCustomWidgetApplyCallback = Widget -> IO ()
- afterPrintOperationCustomWidgetApply :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationCustomWidgetApplyCallback -> m SignalHandlerId
- genClosure_PrintOperationCustomWidgetApply :: PrintOperationCustomWidgetApplyCallback -> IO Closure
- mk_PrintOperationCustomWidgetApplyCallback :: C_PrintOperationCustomWidgetApplyCallback -> IO (FunPtr C_PrintOperationCustomWidgetApplyCallback)
- noPrintOperationCustomWidgetApplyCallback :: Maybe PrintOperationCustomWidgetApplyCallback
- onPrintOperationCustomWidgetApply :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationCustomWidgetApplyCallback -> m SignalHandlerId
- wrap_PrintOperationCustomWidgetApplyCallback :: PrintOperationCustomWidgetApplyCallback -> C_PrintOperationCustomWidgetApplyCallback
- type C_PrintOperationDoneCallback = Ptr () -> CUInt -> Ptr () -> IO ()
- type PrintOperationDoneCallback = PrintOperationResult -> IO ()
- afterPrintOperationDone :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationDoneCallback -> m SignalHandlerId
- genClosure_PrintOperationDone :: PrintOperationDoneCallback -> IO Closure
- mk_PrintOperationDoneCallback :: C_PrintOperationDoneCallback -> IO (FunPtr C_PrintOperationDoneCallback)
- noPrintOperationDoneCallback :: Maybe PrintOperationDoneCallback
- onPrintOperationDone :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationDoneCallback -> m SignalHandlerId
- wrap_PrintOperationDoneCallback :: PrintOperationDoneCallback -> C_PrintOperationDoneCallback
- type C_PrintOperationDrawPageCallback = Ptr () -> Ptr PrintContext -> Int32 -> Ptr () -> IO ()
- type PrintOperationDrawPageCallback = PrintContext -> Int32 -> IO ()
- afterPrintOperationDrawPage :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationDrawPageCallback -> m SignalHandlerId
- genClosure_PrintOperationDrawPage :: PrintOperationDrawPageCallback -> IO Closure
- mk_PrintOperationDrawPageCallback :: C_PrintOperationDrawPageCallback -> IO (FunPtr C_PrintOperationDrawPageCallback)
- noPrintOperationDrawPageCallback :: Maybe PrintOperationDrawPageCallback
- onPrintOperationDrawPage :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationDrawPageCallback -> m SignalHandlerId
- wrap_PrintOperationDrawPageCallback :: PrintOperationDrawPageCallback -> C_PrintOperationDrawPageCallback
- type C_PrintOperationEndPrintCallback = Ptr () -> Ptr PrintContext -> Ptr () -> IO ()
- type PrintOperationEndPrintCallback = PrintContext -> IO ()
- afterPrintOperationEndPrint :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationEndPrintCallback -> m SignalHandlerId
- genClosure_PrintOperationEndPrint :: PrintOperationEndPrintCallback -> IO Closure
- mk_PrintOperationEndPrintCallback :: C_PrintOperationEndPrintCallback -> IO (FunPtr C_PrintOperationEndPrintCallback)
- noPrintOperationEndPrintCallback :: Maybe PrintOperationEndPrintCallback
- onPrintOperationEndPrint :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationEndPrintCallback -> m SignalHandlerId
- wrap_PrintOperationEndPrintCallback :: PrintOperationEndPrintCallback -> C_PrintOperationEndPrintCallback
- type C_PrintOperationPaginateCallback = Ptr () -> Ptr PrintContext -> Ptr () -> IO CInt
- type PrintOperationPaginateCallback = PrintContext -> IO Bool
- afterPrintOperationPaginate :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationPaginateCallback -> m SignalHandlerId
- genClosure_PrintOperationPaginate :: PrintOperationPaginateCallback -> IO Closure
- mk_PrintOperationPaginateCallback :: C_PrintOperationPaginateCallback -> IO (FunPtr C_PrintOperationPaginateCallback)
- noPrintOperationPaginateCallback :: Maybe PrintOperationPaginateCallback
- onPrintOperationPaginate :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationPaginateCallback -> m SignalHandlerId
- wrap_PrintOperationPaginateCallback :: PrintOperationPaginateCallback -> C_PrintOperationPaginateCallback
- type C_PrintOperationPreviewCallback = Ptr () -> Ptr PrintOperationPreview -> Ptr PrintContext -> Ptr Window -> Ptr () -> IO CInt
- type PrintOperationPreviewCallback = PrintOperationPreview -> PrintContext -> Maybe Window -> IO Bool
- afterPrintOperationPreview :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationPreviewCallback -> m SignalHandlerId
- genClosure_PrintOperationPreview :: PrintOperationPreviewCallback -> IO Closure
- mk_PrintOperationPreviewCallback :: C_PrintOperationPreviewCallback -> IO (FunPtr C_PrintOperationPreviewCallback)
- noPrintOperationPreviewCallback :: Maybe PrintOperationPreviewCallback
- onPrintOperationPreview :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationPreviewCallback -> m SignalHandlerId
- wrap_PrintOperationPreviewCallback :: PrintOperationPreviewCallback -> C_PrintOperationPreviewCallback
- type C_PrintOperationRequestPageSetupCallback = Ptr () -> Ptr PrintContext -> Int32 -> Ptr PageSetup -> Ptr () -> IO ()
- type PrintOperationRequestPageSetupCallback = PrintContext -> Int32 -> PageSetup -> IO ()
- afterPrintOperationRequestPageSetup :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationRequestPageSetupCallback -> m SignalHandlerId
- genClosure_PrintOperationRequestPageSetup :: PrintOperationRequestPageSetupCallback -> IO Closure
- mk_PrintOperationRequestPageSetupCallback :: C_PrintOperationRequestPageSetupCallback -> IO (FunPtr C_PrintOperationRequestPageSetupCallback)
- noPrintOperationRequestPageSetupCallback :: Maybe PrintOperationRequestPageSetupCallback
- onPrintOperationRequestPageSetup :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationRequestPageSetupCallback -> m SignalHandlerId
- wrap_PrintOperationRequestPageSetupCallback :: PrintOperationRequestPageSetupCallback -> C_PrintOperationRequestPageSetupCallback
- type C_PrintOperationStatusChangedCallback = Ptr () -> Ptr () -> IO ()
- type PrintOperationStatusChangedCallback = IO ()
- afterPrintOperationStatusChanged :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationStatusChangedCallback -> m SignalHandlerId
- genClosure_PrintOperationStatusChanged :: PrintOperationStatusChangedCallback -> IO Closure
- mk_PrintOperationStatusChangedCallback :: C_PrintOperationStatusChangedCallback -> IO (FunPtr C_PrintOperationStatusChangedCallback)
- noPrintOperationStatusChangedCallback :: Maybe PrintOperationStatusChangedCallback
- onPrintOperationStatusChanged :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationStatusChangedCallback -> m SignalHandlerId
- wrap_PrintOperationStatusChangedCallback :: PrintOperationStatusChangedCallback -> C_PrintOperationStatusChangedCallback
- type C_PrintOperationUpdateCustomWidgetCallback = Ptr () -> Ptr Widget -> Ptr PageSetup -> Ptr PrintSettings -> Ptr () -> IO ()
- type PrintOperationUpdateCustomWidgetCallback = Widget -> PageSetup -> PrintSettings -> IO ()
- afterPrintOperationUpdateCustomWidget :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationUpdateCustomWidgetCallback -> m SignalHandlerId
- genClosure_PrintOperationUpdateCustomWidget :: PrintOperationUpdateCustomWidgetCallback -> IO Closure
- mk_PrintOperationUpdateCustomWidgetCallback :: C_PrintOperationUpdateCustomWidgetCallback -> IO (FunPtr C_PrintOperationUpdateCustomWidgetCallback)
- noPrintOperationUpdateCustomWidgetCallback :: Maybe PrintOperationUpdateCustomWidgetCallback
- onPrintOperationUpdateCustomWidget :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationUpdateCustomWidgetCallback -> m SignalHandlerId
- wrap_PrintOperationUpdateCustomWidgetCallback :: PrintOperationUpdateCustomWidgetCallback -> C_PrintOperationUpdateCustomWidgetCallback
Exported types
newtype PrintOperation Source #
Memory-managed wrapper type.
Instances
GObject PrintOperation Source # | |
Defined in GI.Gtk.Objects.PrintOperation gobjectType :: PrintOperation -> IO GType # | |
IsObject PrintOperation Source # | |
Defined in GI.Gtk.Objects.PrintOperation | |
IsPrintOperationPreview PrintOperation Source # | |
Defined in GI.Gtk.Objects.PrintOperation | |
IsPrintOperation PrintOperation Source # | |
Defined in GI.Gtk.Objects.PrintOperation |
class GObject o => IsPrintOperation o Source #
Type class for types which can be safely cast to PrintOperation
, for instance with toPrintOperation
.
Instances
(GObject a, (UnknownAncestorError PrintOperation a :: Constraint)) => IsPrintOperation a Source # | |
Defined in GI.Gtk.Objects.PrintOperation | |
IsPrintOperation PrintOperation Source # | |
Defined in GI.Gtk.Objects.PrintOperation |
toPrintOperation :: (MonadIO m, IsPrintOperation o) => o -> m PrintOperation Source #
Cast to PrintOperation
, for types for which this is known to be safe. For general casts, use castTo
.
noPrintOperation :: Maybe PrintOperation Source #
A convenience alias for Nothing
:: Maybe
PrintOperation
.
Methods
cancel
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> m () |
Cancels a running print operation. This function may
be called from a PrintOperation
::begin-print
,
PrintOperation
::paginate
or PrintOperation
::draw-page
signal handler to stop the currently running print
operation.
Since: 2.10
drawPageFinish
printOperationDrawPageFinish Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> m () |
Signalize that drawing of particular page is complete.
It is called after completion of page drawing (e.g. drawing in another
thread).
If printOperationSetDeferDrawing
was called before, then this function
has to be called by application. In another case it is called by the library
itself.
Since: 2.16
getDefaultPageSetup
printOperationGetDefaultPageSetup Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> m PageSetup | Returns: the default page setup |
Returns the default page setup, see
printOperationSetDefaultPageSetup
.
Since: 2.10
getEmbedPageSetup
printOperationGetEmbedPageSetup Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> m Bool | Returns: whether page setup selection combos are embedded |
Gets the value of PrintOperation
:embed-page-setup
property.
Since: 2.18
getError
printOperationGetError Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> m () | (Can throw |
Call this when the result of a print operation is
PrintOperationResultError
, either as returned by
printOperationRun
, or in the PrintOperation
::done
signal
handler. The returned GError
will contain more details on what went wrong.
Since: 2.10
getHasSelection
printOperationGetHasSelection Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> m Bool | Returns: whether there is a selection |
Gets the value of PrintOperation
:has-selection
property.
Since: 2.18
getNPagesToPrint
printOperationGetNPagesToPrint Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> m Int32 | Returns: the number of pages that will be printed |
Returns the number of pages that will be printed.
Note that this value is set during print preparation phase
(PrintStatusPreparing
), so this function should never be
called before the data generation phase (PrintStatusGeneratingData
).
You can connect to the PrintOperation
::status-changed
signal
and call printOperationGetNPagesToPrint
when
print status is PrintStatusGeneratingData
.
This is typically used to track the progress of print operation.
Since: 2.18
getPrintSettings
printOperationGetPrintSettings Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> m PrintSettings | Returns: the current print settings of |
Returns the current print settings.
Note that the return value is Nothing
until either
printOperationSetPrintSettings
or
printOperationRun
have been called.
Since: 2.10
getStatus
printOperationGetStatus Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> m PrintStatus | Returns: the status of the print operation |
Returns the status of the print operation.
Also see printOperationGetStatusString
.
Since: 2.10
getStatusString
printOperationGetStatusString Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> m Text | Returns: a string representation of the status of the print operation |
Returns a string representation of the status of the
print operation. The string is translated and suitable
for displaying the print status e.g. in a Statusbar
.
Use printOperationGetStatus
to obtain a status
value that is suitable for programmatic use.
Since: 2.10
getSupportSelection
printOperationGetSupportSelection Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> m Bool | Returns: whether the application supports print of selection |
Gets the value of PrintOperation
:support-selection
property.
Since: 2.18
isFinished
printOperationIsFinished Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> m Bool | Returns: |
A convenience function to find out if the print operation
is finished, either successfully (PrintStatusFinished
)
or unsuccessfully (PrintStatusFinishedAborted
).
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.
Since: 2.10
new
:: (HasCallStack, MonadIO m) | |
=> m PrintOperation | Returns: a new |
Creates a new PrintOperation
.
Since: 2.10
run
:: (HasCallStack, MonadIO m, IsPrintOperation a, IsWindow b) | |
=> a |
|
-> PrintOperationAction |
|
-> Maybe b |
|
-> m PrintOperationResult | Returns: the result of the print operation. A return value of
|
Runs the print operation, by first letting the user modify print settings in the print dialog, and then print the document.
Normally that this function does not return until the rendering of all
pages is complete. You can connect to the
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 call printOperationSetAllowAsync
or set the
PrintOperation
:allow-async
property the operation will run
asynchronously if this is supported on the platform. The
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).
C code
if (settings != NULL) gtk_print_operation_set_print_settings (print, settings); if (page_setup != NULL) gtk_print_operation_set_default_page_setup (print, page_setup); g_signal_connect (print, "begin-print", G_CALLBACK (begin_print), &data); g_signal_connect (print, "draw-page", G_CALLBACK (draw_page), &data); res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, parent, &error); if (res == GTK_PRINT_OPERATION_RESULT_ERROR) { error_dialog = gtk_message_dialog_new (GTK_WINDOW (parent), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Error printing file:\n%s", error->message); g_signal_connect (error_dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); gtk_widget_show (error_dialog); g_error_free (error); } else if (res == GTK_PRINT_OPERATION_RESULT_APPLY) { if (settings != NULL) g_object_unref (settings); settings = g_object_ref (gtk_print_operation_get_print_settings (print)); }
Note that printOperationRun
can only be called once on a
given PrintOperation
.
Since: 2.10
setAllowAsync
printOperationSetAllowAsync Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the printOperationRun
may return
before the print operation is completed. Note that
some platforms may not allow asynchronous operation.
Since: 2.10
setCurrentPage
printOperationSetCurrentPage Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> Int32 |
|
-> m () |
Sets the current page.
If this is called before printOperationRun
,
the user will be able to select to print only the current page.
Note that this only makes sense for pre-paginated documents.
Since: 2.10
setCustomTabLabel
printOperationSetCustomTabLabel Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Sets the label for the tab holding custom widgets.
Since: 2.10
setDefaultPageSetup
printOperationSetDefaultPageSetup Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a, IsPageSetup b) | |
=> a |
|
-> Maybe b | |
-> m () |
Makes defaultPageSetup
the default page setup for op
.
This page setup will be used by printOperationRun
,
but it can be overridden on a per-page basis by connecting
to the PrintOperation
::request-page-setup
signal.
Since: 2.10
setDeferDrawing
printOperationSetDeferDrawing Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> m () |
Sets up the PrintOperation
to wait for calling of
printOperationDrawPageFinish
from application. It can
be used for drawing page in another thread.
This function must be called in the callback of “draw-page” signal.
Since: 2.16
setEmbedPageSetup
printOperationSetEmbedPageSetup Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> Bool |
|
-> m () |
Embed page size combo box and orientation combo box into page setup page.
Selected page setup is stored as default page setup in PrintOperation
.
Since: 2.18
setExportFilename
printOperationSetExportFilename Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> [Char] |
|
-> m () |
Sets up the PrintOperation
to generate a file instead
of showing the print dialog. The indended use of this function
is for implementing “Export to PDF” actions. Currently, PDF
is the only supported format.
“Print to PDF” support is independent of this and is done by letting the user pick the “Print to PDF” item from the list of printers in the print dialog.
Since: 2.10
setHasSelection
printOperationSetHasSelection Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether there is a selection to print.
Application has to set number of pages to which the selection
will draw by printOperationSetNPages
in a callback of
PrintOperation
::begin-print
.
Since: 2.18
setJobName
printOperationSetJobName Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> Text |
|
-> m () |
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.
Since: 2.10
setNPages
printOperationSetNPages Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> Int32 |
|
-> m () |
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
PrintOperation
::begin-print
signal hander.
Note that the page numbers passed to the
PrintOperation
::request-page-setup
and 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 nPages
- 1.
Since: 2.10
setPrintSettings
printOperationSetPrintSettings Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a, IsPrintSettings b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the print settings for op
. This is typically used to
re-establish print settings from a previous print operation,
see printOperationRun
.
Since: 2.10
setShowProgress
printOperationSetShowProgress Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> Bool |
|
-> m () |
If showProgress
is True
, the print operation will show a
progress dialog during the print operation.
Since: 2.10
setSupportSelection
printOperationSetSupportSelection Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether selection is supported by PrintOperation
.
Since: 2.18
setTrackPrintStatus
printOperationSetTrackPrintStatus Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> Bool |
|
-> m () |
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.
Since: 2.10
setUnit
printOperationSetUnit Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> Unit |
|
-> m () |
Sets up the transformation for the cairo context obtained from
PrintContext
in such a way that distances are measured in
units of unit
.
Since: 2.10
setUseFullPage
printOperationSetUseFullPage Source #
:: (HasCallStack, MonadIO m, IsPrintOperation a) | |
=> a |
|
-> Bool |
|
-> m () |
If fullPage
is True
, the transformation for the cairo context
obtained from PrintContext
puts the origin at the top left
corner of the page (which may not be the top left corner of the
sheet, depending on page orientation and the number of pages per
sheet). Otherwise, the origin is at the top left corner of the
imageable area (i.e. inside the margins).
Since: 2.10
Properties
allowAsync
Determines whether the print operation may run asynchronously or not.
Some systems don't support asynchronous printing, but those that do
will return PrintOperationResultInProgress
as the status, and
emit the PrintOperation
::done
signal when the operation is actually
done.
The Windows port does not support asynchronous operation at all (this
is unlikely to change). On other platforms, all actions except for
PrintOperationActionExport
support asynchronous operation.
Since: 2.10
constructPrintOperationAllowAsync :: IsPrintOperation o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “allow-async
” property. This is rarely needed directly, but it is used by new
.
getPrintOperationAllowAsync :: (MonadIO m, IsPrintOperation o) => o -> m Bool Source #
Get the value of the “allow-async
” property.
When overloading is enabled, this is equivalent to
get
printOperation #allowAsync
setPrintOperationAllowAsync :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m () Source #
Set the value of the “allow-async
” property.
When overloading is enabled, this is equivalent to
set
printOperation [ #allowAsync:=
value ]
currentPage
The current page in the document.
If this is set before printOperationRun
,
the user will be able to select to print only the current page.
Note that this only makes sense for pre-paginated documents.
Since: 2.10
constructPrintOperationCurrentPage :: IsPrintOperation o => Int32 -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “current-page
” property. This is rarely needed directly, but it is used by new
.
getPrintOperationCurrentPage :: (MonadIO m, IsPrintOperation o) => o -> m Int32 Source #
Get the value of the “current-page
” property.
When overloading is enabled, this is equivalent to
get
printOperation #currentPage
setPrintOperationCurrentPage :: (MonadIO m, IsPrintOperation o) => o -> Int32 -> m () Source #
Set the value of the “current-page
” property.
When overloading is enabled, this is equivalent to
set
printOperation [ #currentPage:=
value ]
customTabLabel
Used as the label of the tab containing custom widgets. Note that this property may be ignored on some platforms.
If this is Nothing
, GTK+ uses a default label.
Since: 2.10
clearPrintOperationCustomTabLabel :: (MonadIO m, IsPrintOperation o) => o -> m () Source #
Set the value of the “custom-tab-label
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#customTabLabel
constructPrintOperationCustomTabLabel :: IsPrintOperation o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “custom-tab-label
” property. This is rarely needed directly, but it is used by new
.
getPrintOperationCustomTabLabel :: (MonadIO m, IsPrintOperation o) => o -> m (Maybe Text) Source #
Get the value of the “custom-tab-label
” property.
When overloading is enabled, this is equivalent to
get
printOperation #customTabLabel
setPrintOperationCustomTabLabel :: (MonadIO m, IsPrintOperation o) => o -> Text -> m () Source #
Set the value of the “custom-tab-label
” property.
When overloading is enabled, this is equivalent to
set
printOperation [ #customTabLabel:=
value ]
defaultPageSetup
The PageSetup
used by default.
This page setup will be used by printOperationRun
,
but it can be overridden on a per-page basis by connecting
to the PrintOperation
::request-page-setup
signal.
Since: 2.10
clearPrintOperationDefaultPageSetup :: (MonadIO m, IsPrintOperation o) => o -> m () Source #
Set the value of the “default-page-setup
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#defaultPageSetup
constructPrintOperationDefaultPageSetup :: (IsPrintOperation o, IsPageSetup a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “default-page-setup
” property. This is rarely needed directly, but it is used by new
.
getPrintOperationDefaultPageSetup :: (MonadIO m, IsPrintOperation o) => o -> m PageSetup Source #
Get the value of the “default-page-setup
” property.
When overloading is enabled, this is equivalent to
get
printOperation #defaultPageSetup
setPrintOperationDefaultPageSetup :: (MonadIO m, IsPrintOperation o, IsPageSetup a) => o -> a -> m () Source #
Set the value of the “default-page-setup
” property.
When overloading is enabled, this is equivalent to
set
printOperation [ #defaultPageSetup:=
value ]
embedPageSetup
If True
, page size combo box and orientation combo box are embedded into page setup page.
Since: 2.18
constructPrintOperationEmbedPageSetup :: IsPrintOperation o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “embed-page-setup
” property. This is rarely needed directly, but it is used by new
.
getPrintOperationEmbedPageSetup :: (MonadIO m, IsPrintOperation o) => o -> m Bool Source #
Get the value of the “embed-page-setup
” property.
When overloading is enabled, this is equivalent to
get
printOperation #embedPageSetup
setPrintOperationEmbedPageSetup :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m () Source #
Set the value of the “embed-page-setup
” property.
When overloading is enabled, this is equivalent to
set
printOperation [ #embedPageSetup:=
value ]
exportFilename
The name of a file to generate instead of showing the print dialog. Currently, PDF is the only supported format.
The intended use of this property is for implementing “Export to PDF” actions.
“Print to PDF” support is independent of this and is done by letting the user pick the “Print to PDF” item from the list of printers in the print dialog.
Since: 2.10
clearPrintOperationExportFilename :: (MonadIO m, IsPrintOperation o) => o -> m () Source #
Set the value of the “export-filename
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#exportFilename
constructPrintOperationExportFilename :: IsPrintOperation o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “export-filename
” property. This is rarely needed directly, but it is used by new
.
getPrintOperationExportFilename :: (MonadIO m, IsPrintOperation o) => o -> m (Maybe Text) Source #
Get the value of the “export-filename
” property.
When overloading is enabled, this is equivalent to
get
printOperation #exportFilename
setPrintOperationExportFilename :: (MonadIO m, IsPrintOperation o) => o -> Text -> m () Source #
Set the value of the “export-filename
” property.
When overloading is enabled, this is equivalent to
set
printOperation [ #exportFilename:=
value ]
hasSelection
Determines whether there is a selection in your application. This can allow your application to print the selection. This is typically used to make a "Selection" button sensitive.
Since: 2.18
constructPrintOperationHasSelection :: IsPrintOperation o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “has-selection
” property. This is rarely needed directly, but it is used by new
.
getPrintOperationHasSelection :: (MonadIO m, IsPrintOperation o) => o -> m Bool Source #
Get the value of the “has-selection
” property.
When overloading is enabled, this is equivalent to
get
printOperation #hasSelection
setPrintOperationHasSelection :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m () Source #
Set the value of the “has-selection
” property.
When overloading is enabled, this is equivalent to
set
printOperation [ #hasSelection:=
value ]
jobName
A string used to identify the job (e.g. in monitoring applications like eggcups).
If you don't set a job name, GTK+ picks a default one by numbering successive print jobs.
Since: 2.10
constructPrintOperationJobName :: IsPrintOperation o => Text -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “job-name
” property. This is rarely needed directly, but it is used by new
.
getPrintOperationJobName :: (MonadIO m, IsPrintOperation o) => o -> m (Maybe Text) Source #
Get the value of the “job-name
” property.
When overloading is enabled, this is equivalent to
get
printOperation #jobName
setPrintOperationJobName :: (MonadIO m, IsPrintOperation o) => o -> Text -> m () Source #
Set the value of the “job-name
” property.
When overloading is enabled, this is equivalent to
set
printOperation [ #jobName:=
value ]
nPages
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
PrintOperation
::begin-print
signal hander.
Note that the page numbers passed to the
PrintOperation
::request-page-setup
and
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 nPages
- 1.
Since: 2.10
constructPrintOperationNPages :: IsPrintOperation o => Int32 -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “n-pages
” property. This is rarely needed directly, but it is used by new
.
getPrintOperationNPages :: (MonadIO m, IsPrintOperation o) => o -> m Int32 Source #
Get the value of the “n-pages
” property.
When overloading is enabled, this is equivalent to
get
printOperation #nPages
setPrintOperationNPages :: (MonadIO m, IsPrintOperation o) => o -> Int32 -> m () Source #
Set the value of the “n-pages
” property.
When overloading is enabled, this is equivalent to
set
printOperation [ #nPages:=
value ]
nPagesToPrint
The number of pages that will be printed.
Note that this value is set during print preparation phase
(PrintStatusPreparing
), so this value should never be
get before the data generation phase (PrintStatusGeneratingData
).
You can connect to the PrintOperation
::status-changed
signal
and call printOperationGetNPagesToPrint
when
print status is PrintStatusGeneratingData
.
This is typically used to track the progress of print operation.
Since: 2.18
getPrintOperationNPagesToPrint :: (MonadIO m, IsPrintOperation o) => o -> m Int32 Source #
Get the value of the “n-pages-to-print
” property.
When overloading is enabled, this is equivalent to
get
printOperation #nPagesToPrint
printSettings
The PrintSettings
used for initializing the dialog.
Setting this property is typically used to re-establish
print settings from a previous print operation, see
printOperationRun
.
Since: 2.10
clearPrintOperationPrintSettings :: (MonadIO m, IsPrintOperation o) => o -> m () Source #
Set the value of the “print-settings
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#printSettings
constructPrintOperationPrintSettings :: (IsPrintOperation o, IsPrintSettings a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “print-settings
” property. This is rarely needed directly, but it is used by new
.
getPrintOperationPrintSettings :: (MonadIO m, IsPrintOperation o) => o -> m PrintSettings Source #
Get the value of the “print-settings
” property.
When overloading is enabled, this is equivalent to
get
printOperation #printSettings
setPrintOperationPrintSettings :: (MonadIO m, IsPrintOperation o, IsPrintSettings a) => o -> a -> m () Source #
Set the value of the “print-settings
” property.
When overloading is enabled, this is equivalent to
set
printOperation [ #printSettings:=
value ]
showProgress
Determines whether to show a progress dialog during the print operation.
Since: 2.10
constructPrintOperationShowProgress :: IsPrintOperation o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “show-progress
” property. This is rarely needed directly, but it is used by new
.
getPrintOperationShowProgress :: (MonadIO m, IsPrintOperation o) => o -> m Bool Source #
Get the value of the “show-progress
” property.
When overloading is enabled, this is equivalent to
get
printOperation #showProgress
setPrintOperationShowProgress :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m () Source #
Set the value of the “show-progress
” property.
When overloading is enabled, this is equivalent to
set
printOperation [ #showProgress:=
value ]
status
The status of the print operation.
Since: 2.10
getPrintOperationStatus :: (MonadIO m, IsPrintOperation o) => o -> m PrintStatus Source #
Get the value of the “status
” property.
When overloading is enabled, this is equivalent to
get
printOperation #status
statusString
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 Statusbar
.
See the PrintOperation
:status
property for a status value that
is suitable for programmatic use.
Since: 2.10
getPrintOperationStatusString :: (MonadIO m, IsPrintOperation o) => o -> m Text Source #
Get the value of the “status-string
” property.
When overloading is enabled, this is equivalent to
get
printOperation #statusString
supportSelection
If True
, the print operation will support print of selection.
This allows the print dialog to show a "Selection" button.
Since: 2.18
constructPrintOperationSupportSelection :: IsPrintOperation o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “support-selection
” property. This is rarely needed directly, but it is used by new
.
getPrintOperationSupportSelection :: (MonadIO m, IsPrintOperation o) => o -> m Bool Source #
Get the value of the “support-selection
” property.
When overloading is enabled, this is equivalent to
get
printOperation #supportSelection
setPrintOperationSupportSelection :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m () Source #
Set the value of the “support-selection
” property.
When overloading is enabled, this is equivalent to
set
printOperation [ #supportSelection:=
value ]
trackPrintStatus
If True
, the print operation will try to continue report on
the status of the print job in the printer queues and printer.
This can allow your application to show things like “out of paper”
issues, and when the print job actually reaches the printer.
However, this is often implemented using polling, and should
not be enabled unless needed.
Since: 2.10
constructPrintOperationTrackPrintStatus :: IsPrintOperation o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “track-print-status
” property. This is rarely needed directly, but it is used by new
.
getPrintOperationTrackPrintStatus :: (MonadIO m, IsPrintOperation o) => o -> m Bool Source #
Get the value of the “track-print-status
” property.
When overloading is enabled, this is equivalent to
get
printOperation #trackPrintStatus
setPrintOperationTrackPrintStatus :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m () Source #
Set the value of the “track-print-status
” property.
When overloading is enabled, this is equivalent to
set
printOperation [ #trackPrintStatus:=
value ]
unit
The transformation for the cairo context obtained from
PrintContext
is set up in such a way that distances
are measured in units of unit
.
Since: 2.10
constructPrintOperationUnit :: IsPrintOperation o => Unit -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “unit
” property. This is rarely needed directly, but it is used by new
.
getPrintOperationUnit :: (MonadIO m, IsPrintOperation o) => o -> m Unit Source #
Get the value of the “unit
” property.
When overloading is enabled, this is equivalent to
get
printOperation #unit
setPrintOperationUnit :: (MonadIO m, IsPrintOperation o) => o -> Unit -> m () Source #
Set the value of the “unit
” property.
When overloading is enabled, this is equivalent to
set
printOperation [ #unit:=
value ]
useFullPage
If True
, the transformation for the cairo context obtained
from PrintContext
puts the origin at the top left corner
of the page (which may not be the top left corner of the sheet,
depending on page orientation and the number of pages per sheet).
Otherwise, the origin is at the top left corner of the imageable
area (i.e. inside the margins).
Since: 2.10
constructPrintOperationUseFullPage :: IsPrintOperation o => Bool -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “use-full-page
” property. This is rarely needed directly, but it is used by new
.
getPrintOperationUseFullPage :: (MonadIO m, IsPrintOperation o) => o -> m Bool Source #
Get the value of the “use-full-page
” property.
When overloading is enabled, this is equivalent to
get
printOperation #useFullPage
setPrintOperationUseFullPage :: (MonadIO m, IsPrintOperation o) => o -> Bool -> m () Source #
Set the value of the “use-full-page
” property.
When overloading is enabled, this is equivalent to
set
printOperation [ #useFullPage:=
value ]
Signals
beginPrint
type C_PrintOperationBeginPrintCallback = Ptr () -> Ptr PrintContext -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type PrintOperationBeginPrintCallback Source #
= PrintContext |
|
-> IO () |
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
PrintContext
and paginate the document accordingly, and then
set the number of pages with printOperationSetNPages
.
Since: 2.10
afterPrintOperationBeginPrint :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationBeginPrintCallback -> m SignalHandlerId Source #
Connect a signal handler for the “begin-print
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
printOperation #beginPrint callback
genClosure_PrintOperationBeginPrint :: PrintOperationBeginPrintCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_PrintOperationBeginPrintCallback :: C_PrintOperationBeginPrintCallback -> IO (FunPtr C_PrintOperationBeginPrintCallback) Source #
Generate a function pointer callable from C code, from a C_PrintOperationBeginPrintCallback
.
noPrintOperationBeginPrintCallback :: Maybe PrintOperationBeginPrintCallback Source #
A convenience synonym for
.Nothing
:: Maybe
PrintOperationBeginPrintCallback
onPrintOperationBeginPrint :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationBeginPrintCallback -> m SignalHandlerId Source #
Connect a signal handler for the “begin-print
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
printOperation #beginPrint callback
wrap_PrintOperationBeginPrintCallback :: PrintOperationBeginPrintCallback -> C_PrintOperationBeginPrintCallback Source #
createCustomWidget
type C_PrintOperationCreateCustomWidgetCallback = Ptr () -> Ptr () -> IO (Ptr Object) Source #
Type for the callback on the (unwrapped) C side.
type PrintOperationCreateCustomWidgetCallback Source #
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 PrintOperation
::custom-widget-apply
signal is emitted on the operation. Then you can read out any
information you need from the widgets.
Since: 2.10
afterPrintOperationCreateCustomWidget :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationCreateCustomWidgetCallback -> m SignalHandlerId Source #
Connect a signal handler for the “create-custom-widget
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
printOperation #createCustomWidget callback
genClosure_PrintOperationCreateCustomWidget :: PrintOperationCreateCustomWidgetCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_PrintOperationCreateCustomWidgetCallback :: C_PrintOperationCreateCustomWidgetCallback -> IO (FunPtr C_PrintOperationCreateCustomWidgetCallback) Source #
Generate a function pointer callable from C code, from a C_PrintOperationCreateCustomWidgetCallback
.
noPrintOperationCreateCustomWidgetCallback :: Maybe PrintOperationCreateCustomWidgetCallback Source #
A convenience synonym for
.Nothing
:: Maybe
PrintOperationCreateCustomWidgetCallback
onPrintOperationCreateCustomWidget :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationCreateCustomWidgetCallback -> m SignalHandlerId Source #
Connect a signal handler for the “create-custom-widget
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
printOperation #createCustomWidget callback
wrap_PrintOperationCreateCustomWidgetCallback :: PrintOperationCreateCustomWidgetCallback -> C_PrintOperationCreateCustomWidgetCallback Source #
customWidgetApply
type C_PrintOperationCustomWidgetApplyCallback = Ptr () -> Ptr Widget -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type PrintOperationCustomWidgetApplyCallback Source #
Emitted right before PrintOperation
::begin-print
if you added
a custom widget in the PrintOperation
::create-custom-widget
handler.
When you get this signal you should read the information from the
custom widgets, as the widgets are not guaraneed to be around at a
later time.
Since: 2.10
afterPrintOperationCustomWidgetApply :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationCustomWidgetApplyCallback -> m SignalHandlerId Source #
Connect a signal handler for the “custom-widget-apply
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
printOperation #customWidgetApply callback
genClosure_PrintOperationCustomWidgetApply :: PrintOperationCustomWidgetApplyCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_PrintOperationCustomWidgetApplyCallback :: C_PrintOperationCustomWidgetApplyCallback -> IO (FunPtr C_PrintOperationCustomWidgetApplyCallback) Source #
Generate a function pointer callable from C code, from a C_PrintOperationCustomWidgetApplyCallback
.
noPrintOperationCustomWidgetApplyCallback :: Maybe PrintOperationCustomWidgetApplyCallback Source #
A convenience synonym for
.Nothing
:: Maybe
PrintOperationCustomWidgetApplyCallback
onPrintOperationCustomWidgetApply :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationCustomWidgetApplyCallback -> m SignalHandlerId Source #
Connect a signal handler for the “custom-widget-apply
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
printOperation #customWidgetApply callback
wrap_PrintOperationCustomWidgetApplyCallback :: PrintOperationCustomWidgetApplyCallback -> C_PrintOperationCustomWidgetApplyCallback Source #
done
type C_PrintOperationDoneCallback = Ptr () -> CUInt -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type PrintOperationDoneCallback Source #
= PrintOperationResult |
|
-> IO () |
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 PrintOperationResultError
then you can call
printOperationGetError
for more information.
If you enabled print status tracking then
printOperationIsFinished
may still return False
after PrintOperation
::done
was emitted.
Since: 2.10
afterPrintOperationDone :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationDoneCallback -> m SignalHandlerId Source #
Connect a signal handler for the “done
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
printOperation #done callback
genClosure_PrintOperationDone :: PrintOperationDoneCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_PrintOperationDoneCallback :: C_PrintOperationDoneCallback -> IO (FunPtr C_PrintOperationDoneCallback) Source #
Generate a function pointer callable from C code, from a C_PrintOperationDoneCallback
.
noPrintOperationDoneCallback :: Maybe PrintOperationDoneCallback Source #
A convenience synonym for
.Nothing
:: Maybe
PrintOperationDoneCallback
onPrintOperationDone :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationDoneCallback -> m SignalHandlerId Source #
Connect a signal handler for the “done
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
printOperation #done callback
wrap_PrintOperationDoneCallback :: PrintOperationDoneCallback -> C_PrintOperationDoneCallback Source #
Wrap a PrintOperationDoneCallback
into a C_PrintOperationDoneCallback
.
drawPage
type C_PrintOperationDrawPageCallback = Ptr () -> Ptr PrintContext -> Int32 -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type PrintOperationDrawPageCallback Source #
= PrintContext |
|
-> Int32 |
|
-> IO () |
Emitted for every page that is printed. The signal handler
must render the pageNr
's page onto the cairo context obtained
from context
using printContextGetCairoContext
.
C code
static void draw_page (GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer user_data) { cairo_t *cr; PangoLayout *layout; gdouble width, text_height; gint layout_height; PangoFontDescription *desc; cr = gtk_print_context_get_cairo_context (context); width = gtk_print_context_get_width (context); cairo_rectangle (cr, 0, 0, width, HEADER_HEIGHT); cairo_set_source_rgb (cr, 0.8, 0.8, 0.8); cairo_fill (cr); layout = gtk_print_context_create_pango_layout (context); desc = pango_font_description_from_string ("sans 14"); pango_layout_set_font_description (layout, desc); pango_font_description_free (desc); pango_layout_set_text (layout, "some text", -1); pango_layout_set_width (layout, width * PANGO_SCALE); pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER); pango_layout_get_size (layout, NULL, &layout_height); text_height = (gdouble)layout_height / PANGO_SCALE; cairo_move_to (cr, width / 2, (HEADER_HEIGHT - text_height) / 2); pango_cairo_show_layout (cr, layout); g_object_unref (layout); }
Use printOperationSetUseFullPage
and
printOperationSetUnit
before starting the print operation
to set up the transformation of the cairo context according to your
needs.
Since: 2.10
afterPrintOperationDrawPage :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationDrawPageCallback -> m SignalHandlerId Source #
Connect a signal handler for the “draw-page
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
printOperation #drawPage callback
genClosure_PrintOperationDrawPage :: PrintOperationDrawPageCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_PrintOperationDrawPageCallback :: C_PrintOperationDrawPageCallback -> IO (FunPtr C_PrintOperationDrawPageCallback) Source #
Generate a function pointer callable from C code, from a C_PrintOperationDrawPageCallback
.
noPrintOperationDrawPageCallback :: Maybe PrintOperationDrawPageCallback Source #
A convenience synonym for
.Nothing
:: Maybe
PrintOperationDrawPageCallback
onPrintOperationDrawPage :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationDrawPageCallback -> m SignalHandlerId Source #
Connect a signal handler for the “draw-page
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
printOperation #drawPage callback
wrap_PrintOperationDrawPageCallback :: PrintOperationDrawPageCallback -> C_PrintOperationDrawPageCallback Source #
Wrap a PrintOperationDrawPageCallback
into a C_PrintOperationDrawPageCallback
.
endPrint
type C_PrintOperationEndPrintCallback = Ptr () -> Ptr PrintContext -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type PrintOperationEndPrintCallback Source #
= PrintContext |
|
-> IO () |
Emitted after all pages have been rendered.
A handler for this signal can clean up any resources that have
been allocated in the PrintOperation
::begin-print
handler.
Since: 2.10
afterPrintOperationEndPrint :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationEndPrintCallback -> m SignalHandlerId Source #
Connect a signal handler for the “end-print
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
printOperation #endPrint callback
genClosure_PrintOperationEndPrint :: PrintOperationEndPrintCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_PrintOperationEndPrintCallback :: C_PrintOperationEndPrintCallback -> IO (FunPtr C_PrintOperationEndPrintCallback) Source #
Generate a function pointer callable from C code, from a C_PrintOperationEndPrintCallback
.
noPrintOperationEndPrintCallback :: Maybe PrintOperationEndPrintCallback Source #
A convenience synonym for
.Nothing
:: Maybe
PrintOperationEndPrintCallback
onPrintOperationEndPrint :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationEndPrintCallback -> m SignalHandlerId Source #
Connect a signal handler for the “end-print
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
printOperation #endPrint callback
wrap_PrintOperationEndPrintCallback :: PrintOperationEndPrintCallback -> C_PrintOperationEndPrintCallback Source #
Wrap a PrintOperationEndPrintCallback
into a C_PrintOperationEndPrintCallback
.
paginate
type C_PrintOperationPaginateCallback = Ptr () -> Ptr PrintContext -> Ptr () -> IO CInt Source #
Type for the callback on the (unwrapped) C side.
type PrintOperationPaginateCallback Source #
= PrintContext |
|
-> IO Bool | Returns: |
Emitted after the PrintOperation
::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
printOperationSetNPages
, 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.
Since: 2.10
afterPrintOperationPaginate :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationPaginateCallback -> m SignalHandlerId Source #
Connect a signal handler for the “paginate
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
printOperation #paginate callback
genClosure_PrintOperationPaginate :: PrintOperationPaginateCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_PrintOperationPaginateCallback :: C_PrintOperationPaginateCallback -> IO (FunPtr C_PrintOperationPaginateCallback) Source #
Generate a function pointer callable from C code, from a C_PrintOperationPaginateCallback
.
noPrintOperationPaginateCallback :: Maybe PrintOperationPaginateCallback Source #
A convenience synonym for
.Nothing
:: Maybe
PrintOperationPaginateCallback
onPrintOperationPaginate :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationPaginateCallback -> m SignalHandlerId Source #
Connect a signal handler for the “paginate
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
printOperation #paginate callback
wrap_PrintOperationPaginateCallback :: PrintOperationPaginateCallback -> C_PrintOperationPaginateCallback Source #
Wrap a PrintOperationPaginateCallback
into a C_PrintOperationPaginateCallback
.
preview
type C_PrintOperationPreviewCallback = Ptr () -> Ptr PrintOperationPreview -> Ptr PrintContext -> Ptr Window -> Ptr () -> IO CInt Source #
Type for the callback on the (unwrapped) C side.
type PrintOperationPreviewCallback Source #
= PrintOperationPreview |
|
-> PrintContext |
|
-> Maybe Window | |
-> IO Bool | Returns: |
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 printContextSetCairoContext
.
The custom preview implementation can use
printOperationPreviewIsSelected
and
printOperationPreviewRenderPage
to find pages which
are selected for print and render them. The preview must be
finished by calling printOperationPreviewEndPreview
(typically in response to the user clicking a close button).
Since: 2.10
afterPrintOperationPreview :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationPreviewCallback -> m SignalHandlerId Source #
Connect a signal handler for the “preview
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
printOperation #preview callback
genClosure_PrintOperationPreview :: PrintOperationPreviewCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_PrintOperationPreviewCallback :: C_PrintOperationPreviewCallback -> IO (FunPtr C_PrintOperationPreviewCallback) Source #
Generate a function pointer callable from C code, from a C_PrintOperationPreviewCallback
.
noPrintOperationPreviewCallback :: Maybe PrintOperationPreviewCallback Source #
A convenience synonym for
.Nothing
:: Maybe
PrintOperationPreviewCallback
onPrintOperationPreview :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationPreviewCallback -> m SignalHandlerId Source #
Connect a signal handler for the “preview
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
printOperation #preview callback
wrap_PrintOperationPreviewCallback :: PrintOperationPreviewCallback -> C_PrintOperationPreviewCallback Source #
Wrap a PrintOperationPreviewCallback
into a C_PrintOperationPreviewCallback
.
requestPageSetup
type C_PrintOperationRequestPageSetupCallback = Ptr () -> Ptr PrintContext -> Int32 -> Ptr PageSetup -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type PrintOperationRequestPageSetupCallback Source #
= PrintContext |
|
-> Int32 |
|
-> PageSetup |
|
-> IO () |
Emitted once for every page that is printed, to give
the application a chance to modify the page setup. Any changes
done to setup
will be in force only for printing this page.
Since: 2.10
afterPrintOperationRequestPageSetup :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationRequestPageSetupCallback -> m SignalHandlerId Source #
Connect a signal handler for the “request-page-setup
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
printOperation #requestPageSetup callback
genClosure_PrintOperationRequestPageSetup :: PrintOperationRequestPageSetupCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_PrintOperationRequestPageSetupCallback :: C_PrintOperationRequestPageSetupCallback -> IO (FunPtr C_PrintOperationRequestPageSetupCallback) Source #
Generate a function pointer callable from C code, from a C_PrintOperationRequestPageSetupCallback
.
noPrintOperationRequestPageSetupCallback :: Maybe PrintOperationRequestPageSetupCallback Source #
A convenience synonym for
.Nothing
:: Maybe
PrintOperationRequestPageSetupCallback
onPrintOperationRequestPageSetup :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationRequestPageSetupCallback -> m SignalHandlerId Source #
Connect a signal handler for the “request-page-setup
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
printOperation #requestPageSetup callback
wrap_PrintOperationRequestPageSetupCallback :: PrintOperationRequestPageSetupCallback -> C_PrintOperationRequestPageSetupCallback Source #
statusChanged
type C_PrintOperationStatusChangedCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type PrintOperationStatusChangedCallback = IO () Source #
Emitted at between the various phases of the print operation.
See PrintStatus
for the phases that are being discriminated.
Use printOperationGetStatus
to find out the current
status.
Since: 2.10
afterPrintOperationStatusChanged :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationStatusChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “status-changed
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
printOperation #statusChanged callback
genClosure_PrintOperationStatusChanged :: PrintOperationStatusChangedCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_PrintOperationStatusChangedCallback :: C_PrintOperationStatusChangedCallback -> IO (FunPtr C_PrintOperationStatusChangedCallback) Source #
Generate a function pointer callable from C code, from a C_PrintOperationStatusChangedCallback
.
noPrintOperationStatusChangedCallback :: Maybe PrintOperationStatusChangedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
PrintOperationStatusChangedCallback
onPrintOperationStatusChanged :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationStatusChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the “status-changed
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
printOperation #statusChanged callback
wrap_PrintOperationStatusChangedCallback :: PrintOperationStatusChangedCallback -> C_PrintOperationStatusChangedCallback Source #
updateCustomWidget
type C_PrintOperationUpdateCustomWidgetCallback = Ptr () -> Ptr Widget -> Ptr PageSetup -> Ptr PrintSettings -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type PrintOperationUpdateCustomWidgetCallback Source #
= Widget |
|
-> PageSetup |
|
-> PrintSettings |
|
-> IO () |
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.
Since: 2.18
afterPrintOperationUpdateCustomWidget :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationUpdateCustomWidgetCallback -> m SignalHandlerId Source #
Connect a signal handler for the “update-custom-widget
” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after
printOperation #updateCustomWidget callback
genClosure_PrintOperationUpdateCustomWidget :: PrintOperationUpdateCustomWidgetCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_PrintOperationUpdateCustomWidgetCallback :: C_PrintOperationUpdateCustomWidgetCallback -> IO (FunPtr C_PrintOperationUpdateCustomWidgetCallback) Source #
Generate a function pointer callable from C code, from a C_PrintOperationUpdateCustomWidgetCallback
.
noPrintOperationUpdateCustomWidgetCallback :: Maybe PrintOperationUpdateCustomWidgetCallback Source #
A convenience synonym for
.Nothing
:: Maybe
PrintOperationUpdateCustomWidgetCallback
onPrintOperationUpdateCustomWidget :: (IsPrintOperation a, MonadIO m) => a -> PrintOperationUpdateCustomWidgetCallback -> m SignalHandlerId Source #
Connect a signal handler for the “update-custom-widget
” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on
printOperation #updateCustomWidget callback