diff options
author | Tim Janik <timj@src.gnome.org> | 2008-06-20 11:10:55 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 2008-06-20 11:10:55 +0000 |
commit | 870b9c868c3b32e0a77590dfc3b4b00b3e7b1629 (patch) | |
tree | 39c473d7c7f5096209c0eb4e806266f9c6b66b5d | |
parent | dd8ea211421db11e8fa07178494f4bde3897972f (diff) | |
download | gtk+-870b9c868c3b32e0a77590dfc3b4b00b3e7b1629.tar.gz |
Add gtk_window_group_get_windows().
* gtk/gtk.symbols:
* gtk/gtkwindow.[ch] (gtk_window_group_get_windows): New function.
svn path=/trunk/; revision=20632
-rw-r--r-- | gtk/gtk.symbols | 1 | ||||
-rw-r--r-- | gtk/gtkwindow.c | 31 | ||||
-rw-r--r-- | gtk/gtkwindow.h | 2 |
3 files changed, 34 insertions, 0 deletions
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols index 151fa0cabb..3bf67ca8e8 100644 --- a/gtk/gtk.symbols +++ b/gtk/gtk.symbols @@ -4822,6 +4822,7 @@ gtk_window_group_add_window gtk_window_group_get_type G_GNUC_CONST gtk_window_group_new gtk_window_group_remove_window +gtk_window_group_get_windows gtk_window_has_toplevel_focus gtk_window_iconify gtk_window_is_active diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index ffd05e8d1c..54c3a6d31d 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -7457,6 +7457,37 @@ gtk_window_group_remove_window (GtkWindowGroup *window_group, } /** + * gtk_window_group_get_windows: + * @window_group: a #GtkWindowGroup + * + * Returns a list of the #GtkWindows that belong to @window_group. + * + * Returns: A newly-allocated list of windows inside the group. + * + * Since: GSEAL-branch + **/ +GList * +gtk_window_group_get_windows (GtkWindowGroup *window_group) +{ + GList *toplevels, *toplevel, *group_windows; + + g_return_val_if_fail (GTK_IS_WINDOW_GROUP (window_group), NULL); + + group_windows = NULL; + toplevels = gtk_window_list_toplevels (); + + for (toplevel = toplevels; toplevel; toplevel = toplevel->next) + { + GtkWindow *window = toplevel->data; + + if (window_group == window->group) + group_windows = g_list_prepend (group_windows, window); + } + + return g_list_reverse (group_windows); +} + +/** * gtk_window_get_group: * @window: a #GtkWindow, or %NULL * diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h index 40cb937cd5..f10fb1e414 100644 --- a/gtk/gtkwindow.h +++ b/gtk/gtkwindow.h @@ -394,6 +394,8 @@ void gtk_window_group_add_window (GtkWindowGroup *window_grou GtkWindow *window); void gtk_window_group_remove_window (GtkWindowGroup *window_group, GtkWindow *window); +GList * gtk_window_group_get_windows (GtkWindowGroup *window_group); + /* --- internal functions --- */ void _gtk_window_internal_set_focus (GtkWindow *window, |