Class CairoNode
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
org.gnome.gsk.RenderNode
org.gnome.gsk.CairoNode
- All Implemented Interfaces:
Proxy
A render node for a Cairo surface.
-
Nested Class Summary
Nested classes/interfaces inherited from class RenderNode
RenderNode.RenderNode$Impl -
Constructor Summary
ConstructorsConstructorDescriptionCairoNode(MemorySegment address) Create a CairoNode instance for the provided memory address.Creates aGskRenderNodethat will render a cairo surface into the area given bybounds. -
Method Summary
Modifier and TypeMethodDescriptionprotected CairoNodeasParent()Return this instance as if it were its parent type.org.freedesktop.cairo.ContextCreates a Cairo context for drawing using the surface associated to the render node.static MemoryLayoutThe memory layout of the native struct.org.freedesktop.cairo.SurfaceRetrieves the Cairo surface used by the render node.static @Nullable TypegetType()Get the GType of the CairoNode class.Methods inherited from class RenderNode
deserialize, draw, getBounds, getChildren, getNodeType, getOpaqueRect, ref, serialize, unref, writeToFileMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
CairoNode
Create a CairoNode instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
CairoNode
Creates a
GskRenderNodethat will render a cairo surface into the area given bybounds.You can draw to the cairo surface using
getDrawContext().- Parameters:
bounds- the rectangle to render to
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code.- Overrides:
asParentin classRenderNode- 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
-