From: Christian Dywan Date: Wed, 22 Apr 2009 19:58:00 +0000 (+0200) Subject: Add a remove-browser signal to MidoriApp X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b058e8ec5d47859738ba463d49c534553f182cc2;p=midori Add a remove-browser signal to MidoriApp --- diff --git a/midori/midori-app.c b/midori/midori-app.c index b753a64f..f79a307c 100644 --- a/midori/midori-app.c +++ b/midori/midori-app.c @@ -52,6 +52,9 @@ struct _MidoriAppClass (*add_browser) (MidoriApp* app, MidoriBrowser* browser); void + (*remove_browser) (MidoriApp* app, + MidoriBrowser* browser); + void (*quit) (MidoriApp* app); }; @@ -75,6 +78,7 @@ enum enum { ADD_BROWSER, + REMOVE_BROWSER, QUIT, LAST_SIGNAL @@ -131,6 +135,7 @@ static gboolean midori_browser_destroy_cb (MidoriBrowser* browser, MidoriApp* app) { + g_signal_emit (app, signals[REMOVE_BROWSER], 0, browser); katze_array_remove_item (app->browsers, browser); if (!katze_array_is_empty (app->browsers)) return FALSE; @@ -191,6 +196,26 @@ midori_app_class_init (MidoriAppClass* class) G_TYPE_NONE, 1, MIDORI_TYPE_BROWSER); + /** + * MidoriApp::remove-browser: + * @app: the object on which the signal is emitted + * @browser: a #MidoriBrowser + * + * A new browser is being added to the app. + * + * Since: 0.1.7 + */ + signals[REMOVE_BROWSER] = g_signal_new ( + "remove-browser", + G_TYPE_FROM_CLASS (class), + (GSignalFlags)(G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION), + 0, + 0, + NULL, + g_cclosure_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + MIDORI_TYPE_BROWSER); + signals[QUIT] = g_signal_new ( "quit", G_TYPE_FROM_CLASS (class), @@ -752,7 +777,7 @@ midori_app_add_browser (MidoriApp* app, * * Return value: a new #MidoriBrowser * - * Since: 1.0.2 + * Since: 0.1.2 **/ MidoriBrowser* midori_app_create_browser (MidoriApp* app)