Merge branch 'experimental' of git://github.com/Dieterbe/uzbl
authorRobert Manea <gotmor@gmail.com>
Sun, 7 Jun 2009 01:17:09 +0000 (03:17 +0200)
committerRobert Manea <gotmor@gmail.com>
Sun, 7 Jun 2009 01:17:09 +0000 (03:17 +0200)
AUTHORS
Makefile
README
docs/TODO
examples/scripts/cookies.sh
examples/scripts/download.sh
examples/scripts/linkfollow.js
uzbl.c
uzbl.h

diff --git a/AUTHORS b/AUTHORS
index ee9d1dc..e5e3806 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -23,6 +23,8 @@ Contributors:
     (bobpaul) - session script patches
     Tom Adams (holizz) - few patches
     neutralinsomniac - load_progress = 0 fix
+    Maximilian Gaß (mxey) - small patches
+    Abel Camarillo (00z) - make it compile on OpenBSD
 
 Originaly based on http://trac.webkit.org/browser/trunk/WebKitTools/GtkLauncher/main.c
 Which is  copyrighted:
index fa20b6c..04012ed 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-CPPFLAGS:=$(shell pkg-config --cflags gtk+-2.0 webkit-1.0) -ggdb -Wall -W -DARCH="\"$(shell uname -m)\"" -DG_ERRORCHECK_MUTEXES -DCOMMIT="\"$(shell git log | head -n1 | sed "s/.* //")\"" $(CPPFLAGS)
-LDFLAGS:=$(shell pkg-config --libs gtk+-2.0 webkit-1.0) $(LDFLAGS)
+CFLAGS:=-std=c99 $(shell pkg-config --cflags gtk+-2.0 webkit-1.0 libsoup-2.4) -ggdb -Wall -W -DARCH="\"$(shell uname -m)\"" -DG_ERRORCHECK_MUTEXES -DCOMMIT="\"$(shell git log | head -n1 | sed "s/.* //")\"" $(CPPFLAGS)
+LDFLAGS:=$(shell pkg-config --libs gtk+-2.0 webkit-1.0 libsoup-2.4) -pthread $(LDFLAGS)
 all: uzbl uzblctrl
 
 PREFIX?=$(DESTDIR)/usr
diff --git a/README b/README
index 4f394bd..b8fd50e 100644 (file)
--- a/README
+++ b/README
@@ -104,14 +104,13 @@ The following commands are recognized:
        * `<string>` ends with an asterisk: similar behavior as with an underscore, but also makes the binding incremental (i.e. the command will be invoked on every keystroke).
        * `<string>` ends on a different character: you need to type the full string, which will trigger the command immediately, without pressing enter/return.
    - examples:
