gtk+ r20632 - trunk/gtk



Author: timj
Date: Fri Jun 20 11:10:55 2008
New Revision: 20632
URL: http://svn.gnome.org/viewvc/gtk+?rev=20632&view=rev

Log:
Add gtk_window_group_get_windows().

* gtk/gtk.symbols:
* gtk/gtkwindow.[ch] (gtk_window_group_get_windows): New function.


Modified:
   trunk/gtk/gtk.symbols
   trunk/gtk/gtkwindow.c
   trunk/gtk/gtkwindow.h

Modified: trunk/gtk/gtk.symbols
==============================================================================
--- trunk/gtk/gtk.symbols	(original)
+++ trunk/gtk/gtk.symbols	Fri Jun 20 11:10:55 2008
@@ -4822,6 +4822,7 @@
 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

Modified: trunk/gtk/gtkwindow.c
==============================================================================
--- trunk/gtk/gtkwindow.c	(original)
+++ trunk/gtk/gtkwindow.c	Fri Jun 20 11:10:55 2008
@@ -7457,6 +7457,37 @@
 }
 
 /**
+ * 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
  *

Modified: trunk/gtk/gtkwindow.h
==============================================================================
--- trunk/gtk/gtkwindow.h	(original)
+++ trunk/gtk/gtkwindow.h	Fri Jun 20 11:10:55 2008
@@ -394,6 +394,8 @@
 						 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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]