Gnome::Gtk4::R-PrintOperationPreview
#------------------------------------------------------------------------------- #--[Class Description]---------------------------------------------------------- #-------------------------------------------------------------------------------
Description
Gnome::Gtk4::R-PrintOperationPreview is the interface that is used to implement print preview.
A Gnome::Gtk4::R-PrintOperationPreview object is passed to the preview defined in PrintOperation signal by Gnome::Gtk4::PrintOperation.
#------------------------------------------------------------------------------- #--[Methods]-------------------------------------------------------------------- #-------------------------------------------------------------------------------
Methods
#-------------------------------------------------------------------------------
end-preview
Ends a preview.
This function must be called to finish a custom print preview.
method end-preview ( )
#-------------------------------------------------------------------------------
is-selected
Returns whether the given page is included in the set of pages that have been selected for printing.
method is-selected ( Int() $page-nr --> Bool )
$page-nr; a page number.
Return value; True if the page has been selected for printing.
#-------------------------------------------------------------------------------
render-page
Renders a page to the preview.
This is using the print context that was passed to the
preview defined in PrintOperation handler together
with $preview.
A custom print preview should use this function to render the currently selected page.
Note that this function requires a suitable cairo context to be associated with the print context.
method render-page ( Int() $page-nr )
$page-nr; the page to render.
#------------------------------------------------------------------------------- #--[Signal Documentation]------------------------------------------------------- #-------------------------------------------------------------------------------
Signals
got-page-size
Emitted once for each page that gets rendered to the preview.
A handler for this signal should update the $context
according to $page-setup and set up a suitable cairo
context, using .set-cairo-context() in class PrintContext.
method handler (
N-Object $context,
N-Object $page-setup,
Int :$_handle_id,
N-GObject :$_native-object,
Gnome::Gtk4::PrintOperationPreview :$_widget,
*%user-options
)
$context; the current Gnome::Gtk4::PrintContext.
$page-setup; the Gnome::Gtk4::PageSetup for the current page.
$_handle_id; The registered event handler id.
$_native-object; The native object provided by the Raku object which registered this event. This is a native Gnome::Gtk4::PrintOperationPreview object.
%user-options; A list of named arguments provided by .register-signal() in class Object.
ready
The ready signal gets emitted once per preview operation, before the first page is rendered.
A handler for this signal can be used for setup tasks.
method handler (
N-Object $context,
Int :$_handle_id,
N-GObject :$_native-object,
Gnome::Gtk4::PrintOperationPreview :$_widget,
*%user-options
)
$context; the current Gnome::Gtk4::PrintContext.
$_handle_id; The registered event handler id.
$_native-object; The native object provided by the Raku object which registered this event. This is a native Gnome::Gtk4::PrintOperationPreview object.
%user-options; A list of named arguments provided by .register-signal() in class Object.