-
-        # uzbl will load the url when you type: 'o <url><enter>'
-        bind o _ = uri %s
-        # a search command which is called on every character typed after the slash, letting you see the search narrow down while typing.
-        #  Hitting return, enter or esc will terminate the search.
-        bind /*  = search %s
-        # when you type `ZZ` and nothing else, the exit command will be triggered immediately.
-        bind ZZ  = exit
+       * `bind o _ = uri %s`
+         - uzbl will load the url when you type: 'o <url><enter>'
+       * `bind /*  = search %s`
+         - a search command which is called on every character typed after the slash, letting you see the search narrow down while typing.
+         - Hitting return, enter or esc will terminate the search.
+       * `bind ZZ  = exit`
+         - When you type `ZZ` and nothing else, the exit command will be triggered immediately.
 
 * `back`
 * `forward`
index 0bd238b..dcee01b 100644 (file)
--- a/docs/TODO
+++ b/docs/TODO
@@ -1,12 +1,11 @@
 More or less in order of importance/urgency
 
-* cookie handler.  storing seems to work, but not yet sending
+* improve cookie handler.
 * a variable that holds the page state: loading, pending, seen. this can be shown in titlebar/statusbar and used for multiple instances management
 * allow to tag , to group instances together
 * store uri/tag/name/state in xorg window properties
 * split up uzbl.c into multiple files
 * shortcuts to focus other instances (see docs/multiple-instances-management)
-* password handler (manager)
 
 * recognize -h with GOption?
 * implement a vimperator-like link following scheme.
@@ -43,6 +42,18 @@ More or less in order of importance/urgency
 * let users attach handlers to the most common events/signals in uzbl.
   great use case: automatically calling formfiller for certain sites
 * write little script to open new urls with the urxvt url thing +document.
+* document:
+  stylesheet overridding
+  formfiller
+  link following
+  webkit inspector usage
+  scroll commands can take %s, eg scroll 100% for pages
+  chaining of actions, dump_config, print (and other actions that aren't documented yet)
+  overriding variables (such as -u)
+  variable expansion (@var, @{var}, where do they get expanded? can users have their own vars?, should we merge this with the replacement we do for useragent/window title etc?)
+  how %s works for the js command
+* consider switching to CMAKE. (someone already ported the makefile etc)
+  
 
 SOMEDAY:
 figure out caching with webkit and in general how we can speed up everything
index c0c37db..bbb0e88 100755 (executable)
 [ -z "$cookie_data" ] && exit 1
 
 
-#notifier=
+notifier=
 #notifier=notify-send
-notify_wrapper () {
-       echo "$@" >> $HOME/cookielog
-}
+#notify_wrapper () {
+#      echo "$@" >> $HOME/cookielog
+#}
+#notifier=notifier_wrapper
 
 # if this variable is set, we will use it to inform you when and which cookies we store, and when/which we send.
-notifier=notify_wrapper
+# it's primarily used for debugging
+notifier=
 which zenity &>/dev/null || exit 2
 
 # Example cookie:
index 0d38d3c..d87335f 100755 (executable)
@@ -7,10 +7,9 @@ WGET="wget --user-agent=Firefox"
 
 if [[ $8 =~ .*(.torrent) ]] 
 then
-    pushd $HOME
+    cd $HOME
     $WGET $8
 else
-    pushd $HOME
+    cd $HOME
     $WGET $8
 fi
-popd
index b90b82d..a348af9 100644 (file)
@@ -94,9 +94,17 @@ function Hints(){
     this.test = test;
     this.toString = toString;
     this.numbers = numbers;
+    function matchAgainst(element){
+      if(element.node.nodeName == "INPUT"){
+        return element.node.value;
+      } else {
+        return element.node.textContent;
+      }
+    }
     function test(element) {
       // test all the regexp
-      return words.every(function (regex) { return element.node.textContent.match(regex)});
+      var item = matchAgainst(element);
+      return words.every(function (regex) { return item.match(regex)});
     }
   }
 
diff --git a/uzbl.c b/uzbl.c
index c730c37..62deec7 100644 (file)
--- a/uzbl.c
+++ b/uzbl.c
@@ -32,6 +32,7 @@
 
 #define LENGTH(x) (sizeof x / sizeof x[0])
 #define MAX_BINDINGS 256
+#define _POSIX_SOURCE
 
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
@@ -1115,7 +1116,7 @@ sharg_append(GArray *a, const gchar *str) {
 // make sure that the args string you pass can properly be interpreted (eg properly escaped against whitespace, quotes etc)
 static gboolean
 run_command (const gchar *command, const guint npre, const gchar **args,
-             const gboolean sync, char **stdout) {
+             const gboolean sync, char **output_stdout) {
    //command <uzbl conf> <uzbl pid> <uzbl win id> <uzbl fifo file> <uzbl socket file> [args]
     GError *err = NULL;
     
@@ -1139,10 +1140,10 @@ run_command (const gchar *command, const guint npre, const gchar **args,
     
     gboolean result;
     if (sync) {
-        if (*stdout) *stdout = strfree(*stdout);
+        if (*output_stdout) *output_stdout = strfree(*output_stdout);
         
         result = g_spawn_sync(NULL, (gchar **)a->data, NULL, G_SPAWN_SEARCH_PATH,
-                              NULL, NULL, stdout, NULL, NULL, &err);
+                              NULL, NULL, output_stdout, NULL, NULL, &err);
     } else result = g_spawn_async(NULL, (gchar **)a->data, NULL, G_SPAWN_SEARCH_PATH,
                                   NULL, NULL, NULL, &err);
 
@@ -1156,8 +1157,8 @@ run_command (const gchar *command, const guint npre, const gchar **args,
         g_string_append_printf(s, " -- result: %s", (result ? "true" : "false"));
         printf("%s\n", s->str);
         g_string_free(s, TRUE);
-        if(stdout) {
-            printf("Stdout: %s\n", *stdout);
+        if(output_stdout) {
+            printf("Stdout: %s\n", *output_stdout);
         }
     }
     if (err) {
@@ -1558,7 +1559,7 @@ set_var_value(gchar *name, gchar *val) {
         } else if (c->type == TYPE_FLOAT) {
             float *fp = (float *)c->ptr;
             buf = expand_vars(val);
-            *fp = atof(buf);
+            *fp = strtod(buf, &endp);
             g_free(buf);
         }
 
@@ -2030,6 +2031,7 @@ create_mainbar () {
     gtk_misc_set_alignment (GTK_MISC(g->mainbar_label), 0, 0);
     gtk_misc_set_padding (GTK_MISC(g->mainbar_label), 2, 2);
     gtk_box_pack_start (GTK_BOX (g->mainbar), g->mainbar_label, TRUE, TRUE, 0);
+    g_signal_connect (G_OBJECT (g->mainbar), "key-press-event", G_CALLBACK (key_press_cb), NULL);
     return g->mainbar;
 }
 
diff --git a/uzbl.h b/uzbl.h
index ab45bae..a6a3a6e 100644 (file)
--- a/uzbl.h
+++ b/uzbl.h
@@ -323,7 +323,7 @@ close_uzbl (WebKitWebView *page, GArray *argv);
 
 static gboolean
 run_command(const gchar *command, const guint npre,
-            const gchar **args, const gboolean sync, char **stdout);
+            const gchar **args, const gboolean sync, char **output_stdout);
 
 static void
 spawn(WebKitWebView *web_view, GArray *argv);