diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-06 01:33:43 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-06 01:33:43 (EDT) |
commit | a95739910cedf1652bf4998b35cc13cb317cda79 (patch) | |
tree | a5ff568c7a734d7d84856383d9c128877b98115a /src | |
parent | 839e0104e994bd4941693203fca39a659894bb57 (diff) | |
download | marquee-a95739910cedf1652bf4998b35cc13cb317cda79.zip marquee-a95739910cedf1652bf4998b35cc13cb317cda79.tar.gz marquee-a95739910cedf1652bf4998b35cc13cb317cda79.tar.bz2 |
MqApplication: Instantiate a WebKitSettings object with a setting
WIP.
Diffstat (limited to 'src')
-rw-r--r-- | src/application.c | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/src/application.c b/src/application.c index 0cf19c4..fa7ec90 100644 --- a/src/application.c +++ b/src/application.c @@ -29,17 +29,20 @@ #include "about.h" #include "window.h" -MqApplication * -mq_application_new(gchar __attribute__((unused)) *profile, - gboolean __attribute__((unused)) private) +#define GET_BOOL(MQ_NAME) mq_config_get_boolean(application->config, MQ_NAME) +#define MAP_BOOL( WK_NAME, MQ_NAME) WK_NAME, GET_BOOL(MQ_NAME) +#define MAP_BOOL_N(WK_NAME, MQ_NAME) WK_NAME, GET_BOOL(MQ_NAME) + +static void +set_webkit_settings(MqApplication *application) { - MqApplication *application; + WebKitSettings *settings; WebKitWebContext *web_context; - application = malloc(sizeof(*application)); - application->config = mq_config_new("default"); - mq_config_load(application->config); - application->windows = NULL; + settings = webkit_settings_new_with_settings( + MAP_BOOL("enable-smooth-scrolling", + "navigation.smooth-scrolling"), + NULL); web_context = webkit_web_context_get_default(); webkit_web_context_set_favicon_database_directory(web_context, NULL); @@ -48,6 +51,24 @@ mq_application_new(gchar __attribute__((unused)) *profile, webkit_web_context_register_uri_scheme(web_context, "mq-about", (WebKitURISchemeRequestCallback) mq_about_request, application, NULL); +} + +#undef GET_BOOL +#undef MAP_BOOL +#undef MAP_BOOL_N + +MqApplication * +mq_application_new(gchar __attribute__((unused)) *profile, + gboolean __attribute__((unused)) private) +{ + MqApplication *application; + + application = malloc(sizeof(*application)); + application->config = mq_config_new("default"); + mq_config_load(application->config); + application->windows = NULL; + + set_webkit_settings(application); return application; } |