summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonh Wendell <jwendell@gnome.org>2010-07-05 10:05:48 -0300
committerJonh Wendell <jwendell@gnome.org>2010-07-05 17:12:53 -0300
commit9125ccb1cb7970ec182c0f0b8cdd167ad0e8bec7 (patch)
treef96144e272dd79cf03fb68e3c1c758bc35ed649b
parent34e8bd9dba7122661ada0e10f7e60e8eaea3642d (diff)
downloadgtk+-9125ccb1cb7970ec182c0f0b8cdd167ad0e8bec7.tar.gz
[GtkApplication] Add gtk_application_get_windows()
Closes #623598.
-rw-r--r--gtk/gtk.symbols1
-rw-r--r--gtk/gtkapplication.c22
-rw-r--r--gtk/gtkapplication.h25
3 files changed, 36 insertions, 12 deletions
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index b5125d0e7d..3939b7176f 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -265,6 +265,7 @@ gtk_application_new
gtk_application_set_action_group
gtk_application_create_window
gtk_application_get_window
+gtk_application_get_windows
gtk_application_add_window
gtk_application_run
gtk_application_quit
diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c
index ef407d8006..b8bac92ee9 100644
--- a/gtk/gtkapplication.c
+++ b/gtk/gtkapplication.c
@@ -446,6 +446,28 @@ gtk_application_get_window (GtkApplication *app)
}
/**
+ * gtk_application_get_windows:
+ * @app: a #GtkApplication
+ *
+ * Retrieves the list of windows previously registered with
+ * gtk_application_create_window() or gtk_application_add_window().
+ *
+ * Return value: (element-type GtkWindow) (transfer none): A pointer
+ * to the list of #GtkWindow<!-- -->s registered by this application,
+ * or %NULL. The returned #GSList is owned by the #GtkApplication
+ * and it should not be modified or freed directly.
+ *
+ * Since: 3.0
+ */
+G_CONST_RETURN GSList *
+gtk_application_get_windows (GtkApplication *app)
+{
+ g_return_val_if_fail (GTK_IS_APPLICATION (app), NULL);
+
+ return app->priv->windows;
+}
+
+/**
* gtk_application_create_window:
* @app: a #GtkApplication
*
diff --git a/gtk/gtkapplication.h b/gtk/gtkapplication.h
index 2a808d77c6..929cb29323 100644
--- a/gtk/gtkapplication.h
+++ b/gtk/gtkapplication.h
@@ -87,18 +87,19 @@ struct _GtkApplicationClass
void (*_gtk_reserved10) (void);
};
-GType gtk_application_get_type (void) G_GNUC_CONST;
-GtkApplication* gtk_application_new (const gchar *appid,
- gint *argc,
- gchar ***argv);
-void gtk_application_set_action_group (GtkApplication *app,
- GtkActionGroup *group);
-GtkWindow * gtk_application_create_window (GtkApplication *app);
-GtkWindow * gtk_application_get_window (GtkApplication *app);
-void gtk_application_add_window (GtkApplication *app,
- GtkWindow *window);
-void gtk_application_run (GtkApplication *app);
-void gtk_application_quit (GtkApplication *app);
+GType gtk_application_get_type (void) G_GNUC_CONST;
+GtkApplication* gtk_application_new (const gchar *appid,
+ gint *argc,
+ gchar ***argv);
+void gtk_application_set_action_group (GtkApplication *app,
+ GtkActionGroup *group);
+GtkWindow * gtk_application_create_window (GtkApplication *app);
+GtkWindow * gtk_application_get_window (GtkApplication *app);
+G_CONST_RETURN GSList * gtk_application_get_windows (GtkApplication *app);
+void gtk_application_add_window (GtkApplication *app,
+ GtkWindow *window);
+void gtk_application_run (GtkApplication *app);
+void gtk_application_quit (GtkApplication *app);
G_END_DECLS