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.

@FunctionalInterface public static interface Svg.ErrorCallback extends FunctionPointer

Functional interface declaration of the ErrorCallback callback.

Since:
4.22
See Also:
  • Method Details

    • run

      void run(@Nullable GError error)

      Signals that an error occurred.

      Errors can occur both during parsing and during rendering.

      The expected error values are in the Gtk.SvgError enumeration, context information about the location of parsing errors can be obtained with the various gtk_svg_error functions.

      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

      default void upcall(MemorySegment sourceSvg, MemorySegment error)
      The upcall method is called from native code. The parameters are marshaled and run(GError) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, MemorySegment) method.
      Specified by:
      toCallback in interface FunctionPointer
      Parameters:
      arena - the arena in which the function pointer is allocated
      Returns:
      the native function pointer