From 0be42d27d440ec7848cb16db986943c6f704d39d Mon Sep 17 00:00:00 2001 From: Scott Balneaves Date: Tue, 12 Jan 2016 20:56:14 -0600 Subject: [PATCH] Add handling a general configuration variable --- configure.ac | 14 ++++++++++++++ src/lightdm-webkit2-greeter-ext.c | 13 ++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 861e424..6738d2c 100644 --- a/configure.ac +++ b/configure.ac @@ -87,6 +87,20 @@ AC_DEFINE_UNQUOTED(DESKTOP_DIR, "$DESKTOP_DIR", Desktop Dir) dnl ########################################################################### dnl ########################################################################### +ICONS_DIR="/usr/share/icons/" +AC_ARG_WITH(desktop-dir, + AS_HELP_STRING(--with-icons-dir=, + Theme icons directory for webkit themes), + if test x$withval != x; then + ICONS_DIR="$withval" + fi +) +AC_SUBST(ICONS_DIR) +AC_DEFINE_UNQUOTED(ICONS_DIR, "$ICONS_DIR", Icons Dir) + +dnl ########################################################################### +dnl ########################################################################### + AC_ARG_ENABLE([at-spi-command], AC_HELP_STRING([--enable-at-spi-command[=command]], [Try to start at-spi service]]) AC_HELP_STRING([--disable-at-spi-command], [Do not start at-spi service]), diff --git a/src/lightdm-webkit2-greeter-ext.c b/src/lightdm-webkit2-greeter-ext.c index 2ff2d16..3d591cc 100644 --- a/src/lightdm-webkit2-greeter-ext.c +++ b/src/lightdm-webkit2-greeter-ext.c @@ -42,6 +42,8 @@ #include +#include + G_MODULE_EXPORT void webkit_web_extension_initialize(WebKitWebExtension *extension); guint64 page_id = -1; @@ -1013,6 +1015,15 @@ ngettext_cb(JSContextRef context, return result; } +static JSValueRef +get_iconsdir_cb(JSContextRef context, + JSObjectRef thisObject, + JSStringRef propertyName, + JSValueRef *exception) { + return string_or_null(context, ICONS_DIR); +} + + static const JSStaticValue lightdm_user_values[] = { {"name", get_user_name_cb, NULL, kJSPropertyAttributeReadOnly}, @@ -1073,6 +1084,7 @@ static const JSStaticValue lightdm_greeter_values[] = { {"autologin_user", get_autologin_user_cb, NULL, kJSPropertyAttributeReadOnly}, {"autologin_guest", get_autologin_guest_cb, NULL, kJSPropertyAttributeReadOnly}, {"autologin_timeout", get_autologin_timeout_cb, NULL, kJSPropertyAttributeReadOnly}, + {"iconsdir", get_iconsdir_cb, NULL, kJSPropertyAttributeReadOnly}, {NULL, NULL, NULL, 0}}; static const JSStaticFunction lightdm_greeter_functions[] = { @@ -1149,7 +1161,6 @@ static const JSClassDefinition gettext_definition = { gettext_functions, /* Static functions */ }; - /*static void web_page_created_callback(WebKitWebExtension *extension, WebKitWebPage *web_page, gpointer user_data) { #define G_GUINT64_FORMAT "lu"