From bd5214c5fdc97491b50e036402526a71f161277f Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 28 Mar 2019 21:59:35 +0100 Subject: move to C 11 because of WebKit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And this standard is behind a huge paywall, thanks I hate it, but well you know what to do. :D --- Makefile | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 21f1c72..1157017 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ PREFIX = /usr/local DEPS = gtk+-3.0 webkit2gtk-4.0 OBJS = badwolf -CC = cc -std=c99 +CC = cc -std=c11 CFLAGS = -g -Wall -Wextra CDEPS = `pkg-config --cflags $(DEPS)` LIBS = `pkg-config --libs $(DEPS)` diff --git a/README.md b/README.md index 0ac1779..0281349 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Files ending in `.sig` are OpenPGP signatures done with my [key](https://hacktiv ## Manual Installation Dependencies are: - [WebKitGTK](https://webkitgtk.org/), only the latest stable will be fully supported -- C99+ Compiler (such as clang or gcc) +- C11 Compiler (such as clang or gcc) - POSIX make (works with GNU or BSD) Compilation is done with `make`, install with `make install`. -- cgit v1.3.1-23-gd82d From f5d3ddcdaf87b422a02b4bfffe4ba1b299e61e73 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 28 Mar 2019 21:58:56 +0100 Subject: Makefile: fix CC argument ordering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From POSIX manpages: c99 [options...] pathname [[pathname] [−I directory] [−L directory] [−l library]]... --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1157017..b631eee 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ PREFIX = /usr/local DEPS = gtk+-3.0 webkit2gtk-4.0 OBJS = badwolf -CC = cc -std=c11 +CC = cc CFLAGS = -g -Wall -Wextra CDEPS = `pkg-config --cflags $(DEPS)` LIBS = `pkg-config --libs $(DEPS)` @@ -13,7 +13,7 @@ LIBS = `pkg-config --libs $(DEPS)` all: $(OBJS) .c: - $(CC) $(CFLAGS) $(CDEPS) $(LDFLAGS) $(LIBS) -o $@ $< + $(CC) -std=c11 $(CFLAGS) $(CDEPS) -o $@ $< $(LDFLAGS) $(LIBS) install: badwolf mkdir -p $(DESTDIR)$(PREFIX)/bin -- cgit v1.3.1-23-gd82d From ece738d6264e928bc15a9c5d10529f3aa1330be3 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Thu, 28 Mar 2019 22:40:49 +0100 Subject: Move WebkitSettings to config.h --- badwolf.c | 23 +---------------------- config.h | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/badwolf.c b/badwolf.c index cfade8c..be7aef0 100644 --- a/badwolf.c +++ b/badwolf.c @@ -312,28 +312,7 @@ new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web webkit_web_context_set_process_model(web_context, WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); - WebKitSettings *settings = - webkit_settings_new_with_settings("default-charset", - "utf-8", - "enable-caret-browsing", - TRUE, - "enable-developer-extras", - TRUE, - "enable-java", - FALSE, - "enable-javascript", - FALSE, - "enable-plugins", - FALSE, - "javascript-can-access-clipboard", - FALSE, - "javascript-can-open-windows-automatically", - FALSE, - "media-playback-requires-user-gesture", - TRUE, - "minimum-font-size", - 9, - NULL); + WebKitSettings *settings = webkit_settings_new_with_settings(BADWOLF_WEBKIT_SETTINGS); browser->webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, "web-context", diff --git a/config.h b/config.h index 3bb3596..968a5c8 100644 --- a/config.h +++ b/config.h @@ -27,8 +27,7 @@ // BADWOLF_TOOLBAR_PADDING: Amount of padding between toolbar elements #define BADWOLF_TOOLBAR_PADDING 0 -/* - * BADWOLF_DEFAULT_WIDTH / BADWOLF_DEFAULT_HEIGHT: +/* BADWOLF_DEFAULT_WIDTH / BADWOLF_DEFAULT_HEIGHT: * Used to define the default width/height of the window, * useful for floating Window Managers, probably useless in tiling ones * @@ -36,3 +35,23 @@ */ #define BADWOLF_DEFAULT_WIDTH 800 #define BADWOLF_DEFAULT_HEIGHT 600 + +/* BADWOLF_WEBKIT_SETTINGS: + * Used when creating a new view with webkit_settings_new_with_settings the usage is: + * setting-name, setting-value, setting-name, …, NULL + * + * See: https://webkitgtk.org/reference/webkit2gtk/stable/WebKitSettings.html + */ +#define BADWOLF_WEBKIT_SETTINGS \ + "default-charset", "utf-8", \ + "enable-caret-browsing", TRUE, \ + "enable-developer-extras", TRUE, \ + "enable-java", FALSE, \ + "enable-javascript", FALSE, \ + "enable-plugins", FALSE, \ + "javascript-can-access-clipboard", FALSE, \ + "javascript-can-open-windows-automatically", FALSE, \ + "media-playback-requires-user-gesture", TRUE, \ + "minimum-font-size", 9, \ + NULL +// TODO: Look if there is a way to make clang-format ignore this define -- cgit v1.3.1-23-gd82d