Lines Matching defs:node
44 void inspect_child_node(AstNode *node)
46 if (node->inspect) {
47 node->inspect(node);
48 node->inspect = NULL;
54 AstNode* ast_nth_child(AstNode *node, int n)
56 if (!node)
59 inspect_child_node(node);
61 if (n >= node->childnodes->len)
63 return g_array_index(node->childnodes, AstNode *, n);
68 gboolean ast_set_iter(GtkTreeIter *iter, AstNode *node)
70 iter->user_data = node;
72 return node != NULL;
170 * ast_init: this is called every time a new ast node object
177 ast_init (AstNode *node)
179 node->childnodes = g_array_new(FALSE, TRUE, sizeof(AstNode *));
180 node->stamp = g_random_int(); /* Random int to check whether iters belong to out model */
186 * ast_finalize: this is called just before an ast node is
194 /* AstNode *node = AST_NODE(object); */
196 /* FIXME: free all node memory */
264 AstNode *node;
268 node = AST_NODE(tree_model);
273 node = ast_nth_child(node, indices[i]);
275 return ast_set_iter(iter, node);
292 AstNode *node = AST_NODE(iter->user_data);
295 while (node != root) {
296 gtk_tree_path_prepend_index(path, node->index);
297 node = node->parent;
316 AstNode *node = iter->user_data;
322 inspect_child_node(node);
325 g_value_set_string(value, node->text);
341 AstNode *node = iter->user_data;
345 node = ast_nth_child(node->parent, node->index + 1);
346 return ast_set_iter(iter, node);
382 AstNode *node = iter->user_data;
383 inspect_child_node(node);
384 return node->childnodes->len > 0;
395 * to return the number of top-level node,
404 AstNode *node = iter ? iter->user_data
407 inspect_child_node(node);
408 return node->childnodes->len;
429 AstNode *node = parent ? parent->user_data : (AstNode*) tree_model;
430 GArray *array = node->childnodes;
440 * ast_iter_parent: Point 'iter' to the parent node of 'child'. As
451 AstNode *node = (AstNode *) child->user_data;
452 iter->user_data = node->parent;
453 return node->parent != NULL;
460 AstNode *node = (AstNode*) g_object_new (AST_TYPE_NODE, NULL);
461 g_assert(node != NULL);
462 node->parent = parent;
463 node->index = index;
464 node->text = text;
465 node->inspect = inspect;
466 node->ptr = ptr;
467 return node;