WTF
authoruranther <jwheaton@purdue.edu>
Sat, 6 Jun 2009 21:01:45 +0000 (17:01 -0400)
committeruranther <jwheaton@purdue.edu>
Sat, 6 Jun 2009 21:01:45 +0000 (17:01 -0400)
examples/configs/sampleconfig
uzbl.c
uzbl.h

index a799be3..1321803 100644 (file)
@@ -69,7 +69,7 @@ bind    r         = reload
 bind    R         = reload_ign_cache
 bind    +         = zoom_in
 bind    -         = zoom_out
-bind    =         = sh "echo set zoom_level = 1.0 > $4"
+bind    =         = reset_zoom
 bind    t         = toggle_status
 # Hilight matches. Notice the * after the slash - it makes the command incremental, i.e. gets called
 # on every character you type.  You can do `bind /_ = search %s' if you want it less interactive.
diff --git a/uzbl.c b/uzbl.c
index 77e437c..411b765 100644 (file)
--- a/uzbl.c
+++ b/uzbl.c
@@ -83,7 +83,7 @@ typedef const struct {
     void (*func)(void);
 } uzbl_cmdprop;
 
-enum {TYPE_INT, TYPE_STR, TYPE_FLOAT};
+enum {TYPE_INT, TYPE_STR};
 
 /* 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 }
@@ -611,6 +611,7 @@ static struct {char *name; Command command[2];} cmdlist[] =
     { "stop",               {view_stop_loading, 0},        },
     { "zoom_in",            {view_zoom_in, 0},             }, //Can crash (when max zoom reached?).
     { "zoom_out",           {view_zoom_out, 0},            },
+    { "reset_zoom",         {reset_zoom_level, 0},         },
     { "uri",                {load_uri, NOSPLIT}            },
     { "js",                 {run_js, NOSPLIT}              },
     { "script",             {run_external_js, 0}           },
@@ -807,6 +808,12 @@ search_reverse_text (WebKitWebView *page, GArray *argv) {
 }
 
 static void
+reset_zoom_level (WebKitWebView *page, GArray *argv) {
+    (void) argv;
+    webkit_web_view_set_zoom_level (page, 1.0);
+}
+
+static void
 dehilight (WebKitWebView *page, GArray *argv) {
     (void) argv;
     webkit_web_view_set_highlight_text_matches (page, FALSE);
@@ -1366,11 +1373,6 @@ 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);
diff --git a/uzbl.h b/uzbl.h
index ab45bae..6297a64 100644 (file)
--- a/uzbl.h
+++ b/uzbl.h
@@ -149,7 +149,6 @@ typedef struct {
     guint    font_size;
     guint    monospace_size;
     guint    minimum_font_size;
-    gfloat   zoom_level;
     guint    disable_plugins;
     guint    disable_scripts;
     guint    autoload_img;    
@@ -410,6 +409,9 @@ static void
 search_reverse_text (WebKitWebView *page, GArray *argv);
 
 static void
+reset_zoom_level (WebKitWebView *page, GArray *argv);
+
+static void
 dehilight (WebKitWebView *page, GArray *argv);
 
 static void
@@ -478,15 +480,10 @@ cmd_max_conns();
 static void
 cmd_max_conns_host();
 
-/* exported WebKitWebSettings properties */
-
 static void
 cmd_font_size();
 
 static void
-cmd_zoom_level();
-
-static void
 cmd_disable_plugins();
 
 static void