Browse Source

Add handling a general configuration variable

sisyphus
Scott Balneaves 9 years ago
parent
commit
0be42d27d4
  1. 14
      configure.ac
  2. 13
      src/lightdm-webkit2-greeter-ext.c

14
configure.ac

@ -87,6 +87,20 @@ AC_DEFINE_UNQUOTED(DESKTOP_DIR, "$DESKTOP_DIR", Desktop Dir)
dnl ########################################################################### dnl ###########################################################################
dnl ########################################################################### dnl ###########################################################################
ICONS_DIR="/usr/share/icons/"
AC_ARG_WITH(desktop-dir,
AS_HELP_STRING(--with-icons-dir=<path>,
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_ARG_ENABLE([at-spi-command],
AC_HELP_STRING([--enable-at-spi-command[=command]], [Try to start at-spi service]]) 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]), AC_HELP_STRING([--disable-at-spi-command], [Do not start at-spi service]),

13
src/lightdm-webkit2-greeter-ext.c

@ -42,6 +42,8 @@
#include <lightdm.h> #include <lightdm.h>
#include <config.h>
G_MODULE_EXPORT void webkit_web_extension_initialize(WebKitWebExtension *extension); G_MODULE_EXPORT void webkit_web_extension_initialize(WebKitWebExtension *extension);
guint64 page_id = -1; guint64 page_id = -1;
@ -1013,6 +1015,15 @@ ngettext_cb(JSContextRef context,
return result; 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[] = { static const JSStaticValue lightdm_user_values[] = {
{"name", get_user_name_cb, NULL, kJSPropertyAttributeReadOnly}, {"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_user", get_autologin_user_cb, NULL, kJSPropertyAttributeReadOnly},
{"autologin_guest", get_autologin_guest_cb, NULL, kJSPropertyAttributeReadOnly}, {"autologin_guest", get_autologin_guest_cb, NULL, kJSPropertyAttributeReadOnly},
{"autologin_timeout", get_autologin_timeout_cb, NULL, kJSPropertyAttributeReadOnly}, {"autologin_timeout", get_autologin_timeout_cb, NULL, kJSPropertyAttributeReadOnly},
{"iconsdir", get_iconsdir_cb, NULL, kJSPropertyAttributeReadOnly},
{NULL, NULL, NULL, 0}}; {NULL, NULL, NULL, 0}};
static const JSStaticFunction lightdm_greeter_functions[] = { static const JSStaticFunction lightdm_greeter_functions[] = {
@ -1149,7 +1161,6 @@ static const JSClassDefinition gettext_definition = {
gettext_functions, /* Static functions */ gettext_functions, /* Static functions */
}; };
/*static void /*static void
web_page_created_callback(WebKitWebExtension *extension, WebKitWebPage *web_page, gpointer user_data) { web_page_created_callback(WebKitWebExtension *extension, WebKitWebPage *web_page, gpointer user_data) {
#define G_GUINT64_FORMAT "lu" #define G_GUINT64_FORMAT "lu"

Loading…
Cancel
Save