From 52096933524fbc5c5fecc8f000328677a217ef06 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 5 Sep 2009 19:37:15 +0200 Subject: fix some forgotten changes to Makefile in previous commit --- Makefile | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 8bda961..cd39825 100644 --- a/Makefile +++ b/Makefile @@ -6,9 +6,9 @@ CFLAGS!=echo -std=c99 `pkg-config --cflags gtk+-2.0 webkit-1.0 libsoup-2.4 gthre LDFLAGS:=$(shell pkg-config --libs gtk+-2.0 webkit-1.0 libsoup-2.4 gthread-2.0) -pthread $(LDFLAGS) LDFLAGS!=echo `pkg-config --libs gtk+-2.0 webkit-1.0 libsoup-2.4 gthread-2.0` -pthread $(LDFLAGS) -all: uzbl +all: uzbl-browser -uzbl: uzbl-core +uzbl-browser: uzbl-core PREFIX?=$(DESTDIR)/usr/local @@ -17,18 +17,23 @@ tests: uzbl-core.o $(CC) -DUZBL_LIBRARY -shared -Wl uzbl-core.o -o ./tests/libuzbl-core.so cd ./tests/; $(MAKE) -test: uzbl +test: uzbl-core + ./uzbl-core --uri http://www.uzbl.org --verbose + +test-browser: uzbl-browser PATH="`pwd`:$$PATH" ./uzbl-browser --uri http://www.uzbl.org --verbose -test-dev: uzbl - XDG_DATA_HOME=./examples/data XDG_CONFIG_HOME=./examples/config ./uzbl-browser --uri http://www.uzbl.org --verbose +test-dev: uzbl-core + XDG_DATA_HOME=./examples/data XDG_CONFIG_HOME=./examples/config ./uzbl-core --uri http://www.uzbl.org --verbose -test-dev-dispatched: uzbl - XDG_DATA_HOME=./examples/data XDG_CONFIG_HOME=./examples/config ./uzbl-browser --uri http://www.uzbl.org --verbose | ./examples/data/uzbl/scripts/event_manager.py +test-dev-browser: uzbl-browser + XDG_DATA_HOME=./examples/data XDG_CONFIG_HOME=./examples/config PATH="`pwd`:$$PATH" ./uzbl-browser --uri http://www.uzbl.org --verbose -test-share: uzbl - XDG_DATA_HOME=${PREFIX}/share/uzbl/examples/data XDG_CONFIG_HOME=${PREFIX}/share/uzbl/examples/config ./uzbl-browser --uri http://www.uzbl.org --verbose +test-share: uzbl-core + XDG_DATA_HOME=${PREFIX}/share/uzbl/examples/data XDG_CONFIG_HOME=${PREFIX}/share/uzbl/examples/config ./uzbl-core --uri http://www.uzbl.org --verbose +test-share-browser: uzbl-browser + XDG_DATA_HOME=${PREFIX}/share/uzbl/examples/data XDG_CONFIG_HOME=${PREFIX}/share/uzbl/examples/config PATH="`pwd`:$$PATH" ./uzbl-browser --uri http://www.uzbl.org --verbose clean: rm -f uzbl-core -- cgit v1.2.3 From 9cd25e5c8c51e24ac83555c0598f8eb49078ab4d Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 6 Sep 2009 18:31:59 +0200 Subject: todo updates --- docs/TODO | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/TODO b/docs/TODO index 7da0fd6..f626fcd 100644 --- a/docs/TODO +++ b/docs/TODO @@ -1,3 +1,12 @@ +what if fifo/socket doesn't exist, or exists but nothing working behind it (anymore)? +-> useful for both cookie handler and event manager +-> implementing in uzbl-core needs refactoring of handler args, or some edge-case workarounds + (mason-l's proposal was not too bad: basically make cookie stuff more cookie specific. + we don't need a generic talk_to_socket. 3 vars: cookie_handler, cookie_handler_socket and + cookie_handler_launcher. act depending on which vars are set) +-> for now, assume that we don't need to check for crashes, just make sure there is the initial socket/fifo -> can be done in uzbl-browser script + + == event-messages specific == * throw out all old code * document the event handling mechanism, all events, how to get started with sample event handler @@ -9,6 +18,10 @@ * uzbl -> uzbl-core, uzbl-browser script like 'uzbl | $XDG.../event_manager.py' * event manager dynamic config system that configures itself based on events from uzbl (eg to set vars in "uzbl slaves" such as this, set custom vars in uzbl which we react to) * remove chain command +* scalability -> 1 event manager per n uzbl-browser instances -> mkfifo and redirect uzbl-core stdout to fifo in uzbl-browser +* event manager -> everything based on per instance basis (associative array with uzbl instance name as key) +* why the need of queues in mason-l branch? + = keybinding features = * use a datadriven config format to allow simple implementations in different languages. -- cgit v1.2.3 From 207c292171f174d7ebf06fdb3258cb82d1b3a342 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 6 Sep 2009 19:12:24 +0200 Subject: more useful uzbl-browser script that can share event manager with multiple instances through a fifo. also starting the cookie daemon is implemented --- uzbl-browser | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/uzbl-browser b/uzbl-browser index 93ba2d7..1e950db 100755 --- a/uzbl-browser +++ b/uzbl-browser @@ -1,9 +1,35 @@ #!/bin/sh -# this script implements are more useful "browsing experience". make sure to have the event manager in the appropriate place. +# this script implements are more useful "browsing experience". +# We are assuming you want to use the event_manager.py and cookie_daemon.py. +# So, you must have them in the appropriate place, and cookie_daemon_socket must be configured in the default location -if [ x"$XDG_DATA_HOME" != 'x' ] +# Also, we assume existence of fifo/socket == correctly functioning cookie_daemon/event_manager. +# Checking correct functioning of the daemons here would be too complex here, and it's not implemented in uzbl-core either. +# But this shouldn't cause much problems.. + + +if [ x"$XDG_DATA_HOME" == 'x' ] then - uzbl-core "$@" | $XDG_DATA_HOME/uzbl/scripts/event_manager.py -else - uzbl-core "$@" | $HOME/.local/share/uzbl/scripts/event_manager.py + XDG_DATA_HOME=$HOME/.local/share fi + +if [ x"$XDG_CACHE_HOME" == 'x' ] +then + XDG_CACHE_HOME=$HOME/.cache +fi + +if [ ! -S $XDG_CACHE_HOME/uzbl/cookie_daemon_socket ] +then + $XDG_DATA_HOME/uzbl/scripts/cookie_daemon.py +fi + +FIFO=/tmp/uzbl-fifo-eventmanager +EVENT_MANAGER=$XDG_DATA_HOME/uzbl/scripts/event_manager.py + +if [ ! -p $FIFO ] +then + mkfifo $FIFO + (cat $FIFO | $EVENT_MANAGER && rm $FIFO) & +fi + +uzbl-core "$@" > $FIFO -- cgit v1.2.3 From e6cdd95b0f08de2a8b71df40f8cfedacbf8c58b5 Mon Sep 17 00:00:00 2001 From: Robert Manea Date: Sun, 6 Sep 2009 23:38:00 +0200 Subject: Added KEY_RELEASE event --- uzbl-core.c | 15 ++++++++++++++- uzbl-core.h | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/uzbl-core.c b/uzbl-core.c index ad7dd56..d8179df 100644 --- a/uzbl-core.c +++ b/uzbl-core.c @@ -2304,7 +2304,7 @@ key_press_cb (GtkWidget* window, GdkEventKey* event) (void) window; if(event->type == GDK_KEY_PRESS) - send_event(KEY_PRESS, gdk_keyval_name(event->keyval) ); + send_event(KEY_PRESS, gdk_keyval_name(event->keyval)); if (event->type != GDK_KEY_PRESS || event->keyval == GDK_Page_Up || @@ -2329,6 +2329,16 @@ key_press_cb (GtkWidget* window, GdkEventKey* event) return TRUE; } +gboolean +key_release_cb (GtkWidget* window, GdkEventKey* event) { + (void) window; + + if(event->type == GDK_KEY_RELEASE) + send_event(KEY_RELEASE, gdk_keyval_name(event->keyval)); + + return TRUE; +} + void run_keycmd(const gboolean key_ret) { @@ -2437,6 +2447,7 @@ create_mainbar () { 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); + g_signal_connect (G_OBJECT (g->mainbar), "key-release-event", G_CALLBACK (key_release_cb), NULL); return g->mainbar; } @@ -2447,6 +2458,7 @@ create_window () { gtk_widget_set_name (window, "Uzbl browser"); g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (destroy_cb), NULL); g_signal_connect (G_OBJECT (window), "key-press-event", G_CALLBACK (key_press_cb), NULL); + g_signal_connect (G_OBJECT (window), "key-release-event", G_CALLBACK (key_release_cb), NULL); g_signal_connect (G_OBJECT (window), "configure-event", G_CALLBACK (configure_event_cb), NULL); return window; @@ -2457,6 +2469,7 @@ create_plug () { GtkPlug* plug = GTK_PLUG (gtk_plug_new (uzbl.state.socket_id)); g_signal_connect (G_OBJECT (plug), "destroy", G_CALLBACK (destroy_cb), NULL); g_signal_connect (G_OBJECT (plug), "key-press-event", G_CALLBACK (key_press_cb), NULL); + g_signal_connect (G_OBJECT (plug), "key-release-event", G_CALLBACK (key_release_cb), NULL); return plug; } diff --git a/uzbl-core.h b/uzbl-core.h index 010cbe5..842d965 100644 --- a/uzbl-core.h +++ b/uzbl-core.h @@ -390,6 +390,9 @@ update_title (void); gboolean key_press_cb (GtkWidget* window, GdkEventKey* event); +gboolean +key_release_cb (GtkWidget* window, GdkEventKey* event); + void run_keycmd(const gboolean key_ret); -- cgit v1.2.3