Interface WebPage.ContextMenuCallback

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

Functional interface declaration of the ContextMenuCallback callback.

See Also:
  • Method Details

    • run

      boolean run(@Nullable ContextMenu contextMenu, @Nullable WebHitTestResult hitTestResult)
      Emitted before a context menu is displayed in the UI Process to give the application a chance to customize the proposed menu, build its own context menu or pass user data to the UI Process. This signal is useful when the information available in the UI Process is not enough to build or customize the context menu, for example, to add menu entries depending on the node at the coordinates of the hitTestResult. Otherwise, it's recommended to use WebKitWebView::context-menu signal instead.
      Since:
      2.8
    • upcall

      default int upcall(MemorySegment sourceWebPage, MemorySegment contextMenu, MemorySegment hitTestResult)
      The upcall method is called from native code. The parameters are marshaled and run(ContextMenu, WebHitTestResult) 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