diff options
author | Barrucadu <mike@barrucadu.co.uk> | 2009-05-03 17:57:00 +0100 |
---|---|---|
committer | Barrucadu <mike@barrucadu.co.uk> | 2009-05-03 17:57:00 +0100 |
commit | 8b88ac0b6c9623789ae808444d8453bcf7c1326c (patch) | |
tree | 855dbeffe030ca7b210c02fa9b93d00d30d17cd7 /uzbl.c | |
parent | 8f9c1fbc0aa1cf4f848c859573b71390b058f5af (diff) | |
parent | 070aab904c4da8d64fbb02b5a2bdc79750fb16d6 (diff) |
Merge branch 'dieter/experimental' into experimental
Conflicts:
examples/configs/sampleconfig
examples/configs/sampleconfig-dev
uzbl.c
Diffstat (limited to 'uzbl.c')
-rw-r--r-- | uzbl.c | 47 |
1 files changed, 32 insertions, 15 deletions
@@ -70,6 +70,7 @@ static char fifo_path[64]; static char socket_path[108]; static char executable_path[500]; static GString* keycmd; +static gchar searchtx[500] = "\0"; /* state variables (initial values coming from command line arguments but may be changed later) */ static gchar* uri = NULL; @@ -293,20 +294,21 @@ VIEWFUNC(go_forward) static struct {char *name; Command command;} cmdlist[] = { - { "back", view_go_back }, - { "forward", view_go_forward }, - { "scroll_vert", scroll_vert }, - { "scroll_horz", scroll_horz }, - { "reload", view_reload, }, - { "reload_ign_cache", view_reload_bypass_cache}, - { "stop", view_stop_loading, }, - { "zoom_in", view_zoom_in, }, //Can crash (when max zoom reached?). - { "zoom_out", view_zoom_out, }, - { "uri", load_uri }, - { "toggle_status", toggle_status_cb }, - { "spawn", spawn }, - { "exit", close_uzbl }, - { "insert_mode", set_insert_mode } + { "back", view_go_back }, + { "forward", view_go_forward }, + { "scroll_vert", scroll_vert }, + { "scroll_horz", scroll_horz }, + { "reload", view_reload, }, //Buggy + { "refresh", view_reload, }, /* for convenience, will change */ + { "stop", view_stop_loading, }, + { "zoom_in", view_zoom_in, }, //Can crash (when max zoom reached?). + { "zoom_out", view_zoom_out, }, + { "uri", load_uri }, + { "toggle_status", toggle_status_cb }, + { "spawn", spawn }, + { "exit", close_uzbl }, + { "search", search_text }, + { "insert_mode", set_insert_mode } }; static void @@ -374,6 +376,20 @@ load_uri (WebKitWebView * web_view, const gchar *param) { } static void +search_text (WebKitWebView *page, const char *param) { + if ((param) && (param[0] != '\0')) { + strcpy(searchtx, param); + } + if (searchtx[0] != '\0') { + printf ("Searching: %s\n", searchtx); + webkit_web_view_unmark_text_matches (page); + webkit_web_view_mark_text_matches (page, searchtx, FALSE, 0); + webkit_web_view_set_highlight_text_matches (page, TRUE); + webkit_web_view_search_text (page, searchtx, FALSE, TRUE, TRUE); + } +} + +static void new_window_load_uri (const gchar * uri) { GString* to_execute = g_string_new (""); g_string_append_printf (to_execute, "%s --uri '%s'", executable_path, uri); @@ -675,7 +691,7 @@ key_press_cb (WebKitWebView* page, GdkEventKey* event) return TRUE; } - if (insert_mode && (event->state & modmask)) + if (insert_mode && ((event->state & modmask) != modmask)) return FALSE; if (event->keyval == GDK_Escape) { @@ -729,6 +745,7 @@ key_press_cb (WebKitWebView* page, GdkEventKey* event) g_string_free (actionparam, TRUE); g_string_free (parampart, TRUE); g_string_truncate(keycmd, 0); + update_title(); } g_string_truncate(short_keys, short_keys->len - 1); |