mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-09-22 06:44:07 +00:00
new functions, recursive process tree to specified depth
* gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth) (gtk_ctree_pre_recursive_to_depth): new functions, recursive process tree to specified depth (gtk_ctree_expand_to_depth): expand tree to specified depth (gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth
This commit is contained in:
parent
bfa2ec274b
commit
cebb7bfc9f
@ -1,3 +1,11 @@
|
|||||||
|
Mon Jul 20 21:28:18 1998 Lars Hamann <lars@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth)
|
||||||
|
(gtk_ctree_pre_recursive_to_depth): new functions, recursive process
|
||||||
|
tree to specified depth
|
||||||
|
(gtk_ctree_expand_to_depth): expand tree to specified depth
|
||||||
|
(gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth
|
||||||
|
|
||||||
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
|
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
|
||||||
|
|
||||||
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
|
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
Mon Jul 20 21:28:18 1998 Lars Hamann <lars@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth)
|
||||||
|
(gtk_ctree_pre_recursive_to_depth): new functions, recursive process
|
||||||
|
tree to specified depth
|
||||||
|
(gtk_ctree_expand_to_depth): expand tree to specified depth
|
||||||
|
(gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth
|
||||||
|
|
||||||
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
|
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
|
||||||
|
|
||||||
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
|
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
Mon Jul 20 21:28:18 1998 Lars Hamann <lars@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth)
|
||||||
|
(gtk_ctree_pre_recursive_to_depth): new functions, recursive process
|
||||||
|
tree to specified depth
|
||||||
|
(gtk_ctree_expand_to_depth): expand tree to specified depth
|
||||||
|
(gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth
|
||||||
|
|
||||||
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
|
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
|
||||||
|
|
||||||
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
|
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
Mon Jul 20 21:28:18 1998 Lars Hamann <lars@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth)
|
||||||
|
(gtk_ctree_pre_recursive_to_depth): new functions, recursive process
|
||||||
|
tree to specified depth
|
||||||
|
(gtk_ctree_expand_to_depth): expand tree to specified depth
|
||||||
|
(gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth
|
||||||
|
|
||||||
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
|
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
|
||||||
|
|
||||||
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
|
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
Mon Jul 20 21:28:18 1998 Lars Hamann <lars@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth)
|
||||||
|
(gtk_ctree_pre_recursive_to_depth): new functions, recursive process
|
||||||
|
tree to specified depth
|
||||||
|
(gtk_ctree_expand_to_depth): expand tree to specified depth
|
||||||
|
(gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth
|
||||||
|
|
||||||
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
|
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
|
||||||
|
|
||||||
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
|
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
Mon Jul 20 21:28:18 1998 Lars Hamann <lars@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth)
|
||||||
|
(gtk_ctree_pre_recursive_to_depth): new functions, recursive process
|
||||||
|
tree to specified depth
|
||||||
|
(gtk_ctree_expand_to_depth): expand tree to specified depth
|
||||||
|
(gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth
|
||||||
|
|
||||||
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
|
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
|
||||||
|
|
||||||
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
|
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
Mon Jul 20 21:28:18 1998 Lars Hamann <lars@gtk.org>
|
||||||
|
|
||||||
|
* gtk/gtkctree.c (gtk_ctree_post_recursive_to_depth)
|
||||||
|
(gtk_ctree_pre_recursive_to_depth): new functions, recursive process
|
||||||
|
tree to specified depth
|
||||||
|
(gtk_ctree_expand_to_depth): expand tree to specified depth
|
||||||
|
(gtk_ctree_collapse_to_depth): collapse all nodes with level >= depth
|
||||||
|
|
||||||
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
|
Sun Jul 19 23:51:05 1998 Lars Hamann <lars@gtk.org>
|
||||||
|
|
||||||
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
|
* gtk/gtkclist.c (scroll_vertical): fix for vertical scrolling in case
|
||||||
|
157
gtk/gtkctree.c
157
gtk/gtkctree.c
@ -125,6 +125,9 @@ static void tree_expand (GtkCTree *ctree,
|
|||||||
static void tree_collapse (GtkCTree *ctree,
|
static void tree_collapse (GtkCTree *ctree,
|
||||||
GList *node,
|
GList *node,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
static void tree_collapse_to_depth (GtkCTree *ctree,
|
||||||
|
GList *node,
|
||||||
|
gint depth);
|
||||||
static void tree_toggle_expansion (GtkCTree *ctree,
|
static void tree_toggle_expansion (GtkCTree *ctree,
|
||||||
GList *node,
|
GList *node,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
@ -3225,6 +3228,15 @@ tree_collapse (GtkCTree *ctree,
|
|||||||
data);
|
data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
tree_collapse_to_depth (GtkCTree *ctree,
|
||||||
|
GList *node,
|
||||||
|
gint depth)
|
||||||
|
{
|
||||||
|
if (node && GTK_CTREE_ROW (node)->level == depth)
|
||||||
|
gtk_ctree_collapse_recursive (ctree, node);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
tree_toggle_expansion (GtkCTree *ctree,
|
tree_toggle_expansion (GtkCTree *ctree,
|
||||||
GList *node,
|
GList *node,
|
||||||
@ -3883,6 +3895,9 @@ gtk_ctree_post_recursive (GtkCTree *ctree,
|
|||||||
GList *work;
|
GList *work;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
|
||||||
|
g_return_if_fail (ctree != NULL);
|
||||||
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||||
|
|
||||||
if (node)
|
if (node)
|
||||||
work = GTK_CTREE_ROW (node)->children;
|
work = GTK_CTREE_ROW (node)->children;
|
||||||
else
|
else
|
||||||
@ -3899,6 +3914,44 @@ gtk_ctree_post_recursive (GtkCTree *ctree,
|
|||||||
func (ctree, node, data);
|
func (ctree, node, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gtk_ctree_post_recursive_to_depth (GtkCTree *ctree,
|
||||||
|
GList *node,
|
||||||
|
gint depth,
|
||||||
|
GtkCTreeFunc func,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
GList *work;
|
||||||
|
GList *tmp;
|
||||||
|
|
||||||
|
g_return_if_fail (ctree != NULL);
|
||||||
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||||
|
|
||||||
|
if (depth < 0)
|
||||||
|
{
|
||||||
|
gtk_ctree_post_recursive (ctree, node, func, data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (node)
|
||||||
|
work = GTK_CTREE_ROW (node)->children;
|
||||||
|
else
|
||||||
|
work = GTK_CLIST (ctree)->row_list;
|
||||||
|
|
||||||
|
if (work && GTK_CTREE_ROW (work)->level <= depth)
|
||||||
|
{
|
||||||
|
while (work)
|
||||||
|
{
|
||||||
|
tmp = GTK_CTREE_ROW (work)->sibling;
|
||||||
|
gtk_ctree_post_recursive_to_depth (ctree, work, depth, func, data);
|
||||||
|
work = tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (node && GTK_CTREE_ROW (node)->level <= depth)
|
||||||
|
func (ctree, node, data);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gtk_ctree_pre_recursive (GtkCTree *ctree,
|
gtk_ctree_pre_recursive (GtkCTree *ctree,
|
||||||
GList *node,
|
GList *node,
|
||||||
@ -3908,6 +3961,8 @@ gtk_ctree_pre_recursive (GtkCTree *ctree,
|
|||||||
GList *work;
|
GList *work;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
|
|
||||||
|
g_return_if_fail (ctree != NULL);
|
||||||
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||||
|
|
||||||
if (node)
|
if (node)
|
||||||
{
|
{
|
||||||
@ -3925,6 +3980,45 @@ gtk_ctree_pre_recursive (GtkCTree *ctree,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gtk_ctree_pre_recursive_to_depth (GtkCTree *ctree,
|
||||||
|
GList *node,
|
||||||
|
gint depth,
|
||||||
|
GtkCTreeFunc func,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
GList *work;
|
||||||
|
GList *tmp;
|
||||||
|
|
||||||
|
g_return_if_fail (ctree != NULL);
|
||||||
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||||
|
|
||||||
|
if (depth < 0)
|
||||||
|
{
|
||||||
|
gtk_ctree_pre_recursive (ctree, node, func, data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (node)
|
||||||
|
{
|
||||||
|
work = GTK_CTREE_ROW (node)->children;
|
||||||
|
if (GTK_CTREE_ROW (node)->level <= depth)
|
||||||
|
func (ctree, node, data);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
work = GTK_CLIST (ctree)->row_list;
|
||||||
|
|
||||||
|
if (work && GTK_CTREE_ROW (work)->level <= depth)
|
||||||
|
{
|
||||||
|
while (work)
|
||||||
|
{
|
||||||
|
tmp = GTK_CTREE_ROW (work)->sibling;
|
||||||
|
gtk_ctree_pre_recursive_to_depth (ctree, work, depth, func, data);
|
||||||
|
work = tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gtk_ctree_is_visible (GtkCTree *ctree,
|
gtk_ctree_is_visible (GtkCTree *ctree,
|
||||||
GList *node)
|
GList *node)
|
||||||
@ -4085,6 +4179,7 @@ gtk_ctree_expand_recursive (GtkCTree *ctree,
|
|||||||
gboolean thaw = FALSE;
|
gboolean thaw = FALSE;
|
||||||
|
|
||||||
g_return_if_fail (ctree != NULL);
|
g_return_if_fail (ctree != NULL);
|
||||||
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||||
|
|
||||||
clist = GTK_CLIST (ctree);
|
clist = GTK_CLIST (ctree);
|
||||||
|
|
||||||
@ -4104,6 +4199,36 @@ gtk_ctree_expand_recursive (GtkCTree *ctree,
|
|||||||
gtk_clist_thaw (clist);
|
gtk_clist_thaw (clist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gtk_ctree_expand_to_depth (GtkCTree *ctree,
|
||||||
|
GList *node,
|
||||||
|
gint depth)
|
||||||
|
{
|
||||||
|
GtkCList *clist;
|
||||||
|
gboolean thaw = FALSE;
|
||||||
|
|
||||||
|
g_return_if_fail (ctree != NULL);
|
||||||
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||||
|
|
||||||
|
clist = GTK_CLIST (ctree);
|
||||||
|
|
||||||
|
if (node && GTK_CTREE_ROW (node)->is_leaf)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (((node && gtk_ctree_is_visible (ctree, node)) || !node) &&
|
||||||
|
!GTK_CLIST_FROZEN (clist))
|
||||||
|
{
|
||||||
|
gtk_clist_freeze (clist);
|
||||||
|
thaw = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gtk_ctree_post_recursive_to_depth (ctree, node, depth,
|
||||||
|
GTK_CTREE_FUNC (tree_expand), NULL);
|
||||||
|
|
||||||
|
if (thaw)
|
||||||
|
gtk_clist_thaw (clist);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gtk_ctree_collapse (GtkCTree *ctree,
|
gtk_ctree_collapse (GtkCTree *ctree,
|
||||||
GList *node)
|
GList *node)
|
||||||
@ -4125,6 +4250,7 @@ gtk_ctree_collapse_recursive (GtkCTree *ctree,
|
|||||||
gboolean thaw = FALSE;
|
gboolean thaw = FALSE;
|
||||||
|
|
||||||
g_return_if_fail (ctree != NULL);
|
g_return_if_fail (ctree != NULL);
|
||||||
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||||
|
|
||||||
if (node && GTK_CTREE_ROW (node)->is_leaf)
|
if (node && GTK_CTREE_ROW (node)->is_leaf)
|
||||||
return;
|
return;
|
||||||
@ -4144,6 +4270,37 @@ gtk_ctree_collapse_recursive (GtkCTree *ctree,
|
|||||||
gtk_clist_thaw (clist);
|
gtk_clist_thaw (clist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gtk_ctree_collapse_to_depth (GtkCTree *ctree,
|
||||||
|
GList *node,
|
||||||
|
gint depth)
|
||||||
|
{
|
||||||
|
GtkCList *clist;
|
||||||
|
gboolean thaw = FALSE;
|
||||||
|
|
||||||
|
g_return_if_fail (ctree != NULL);
|
||||||
|
g_return_if_fail (GTK_IS_CTREE (ctree));
|
||||||
|
|
||||||
|
if (node && GTK_CTREE_ROW (node)->is_leaf)
|
||||||
|
return;
|
||||||
|
|
||||||
|
clist = GTK_CLIST (ctree);
|
||||||
|
|
||||||
|
if (((node && gtk_ctree_is_visible (ctree, node)) || !node) &&
|
||||||
|
!GTK_CLIST_FROZEN (clist))
|
||||||
|
{
|
||||||
|
gtk_clist_freeze (clist);
|
||||||
|
thaw = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gtk_ctree_post_recursive_to_depth (ctree, node, depth,
|
||||||
|
GTK_CTREE_FUNC (tree_collapse_to_depth),
|
||||||
|
GINT_TO_POINTER (depth));
|
||||||
|
|
||||||
|
if (thaw)
|
||||||
|
gtk_clist_thaw (clist);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gtk_ctree_toggle_expansion (GtkCTree *ctree,
|
gtk_ctree_toggle_expansion (GtkCTree *ctree,
|
||||||
GList *node)
|
GList *node)
|
||||||
|
@ -185,10 +185,20 @@ void gtk_ctree_post_recursive (GtkCTree *ctree,
|
|||||||
GList *node,
|
GList *node,
|
||||||
GtkCTreeFunc func,
|
GtkCTreeFunc func,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
void gtk_ctree_post_recursive_to_depth (GtkCTree *ctree,
|
||||||
|
GList *node,
|
||||||
|
gint depth,
|
||||||
|
GtkCTreeFunc func,
|
||||||
|
gpointer data);
|
||||||
void gtk_ctree_pre_recursive (GtkCTree *ctree,
|
void gtk_ctree_pre_recursive (GtkCTree *ctree,
|
||||||
GList *node,
|
GList *node,
|
||||||
GtkCTreeFunc func,
|
GtkCTreeFunc func,
|
||||||
gpointer data);
|
gpointer data);
|
||||||
|
void gtk_ctree_pre_recursive_to_depth (GtkCTree *ctree,
|
||||||
|
GList *node,
|
||||||
|
gint depth,
|
||||||
|
GtkCTreeFunc func,
|
||||||
|
gpointer data);
|
||||||
gboolean gtk_ctree_is_visible (GtkCTree *ctree,
|
gboolean gtk_ctree_is_visible (GtkCTree *ctree,
|
||||||
GList *node);
|
GList *node);
|
||||||
GList * gtk_ctree_last (GtkCTree *ctree,
|
GList * gtk_ctree_last (GtkCTree *ctree,
|
||||||
@ -220,10 +230,16 @@ void gtk_ctree_expand (GtkCTree *ctree,
|
|||||||
GList *node);
|
GList *node);
|
||||||
void gtk_ctree_expand_recursive (GtkCTree *ctree,
|
void gtk_ctree_expand_recursive (GtkCTree *ctree,
|
||||||
GList *node);
|
GList *node);
|
||||||
|
void gtk_ctree_expand_to_depth (GtkCTree *ctree,
|
||||||
|
GList *node,
|
||||||
|
gint depth);
|
||||||
void gtk_ctree_collapse (GtkCTree *ctree,
|
void gtk_ctree_collapse (GtkCTree *ctree,
|
||||||
GList *node);
|
GList *node);
|
||||||
void gtk_ctree_collapse_recursive (GtkCTree *ctree,
|
void gtk_ctree_collapse_recursive (GtkCTree *ctree,
|
||||||
GList *node);
|
GList *node);
|
||||||
|
void gtk_ctree_collapse_to_depth (GtkCTree *ctree,
|
||||||
|
GList *node,
|
||||||
|
gint depth);
|
||||||
void gtk_ctree_toggle_expansion (GtkCTree *ctree,
|
void gtk_ctree_toggle_expansion (GtkCTree *ctree,
|
||||||
GList *node);
|
GList *node);
|
||||||
void gtk_ctree_toggle_expansion_recursive (GtkCTree *ctree,
|
void gtk_ctree_toggle_expansion_recursive (GtkCTree *ctree,
|
||||||
|
Loading…
Reference in New Issue
Block a user