summaryrefslogtreecommitdiff
path: root/src/callback.c
diff options
context:
space:
mode:
authorportix <none@none>2013-03-15 04:13:20 +0100
committerportix <none@none>2013-03-15 04:13:20 +0100
commitfa00d93c8ddd539617b8257cc7542578ce1818f1 (patch)
treebbdab6ccc32f432b6f80f4033e4b53c89c5f4e2b /src/callback.c
parent5792415c791c941915deea0205babf6c1429845f (diff)
downloaddwb-fa00d93c8ddd539617b8257cc7542578ce1818f1.zip
Inline documentation of javascript api; clean up api: new namespaces net and
timer; this refers to connected object in GObject.connect, moving prototype declarations from util.js to dwb.js; moving some functions from global namespace to util
Diffstat (limited to 'src/callback.c')
-rw-r--r--src/callback.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/callback.c b/src/callback.c
index 657632af..0e1a8f87 100644
--- a/src/callback.c
+++ b/src/callback.c
@@ -147,6 +147,38 @@ callback_key_press(GtkWidget *w, GdkEventKey *e)
if (EMIT_SCRIPT(KEY_PRESS))
{
+ /**
+ * Emitted when a key was pressed
+ * @event keyPress
+ * @memberOf signals
+ * @param {signals~onKeyPress} callback
+ * Callback function that will be called when the signal is emitted
+ *
+ * */
+ /**
+ * Callback called whenever a key is pressed
+ * @memberOf signals
+ * @callback signals~onKeyPress
+ *
+ * @param {WebKitWebView} webview The currently focused webview
+ * @param {Object} event
+ * The event
+ * @param {Boolean} event.isModifier
+ * Whether the key is a modifier
+ * @param {Number} event.keyCode
+ * The hardware keycode
+ * @param {Number} event.keyVal
+ * The keycode as listed in gdkkeysyms.h
+ * @param {String} event.name
+ * A string representation of the key
+ * @param {Modifier} event.state
+ * A bitmask of {@link Enums and Flags.Modifier|Modifier} pressed
+ *
+ * @returns {Boolean}
+ * Return true to stop emission of the signal, will also prevent
+ * dwb from handling the signal.
+ *
+ * */
char *json = util_create_json(5, UINTEGER, "state", e->state,
UINTEGER, "keyVal", e->keyval, UINTEGER, "keyCode", e->hardware_keycode,
BOOLEAN, "isModifier", e->is_modifier, CHAR, "name", gdk_keyval_name(e->keyval));
@@ -203,6 +235,32 @@ callback_key_release(GtkWidget *w, GdkEventKey *e)
{
if (EMIT_SCRIPT(KEY_RELEASE))
{
+ /**
+ * Emitted when a key was released
+ * @event keyRelease
+ * @memberOf signals
+ * @param {signals~onKeyRelease} callback
+ * Callback function that will be called when the signal is emitted
+ *
+ * */
+ /**
+ * Callback called whenever a key is pressed
+ * @callback signals~onKeyRelease
+ *
+ * @param {WebKitWebView} webview The currently focused webview
+ * @param {Object} event The event
+ * @param {Boolean} event.isModifier Whether the key is a modifier
+ * @param {Number} event.keyCode The hardware keycode
+ * @param {Number} event.keyVal The keycode as listed in gdkkeysyms.h
+ * @param {String} event.name A string representation of the
+ * key
+ * @param {Modifier} event.state
+ * A bitmask of {@link Enums and Flags.Modifier|Modifier} pressed
+ * @returns {Boolean}
+ * Return true to stop emission of the signal, will also prevent
+ * dwb from handling the signal.
+ *
+ * */
char *json = util_create_json(5, UINTEGER, "state", e->state,
UINTEGER, "keyVal", e->keyval, UINTEGER, "keyCode", e->hardware_keycode,
BOOLEAN, "isModifier", e->is_modifier, CHAR, "name", gdk_keyval_name(e->keyval));