Add midori_browser_foreach to iterate over all present browsers

This commit is contained in:
Christian Dywan 2009-04-22 21:53:14 +02:00
parent d7f6c7ded8
commit 758434e711
2 changed files with 30 additions and 3 deletions

View file

@ -1214,6 +1214,28 @@ _midori_browser_remove_tab (MidoriBrowser* browser,
gtk_widget_destroy (view); 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 static void
_midori_browser_quit (MidoriBrowser* browser) _midori_browser_quit (MidoriBrowser* browser)
{ {
@ -1282,8 +1304,8 @@ midori_browser_class_init (MidoriBrowserClass* class)
G_TYPE_POINTER); G_TYPE_POINTER);
/** /**
* MidoriView::add-download: * MidoriBrowser::add-download:
* @view: the object on which the signal is emitted * @browser: the object on which the signal is emitted
* @download: a new download * @download: a new download
* *
* Emitted when a new download was accepted and is * 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 * Emitting this signal manually is equal to a
* user initiating and confirming a download * user initiating and confirming a download
* *
* Note: This requires WebKitGTK 1.1.3. * Note: This requires WebKitGTK+ 1.1.3.
* *
* Since: 0.1.5 * Since: 0.1.5
*/ */

View file

@ -88,6 +88,11 @@ void
midori_browser_remove_tab (MidoriBrowser* browser, midori_browser_remove_tab (MidoriBrowser* browser,
GtkWidget* widget); GtkWidget* widget);
void
midori_browser_foreach (MidoriBrowser* browser,
GtkCallback callback,
gpointer callback_data);
gint gint
midori_browser_add_item (MidoriBrowser* browser, midori_browser_add_item (MidoriBrowser* browser,
KatzeItem* item); KatzeItem* item);