aboutsummaryrefslogtreecommitdiffhomepage
path: root/uzbl.c
diff options
context:
space:
mode:
authorGravatar dusanx <ef_dva@yahoo.com>2009-05-03 16:58:11 +0200
committerGravatar dusanx <ef_dva@yahoo.com>2009-05-03 16:58:11 +0200
commit1825c5b18e7369cf63025ea13ebcf898135bc65b (patch)
tree4d2485dcfe8fb655429c43b48086de2f5fd50679 /uzbl.c
parent871baf52aa5c5a3d0c2e73c26959e202278d40f7 (diff)
Search
Diffstat (limited to 'uzbl.c')
-rw-r--r--uzbl.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/uzbl.c b/uzbl.c
index ffae493..f8cb48f 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -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;
@@ -320,6 +321,7 @@ static struct {char *name; Command command;} cmdlist[] =
{ "toggle_status", toggle_status_cb },
{ "spawn", spawn },
{ "exit", close_uzbl },
+ { "search", search_text },
{ "insert_mode", set_insert_mode }
};
@@ -388,6 +390,20 @@ load_uri (WebKitWebView * web_view, const gchar *param) {
}
static void
+search_text (WebKitWebView *page, const char *param) {
+ if ((param) && (param[0] != '\0')) {
+ printf("\nima param!!!\n");
+ strcpy(searchtx, param);
+ }
+ if (searchtx[0] != '\0') {
+ printf ("\n\nsearching: %s\n\n", searchtx);
+ 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);
@@ -742,6 +758,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);