summaryrefslogtreecommitdiff
path: root/src/scripts.c
diff options
context:
space:
mode:
authorportix <none@none>2012-11-01 14:58:56 +0100
committerportix <none@none>2012-11-01 14:58:56 +0100
commit3da3defd89ea9213397bab7ec5908639b3594391 (patch)
tree82801b03e71825ce3825a5ef88103dffa20ecd81 /src/scripts.c
parent2529be6a2c5783fbdde70847787cba06cb46175b (diff)
downloaddwb-3da3defd89ea9213397bab7ec5908639b3594391.zip
New signal changeMode; new method util.getMode
Diffstat (limited to 'src/scripts.c')
-rw-r--r--src/scripts.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/scripts.c b/src/scripts.c
index 27605d12..a26f9cf3 100644
--- a/src/scripts.c
+++ b/src/scripts.c
@@ -80,6 +80,8 @@ static Sigmap m_sigmap[] = {
{ SCRIPTS_SIG_DOCUMENT_LOADED, "documentLoaded" },
{ SCRIPTS_SIG_MOUSE_MOVE, "mouseMove" },
{ SCRIPTS_SIG_STATUS_BAR, "statusBarChange" },
+ { SCRIPTS_SIG_CHANGE_MODE, "changeMode" },
+ { 0, NULL },
};
@@ -1028,7 +1030,10 @@ util_markup_escape(JSContextRef ctx, JSObjectRef f, JSObjectRef thisObject, size
}
return JSValueMakeNull(ctx);
}
-
+static JSValueRef
+util_get_mode(JSContextRef ctx, JSObjectRef f, JSObjectRef thisObject, size_t argc, const JSValueRef argv[], JSValueRef* exc) {
+ return JSValueMakeNumber(ctx, BASIC_MODES(dwb.state.mode));
+}
/* DATA {{{*/
/* data_get_profile {{{*/
static JSValueRef
@@ -1895,6 +1900,7 @@ create_global_object() {
JSStaticFunction util_functions[] = {
{ "domainFromHost", util_domain_from_host, kJSDefaultAttributes },
{ "markupEscape", util_markup_escape, kJSDefaultAttributes },
+ { "getMode", util_get_mode, kJSDefaultAttributes },
{ 0, 0, 0 },
};
class = create_class("util", util_functions, NULL);