Class CairoContext

All Implemented Interfaces:
Proxy
Direct Known Subclasses:
CairoContext.CairoContext$Impl

@Generated("org.javagi.JavaGI") public abstract class CairoContext extends DrawContext

Represents the platform-specific draw context.

GdkCairoContexts are created for a surface using Surface.createCairoContext(), and the context can then be used to draw on that surface.

  • Constructor Details

    • CairoContext

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

      public CairoContext()
      Create a new CairoContext.
  • Method Details

    • getType

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

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

      protected CairoContext 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 DrawContext
      Returns:
      the instance as if it were its parent type
    • cairoCreate

      @Deprecated public @Nullable org.freedesktop.cairo.Context cairoCreate()
      Deprecated.
      Drawing content with Cairo should be done via Cairo rendernodes, not by using renderers.

      Retrieves a Cairo context to be used to draw on the GdkSurface of context.

      A call to DrawContext.beginFrame(Region) with this context must have been done or this function will return null.

      The returned context is guaranteed to be valid until DrawContext.endFrame() is called.

      Returns:
      a Cairo context to draw on `GdkSurface