Package org.gnome.gtk
Interface PrintOperation.PreviewCallback
- All Superinterfaces:
FunctionPointer
- Enclosing class:
PrintOperation
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional interface declaration of the
PreviewCallback
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
run
(PrintOperationPreview preview, PrintContext context, @Nullable Window parent) Gets emitted when a preview is requested from the native dialog.default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.default int
upcall
(MemorySegment sourcePrintOperation, MemorySegment preview, MemorySegment context, MemorySegment parent) Theupcall
method is called from native code.
-
Method Details
-
run
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 providedcontext
for the preview implementation, it must be given a suitable cairo context withPrintContext.setCairoContext(org.freedesktop.cairo.Context, double, double)
.The custom preview implementation can use
PrintOperationPreview.isSelected(int)
andPrintOperationPreview.renderPage(int)
to find pages which are selected for print and render them. The preview must be finished by callingPrintOperationPreview.endPreview()
(typically in response to the user clicking a close button). -
upcall
default int upcall(MemorySegment sourcePrintOperation, MemorySegment preview, MemorySegment context, MemorySegment parent) Theupcall
method is called from native code. The parameters are marshaled andrun(org.gnome.gtk.PrintOperationPreview, org.gnome.gtk.PrintContext, org.gnome.gtk.Window)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.- Specified by:
toCallback
in interfaceFunctionPointer
- Parameters:
arena
- the function pointer will be allocated in this arena- Returns:
- the native function pointer
-