Top | ![]() |
![]() |
![]() |
![]() |
gboolean | children-possible | Read / Write |
gboolean | destroy-item | Read / Write |
gchar * | display-name | Read / Write |
GIcon * | expanded-icon | Read / Write |
gchar * | expanded-icon-name | Write |
gboolean | has-error | Read / Write |
GIcon * | icon | Read / Write |
gchar * | icon-name | Write |
gboolean | is-header | Read / Write |
GObject * | item | Read / Write |
gboolean | reset-on-collapse | Read / Write |
gchar * | tag | Read / Write |
gboolean | use-markup | Read / Write |
The IdeTreeNode class is used to represent an item that should be displayed in the tree of the Ide application. The IdeTreeAddin plugins create and maintain these nodes during the lifetime of the program.
Plugins that want to add items to the tree should implement the IdeTreeAddin interface and register it during plugin initialization.
IdeTreeNodeVisit (*IdeTreeTraverseFunc) (IdeTreeNode *node
,gpointer user_data
);
This function prototype is used to traverse a tree of IdeTreeNode.
Since: 3.32
int (*IdeTreeNodeCompare) (IdeTreeNode *node
,IdeTreeNode *child
);
This callback function is a convenience wrapper around GCompareFunc
Since: 3.32
void ide_tree_node_set_has_error (IdeTreeNode *self
,gboolean has_error
);
GtkTreePath *
ide_tree_node_get_path (IdeTreeNode *self
);
Gets the path for the tree node.
Since: 3.32
const gchar *
ide_tree_node_get_display_name (IdeTreeNode *self
);
Gets the “display-name” property.
Since: 3.32
void ide_tree_node_set_display_name (IdeTreeNode *self
,const gchar *display_name
);
Sets the “display-name” property, which is the text to use when displaying the item in the tree.
Since: 3.32
gboolean
ide_tree_node_get_is_header (IdeTreeNode *self
);
Gets the “is-header” property.
If this is TRUE
, then the node will be rendered with alternate
styling for group headers.
Since: 3.32
void ide_tree_node_set_is_header (IdeTreeNode *self
,gboolean header
);
Sets the “is-header” property.
Since: 3.32
GIcon *
ide_tree_node_get_icon (IdeTreeNode *self
);
Gets the icon associated with the tree node.
Since: 3.32
void ide_tree_node_set_icon (IdeTreeNode *self
,GIcon *icon
);
Sets the icon for the tree node.
Since: 3.32
void ide_tree_node_set_icon_name (IdeTreeNode *self
,const gchar *icon_name
);
Sets the “icon” property using an icon-name.
Since: 3.32
GIcon *
ide_tree_node_get_expanded_icon (IdeTreeNode *self
);
Gets the expanded icon associated with the tree node.
Since: 3.32
void ide_tree_node_set_expanded_icon (IdeTreeNode *self
,GIcon *expanded_icon
);
Sets the expanded icon for the tree node.
Since: 3.32
void ide_tree_node_set_expanded_icon_name (IdeTreeNode *self
,const gchar *expanded_icon_name
);
Sets the “icon” property using an icon-name.
Since: 3.32
gpointer
ide_tree_node_get_item (IdeTreeNode *self
);
Gets the item that has been associated with the node.
a GObject if the item has been previously set.
[transfer none][type GObject.Object][nullable]
Since: 3.32
gboolean
ide_tree_node_get_children_possible (IdeTreeNode *self
);
Checks if the node can have children, and if so, returns TRUE
.
It may not actually have children yet.
Since: 3.32
void ide_tree_node_set_children_possible (IdeTreeNode *self
,gboolean children_possible
);
Sets if the children are possible for the node.
Since: 3.32
gboolean
ide_tree_node_is_empty (IdeTreeNode *self
);
This function checks if self
is a synthesized "empty" node.
Empty nodes are added to IdeTreeNode that may have children in the future, but are currently empty. It allows the tree to display the "(Empty)" contents and show a proper expander arrow.
Since: 3.32
gboolean
ide_tree_node_has_child (IdeTreeNode *self
);
Checks if self
has any children.
Since: 3.32
guint
ide_tree_node_get_n_children (IdeTreeNode *self
);
Gets the number of children that self
contains.
Since: 3.32
IdeTreeNode *
ide_tree_node_get_next (IdeTreeNode *self
);
Gets the next sibling after self
.
Since: 3.32
IdeTreeNode *
ide_tree_node_get_previous (IdeTreeNode *self
);
Gets the previous sibling before self
.
Since: 3.32
guint
ide_tree_node_get_index (IdeTreeNode *self
);
Gets the position of the self
.
Since: 3.32
IdeTreeNode * ide_tree_node_get_nth_child (IdeTreeNode *self
,guint index_
);
Gets the nth
child of the tree node or NULL
if it does not exist.
Since: 3.32
void ide_tree_node_prepend (IdeTreeNode *self
,IdeTreeNode *child
);
Prepends child
as a child of self
at the 0 index.
This operation is O(1).
Since: 3.32
void ide_tree_node_append (IdeTreeNode *self
,IdeTreeNode *child
);
Appends child
as a child of self
at the last position.
This operation is O(1).
Since: 3.32
void ide_tree_node_insert_sorted (IdeTreeNode *self
,IdeTreeNode *child
,IdeTreeNodeCompare cmpfn
);
Insert child
as a child of self
at the sorted position determined by cmpfn
This operation is O(n).
Since: 3.32
void ide_tree_node_insert_before (IdeTreeNode *self
,IdeTreeNode *child
);
Inserts child
directly before self
by adding it to the parent of self
.
This operation is O(1).
Since: 3.32
void ide_tree_node_insert_after (IdeTreeNode *self
,IdeTreeNode *child
);
Inserts child
directly after self
by adding it to the parent of self
.
This operation is O(1).
Since: 3.32
void ide_tree_node_remove (IdeTreeNode *self
,IdeTreeNode *child
);
Removes the child node child
from self
. self
must be the parent of child
.
This function is O(1).
Since: 3.32
IdeTreeNode *
ide_tree_node_get_parent (IdeTreeNode *self
);
Gets the parent node of self
.
Since: 3.32
gboolean
ide_tree_node_is_root (IdeTreeNode *self
);
Checks if self
is the root node, meaning it has no parent.
Since: 3.32
gboolean
ide_tree_node_is_first (IdeTreeNode *self
);
Checks if self
is the first sibling.
Since: 3.32
gboolean
ide_tree_node_is_last (IdeTreeNode *self
);
Checks if self
is the last sibling.
Since: 3.32
IdeTreeNode *
ide_tree_node_get_root (IdeTreeNode *self
);
Gets the root IdeTreeNode by following the “parent” properties of each node.
Since: 3.32
gboolean ide_tree_node_holds (IdeTreeNode *self
,GType type
);
Checks to see if the “item” property matches type
or is a subclass of type
.
Since: 3.32
void ide_tree_node_traverse (IdeTreeNode *self
,GTraverseType traverse_type
,GTraverseFlags traverse_flags
,gint max_depth
,IdeTreeTraverseFunc traverse_func
,gpointer user_data
);
Calls traverse_func
for each node that matches the requested
type, flags, and depth.
Traversal is stopped if traverse_func
returns TRUE
.
self |
||
traverse_type |
the type of traversal, pre and post supported |
|
traverse_flags |
the flags for what nodes to match |
|
max_depth |
the max depth for the traversal or -1 for all |
|
traverse_func |
the callback for each matching node. |
[scope call] |
user_data |
user data for |
Since: 3.32
gboolean
ide_tree_node_get_reset_on_collapse (IdeTreeNode *self
);
Checks if the node should have all children removed when collapsed.
Since: 3.32
void ide_tree_node_set_reset_on_collapse (IdeTreeNode *self
,gboolean reset_on_collapse
);
If TRUE
, then children will be removed when the row is collapsed.
Since: 3.32
const GdkRGBA *
ide_tree_node_get_background_rgba (IdeTreeNode *self
);
void ide_tree_node_set_background_rgba (IdeTreeNode *self
,const GdkRGBA *background_rgba
);
const GdkRGBA *
ide_tree_node_get_foreground_rgba (IdeTreeNode *self
);
void ide_tree_node_set_foreground_rgba (IdeTreeNode *self
,const GdkRGBA *foreground_rgba
);
void ide_tree_node_set_use_markup (IdeTreeNode *self
,gboolean use_markup
);
“children-possible”
property“children-possible” gboolean
The "children-possible" property denotes if the node may have children even if it doesn't have children yet. This is useful for delayed loading of children nodes.
Owner: IdeTreeNode
Flags: Read / Write
Default value: FALSE
Since: 3.32
“destroy-item”
property“destroy-item” gboolean
If TRUE
and “item” is an IdeObject, it will be destroyed
when the node is destroyed.
Owner: IdeTreeNode
Flags: Read / Write
Default value: FALSE
Since: 3.32
“display-name”
property“display-name” gchar *
The "display-name" property is the name for the node as it should be displayed in the tree.
Owner: IdeTreeNode
Flags: Read / Write
Default value: NULL
Since: 3.32
“expanded-icon”
property“expanded-icon” GIcon *
The "expanded-icon" property is the icon that should be displayed to the user in the tree for this node.
Owner: IdeTreeNode
Flags: Read / Write
Since: 3.32
“expanded-icon-name”
property“expanded-icon-name” gchar *
The "expanded-icon-name" is a convenience property to set the “expanded-icon” property using an icon-name.
Owner: IdeTreeNode
Flags: Write
Default value: NULL
Since: 3.32
“has-error”
property“has-error” gboolean
The "has-error" property is true if the node should be rendered with an error styling. This is useful when errors are known by the diagnostics manager for a given file or folder.
Owner: IdeTreeNode
Flags: Read / Write
Default value: FALSE
Since: 3.32
“icon”
property“icon” GIcon *
The "icon" property is the icon that should be displayed to the user in the tree for this node.
Owner: IdeTreeNode
Flags: Read / Write
Since: 3.32
“icon-name”
property“icon-name” gchar *
The "icon-name" is a convenience property to set the “icon” property using an icon-name.
Owner: IdeTreeNode
Flags: Write
Default value: NULL
Since: 3.32
“is-header”
property“is-header” gboolean
The "is-header" property denotes the node should be styled as a group header.
Owner: IdeTreeNode
Flags: Read / Write
Default value: FALSE
Since: 3.32
“item”
property“item” GObject *
The "item" property is an optional GObject that can be used to store information about the node, which is sometimes useful when creating IdeTreeAddin plugins.
Owner: IdeTreeNode
Flags: Read / Write
Since: 3.32
“reset-on-collapse”
property“reset-on-collapse” gboolean
The "reset-on-collapse" denotes that children should be removed when the node is collapsed.
Owner: IdeTreeNode
Flags: Read / Write
Default value: TRUE
Since: 3.32
“tag”
property“tag” gchar *
The "tag" property can be used to denote the type of node when you do not have an object to assign to “item”.
See ide_tree_node_is_tag()
to match a tag when building.
Owner: IdeTreeNode
Flags: Read / Write
Default value: NULL
Since: 3.32
“use-markup”
property“use-markup” gboolean
If TRUE, the "use-markup" property denotes that “display-name” contains pango markup.
Owner: IdeTreeNode
Flags: Read / Write
Default value: FALSE
Since: 3.32