The basic block in a scene graph to be rendered using [classGsk.Renderer].
Each node has a parent, except the top-level node; each node may have children nodes.
Each node has an associated drawing surface, which has the size of the rectangle set when creating it.
Render nodes are meant to be transient; once they have been associated to a [classGsk.Renderer] it's safe to release any reference you have on them. All [classGsk.RenderNode]s are immutable, you can only specify their properties during construction.
function Create (Ptr: not null access System.Address) return Dummy_Gsk_Render_Node_Record
function Create (Ptr: not null access System.Address) return Gsk_Render_Node_Record
function Deserialize
(Bytes : Glib.Bytes.Gbytes;
Error_Func : Gsk_Parse_Error_Func) return Gsk_Render_Node
Loads data previously created via [methodGsk.RenderNode.serialize]. For a discussion of the supported format, see that function.
the bytes containing the data
callback on parsing errors
a new render node. Has transfer-ownership='full'.
procedure Draw (Self : Gsk_Render_Node; Cr : Cairo.Cairo_Context)
Draws the contents of a render node on a cairo context. Typically, you'll use this function to implement fallback rendering of render nodes on an intermediate Cairo context, instead of using the drawing context associated to a [classGdk.Surface]'s rendering buffer. For advanced nodes that cannot be supported using Cairo, in particular for nodes doing 3D operations, this function may fail.
cairo context to draw to
type Dummy_Gsk_Render_Node_Record is new Gsk_Render_Node_Record with private;
function From_Object_Free
(B : not null access Gsk_Color_Stop) return Gsk_Color_Stop
Return the underlying object and free the pointer. This is meant to be used internally by GtkAda, and should not in general be called by user code.
function From_Object_Free
(B : not null access Gsk_Parse_Location) return Gsk_Parse_Location
Return the underlying object and free the pointer. This is meant to be used internally by GtkAda, and should not in general be called by user code.
function From_Object_Full_Ownership
(Object : System.Address) return Gsk_Render_Node
For internal usage. Do not call manualy.
function From_Object_None_Ownership
(Object : System.Address) return Gsk_Render_Node
For internal usage. Do not call manualy.
procedure Get_Bounds
(Self : Gsk_Render_Node;
Bounds : not null access Graphene.Rect.Graphene_Rect_T)
Retrieves the boundaries of the Node. The node will not draw outside of its boundaries.
return location for the boundaries
function Get_Children
(Self : Gsk_Render_Node) return Gsk_Render_Node_Array
Gets a list of all children nodes of the rendernode. Keep in mind that for various rendernodes, their children have different semantics, like the mask vs the source of a mask node. If you care about thse semantics, don't use this function, use the specific getters instead. Since: gtk+ 4.22
The children
function Get_Node_Type
(Self : Gsk_Render_Node) return Gsk.Enums.Gsk_Render_Node_Type
Returns the type of the render node.
the type of Node
function Get_Object
(Self : access Gsk_Render_Node_Record'Class) return System.Address
For internal usage. Do not call manualy.
function Get_Opaque_Rect
(Self : Gsk_Render_Node;
Out_Opaque : not null access Graphene.Rect.Graphene_Rect_T)
return Boolean
Gets an opaque rectangle inside the node that GTK can determine to be fully opaque. There is no guarantee that this is indeed the largest opaque rectangle or that regions outside the rectangle are not opaque. This function is a best effort with that goal. The rectangle will be fully contained in the bounds of the node. Since: gtk+ 4.16
return location for the opaque rect
true if part or all of the rendernode is opaque, false if no opaque region could be found.
function Get_Type return Glib.GType
type Gsk_Color_Stop is record
Offset : Interfaces.C.C_float;
Color : Gdk.RGBA.Gdk_RGBA;
end record;
A color stop in a gradient node.
type Gsk_Color_Stop_Array is array (Natural range <>) of Gsk_Color_Stop
with Convention => C;
type Gsk_Parse_Error_Func is access procedure
(Start : Gsk_Parse_Location;
The_End : Gsk_Parse_Location;
Error : Glib.Error.GError);
Type of callback that is called when an error occurs during node deserialization.
start of the error location
end of the error location
the error
type Gsk_Parse_Location is record
Bytes : Gsize;
Chars : Gsize;
Lines : Gsize;
Line_Bytes : Gsize;
Line_Chars : Gsize;
end record;
A location in a parse buffer.
type Gsk_Render_Node is access all Gsk_Render_Node_Record'Class;
type Gsk_Render_Node_Array is array (Natural range <>) of Gsk_Render_Node
with Convention => C;
type Gsk_Render_Node_Record is abstract new Ada.Finalization.Controlled with private;
function Is_Created
(Self : not null access Gsk_Render_Node_Record'Class) return Boolean
Retrn True if Self is initialized with Gtk object
function Serialize (Self : Gsk_Render_Node) return Glib.Bytes.Gbytes
Serializes the Node for later deserialization via Gsk.Render_Node.Deserialize. No guarantees are made about the format used other than that the same version of GTK will be able to deserialize the result of a call to Gsk.Render_Node.Serialize and Gsk.Render_Node.Deserialize will correctly reject files it cannot open that were created with previous versions of GTK. The intended use of this functions is testing, benchmarking and debugging. The format is not meant as a permanent storage format.
a GBytes representing the node. Has transfer-ownership='full'.
procedure Set_Object
(Self : not null access Gsk_Render_Node_Record'Class;
Object : System.Address)
For internal usage. Do not call manualy.
function Write_To_File
(Self : Gsk_Render_Node;
Filename : UTF8_String;
Error : out Glib.Error.GError) return Boolean
This function is equivalent to calling [methodGsk.RenderNode.serialize] followed by [funcGlib.file_set_contents]. See those two functions for details on the arguments. It is mostly intended for use inside a debugger to quickly dump a render node to a file for later inspection.
the file to save it to
the return location for a recoverable error
true if saving was successful