diff options
author | portix <none@none> | 2012-06-04 14:47:37 +0200 |
---|---|---|
committer | portix <none@none> | 2012-06-04 14:47:37 +0200 |
commit | 1e941e5a993d7f5b33a52a320db8861e746bde97 (patch) | |
tree | 3b7fc31cbd29abf959eb55b1a78049abdc282598 /src | |
parent | d3c03a834b0c8d4b2b5486e193d0993b87bd9b48 (diff) | |
download | dwb-1e941e5a993d7f5b33a52a320db8861e746bde97.zip |
New signal documentFinished
Diffstat (limited to 'src')
-rw-r--r-- | src/dwb.h | 3 | ||||
-rw-r--r-- | src/scripts.c | 1 | ||||
-rw-r--r-- | src/scripts.h | 1 | ||||
-rw-r--r-- | src/view.c | 14 |
4 files changed, 18 insertions, 1 deletions
@@ -413,6 +413,9 @@ enum Signal { SIG_NEW_WINDOW, SIG_CREATE_PLUGIN_WIDGET, SIG_RESOURCE_REQUEST, +#if WEBKIT_CHECK_VERSION(1, 8, 0) + SIG_DOCUMENT_FINISHED, +#endif SIG_WINDOW_OBJECT, SIG_LOAD_STATUS, SIG_LOAD_ERROR, diff --git a/src/scripts.c b/src/scripts.c index f699e97f..04c676b0 100644 --- a/src/scripts.c +++ b/src/scripts.c @@ -73,6 +73,7 @@ static Sigmap _sigmap[] = { { SCRIPTS_SIG_CREATE_TAB, "createTab" }, { SCRIPTS_SIG_FRAME_CREATED, "frameCreated" }, { SCRIPTS_SIG_CLOSE, "close" }, + { SCRIPTS_SIG_DOCUMENT_LOADED, "documentLoaded" }, }; diff --git a/src/scripts.h b/src/scripts.h index 4524c1d5..75ed2ea9 100644 --- a/src/scripts.h +++ b/src/scripts.h @@ -42,6 +42,7 @@ enum SIGNALS { SCRIPTS_SIG_CREATE_TAB, SCRIPTS_SIG_FRAME_CREATED, SCRIPTS_SIG_CLOSE, + SCRIPTS_SIG_DOCUMENT_LOADED, SCRIPTS_SIG_LAST, } ; @@ -82,6 +82,15 @@ view_resource_request_cb(WebKitWebView *wv, WebKitWebFrame *frame, WebKitWebReso scripts_emit(&signal); } } +#if WEBKIT_CHECK_VERSION(1, 8, 0) +static void +view_document_finished(WebKitWebView *wv, WebKitWebFrame *frame, GList *gl) { + if (EMIT_SCRIPT(DOCUMENT_LOADED)) { + ScriptSignal signal = { SCRIPTS_WV(gl), { G_OBJECT(frame) }, SCRIPTS_SIG_META(NULL, DOCUMENT_LOADED, 1) }; + scripts_emit(&signal); + } +} +#endif /* view_button_press_cb(WebKitWebView *web, GdkEventButton *button, GList *gl) {{{*/ static void @@ -813,7 +822,10 @@ view_init_signals(GList *gl) { v->status->signals[SIG_MIME_TYPE] = g_signal_connect(v->web, "mime-type-policy-decision-requested", G_CALLBACK(view_mime_type_policy_cb), gl); v->status->signals[SIG_NAVIGATION] = g_signal_connect(v->web, "navigation-policy-decision-requested", G_CALLBACK(view_navigation_policy_cb), gl); v->status->signals[SIG_NEW_WINDOW] = g_signal_connect(v->web, "new-window-policy-decision-requested", G_CALLBACK(view_new_window_policy_cb), gl); - v->status->signals[SIG_RESOURCE_REQUEST] = g_signal_connect(v->web, "resource-request-starting", G_CALLBACK(view_resource_request_cb), gl); + v->status->signals[SIG_RESOURCE_REQUEST] = g_signal_connect(v->web, "resource-request-starting", G_CALLBACK(view_resource_request_cb), gl); +#if WEBKIT_CHECK_VERSION(1, 8, 0) + v->status->signals[SIG_DOCUMENT_FINISHED] = g_signal_connect(v->web, "document-load-finished", G_CALLBACK(view_document_finished), gl); +#endif v->status->signals[SIG_CREATE_PLUGIN_WIDGET] = g_signal_connect(v->web, "create-plugin-widget", G_CALLBACK(view_create_plugin_widget_cb), gl); v->status->signals[SIG_FRAME_CREATED] = g_signal_connect(v->web, "frame-created", G_CALLBACK(view_frame_created_cb), gl); |