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 TypeMethodDescriptionbooleanrun(@Nullable PrintOperationPreview preview, @Nullable PrintContext context, @Nullable Window parent) Gets emitted when a preview is requested from the native dialog.default MemorySegmenttoCallback(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 intupcall(MemorySegment sourcePrintOperation, MemorySegment preview, MemorySegment context, MemorySegment parent) Theupcallmethod is called from native code.
-
Method Details
-
run
boolean run(@Nullable PrintOperationPreview preview, @Nullable PrintContext context, @Nullable Window parent) 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
truefrom its handler for this signal. In order to use the providedcontextfor 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) Theupcallmethod 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:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-