Package org.gnome.gsk
Class ConicGradientNode
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
org.gnome.gsk.RenderNode
org.gnome.gsk.ConicGradientNode
-
Nested Class Summary
Nested classes/interfaces inherited from class org.gnome.gsk.RenderNode
RenderNode.RenderNodeImpl
-
Constructor Summary
ConstructorDescriptionConicGradientNode
(MemorySegment address) Create a ConicGradientNode proxy instance for the provided memory address.ConicGradientNode
(Rect bounds, Point center, float rotation, ColorStop[] colorStops) Creates aGskRenderNode
that draws a conic gradient. -
Method Summary
Modifier and TypeMethodDescriptionprotected ConicGradientNode
asParent()
Returns this instance as if it were its parent type.float
getAngle()
Retrieves the angle for the gradient in radians, normalized in [0, 2 * PI].Retrieves the center pointer for the gradient.Retrieves the color stops in the gradient.long
Retrieves the number of color stops in the gradient.float
Retrieves the rotation for the gradient in degrees.static Type
getType()
Get the GType of the ConicGradientNode classMethods inherited from class org.gnome.gsk.RenderNode
deserialize, draw, getBounds, getNodeType, getOpaqueRect, ref, serialize, unref, writeToFile
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getMemoryLayout, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
ConicGradientNode
Create a ConicGradientNode proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
ConicGradientNode
Creates aGskRenderNode
that draws a conic gradient.The conic gradient starts around
center
in the direction ofrotation
. A rotation of 0 means that the gradient points up. Color stops are then added clockwise.- Parameters:
bounds
- the bounds of the nodecenter
- the center of the gradientrotation
- the rotation of the gradient in degreescolorStops
- a pointer to an array ofGskColorStop
defining the gradient. The offsets of all color stops must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type.- Overrides:
asParent
in classRenderNode
-
getAngle
public float getAngle()Retrieves the angle for the gradient in radians, normalized in [0, 2 * PI].The angle is starting at the top and going clockwise, as expressed in the css specification:
angle = 90 - gsk_conic_gradient_node_get_rotation()
- Returns:
- the angle for the gradient
-
getCenter
Retrieves the center pointer for the gradient.- Returns:
- the center point for the gradient
-
getColorStops
Retrieves the color stops in the gradient.- Returns:
- the color stops in the gradient
-
getNColorStops
public long getNColorStops()Retrieves the number of color stops in the gradient.- Returns:
- the number of color stops
-
getRotation
public float getRotation()Retrieves the rotation for the gradient in degrees.- Returns:
- the rotation for the gradient
-