X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=config.def.h;h=a1ab211131aff01f2ede84bb35f2832011c86bd1;hb=29c2ab207afe24c48aaadaf3d2b60390eed4ce6a;hp=80a0febc04a121df124d4aff93f1c02e90530b6d;hpb=ea9d60c5c0cb5a5c021dd106f3636f83e1452d08;p=surf.git diff --git a/config.def.h b/config.def.h index 80a0feb..a1ab211 100644 --- a/config.def.h +++ b/config.def.h @@ -2,8 +2,9 @@ static char *useragent = "Mozilla/5.0 (X11; U; Unix; en-US) " "AppleWebKit/537.15 (KHTML, like Gecko) Chrome/24.0.1295.0 " "Safari/537.15 Surf/"VERSION; -static char *stylefile = "~/.surf/style.css"; static char *scriptfile = "~/.surf/script.js"; +static char *styledir = "~/.surf/styles/"; +static char *cachefolder = "~/.surf/cache/"; static Bool kioskmode = FALSE; /* Ignore shortcuts */ static Bool showindicators = TRUE; /* Show indicators in window title */ @@ -22,14 +23,17 @@ static char *strictssl = FALSE; /* Refuse untrusted SSL connections */ static time_t sessiontime = 3600; /* Webkit default features */ -static Bool enablescrollbars = TRUE; +static Bool enablescrollbars = TRUE; static Bool enablespatialbrowsing = TRUE; -static Bool enableplugins = TRUE; -static Bool enablescripts = TRUE; -static Bool enableinspector = TRUE; -static Bool loadimages = TRUE; -static Bool hidebackground = FALSE; -static Bool allowgeolocation = TRUE; +static Bool enablediskcache = TRUE; +static int diskcachebytes = 5 * 1024 * 1024; +static Bool enableplugins = TRUE; +static Bool enablescripts = TRUE; +static Bool enableinspector = TRUE; +static Bool enablestyles = TRUE; +static Bool loadimages = TRUE; +static Bool hidebackground = FALSE; +static Bool allowgeolocation = TRUE; #define SETPROP(p, q) { \ .v = (char *[]){ "/bin/sh", "-c", \ @@ -49,6 +53,26 @@ static Bool allowgeolocation = TRUE; } \ } +/* PLUMB(URI) */ +/* This called when some URI which does not begin with "about:", + * "http://" or "https://" should be opened. + */ +#define PLUMB(u) {\ + .v = (char *[]){ "/bin/sh", "-c", \ + "xdg-open \"$0\"", u, NULL \ + } \ +} + +/* styles */ +/* + * The iteration will stop at the first match, beginning at the beginning of + * the list. + */ +static SiteStyle styles[] = { + /* regexp file in $styledir */ + { ".*", "default.css" }, +}; + #define MODKEY GDK_CONTROL_MASK /* hotkeys */ @@ -103,3 +127,13 @@ static Key keys[] = { { MODKEY|GDK_SHIFT_MASK,GDK_g, togglegeolocation, { 0 } }, }; +/* button definitions */ +/* click can be ClkDoc, ClkLink, ClkImg, ClkMedia, ClkSel, ClkEdit, ClkAny */ +static Button buttons[] = { + /* click event mask button function argument */ + { ClkLink, 0, 2, linkopenembed, { 0 } }, + { ClkLink, MODKEY, 2, linkopen, { 0 } }, + { ClkLink, MODKEY, 1, linkopen, { 0 } }, + { ClkAny, 0, 8, navigate, { .i = -1 } }, + { ClkAny, 0, 9, navigate, { .i = +1 } }, +};