|
|
@ -469,8 +469,11 @@ set_layout_cb(JSContextRef context, |
|
|
|
size_t layout_size; |
|
|
|
size_t layout_size; |
|
|
|
gchar *layout; |
|
|
|
gchar *layout; |
|
|
|
|
|
|
|
|
|
|
|
// FIXME: Throw exception
|
|
|
|
|
|
|
|
if (JSValueGetType(context, value) != kJSTypeString) { |
|
|
|
if (JSValueGetType(context, value) != kJSTypeString) { |
|
|
|
|
|
|
|
JSStringRef string = JSStringCreateWithUTF8CString("Expected a string"); |
|
|
|
|
|
|
|
JSValueRef exceptionString = JSValueMakeString(context, string); |
|
|
|
|
|
|
|
JSStringRelease(string); |
|
|
|
|
|
|
|
*exception = JSValueToObject(context, exceptionString, NULL); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -573,8 +576,11 @@ cancel_timed_login_cb(JSContextRef context, |
|
|
|
JSValueRef *exception) { |
|
|
|
JSValueRef *exception) { |
|
|
|
LightDMGreeter *greeter = JSObjectGetPrivate(thisObject); |
|
|
|
LightDMGreeter *greeter = JSObjectGetPrivate(thisObject); |
|
|
|
|
|
|
|
|
|
|
|
// FIXME: Throw exception
|
|
|
|
|
|
|
|
if (argumentCount != 0) { |
|
|
|
if (argumentCount != 0) { |
|
|
|
|
|
|
|
JSStringRef string = JSStringCreateWithUTF8CString("Argument count not zero"); |
|
|
|
|
|
|
|
JSValueRef exceptionString = JSValueMakeString(context, string); |
|
|
|
|
|
|
|
JSStringRelease(string); |
|
|
|
|
|
|
|
*exception = JSValueToObject(context, exceptionString, NULL); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -595,8 +601,11 @@ start_authentication_cb(JSContextRef context, |
|
|
|
size_t name_size; |
|
|
|
size_t name_size; |
|
|
|
gchar *name; |
|
|
|
gchar *name; |
|
|
|
|
|
|
|
|
|
|
|
// FIXME: Throw exception
|
|
|
|
|
|
|
|
if (!( argumentCount == 1 && JSValueGetType(context, arguments[0]) == kJSTypeString )) { |
|
|
|
if (!( argumentCount == 1 && JSValueGetType(context, arguments[0]) == kJSTypeString )) { |
|
|
|
|
|
|
|
JSStringRef string = JSStringCreateWithUTF8CString("Username argument not supplied"); |
|
|
|
|
|
|
|
JSValueRef exceptionString = JSValueMakeString(context, string); |
|
|
|
|
|
|
|
JSStringRelease(string); |
|
|
|
|
|
|
|
*exception = JSValueToObject(context, exceptionString, NULL); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -628,8 +637,11 @@ respond_cb(JSContextRef context, |
|
|
|
size_t response_size; |
|
|
|
size_t response_size; |
|
|
|
gchar *response; |
|
|
|
gchar *response; |
|
|
|
|
|
|
|
|
|
|
|
// FIXME: Throw exception
|
|
|
|
|
|
|
|
if (!( argumentCount == 1 && JSValueGetType(context, arguments[0]) == kJSTypeString )) { |
|
|
|
if (!( argumentCount == 1 && JSValueGetType(context, arguments[0]) == kJSTypeString )) { |
|
|
|
|
|
|
|
JSStringRef string = JSStringCreateWithUTF8CString("Response not supplied"); |
|
|
|
|
|
|
|
JSValueRef exceptionString = JSValueMakeString(context, string); |
|
|
|
|
|
|
|
JSStringRelease(string); |
|
|
|
|
|
|
|
*exception = JSValueToObject(context, exceptionString, NULL); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -655,8 +667,11 @@ cancel_authentication_cb(JSContextRef context, |
|
|
|
JSValueRef *exception) { |
|
|
|
JSValueRef *exception) { |
|
|
|
LightDMGreeter *greeter = JSObjectGetPrivate(thisObject); |
|
|
|
LightDMGreeter *greeter = JSObjectGetPrivate(thisObject); |
|
|
|
|
|
|
|
|
|
|
|
// FIXME: Throw exception
|
|
|
|
|
|
|
|
if (argumentCount != 0) { |
|
|
|
if (argumentCount != 0) { |
|
|
|
|
|
|
|
JSStringRef string = JSStringCreateWithUTF8CString("Argument count not zero"); |
|
|
|
|
|
|
|
JSValueRef exceptionString = JSValueMakeString(context, string); |
|
|
|
|
|
|
|
JSStringRelease(string); |
|
|
|
|
|
|
|
*exception = JSValueToObject(context, exceptionString, NULL); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -709,8 +724,11 @@ suspend_cb(JSContextRef context, |
|
|
|
size_t argumentCount, |
|
|
|
size_t argumentCount, |
|
|
|
const JSValueRef arguments[], |
|
|
|
const JSValueRef arguments[], |
|
|
|
JSValueRef *exception) { |
|
|
|
JSValueRef *exception) { |
|
|
|
// FIXME: Throw exception
|
|
|
|
|
|
|
|
if (argumentCount != 0) { |
|
|
|
if (argumentCount != 0) { |
|
|
|
|
|
|
|
JSStringRef string = JSStringCreateWithUTF8CString("Argument count not zero"); |
|
|
|
|
|
|
|
JSValueRef exceptionString = JSValueMakeString(context, string); |
|
|
|
|
|
|
|
JSStringRelease(string); |
|
|
|
|
|
|
|
*exception = JSValueToObject(context, exceptionString, NULL); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -735,8 +753,11 @@ hibernate_cb(JSContextRef context, |
|
|
|
size_t argumentCount, |
|
|
|
size_t argumentCount, |
|
|
|
const JSValueRef arguments[], |
|
|
|
const JSValueRef arguments[], |
|
|
|
JSValueRef *exception) { |
|
|
|
JSValueRef *exception) { |
|
|
|
// FIXME: Throw exception
|
|
|
|
|
|
|
|
if (argumentCount != 0) { |
|
|
|
if (argumentCount != 0) { |
|
|
|
|
|
|
|
JSStringRef string = JSStringCreateWithUTF8CString("Argument count not zero"); |
|
|
|
|
|
|
|
JSValueRef exceptionString = JSValueMakeString(context, string); |
|
|
|
|
|
|
|
JSStringRelease(string); |
|
|
|
|
|
|
|
*exception = JSValueToObject(context, exceptionString, NULL); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -761,8 +782,11 @@ restart_cb(JSContextRef context, |
|
|
|
size_t argumentCount, |
|
|
|
size_t argumentCount, |
|
|
|
const JSValueRef arguments[], |
|
|
|
const JSValueRef arguments[], |
|
|
|
JSValueRef *exception) { |
|
|
|
JSValueRef *exception) { |
|
|
|
// FIXME: Throw exception
|
|
|
|
|
|
|
|
if (argumentCount != 0) { |
|
|
|
if (argumentCount != 0) { |
|
|
|
|
|
|
|
JSStringRef string = JSStringCreateWithUTF8CString("Argument count not zero"); |
|
|
|
|
|
|
|
JSValueRef exceptionString = JSValueMakeString(context, string); |
|
|
|
|
|
|
|
JSStringRelease(string); |
|
|
|
|
|
|
|
*exception = JSValueToObject(context, exceptionString, NULL); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -787,8 +811,11 @@ shutdown_cb(JSContextRef context, |
|
|
|
size_t argumentCount, |
|
|
|
size_t argumentCount, |
|
|
|
const JSValueRef arguments[], |
|
|
|
const JSValueRef arguments[], |
|
|
|
JSValueRef *exception) { |
|
|
|
JSValueRef *exception) { |
|
|
|
// FIXME: Throw exception
|
|
|
|
|
|
|
|
if (argumentCount != 0) { |
|
|
|
if (argumentCount != 0) { |
|
|
|
|
|
|
|
JSStringRef string = JSStringCreateWithUTF8CString("Argument count not zero"); |
|
|
|
|
|
|
|
JSValueRef exceptionString = JSValueMakeString(context, string); |
|
|
|
|
|
|
|
JSStringRelease(string); |
|
|
|
|
|
|
|
*exception = JSValueToObject(context, exceptionString, NULL); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -809,7 +836,14 @@ login_cb(JSContextRef context, |
|
|
|
size_t username_size, session_size; |
|
|
|
size_t username_size, session_size; |
|
|
|
gchar *username, *session = NULL; |
|
|
|
gchar *username, *session = NULL; |
|
|
|
|
|
|
|
|
|
|
|
// FIXME: Throw exception
|
|
|
|
if (!((argumentCount == 1 && JSValueGetType (context, arguments[0]) == kJSTypeString) || |
|
|
|
|
|
|
|
(argumentCount == 2 && JSValueGetType (context, arguments[0]) == kJSTypeString && JSValueGetType (context, arguments[1]) == kJSTypeString))) { |
|
|
|
|
|
|
|
JSStringRef string = JSStringCreateWithUTF8CString("Username or Session incorrect"); |
|
|
|
|
|
|
|
JSValueRef exceptionString = JSValueMakeString(context, string); |
|
|
|
|
|
|
|
JSStringRelease(string); |
|
|
|
|
|
|
|
*exception = JSValueToObject(context, exceptionString, NULL); |
|
|
|
|
|
|
|
return JSValueMakeNull (context); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
arg = JSValueToStringCopy(context, arguments[0], NULL); |
|
|
|
arg = JSValueToStringCopy(context, arguments[0], NULL); |
|
|
|
username_size = JSStringGetMaximumUTF8CStringSize(arg); |
|
|
|
username_size = JSStringGetMaximumUTF8CStringSize(arg); |
|
|
@ -846,7 +880,13 @@ set_language_cb(JSContextRef context, |
|
|
|
size_t language_size; |
|
|
|
size_t language_size; |
|
|
|
gchar *language; |
|
|
|
gchar *language; |
|
|
|
|
|
|
|
|
|
|
|
// FIXME: Throw exception
|
|
|
|
if (!(argumentCount == 1 && JSValueGetType (context, arguments[0]) == kJSTypeString)) { |
|
|
|
|
|
|
|
JSStringRef string = JSStringCreateWithUTF8CString("Language not supplied"); |
|
|
|
|
|
|
|
JSValueRef exceptionString = JSValueMakeString(context, string); |
|
|
|
|
|
|
|
JSStringRelease(string); |
|
|
|
|
|
|
|
*exception = JSValueToObject(context, exceptionString, NULL); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
arg = JSValueToStringCopy(context, arguments[0], NULL); |
|
|
|
arg = JSValueToStringCopy(context, arguments[0], NULL); |
|
|
|
language_size = JSStringGetMaximumUTF8CStringSize(arg); |
|
|
|
language_size = JSStringGetMaximumUTF8CStringSize(arg); |
|
|
@ -872,8 +912,11 @@ gettext_cb(JSContextRef context, |
|
|
|
size_t string_size; |
|
|
|
size_t string_size; |
|
|
|
gchar *string; |
|
|
|
gchar *string; |
|
|
|
|
|
|
|
|
|
|
|
// FIXME: Throw exception
|
|
|
|
if (!(argumentCount == 1 && JSValueGetType (context, arguments[0]) == kJSTypeString)) { |
|
|
|
if (argumentCount != 1) { |
|
|
|
JSStringRef string = JSStringCreateWithUTF8CString("Argument not supplied"); |
|
|
|
|
|
|
|
JSValueRef exceptionString = JSValueMakeString(context, string); |
|
|
|
|
|
|
|
JSStringRelease(string); |
|
|
|
|
|
|
|
*exception = JSValueToObject(context, exceptionString, NULL); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -901,8 +944,11 @@ ngettext_cb(JSContextRef context, |
|
|
|
gchar *string, *plural_string; |
|
|
|
gchar *string, *plural_string; |
|
|
|
unsigned int n; |
|
|
|
unsigned int n; |
|
|
|
|
|
|
|
|
|
|
|
// FIXME: Throw exception
|
|
|
|
|
|
|
|
if (argumentCount != 3) { |
|
|
|
if (argumentCount != 3) { |
|
|
|
|
|
|
|
JSStringRef string = JSStringCreateWithUTF8CString("Needs 3 arguments"); |
|
|
|
|
|
|
|
JSValueRef exceptionString = JSValueMakeString(context, string); |
|
|
|
|
|
|
|
JSStringRelease(string); |
|
|
|
|
|
|
|
*exception = JSValueToObject(context, exceptionString, NULL); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
return JSValueMakeNull(context); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1126,8 +1172,6 @@ show_prompt_cb(LightDMGreeter *greeter, |
|
|
|
gchar *etext; |
|
|
|
gchar *etext; |
|
|
|
const gchar *ct = ""; |
|
|
|
const gchar *ct = ""; |
|
|
|
|
|
|
|
|
|
|
|
g_debug("Show prompt %s", text); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
web_page = webkit_web_extension_get_page(extension, page_id); |
|
|
|
web_page = webkit_web_extension_get_page(extension, page_id); |
|
|
|
|
|
|
|
|
|
|
|
if (web_page != NULL) { |
|
|
|
if (web_page != NULL) { |
|
|
|