Interface Svg.ErrorCallback
- All Superinterfaces:
FunctionPointer
- Enclosing class:
Svg
- 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 ErrorCallback callback.
- Since:
- 4.22
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidSignals that an error occurred.default MemorySegmenttoCallback(Arena arena) Creates a native function pointer to theupcall(MemorySegment, MemorySegment)method.default voidupcall(MemorySegment sourceSvg, MemorySegment error) Theupcallmethod is called from native code.
-
Method Details
-
run
Signals that an error occurred.
Errors can occur both during parsing and during rendering.
The expected error values are in the
Gtk.SvgErrorenumeration, context information about the location of parsing errors can be obtained with the variousgtk_svg_errorfunctions.Parsing errors are never fatal, so the parsing will resume after the error. Errors may however cause parts of the given data or even all of it to not be parsed at all. So it is a useful idea to check that the parsing succeeds by connecting to this signal.
::: note This signal is emitted in the middle of parsing or rendering, and if you handle it, you must be careful. Logging the errors you receive is fine, but modifying the widget hierarchy or changing the paintable state definitively isn't.
If in doubt, defer to an idle.- Since:
- 4.22
-
upcall
Theupcallmethod is called from native code. The parameters are marshaled andrun(GError)is executed. -
toCallback
Creates a native function pointer to theupcall(MemorySegment, MemorySegment)method.- Specified by:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-