Interface CssProvider.ParsingErrorCallback

All Superinterfaces:
FunctionPointer
Enclosing class:
CssProvider
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 CssProvider.ParsingErrorCallback extends FunctionPointer

Functional interface declaration of the ParsingErrorCallback callback.

See Also:
  • Method Details

    • run

      void run(@Nullable CssSection section, @Nullable GError error)

      Signals that a parsing error occurred.

      The expected error values are in the Gtk.CssParserError and Gtk.CssParserWarning enumerations.

      The path, line and position describe the actual location of the error as accurately as possible.

      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.

      Errors in the Gtk.CssParserWarning enumeration should not be treated as fatal errors.

      Note that this signal may be emitted at any time as the css provider may opt to defer parsing parts or all of the input to a later time than when a loading function was called.

    • upcall

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

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, 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