From 758434e71149102397858706fc24dfcc3cd04ee8 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Wed, 22 Apr 2009 21:53:14 +0200 Subject: [PATCH] Add midori_browser_foreach to iterate over all present browsers --- midori/midori-browser.c | 28 +++++++++++++++++++++++++--- midori/midori-browser.h | 5 +++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 02f5a3ed..39599d93 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -1214,6 +1214,28 @@ _midori_browser_remove_tab (MidoriBrowser* browser, gtk_widget_destroy (view); } +/** + * midori_browser_foreach: + * @browser: a #MidoriBrowser + * @callback: a #GtkCallback + * @callback_data: custom data + * + * Calls the specified callback for each view contained + * in the browser. + * + * Since: 0.1.7 + **/ +void +midori_browser_foreach (MidoriBrowser* browser, + GtkCallback callback, + gpointer callback_data) +{ + g_return_if_fail (MIDORI_IS_BROWSER (browser)); + + gtk_container_foreach (GTK_CONTAINER (browser->notebook), + callback, callback_data); +} + static void _midori_browser_quit (MidoriBrowser* browser) { @@ -1282,8 +1304,8 @@ midori_browser_class_init (MidoriBrowserClass* class) G_TYPE_POINTER); /** - * MidoriView::add-download: - * @view: the object on which the signal is emitted + * MidoriBrowser::add-download: + * @browser: the object on which the signal is emitted * @download: a new download * * Emitted when a new download was accepted and is @@ -1293,7 +1315,7 @@ midori_browser_class_init (MidoriBrowserClass* class) * Emitting this signal manually is equal to a * user initiating and confirming a download * - * Note: This requires WebKitGTK 1.1.3. + * Note: This requires WebKitGTK+ 1.1.3. * * Since: 0.1.5 */ diff --git a/midori/midori-browser.h b/midori/midori-browser.h index 92a61779..9cf3ac91 100644 --- a/midori/midori-browser.h +++ b/midori/midori-browser.h @@ -88,6 +88,11 @@ void midori_browser_remove_tab (MidoriBrowser* browser, GtkWidget* widget); +void +midori_browser_foreach (MidoriBrowser* browser, + GtkCallback callback, + gpointer callback_data); + gint midori_browser_add_item (MidoriBrowser* browser, KatzeItem* item);