Class CairoNode

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class CairoNode extends RenderNode
A render node for a Cairo surface.
  • Constructor Details

    • CairoNode

      public CairoNode(MemorySegment address)
      Create a CairoNode instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • CairoNode

      public CairoNode(Rect bounds)

      Creates a GskRenderNode that will render a cairo surface into the area given by bounds.

      You can draw to the cairo surface using getDrawContext().

      Parameters:
      bounds - the rectangle to render to
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the CairoNode class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected CairoNode asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class RenderNode
      Returns:
      the instance as if it were its parent type
    • getDrawContext

      public org.freedesktop.cairo.Context getDrawContext()

      Creates a Cairo context for drawing using the surface associated to the render node.

      If no surface exists yet, a surface will be created optimized for rendering to renderer.

      Returns:
      a Cairo context used for drawing; use cairo_destroy() when done drawing
    • getSurface

      public org.freedesktop.cairo.Surface getSurface()
      Retrieves the Cairo surface used by the render node.
      Returns:
      a Cairo surface