viking

webkit based web browser for Enlightenment
Log | Files | Refs | LICENSE

commit bca221a3770200ea2695ffeac9816ec29b60841c
parent aeaccfc595cecc2eb4758edf6287c638b49c6141
Author: Kyle Milz <kmilz@ucalgary.ca>
Date:   Tue, 25 Sep 2012 09:27:29 -0600

history: add infrastructure for history toggling

Diffstat:
Mcommands.c | 17+++++++++++++++++
Mcommands.h | 1+
Mkeymap.h | 1+
Mmain.h | 1+
4 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/commands.c b/commands.c @@ -1469,3 +1469,20 @@ inspector(const Arg *arg, void *data) return EINA_TRUE; } +Eina_Bool +toggle_history(const Arg *arg, void *data) +{ + App_Data *ad = data; + Buffer_Data *bd = ad->cur_buf; + + if (bd->history_enabled) { + bd->history_enabled = EINA_FALSE; + update_url(elm_web_uri_get(bd->web), data); + } else { + bd->history_enabled = EINA_TRUE; + update_url(elm_web_uri_get(bd->web), data); + } + + return EINA_TRUE; +} + diff --git a/commands.h b/commands.h @@ -31,6 +31,7 @@ Eina_Bool list(const Arg *, void *); Eina_Bool switch_buffer(const Arg *, void *); Eina_Bool inspector(const Arg *, void *); Eina_Bool proxy(const Arg *, void *); +Eina_Bool toggle_history(const Arg *, void *); // static Eina_Bool fake_key_event(const Arg *, void *); Eina_Bool process_set_line(char *line); diff --git a/keymap.h b/keymap.h @@ -25,6 +25,7 @@ static Key keys[] = { { 0, 'q', "7", quickmark, { .s = "7" } }, { 0, 'q', "8", quickmark, { .s = "8" } }, { 0, 'q', "9", quickmark, { .s = "9" } }, + { "Control", 0, "h", toggle_history, { 0 } }, { 0, 0, "0", scroll, {ScrollJumpTo | DirectionLeft} }, { 0, 0, "$", scroll, {ScrollJumpTo | DirectionRight} }, { 0, 'g', "g", scroll, {ScrollJumpTo | DirectionTop} }, diff --git a/main.h b/main.h @@ -66,6 +66,7 @@ struct _Buffer_Data Evas_Object *web_inspector; Eina_Bool proxy_enabled; + Eina_Bool history_enabled; }; struct dl {