aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-06-02 22:52:12 +0200
committerGravatar Dieter Plaetinck <dieter@plaetinck.be>2009-06-02 22:52:12 +0200
commitdfd89110a7a965d417ebda0d16dd024bcfbbf2f5 (patch)
treea194804a6377a5a147c1889b4ebb726b16d42ca7 /uzbl.c
parente91f5b5d31aea3436ec0edffb7aab322f189420e (diff)
parentf3ee2bb1790e96041bfc920e14d32518bf096e59 (diff)
merge in uranthers zoomlevel thingie. doesnt work yet because of strof not recognized. stay tuned...
Diffstat (limited to 'uzbl.c')
-rw-r--r--uzbl.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/uzbl.c b/uzbl.c
index b444c97..ba5a98a 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -43,16 +43,14 @@
#include <sys/utsname.h>
#include <sys/time.h>
#include <webkit/webkit.h>
+#include <libsoup/soup.h>
+
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
-#include <string.h>
#include <fcntl.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <libsoup/soup.h>
#include <signal.h>
#include "uzbl.h"
#include "config.h"
@@ -85,7 +83,7 @@ typedef const struct {
void (*func)(void);
} uzbl_cmdprop;
-enum {TYPE_INT, TYPE_STR};
+enum {TYPE_INT, TYPE_STR, TYPE_FLOAT};
/* an abbreviation to help keep the table's width humane */
#define PTR(var, t, d, fun) { .ptr = (void*)&(var), .type = TYPE_##t, .dump = d, .func = fun }
@@ -133,7 +131,8 @@ const struct {
{ "max_conns", PTR(uzbl.net.max_conns, INT, 1, cmd_max_conns)},
{ "max_conns_host", PTR(uzbl.net.max_conns_host, INT, 1, cmd_max_conns_host)},
{ "useragent", PTR(uzbl.net.useragent, STR, 1, cmd_useragent)},
- /* exported WebKitWebSettings properties*/
+ /* exported WebKitWebSettings properties */
+ { "zoom_level", PTR(uzbl.behave.zoom_level, FLOAT,1, cmd_zoom_level)},
{ "font_size", PTR(uzbl.behave.font_size, INT, 1, cmd_font_size)},
{ "monospace_size", PTR(uzbl.behave.monospace_size, INT, 1, cmd_font_size)},
{ "minimum_font_size", PTR(uzbl.behave.minimum_font_size, INT, 1, cmd_minimum_font_size)},
@@ -599,7 +598,6 @@ VIEWFUNC(go_forward)
#undef VIEWFUNC
/* -- command to callback/function map for things we cannot attach to any signals */
-// TODO: reload
static struct {char *name; Command command[2];} cmdlist[] =
{ /* key function no_split */
{ "back", {view_go_back, 0} },
@@ -1368,6 +1366,11 @@ cmd_font_size() {
}
static void
+cmd_zoom_level() {
+ webkit_web_view_set_zoom_level (uzbl.gui.web_view, uzbl.behave.zoom_level);
+}
+
+static void
cmd_disable_plugins() {
g_object_set (G_OBJECT(view_settings()), "enable-plugins",
!uzbl.behave.disable_plugins, NULL);
@@ -1547,6 +1550,11 @@ set_var_value(gchar *name, gchar *val) {
buf = expand_vars(val);
*ip = (int)strtoul(buf, &endp, 10);
g_free(buf);
+ } else if (c->type == TYPE_FLOAT) {
+ float *fp = (float *)c->ptr;
+ buf = expand_vars(val);
+ *fp = strtof(buf, &endp);
+ g_free(buf);
}
/* invoke a command specific function */