summaryrefslogtreecommitdiff
path: root/src/view.c
diff options
context:
space:
mode:
authorportix <none@none>2012-09-13 23:39:35 +0200
committerportix <none@none>2012-09-13 23:39:35 +0200
commit2371449d81804977e50f5fac95beb0d5e9255725 (patch)
tree4031f9adfeac3762ac8111232ce24e9d2df34b44 /src/view.c
parent26c6cf9f35ba6a19c4b936b657d9037e8d08d0cc (diff)
downloaddwb-2371449d81804977e50f5fac95beb0d5e9255725.zip
Connect ot motion-notify-event; implementing mouseMove-signal
Diffstat (limited to 'src/view.c')
-rw-r--r--src/view.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/view.c b/src/view.c
index e141c698..5a0f31f3 100644
--- a/src/view.c
+++ b/src/view.c
@@ -748,6 +748,20 @@ view_load_error_cb(WebKitWebView *web, WebKitWebFrame *frame, char *uri, GError
return true;
}/*}}}*/
+static gboolean
+view_motion_notify_cb(WebKitWebView *web, GdkEventButton *e, GList *gl) {
+ if (EMIT_SCRIPT(MOUSE_MOVE)) {
+ char *json = util_create_json(7,
+ UINTEGER, "time", e->time,
+ DOUBLE, "x", e->x, DOUBLE, "y", e->y,
+ UINTEGER, "state", e->state, UINTEGER, "button", e->button,
+ DOUBLE, "xRoot", e->x_root, DOUBLE, "yRoot", e->y_root);
+ ScriptSignal signal = { SCRIPTS_WV(gl), SCRIPTS_SIG_META(json, MOUSE_MOVE, 0) };
+ SCRIPTS_EMIT_RETURN(signal, json);
+ }
+ return false;
+}
+
/* Entry */
/* dwb_entry_activate_cb (GtkWidget *entry) {{{*/
@@ -862,6 +876,7 @@ view_init_signals(GList *gl) {
/* v->status->signals[SIG_ENTRY_ACTIVATE] = g_signal_connect(v->entry, "activate", G_CALLBACK(view_entry_activate_cb), gl); */
+ v->status->signals[SIG_MOTION_NOTIFY] = g_signal_connect(v->web, "motion-notify-event", G_CALLBACK(view_motion_notify_cb), gl);
v->status->signals[SIG_TAB_BUTTON_PRESS] = g_signal_connect(v->tabevent, "button-press-event", G_CALLBACK(view_tab_button_press_cb), gl);
//WebKitWebFrame *frame = webkit_web_view_get_main_frame(WEBKIT_WEB_VIEW(v->web));
//v->status->signals[SIG_MAIN_FRAME_COMMITTED] = g_signal_connect(frame, "load-committed", G_CALLBACK(view_main_frame_committed_cb), gl);