summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commands.c74
-rw-r--r--src/completion.c18
-rw-r--r--src/download.c20
-rw-r--r--src/dwb.c546
-rw-r--r--src/dwb.h140
-rw-r--r--src/session.c2
-rw-r--r--src/util.c24
-rw-r--r--src/view.c54
8 files changed, 433 insertions, 445 deletions
diff --git a/src/commands.c b/src/commands.c
index f9916f76..c1d1c3b3 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -25,7 +25,7 @@ dwb_com_simple_command(KeyMap *km) {
Arg *arg = &km->map->arg;
arg->e = NULL;
- if (dwb.state.mode & AutoComplete) {
+ if (dwb.state.mode & AUTO_COMPLETE) {
dwb_comp_clean_autocompletion();
}
@@ -33,7 +33,7 @@ dwb_com_simple_command(KeyMap *km) {
if (!km->map->hide) {
dwb_set_normal_message(dwb.state.fview, false, "%s:", km->map->n.second);
}
- else if (km->map->hide == AlwaysSM) {
+ else if (km->map->hide == ALWAYS_SM) {
CLEAR_COMMAND_TEXT(dwb.state.fview);
gtk_widget_hide(dwb.gui.entry);
}
@@ -54,7 +54,7 @@ dwb_com_simple_command(KeyMap *km) {
/* dwb_com_set_setting {{{*/
gboolean
dwb_com_set_setting(Arg *arg) {
- dwb.state.mode = SettingsMode;
+ dwb.state.mode = SETTINGS_MODE;
dwb.state.setting_apply = arg->n;
dwb_focus_entry();
return true;
@@ -63,7 +63,7 @@ dwb_com_set_setting(Arg *arg) {
/* dwb_com_set_key {{{*/
gboolean
dwb_com_set_key(Arg *arg) {
- dwb.state.mode = KeyMode;
+ dwb.state.mode = KEY_MODE;
dwb_focus_entry();
return true;
}/*}}}*/
@@ -118,7 +118,7 @@ dwb_com_add_search_field(Arg *a) {
return false;
}
}
- dwb.state.mode = SearchFieldMode;
+ dwb.state.mode = SEARCH_FIELD_MODE;
dwb_set_normal_message(dwb.state.fview, false, "Enter a Keyword for marked search:");
dwb_focus_entry();
FREE(value);
@@ -153,7 +153,7 @@ dwb_com_toggle_proxy(Arg *a) {
gboolean
dwb_com_find(Arg *arg) {
View *v = CURRENT_VIEW();
- dwb.state.mode = FindMode;
+ dwb.state.mode = FIND_MODE;
dwb.state.forward_search = arg->b;
if (v->status->search_string) {
g_free(v->status->search_string);
@@ -180,12 +180,12 @@ dwb_com_resize_master(Arg *arg) {
/* dwb_com_show_hints {{{*/
gboolean
dwb_com_show_hints(Arg *arg) {
- if (dwb.state.nv == OpenNormal)
+ if (dwb.state.nv == OPEN_NORMAL)
dwb.state.nv = arg->n;
- if (dwb.state.mode != HintMode) {
+ if (dwb.state.mode != HINT_MODE) {
gtk_entry_set_text(GTK_ENTRY(dwb.gui.entry), "");
webkit_web_view_execute_script(CURRENT_WEBVIEW(), "dwb_show_hints()");
- dwb.state.mode = HintMode;
+ dwb.state.mode = HINT_MODE;
dwb_focus_entry();
}
return true;
@@ -227,7 +227,7 @@ dwb_com_show_settings(Arg *arg) {
const char *setting_string;
dwb.state.setting_apply = arg->n;
- if ( dwb.state.setting_apply == Global ) {
+ if ( dwb.state.setting_apply == APPLY_GLOBAL ) {
t = dwb.settings;
setting_string = "Global Settings";
}
@@ -246,10 +246,10 @@ dwb_com_show_settings(Arg *arg) {
g_string_append(buffer, HTML_FORM_START);
for (; l; l=l->next) {
WebSettings *m = l->data;
- if (!m->global || (m->global && dwb.state.setting_apply == Global)) {
+ if (!m->global || (m->global && dwb.state.setting_apply == APPLY_GLOBAL)) {
g_string_append(buffer, HTML_DIV_START);
g_string_append_printf(buffer, HTML_DIV_KEYS_TEXT, m->n.first, m->n.second);
- if (m->type == Boolean) {
+ if (m->type == BOOLEAN) {
const char *value = m->arg.b ? "checked" : "";
g_string_append_printf(buffer, HTML_DIV_SETTINGS_CHECKBOX, m->n.first, value);
}
@@ -298,7 +298,7 @@ dwb_com_bookmark(Arg *arg) {
/* dwb_com_quickmark(Arg *arg) {{{*/
gboolean
dwb_com_quickmark(Arg *arg) {
- if (dwb.state.nv == OpenNormal)
+ if (dwb.state.nv == OPEN_NORMAL)
dwb.state.nv = arg->i;
dwb.state.mode = arg->n;
return true;
@@ -368,17 +368,17 @@ dwb_com_scroll(Arg *arg) {
View *v = gl->data;
- GtkAdjustment *a = arg->n == Left || arg->n == Right
+ GtkAdjustment *a = arg->n == SCROLL_LEFT || arg->n == SCROLL_RIGHT
? gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(v->scroll))
: gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(v->scroll));
- int sign = arg->n == Up || arg->n == PageUp || arg->n == HalfPageUp || arg->n == Left ? -1 : 1;
+ int sign = arg->n == SCROLL_UP || arg->n == SCROLL_PAGE_UP || arg->n == SCROLL_HALF_PAGE_UP || arg->n == SCROLL_LEFT ? -1 : 1;
double value = gtk_adjustment_get_value(a);
double inc;
- if (arg->n == PageUp || arg->n == PageDown)
+ if (arg->n == SCROLL_PAGE_UP || arg->n == SCROLL_PAGE_DOWN)
inc = gtk_adjustment_get_page_increment(a);
- else if (arg->n == HalfPageUp || arg->n == HalfPageDown)
+ else if (arg->n == SCROLL_HALF_PAGE_UP || arg->n == SCROLL_HALF_PAGE_DOWN)
inc = gtk_adjustment_get_page_increment(a) / 2;
else
inc = gtk_adjustment_get_step_increment(a);
@@ -386,8 +386,8 @@ dwb_com_scroll(Arg *arg) {
double lower = gtk_adjustment_get_lower(a);
double upper = gtk_adjustment_get_upper(a) - gtk_adjustment_get_page_size(a) + lower;
switch (arg->n) {
- case Top: scroll = lower; break;
- case Bottom: scroll = upper; break;
+ case SCROLL_TOP: scroll = lower; break;
+ case SCROLL_BOTTOM: scroll = upper; break;
default: scroll = value + sign * inc * NN(dwb.state.nummod); break;
}
@@ -416,11 +416,11 @@ dwb_com_set_orientation(Arg *arg) {
l = arg->n;
}
else {
- dwb.state.layout ^= BottomStack;
+ dwb.state.layout ^= BOTTOM_STACK;
l = dwb.state.layout;
}
- gtk_orientable_set_orientation(GTK_ORIENTABLE(dwb.gui.paned), l & BottomStack );
- gtk_orientable_set_orientation(GTK_ORIENTABLE(dwb.gui.right), (l & BottomStack) ^ 1);
+ gtk_orientable_set_orientation(GTK_ORIENTABLE(dwb.gui.paned), l & BOTTOM_STACK );
+ gtk_orientable_set_orientation(GTK_ORIENTABLE(dwb.gui.right), (l & BOTTOM_STACK) ^ 1);
dwb_resize(dwb.state.size);
return true;
}/*}}}*/
@@ -450,7 +450,7 @@ dwb_com_history_forward(Arg *arg) {
/* dwb_com_open(Arg *arg) {{{*/
gboolean
dwb_com_open(Arg *arg) {
- if (dwb.state.nv == OpenNormal)
+ if (dwb.state.nv == OPEN_NORMAL)
dwb.state.nv = arg->n;
if (arg && arg->p) {
@@ -493,8 +493,8 @@ dwb_com_maximized_show(View *v) {
void
dwb_com_toggle_maximized(Arg *arg) {
- dwb.state.layout ^= Maximized;
- if (dwb.state.layout & Maximized) {
+ dwb.state.layout ^= MAXIMIZED;
+ if (dwb.state.layout & MAXIMIZED) {
g_list_foreach(dwb.state.views, (GFunc)dwb_com_maximized_hide, NULL);
if (dwb.state.views == dwb.state.fview) {
gtk_widget_hide(dwb.gui.right);
@@ -566,8 +566,8 @@ dwb_com_remove_view(Arg *arg) {
dwb.state.views = g_list_delete_link(dwb.state.views, gl);
- /* Update Maximized layout */
- if (dwb.state.layout & Maximized) {
+ /* Update MAXIMIZED layout */
+ if (dwb.state.layout & MAXIMIZED) {
gtk_widget_show(CURRENT_VIEW()->vbox);
if (dwb.state.fview == dwb.state.views) {
gtk_widget_hide(dwb.gui.right);
@@ -624,7 +624,7 @@ dwb_com_push_master(Arg *arg) {
dwb.state.views = g_list_concat(gl, dwb.state.views);
dwb_grab_focus(dwb.state.views);
}
- if (dwb.state.layout & Maximized) {
+ if (dwb.state.layout & MAXIMIZED) {
gtk_widget_show(dwb.gui.left);
gtk_widget_hide(dwb.gui.right);
gtk_widget_show(new->vbox);
@@ -643,7 +643,7 @@ dwb_com_focus_next(Arg *arg) {
return false;
}
if (gl->next) {
- if (dwb.state.layout & Maximized) {
+ if (dwb.state.layout & MAXIMIZED) {
if (gl == dwb.state.views) {
gtk_widget_hide(dwb.gui.left);
gtk_widget_show(dwb.gui.right);
@@ -654,7 +654,7 @@ dwb_com_focus_next(Arg *arg) {
dwb_focus(gl->next);
}
else {
- if (dwb.state.layout & Maximized) {
+ if (dwb.state.layout & MAXIMIZED) {
gtk_widget_hide(dwb.gui.right);
gtk_widget_show(dwb.gui.left);
gtk_widget_show(((View *)dwb.state.views->data)->vbox);
@@ -674,7 +674,7 @@ dwb_com_focus_prev(Arg *arg) {
}
if (gl == dwb.state.views) {
GList *last = g_list_last(dwb.state.views);
- if (dwb.state.layout & Maximized) {
+ if (dwb.state.layout & MAXIMIZED) {
gtk_widget_hide(dwb.gui.left);
gtk_widget_show(dwb.gui.right);
gtk_widget_show(((View *)last->data)->vbox);
@@ -683,7 +683,7 @@ dwb_com_focus_prev(Arg *arg) {
dwb_focus(last);
}
else {
- if (dwb.state.layout & Maximized) {
+ if (dwb.state.layout & MAXIMIZED) {
if (gl == dwb.state.views->next) {
gtk_widget_hide(dwb.gui.right);
gtk_widget_show(dwb.gui.left);
@@ -705,7 +705,7 @@ dwb_com_focus_nth_view(Arg *arg) {
if (!l)
return false;
if (l != dwb.state.fview) {
- if (dwb.state.layout & Maximized) {
+ if (dwb.state.layout & MAXIMIZED) {
if (l == dwb.state.views) {
gtk_widget_hide(dwb.gui.right);
gtk_widget_show(dwb.gui.left);
@@ -766,7 +766,7 @@ dwb_com_paste(Arg *arg) {
char *text = NULL;
if ( (text = gtk_clipboard_wait_for_text(clipboard)) ) {
- if (dwb.state.nv == OpenNormal)
+ if (dwb.state.nv == OPEN_NORMAL)
dwb.state.nv = arg->n;
Arg a = { .p = text };
dwb_load_uri(&a);
@@ -880,8 +880,8 @@ dwb_com_entry_history_back(Arg *a) {
gboolean
dwb_com_save_session(Arg *arg) {
- if (arg->n == NormalMode) {
- dwb.state.mode = SaveSession;
+ if (arg->n == NORMAL_MODE) {
+ dwb.state.mode = SAVE_SESSION;
dwb_session_save(NULL);
dwb_end();
}
@@ -900,7 +900,7 @@ dwb_com_bookmarks(Arg *arg) {
if (!g_list_length(dwb.fc.bookmarks)) {
return false;
}
- if (dwb.state.nv == OpenNormal)
+ if (dwb.state.nv == OPEN_NORMAL)
dwb.state.nv = arg->n;
dwb_focus_entry();
dwb_comp_complete(COMP_BOOKMARK, 0);
diff --git a/src/completion.c b/src/completion.c
index 82b42b95..b4ba0377 100644
--- a/src/completion.c
+++ b/src/completion.c
@@ -168,7 +168,7 @@ dwb_comp_clean_completion() {
gtk_widget_destroy(CURRENT_VIEW()->compbox);
dwb.comps.completions = NULL;
dwb.comps.active_comp = NULL;
- dwb.state.mode &= ~CompletionMode;
+ dwb.state.mode &= ~COMPLETION_MODE;
}/*}}}*/
/* dwb_comp_show_completion(int back) {{{*/
@@ -223,14 +223,14 @@ dwb_comp_get_simple_completion(GList *gl) {
/* dwb_completion_get_settings return: GList *Completions{{{*/
static GList *
dwb_comp_get_settings_completion() {
- GList *l = g_hash_table_get_values(dwb.state.setting_apply == Global ? dwb.settings : CURRENT_VIEW()->setting);
+ GList *l = g_hash_table_get_values(dwb.state.setting_apply == APPLY_GLOBAL ? dwb.settings : CURRENT_VIEW()->setting);
l = g_list_sort(l, (GCompareFunc)dwb_util_web_settings_sort_first);
const char *input = GET_TEXT();
GList *list = NULL;
for (; l; l=l->next) {
WebSettings *s = l->data;
- if (dwb.state.setting_apply == Global || !s->global) {
+ if (dwb.state.setting_apply == APPLY_GLOBAL || !s->global) {
Navigation n = s->n;
if (g_strrstr(n.first, input)) {
char *value = dwb_util_arg_to_char(&s->arg, s->type);
@@ -272,7 +272,7 @@ dwb_comp_get_key_completion(gboolean entry) {
void
dwb_comp_complete(CompletionType type, int back) {
View *v = CURRENT_VIEW();
- if ( !(dwb.state.mode & CompletionMode) ) {
+ if ( !(dwb.state.mode & COMPLETION_MODE) ) {
v->compbox = gtk_vbox_new(true, 0);
gtk_box_pack_end(GTK_BOX(v->bottombox), v->compbox, false, false, 0);
switch (type) {
@@ -290,7 +290,7 @@ dwb_comp_complete(CompletionType type, int back) {
return;
}
dwb_comp_show_completion(back);
- dwb.state.mode |= CompletionMode;
+ dwb.state.mode |= COMPLETION_MODE;
}
else if (dwb.comps.completions && dwb.comps.active_comp) {
dwb.comps.active_comp = dwb_comp_update_completion(v->compbox, dwb.comps.completions, dwb.comps.active_comp, dwb.misc.max_c_items, back);
@@ -324,7 +324,7 @@ dwb_comp_clean_autocompletion() {
gtk_widget_destroy(CURRENT_VIEW()->autocompletion);
dwb.comps.auto_c = NULL;
dwb.comps.active_auto_c = NULL;
- dwb.state.mode &= ~AutoComplete;
+ dwb.state.mode &= ~AUTO_COMPLETE;
View *v = CURRENT_VIEW();
gtk_widget_show(v->entry);
@@ -370,8 +370,8 @@ dwb_comp_autocomplete(GList *gl, GdkEventKey *e) {
}
View *v = CURRENT_VIEW();
- if (! (dwb.state.mode & AutoComplete) && gl) {
- dwb.state.mode |= AutoComplete;
+ if (! (dwb.state.mode & AUTO_COMPLETE) && gl) {
+ dwb.state.mode |= AUTO_COMPLETE;
dwb.comps.auto_c = dwb_comp_init_autocompletion(gl);
dwb.comps.active_auto_c = g_list_first(dwb.comps.auto_c);
dwb_comp_modify_completion_item(dwb.comps.active_auto_c->data, &dwb.color.active_c_fg, &dwb.color.active_c_bg, dwb.font.fd_bold);
@@ -456,7 +456,7 @@ dwb_comp_init_path_completion(int back) {
char *text = gtk_editable_get_chars(GTK_EDITABLE(dwb.gui.entry), 0, -1);
dwb.comps.path_completion = g_list_append(NULL, g_strdup(text));
- if (dwb.state.dl_action == Execute && text[0] != '/') {
+ if (dwb.state.dl_action == DL_ACTION_EXECUTE && text[0] != '/') {
GList *list = dwb_comp_get_binaries(NULL, text);
list = g_list_sort(list, (GCompareFunc)strcmp);
dwb.comps.path_completion = g_list_concat(dwb.comps.path_completion, list);
diff --git a/src/download.c b/src/download.c
index 75772229..51d04c8c 100644
--- a/src/download.c
+++ b/src/download.c
@@ -151,7 +151,7 @@ dwb_dl_status_cb(WebKitDownload *download) {
GList *list = dwb_dl_get_download_label(download);
if (list) {
DwbDownload *label = list->data;
- if (label->action == Execute && status == WEBKIT_DOWNLOAD_STATUS_FINISHED) {
+ if (label->action == DL_ACTION_EXECUTE && status == WEBKIT_DOWNLOAD_STATUS_FINISHED) {
dwb_dl_spawn(label);
}
gtk_widget_destroy(label->event);
@@ -229,7 +229,7 @@ dwb_dl_start() {
filename = "dwb_download";
}
- if (dwb.state.dl_action == Execute) {
+ if (dwb.state.dl_action == DL_ACTION_EXECUTE) {
fullpath = g_build_filename("file:///tmp", filename, NULL);
}
else {
@@ -245,7 +245,7 @@ dwb_dl_start() {
}
}
- if (external && dwb.state.dl_action == Download) {
+ if (external && dwb.state.dl_action == DL_ACTION_DOWNLOAD) {
const char *uri = webkit_download_get_uri(dwb.state.download);
command = dwb_get_download_command(uri, fullpath);
if (!g_spawn_command_line_async(command, NULL)) {
@@ -265,7 +265,7 @@ dwb_dl_start() {
webkit_download_start(dwb.state.download);
}
FREE(lastdir);
- if (dwb.state.dl_action != Execute) {
+ if (dwb.state.dl_action != DL_ACTION_EXECUTE) {
lastdir = g_strdup(path);
}
@@ -302,11 +302,11 @@ void
dwb_dl_get_path(GList *gl, WebKitDownload *d) {
char *command;
dwb_focus_entry();
- dwb.state.mode = DownloadGetPath;
+ dwb.state.mode = DOWNLOAD_GET_PATH;
dwb.state.download = d;
if ( dwb.state.mimetype_request && (command = dwb_get_command_from_mimetype(dwb.state.mimetype_request)) ) {
- dwb.state.dl_action = Execute;
+ dwb.state.dl_action = DL_ACTION_EXECUTE;
dwb_dl_entry_set_spawn_command(command);
}
else {
@@ -317,13 +317,13 @@ dwb_dl_get_path(GList *gl, WebKitDownload *d) {
/* dwb_dl_set_execute {{{*/
void
dwb_dl_set_execute(Arg *arg) {
- if (dwb.state.mode == DownloadGetPath) {
- if (dwb.state.dl_action == Download) {
- dwb.state.dl_action = Execute;
+ if (dwb.state.mode == DOWNLOAD_GET_PATH) {
+ if (dwb.state.dl_action == DL_ACTION_DOWNLOAD) {
+ dwb.state.dl_action = DL_ACTION_EXECUTE;
dwb_dl_entry_set_spawn_command(NULL);
}
else {
- dwb.state.dl_action = Download;
+ dwb.state.dl_action = DL_ACTION_DOWNLOAD;
dwb_dl_entry_set_directory();
}
}
diff --git a/src/dwb.c b/src/dwb.c
index 83f6c57e..fe3209ec 100644
--- a/src/dwb.c
+++ b/src/dwb.c
@@ -85,249 +85,250 @@ static char *restore = NULL;
/* FUNCTION_MAP{{{*/
static FunctionMap FMAP [] = {
- { { "add_view", "Add a new view", }, 1, (Func)dwb_add_view, NULL, AlwaysSM, { .p = NULL }, },
- { { "allow_cookie", "Cookie allowed", }, 0, (Func)dwb_com_allow_cookie, "No cookie in current context", PostSM, },
- { { "bookmark", "Bookmark current page", }, 1, (Func)dwb_com_bookmark, NO_URL, PostSM, },
- { { "bookmarks", "Bookmarks", }, 0, (Func)dwb_com_bookmarks, "No Bookmarks", NeverSM, { .n = OpenNormal }, },
- { { "bookmarks_nv", "Bookmarks new view", }, 0, (Func)dwb_com_bookmarks, "No Bookmarks", NeverSM, { .n = OpenNewView }, },
- { { "bookmarks_nw", "Bookmarks new window", }, 0, (Func)dwb_com_bookmarks, "No Bookmarks", NeverSM, { .n = OpenNewWindow}, },
- { { "new_view", "New view for next navigation", }, 0, (Func)dwb_com_new_window_or_view, NULL, NeverSM, { .n = OpenNewView}, },
- { { "new_window", "New window for next navigation", }, 0, (Func)dwb_com_new_window_or_view, NULL, NeverSM, { .n = OpenNewWindow}, },
- { { "command_mode", "Enter command mode", }, 0, (Func)dwb_command_mode, NULL, PostSM, },
- { { "decrease_master", "Decrease master area", }, 1, (Func)dwb_com_resize_master, "Cannot decrease further", AlwaysSM, { .n = 5 } },
- { { "download_hint", "Download via hints", }, 0, (Func)dwb_com_show_hints, NO_HINTS, NeverSM, { .n = OpenDownload }, },
- { { "find_backward", "Find Backward ", }, 0, (Func)dwb_com_find, NO_URL, NeverSM, { .b = false }, },
- { { "find_forward", "Find Forward ", }, 0, (Func)dwb_com_find, NO_URL, NeverSM, { .b = true }, },
- { { "find_next", "Find next", }, 0, (Func)dwb_search, "No matches", AlwaysSM, { .b = true }, },
- { { "find_previous", "Find previous", }, 0, (Func)dwb_search, "No matches", AlwaysSM, { .b = false }, },
- { { "focus_input", "Focus input", }, 1, (Func)dwb_com_focus_input, "No input found in current context", AlwaysSM, },
- { { "focus_next", "Focus next view", }, 0, (Func)dwb_com_focus_next, "No other view", AlwaysSM, },
- { { "focus_prev", "Focus previous view", }, 0, (Func)dwb_com_focus_prev, "No other view", AlwaysSM, },
- { { "focus_nth_view", "Focus nth view", }, 0, (Func)dwb_com_focus_nth_view, "No such view", AlwaysSM, { 0 } },
- { { "hint_mode", "Follow hints", }, 0, (Func)dwb_com_show_hints, NO_HINTS, NeverSM, { .n = OpenNormal }, },
- { { "hint_mode_nv", "Follow hints (new view)", }, 0, (Func)dwb_com_show_hints, NO_HINTS, NeverSM, { .n = OpenNewView }, },
- { { "hint_mode_nw", "Follow hints (new window)", }, 0, (Func)dwb_com_show_hints, NO_HINTS, NeverSM, { .n = OpenNewWindow }, },
- { { "history_back", "Go Back", }, 1, (Func)dwb_com_history_back, "Beginning of History", AlwaysSM, },
- { { "history_forward", "Go Forward", }, 1, (Func)dwb_com_history_forward, "End of History", AlwaysSM, },
- { { "increase_master", "Increase master area", }, 1, (Func)dwb_com_resize_master, "Cannot increase further", AlwaysSM, { .n = -5 } },
- { { "insert_mode", "Insert Mode", }, 0, (Func)dwb_insert_mode, NULL, AlwaysSM, },
- { { "open", "Open", }, 1, (Func)dwb_com_open, NULL, NeverSM, { .n = OpenNormal, .p = NULL } },
- { { "open_nv", "Viewopen", }, 1, (Func)dwb_com_open, NULL, NeverSM, { .n = OpenNewView, .p = NULL } },
- { { "open_nw", "Winopen", }, 1, (Func)dwb_com_open, NULL, NeverSM, { .n = OpenNewWindow, .p = NULL } },
- { { "open_quickmark", "Quickmark", }, 0, (Func)dwb_com_quickmark, NO_URL, NeverSM, { .n = QuickmarkOpen, .i=OpenNormal }, },
- { { "open_quickmark_nv", "Quickmark-new-view", }, 0, (Func)dwb_com_quickmark, NULL, NeverSM, { .n = QuickmarkOpen, .i=OpenNewView }, },
- { { "open_quickmark_nw", "Quickmark-new-window", }, 0, (Func)dwb_com_quickmark, NULL, NeverSM, { .n = QuickmarkOpen, .i=OpenNewWindow }, },
- { { "open_start_page", "Open startpage", }, 1, (Func)dwb_com_open_startpage, "No startpage set", AlwaysSM, },
- { { "push_master", "Push to master area", }, 1, (Func)dwb_com_push_master, "No other view", AlwaysSM, },
- { { "reload", "Reload", }, 1, (Func)dwb_com_reload, NULL, AlwaysSM, },
- { { "remove_view", "Close view", }, 1, (Func)dwb_com_remove_view, NULL, AlwaysSM, },
- { { "save_quickmark", "Save a quickmark for this page", }, 0, (Func)dwb_com_quickmark, NO_URL, NeverSM, { .n = QuickmarkSave }, },
- { { "save_search_field", "Add a new searchengine", }, 0, (Func)dwb_com_add_search_field, "No input in current context", PostSM, },
- { { "scroll_bottom", "Scroll to bottom of the page", }, 1, (Func)dwb_com_scroll, NULL, AlwaysSM, { .n = Bottom }, },
- { { "scroll_down", "Scroll down", }, 0, (Func)dwb_com_scroll, "Bottom of the page", AlwaysSM, { .n = Down, }, },
- { { "scroll_left", "Scroll left", }, 0, (Func)dwb_com_scroll, "Left side of the page", AlwaysSM, { .n = Left }, },
- { { "scroll_halfpage_down", "Scroll one-half page down", }, 0, (Func)dwb_com_scroll, "Bottom of the page", AlwaysSM, { .n = HalfPageDown, }, },
- { { "scroll_halfpage_up", "Scroll one-half page up", }, 0, (Func)dwb_com_scroll, "Top of the page", AlwaysSM, { .n = HalfPageUp, }, },
- { { "scroll_page_down", "Scroll one page down", }, 0, (Func)dwb_com_scroll, "Bottom of the page", AlwaysSM, { .n = PageDown, }, },
- { { "scroll_page_up", "Scroll one page up", }, 0, (Func)dwb_com_scroll, "Top of the page", AlwaysSM, { .n = PageUp, }, },
- { { "scroll_right", "Scroll left", }, 0, (Func)dwb_com_scroll, "Right side of the page", AlwaysSM, { .n = Right }, },
- { { "scroll_top", "Scroll to the top of the page", }, 1, (Func)dwb_com_scroll, NULL, AlwaysSM, { .n = Top }, },
- { { "scroll_up", "Scroll up", }, 0, (Func)dwb_com_scroll, "Top of the page", AlwaysSM, { .n = Up, }, },
- { { "set_global_setting", "Set global property", }, 0, (Func)dwb_com_set_setting, NULL, NeverSM, { .n = Global } },
- { { "set_key", "Set keybinding", }, 0, (Func)dwb_com_set_key, NULL, NeverSM, { 0 } },
- { { "set_setting", "Set property", }, 0, (Func)dwb_com_set_setting, NULL, NeverSM, { .n = PerView } },
- { { "show_global_settings", "Show global settings", }, 1, (Func)dwb_com_show_settings, NULL, AlwaysSM, { .n = Global } },
- { { "show_keys", "Key configuration", }, 1, (Func)dwb_com_show_keys, NULL, AlwaysSM, },
- { { "show_settings", "Settings", }, 1, (Func)dwb_com_show_settings, NULL, AlwaysSM, { .n = PerView } },
- { { "toggle_bottomstack", "Toggle bottomstack", }, 1, (Func)dwb_com_set_orientation, NULL, AlwaysSM, },
- { { "toggle_encoding", "Toggle Custom encoding", }, 1, (Func)dwb_com_toggle_custom_encoding, NULL, PostSM, },
- { { "toggle_maximized", "Toggle maximized", }, 1, (Func)dwb_com_toggle_maximized, NULL, AlwaysSM, },
- { { "view_source", "View source", }, 1, (Func)dwb_com_view_source, NULL, AlwaysSM, },
- { { "zoom_in", "Zoom in", }, 1, (Func)dwb_com_zoom_in, "Cannot zoom in further", AlwaysSM, },
- { { "zoom_normal", "Zoom 100%", }, 1, (Func)dwb_com_set_zoom_level, NULL, AlwaysSM, { .d = 1.0, .p = NULL } },
- { { "zoom_out", "Zoom out", }, 1, (Func)dwb_com_zoom_out, "Cannot zoom out further", AlwaysSM, },
+ { { "add_view", "Add a new view", }, 1, (Func)dwb_add_view, NULL, ALWAYS_SM, { .p = NULL }, },
+ { { "allow_cookie", "Cookie allowed", }, 0, (Func)dwb_com_allow_cookie, "No cookie in current context", POST_SM, },
+ { { "bookmark", "Bookmark current page", }, 1, (Func)dwb_com_bookmark, NO_URL, POST_SM, },
+ { { "bookmarks", "Bookmarks", }, 0, (Func)dwb_com_bookmarks, "No Bookmarks", NEVER_SM, { .n = OPEN_NORMAL }, },
+ { { "bookmarks_nv", "Bookmarks new view", }, 0, (Func)dwb_com_bookmarks, "No Bookmarks", NEVER_SM, { .n = OPEN_NEW_VIEW }, },
+ { { "bookmarks_nw", "Bookmarks new window", }, 0, (Func)dwb_com_bookmarks, "No Bookmarks", NEVER_SM, { .n = OPEN_NEW_WINDOW}, },
+ { { "new_view", "New view for next navigation", }, 0, (Func)dwb_com_new_window_or_view, NULL, NEVER_SM, { .n = OPEN_NEW_VIEW}, },
+ { { "new_window", "New window for next navigation", }, 0, (Func)dwb_com_new_window_or_view, NULL, NEVER_SM, { .n = OPEN_NEW_WINDOW}, },
+ { { "command_mode", "Enter command mode", }, 0, (Func)dwb_command_mode, NULL, POST_SM, },
+ { { "decrease_master", "Decrease master area", }, 1, (Func)dwb_com_resize_master, "Cannot decrease further", ALWAYS_SM, { .n = 5 } },
+ { { "download_hint", "Download via hints", }, 0, (Func)dwb_com_show_hints, NO_HINTS, NEVER_SM, { .n = OPEN_DOWNLOAD }, },
+ { { "find_backward", "Find Backward ", }, 0, (Func)dwb_com_find, NO_URL, NEVER_SM, { .b = false }, },
+ { { "find_forward", "Find Forward ", }, 0, (Func)dwb_com_find, NO_URL, NEVER_SM, { .b = true }, },
+ { { "find_next", "Find next", }, 0, (Func)dwb_search, "No matches", ALWAYS_SM, { .b = true }, },
+ { { "find_previous", "Find previous", }, 0, (Func)dwb_search, "No matches", ALWAYS_SM, { .b = false }, },
+ { { "focus_input", "Focus input", }, 1, (Func)dwb_com_focus_input, "No input found in current context", ALWAYS_SM, },
+ { { "focus_next", "Focus next view", }, 0, (Func)dwb_com_focus_next, "No other view", ALWAYS_SM, },
+ { { "focus_prev", "Focus previous view", }, 0, (Func)dwb_com_focus_prev, "No other view", ALWAYS_SM, },
+ { { "focus_nth_view", "Focus nth view", }, 0, (Func)dwb_com_focus_nth_view, "No such view", ALWAYS_SM, { 0 } },
+ { { "hint_mode", "Follow hints", }, 0, (Func)dwb_com_show_hints, NO_HINTS, NEVER_SM, { .n = OPEN_NORMAL }, },
+ { { "hint_mode_nv", "Follow hints (new view)", }, 0, (Func)dwb_com_show_hints, NO_HINTS, NEVER_SM, { .n = OPEN_NEW_VIEW }, },
+ { { "hint_mode_nw", "Follow hints (new window)", }, 0, (Func)dwb_com_show_hints, NO_HINTS, NEVER_SM, { .n = OPEN_NEW_WINDOW }, },
+ { { "history_back", "Go Back", }, 1, (Func)dwb_com_history_back, "Beginning of History", ALWAYS_SM, },
+ { { "history_forward", "Go Forward", }, 1, (Func)dwb_com_history_forward, "End of History", ALWAYS_SM, },
+ { { "increase_master", "Increase master area", }, 1, (Func)dwb_com_resize_master, "Cannot increase further", ALWAYS_SM, { .n = -5 } },
+ { { "insert_mode", "Insert Mode", }, 0, (Func)dwb_insert_mode, NULL, ALWAYS_SM, },
+ { { "open", "Open", }, 1, (Func)dwb_com_open, NULL, NEVER_SM, { .n = OPEN_NORMAL, .p = NULL } },
+ { { "open_nv", "Viewopen", }, 1, (Func)dwb_com_open, NULL, NEVER_SM, { .n = OPEN_NEW_VIEW, .p = NULL } },
+ { { "open_nw", "Winopen", }, 1, (Func)dwb_com_open, NULL, NEVER_SM, { .n = OPEN_NEW_WINDOW, .p = NULL } },
+ { { "open_quickmark", "Quickmark", }, 0, (Func)dwb_com_quickmark, NO_URL, NEVER_SM, { .n = QUICK_MARK_OPEN, .i=OPEN_NORMAL }, },
+ { { "open_quickmark_nv", "Quickmark-new-view", }, 0, (Func)dwb_com_quickmark, NULL, NEVER_SM, { .n = QUICK_MARK_OPEN, .i=OPEN_NEW_VIEW }, },
+ { { "open_quickmark_nw", "Quickmark-new-window", }, 0, (Func)dwb_com_quickmark, NULL, NEVER_SM, { .n = QUICK_MARK_OPEN, .i=OPEN_NEW_WINDOW }, },
+ { { "open_start_page", "Open startpage", }, 1, (Func)dwb_com_open_startpage, "No startpage set", ALWAYS_SM, },
+ { { "push_master", "Push to master area", }, 1, (Func)dwb_com_push_master, "No other view", ALWAYS_SM, },
+ { { "reload", "Reload", }, 1, (Func)dwb_com_reload, NULL, ALWAYS_SM, },
+ { { "remove_view", "Close view", }, 1, (Func)dwb_com_remove_view, NULL, ALWAYS_SM, },
+ { { "save_quickmark", "Save a quickmark for this page", }, 0, (Func)dwb_com_quickmark, NO_URL, NEVER_SM, { .n = QUICK_MARK_SAVE }, },
+ { { "save_search_field", "Add a new searchengine", }, 0, (Func)dwb_com_add_search_field, "No input in current context", POST_SM, },
+ { { "scroll_bottom", "Scroll to bottom of the page", }, 1, (Func)dwb_com_scroll, NULL, ALWAYS_SM, { .n = SCROLL_BOTTOM }, },
+ { { "scroll_down", "Scroll down", }, 0, (Func)dwb_com_scroll, "Bottom of the page", ALWAYS_SM, { .n = SCROLL_DOWN, }, },
+ { { "scroll_left", "Scroll left", }, 0, (Func)dwb_com_scroll, "Left side of the page", ALWAYS_SM, { .n = SCROLL_LEFT }, },
+ { { "scroll_halfpage_down", "Scroll one-half page down", }, 0, (Func)dwb_com_scroll, "Bottom of the page", ALWAYS_SM, { .n = SCROLL_HALF_PAGE_DOWN, }, },
+ { { "scroll_halfpage_up", "Scroll one-half page up", }, 0, (Func)dwb_com_scroll, "Top of the page", ALWAYS_SM, { .n = SCROLL_HALF_PAGE_UP, }, },
+ { { "scroll_page_down", "Scroll one page down", }, 0, (Func)dwb_com_scroll, "Bottom of the page", ALWAYS_SM, { .n = SCROLL_PAGE_DOWN, }, },
+ { { "scroll_page_up", "Scroll one page up", }, 0, (Func)dwb_com_scroll, "Top of the page", ALWAYS_SM, { .n = SCROLL_PAGE_UP, }, },
+ { { "scroll_right", "Scroll left", }, 0, (Func)dwb_com_scroll, "Right side of the page", ALWAYS_SM, { .n = SCROLL_RIGHT }, },
+ { { "scroll_top", "Scroll to the top of the page", }, 1, (Func)dwb_com_scroll, NULL, ALWAYS_SM, { .n = SCROLL_TOP }, },
+ { { "scroll_up", "Scroll up", }, 0, (Func)dwb_com_scroll, "Top of the page", ALWAYS_SM, { .n = SCROLL_UP, }, },
+ { { "set_global_setting", "Set global property", }, 0, (Func)dwb_com_set_setting, NULL, NEVER_SM, { .n = APPLY_GLOBAL } },
+ { { "set_key", "Set keybinding", }, 0, (Func)dwb_com_set_key, NULL, NEVER_SM, { 0 } },
+ { { "set_setting", "Set property", }, 0, (Func)dwb_com_set_setting, NULL, NEVER_SM, { .n = APPLY_PER_VIEW } },
+ { { "show_global_settings", "Show global settings", }, 1, (Func)dwb_com_show_settings, NULL, ALWAYS_SM, { .n = APPLY_GLOBAL } },
+ { { "show_keys", "Key configuration", }, 1, (Func)dwb_com_show_keys, NULL, ALWAYS_SM, },
+ { { "show_settings", "Settings", }, 1, (Func)dwb_com_show_settings, NULL, ALWAYS_SM, { .n = APPLY_PER_VIEW } },
+ { { "toggle_bottomstack", "Toggle bottomstack", }, 1, (Func)dwb_com_set_orientation, NULL, ALWAYS_SM, },
+ { { "toggle_encoding", "Toggle Custom encoding", }, 1, (Func)dwb_com_toggle_custom_encoding, NULL, POST_SM, },
+ { { "toggle_maximized", "Toggle maximized", }, 1, (Func)dwb_com_toggle_maximized, NULL, ALWAYS_SM, },
+ { { "view_source", "View source", }, 1, (Func)dwb_com_view_source, NULL, ALWAYS_SM, },
+ { { "zoom_in", "Zoom in", }, 1, (Func)dwb_com_zoom_in, "Cannot zoom in further", ALWAYS_SM, },
+ { { "zoom_normal", "Zoom 100%", }, 1, (Func)dwb_com_set_zoom_level, NULL, ALWAYS_SM, { .d = 1.0, .p = NULL } },
+ { { "zoom_out", "Zoom out", }, 1, (Func)dwb_com_zoom_out, "Cannot zoom out further", ALWAYS_SM, },
// yank and paste
- { { "yank", "Yank", }, 1, (Func)dwb_com_yank, NO_URL, PostSM, { .p = GDK_NONE } },
- { { "yank_primary", "Yank to Primary selection", }, 1, (Func)dwb_com_yank, NO_URL, PostSM, { .p = GDK_SELECTION_PRIMARY } },
- { { "paste", "Paste", }, 1, (Func)dwb_com_paste, "Clipboard is empty", AlwaysSM, { .n = OpenNormal, .p = GDK_NONE } },
- { { "paste_primary", "Paste primary selection", }, 1, (Func)dwb_com_paste, "No primary selection", AlwaysSM, { .n = OpenNormal, .p = GDK_SELECTION_PRIMARY } },
- { { "paste_nv", "Paste, new view", }, 1, (Func)dwb_com_paste, "Clipboard is empty", AlwaysSM, { .n = OpenNewView, .p = GDK_NONE } },
- { { "paste_primary_nv", "Paste primary selection, new view", }, 1, (Func)dwb_com_paste, "No primary selection", AlwaysSM, { .n = OpenNewView, .p = GDK_SELECTION_PRIMARY } },
- { { "paste_nw", "Paste, new window", }, 1, (Func)dwb_com_paste, "Clipboard is empty", AlwaysSM, { .n = OpenNewWindow, .p = GDK_NONE } },
- { { "paste_primary_nw", "Paste primary selection, new window", }, 1, (Func)dwb_com_paste, "No primary selection", AlwaysSM, { .n = OpenNewWindow, .p = GDK_SELECTION_PRIMARY } },
-
- { { "save_session", "Save current session", }, 1, (Func)dwb_com_save_session, NULL, AlwaysSM, { .n = NormalMode } },
- { { "save_named_session", "Save current session with name", }, 0, (Func)dwb_com_save_session, NULL, PostSM, { .n = SaveSession } },
- { { "save", "Save all configuration files", }, 1, (Func)dwb_com_save_files, NULL, PostSM, { .n = SaveSession } },
- { { "undo", "Undo closing last tab", }, 1, (Func)dwb_com_undo, "No more closed views", PostSM },
+ { { "yank", "Yank", }, 1, (Func)dwb_com_yank, NO_URL, POST_SM, { .p = GDK_NONE } },
+ { { "yank_primary", "Yank to Primary selection", }, 1, (Func)dwb_com_yank, NO_URL, POST_SM, { .p = GDK_SELECTION_PRIMARY } },
+ { { "paste", "Paste", }, 1, (Func)dwb_com_paste, "Clipboard is empty", ALWAYS_SM, { .n = OPEN_NORMAL, .p = GDK_NONE } },
+ { { "paste_primary", "Paste primary selection", }, 1, (Func)dwb_com_paste, "No primary selection", ALWAYS_SM, { .n = OPEN_NORMAL, .p = GDK_SELECTION_PRIMARY } },
+ { { "paste_nv", "Paste, new view", }, 1, (Func)dwb_com_paste, "Clipboard is empty", ALWAYS_SM, { .n = OPEN_NEW_VIEW, .p = GDK_NONE } },
+ { { "paste_primary_nv", "Paste primary selection, new view", }, 1, (Func)dwb_com_paste, "No primary selection", ALWAYS_SM, { .n = OPEN_NEW_VIEW, .p = GDK_SELECTION_PRIMARY } },
+ { { "paste_nw", "Paste, new window", }, 1, (Func)dwb_com_paste, "Clipboard is empty", ALWAYS_SM, { .n = OPEN_NEW_WINDOW, .p = GDK_NONE } },
+ { { "paste_primary_nw", "Paste primary selection, new window", }, 1, (Func)dwb_com_paste, "No primary selection", ALWAYS_SM, { .n = OPEN_NEW_WINDOW, .p = GDK_SELECTION_PRIMARY } },
+
+ { { "save_session", "Save current session", }, 1, (Func)dwb_com_save_session, NULL, ALWAYS_SM, { .n = NORMAL_MODE } },
+ { { "save_named_session", "Save current session with name", }, 0, (Func)dwb_com_save_session, NULL, POST_SM, { .n = SAVE_SESSION } },
+ { { "save", "Save all configuration files", }, 1, (Func)dwb_com_save_files, NULL, POST_SM, { .n = SAVE_SESSION } },
+ { { "undo", "Undo closing last tab", }, 1, (Func)dwb_com_undo, "No more closed views", POST_SM },
//Entry editing
- { { "entry_delete_word", "Delete word", }, 0, (Func)dwb_com_entry_delete_word, NULL, AlwaysSM, { 0 }, true, },
- { { "entry_delete_letter", "Delete a single letter", }, 0, (Func)dwb_com_entry_delete_letter, NULL, AlwaysSM, { 0 }, true, },
- { { "entry_delete_line", "Delete to beginning of the line", }, 0, (Func)dwb_com_entry_delete_line, NULL, AlwaysSM, { 0 }, true, },
- { { "entry_word_forward", "Move cursor forward on word", }, 0, (Func)dwb_com_entry_word_forward, NULL, AlwaysSM, { 0 }, true, },
- { { "entry_word_back", "Move cursor back on word", }, 0, (Func)dwb_com_entry_word_back, NULL, AlwaysSM, { 0 }, true, },
- { { "entry_history_back", "Command history back", }, 0, (Func)dwb_com_entry_history_back, NULL, AlwaysSM, { 0 }, true, },
- { { "entry_history_forward", "Command history forward", }, 0, (Func)dwb_com_entry_history_forward, NULL, AlwaysSM, { 0 }, true, },
- { { "download_set_execute", "Complete binaries", }, 0, (Func)dwb_dl_set_execute, NULL, AlwaysSM, { 0 }, true, },
- { { "complete_history", "Complete browsing history", }, 0, (Func)dwb_com_complete_type, NULL, AlwaysSM, { .n = COMP_HISTORY }, true, },
- { { "complete_bookmarks", "Complete bookmarks", }, 0, (Func)dwb_com_complete_type, NULL, AlwaysSM, { .n = COMP_BOOKMARK }, true, },
- { { "complete_commands", "Complete command history", }, 0, (Func)dwb_com_complete_type, NULL, AlwaysSM, { .n = COMP_INPUT }, true, },
- { { "complete_searchengines", "Complete searchengines", }, 0, (Func)dwb_com_complete_type, NULL, AlwaysSM, { .n = COMP_SEARCH }, true, },
- { { "complete_userscript", "Complete userscripts", }, 0, (Func)dwb_com_complete_type, NULL, AlwaysSM, { .n = COMP_USERSCRIPT }, true, },
-
- { { "spell_checking", "Setting: spell checking", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "enable-spell-checking" } },
- { { "scripts", "Setting: scripts", }, 1, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "enable-scripts" } },
- { { "auto_shrink_images", "Toggle autoshrink images", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "auto-shrink-images" } },
- { { "autoload_images", "Toggle autoload images", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "auto-load-images" } },
- { { "autoresize_window", "Toggle autoresize window", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "auto-resize-window" } },
- { { "caret_browsing", "Toggle caret browsing", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "enable-caret-browsing" } },
- { { "default_context_menu", "Toggle enable default context menu", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "enable-default-context-menu" } },
- { { "file_access_from_file_uris", "Toggle file access from file uris", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "enable-file-acces-from-file-uris" } },
- { { "universal file_access_from_file_uris", "Toggle universal file access from file uris", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "enable-universal-file-acces-from-file-uris" } },
- { { "java_applets", "Toggle java applets", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "enable-java-applets" } },
- { { "plugins", "Toggle plugins", }, 1, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "enable-plugins" } },
- { { "private_browsing", "Toggle private browsing", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "enable-private-browsing" } },
- { { "page_cache", "Toggle page cache", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "enable-page-cache" } },
- { { "js_can_open_windows", "Toggle Javascript can open windows automatically", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "javascript-can-open-windows-automatically" } },
- { { "enforce_96_dpi", "Toggle enforce a resolution of 96 dpi", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "enforce-96-dpi" } },
- { { "print_backgrounds", "Toggle print backgrounds", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "print-backgrounds" } },
- { { "resizable_text_areas", "Toggle resizable text areas", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "resizable-text-areas" } },
- { { "tab_cycle", "Toggle tab cycles through elements", }, 0, (Func)dwb_com_toggle_property, NULL, PostSM, { .p = "tab-key-cycles-through-elements" } },
- { { "proxy", "Toggle proxy", }, 1, (Func)dwb_com_toggle_proxy, NULL, PostSM, { 0 } },
- { { "toggle_block_content", "Toggle block content for current domain" }, 1, (Func) dwb_com_toggle_block_content, NULL, PostSM, { 0 } },
- { { "allow_content", "Allow scripts for current domain in the current session" }, 1, (Func) dwb_com_allow_content, NULL, PostSM, { 0 } },
- { { "allow_plugins", "Allow plugins for this domain" }, 1, (Func) dwb_com_allow_plugins, NO_URL, PostSM, { 0 } },
- { { "print", "Print page" }, 1, (Func) dwb_com_print, NULL, PostSM, { 0 } },
- { { "execute_userscript", "Execute userscript" }, 1, (Func) dwb_com_execute_userscript, "No userscripts available", NeverSM, { 0 } },
+ { { "entry_delete_word", "Delete word", }, 0, (Func)dwb_com_entry_delete_word, NULL, ALWAYS_SM, { 0 }, true, },
+ { { "entry_delete_letter", "Delete a single letter", }, 0, (Func)dwb_com_entry_delete_letter, NULL, ALWAYS_SM, { 0 }, true, },
+ { { "entry_delete_line", "Delete to beginning of the line", }, 0, (Func)dwb_com_entry_delete_line, NULL, ALWAYS_SM, { 0 }, true, },
+ { { "entry_word_forward", "Move cursor forward on word", }, 0, (Func)dwb_com_entry_word_forward, NULL, ALWAYS_SM, { 0 }, true, },
+ { { "entry_word_back", "Move cursor back on word", }, 0, (Func)dwb_com_entry_word_back, NULL, ALWAYS_SM, { 0 }, true, },
+ { { "entry_history_back", "Command history back", }, 0, (Func)dwb_com_entry_history_back, NULL, ALWAYS_SM, { 0 }, true, },
+ { { "entry_history_forward", "Command history forward", }, 0, (Func)dwb_com_entry_history_forward, NULL, ALWAYS_SM, { 0 }, true, },
+ { { "download_set_execute", "Complete binaries", }, 0, (Func)dwb_dl_set_execute, NULL, ALWAYS_SM, { 0 }, true, },
+ { { "complete_history", "Complete browsing history", }, 0, (Func)dwb_com_complete_type, NULL, ALWAYS_SM, { .n = COMP_HISTORY }, true, },
+ { { "complete_bookmarks", "Complete bookmarks", }, 0, (Func)dwb_com_complete_type, NULL, ALWAYS_SM, { .n = COMP_BOOKMARK }, true, },
+ { { "complete_commands", "Complete command history", }, 0, (Func)dwb_com_complete_type, NULL, ALWAYS_SM, { .n = COMP_INPUT }, true, },
+ { { "complete_searchengines", "Complete searchengines", }, 0, (Func)dwb_com_complete_type, NULL, ALWAYS_SM, { .n = COMP_SEARCH }, true, },
+ { { "complete_userscript", "Complete userscripts", }, 0, (Func)dwb_com_complete_type, NULL, ALWAYS_SM, { .n = COMP_USERSCRIPT }, true, },
+
+ { { "spell_checking", "Setting: spell checking", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "enable-spell-checking" } },
+ { { "scripts", "Setting: scripts", }, 1, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "enable-scripts" } },
+ { { "auto_shrink_images", "Toggle autoshrink images", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "auto-shrink-images" } },
+ { { "autoload_images", "Toggle autoload images", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "auto-load-images" } },
+ { { "autoresize_window", "Toggle autoresize window", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "auto-resize-window" } },
+ { { "caret_browsing", "Toggle caret browsing", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "enable-caret-browsing" } },
+ { { "default_context_menu", "Toggle enable default context menu", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "enable-default-context-menu" } },
+ { { "file_access_from_file_uris", "Toggle file access from file uris", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "enable-file-acces-from-file-uris" } },
+ { { "universal file_access_from_file_uris", "Toggle universal file access from file uris", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "enable-universal-file-acces-from-file-uris" } },
+ { { "java_applets", "Toggle java applets", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "enable-java-applets" } },
+ { { "plugins", "Toggle plugins", }, 1, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "enable-plugins" } },
+ { { "private_browsing", "Toggle private browsing", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "enable-private-browsing" } },
+ { { "page_cache", "Toggle page cache", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "enable-page-cache" } },
+ { { "js_can_open_windows", "Toggle Javascript can open windows automatically", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "javascript-can-open-windows-automatically" } },
+ { { "enforce_96_dpi", "Toggle enforce a resolution of 96 dpi", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "enforce-96-dpi" } },
+ { { "print_backgrounds", "Toggle print backgrounds", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "print-backgrounds" } },
+ { { "resizable_text_areas", "Toggle resizable text areas", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "resizable-text-areas" } },
+ { { "tab_cycle", "Toggle tab cycles through elements", }, 0, (Func)dwb_com_toggle_property, NULL, POST_SM, { .p = "tab-key-cycles-through-elements" } },
+ { { "proxy", "Toggle proxy", }, 1, (Func)dwb_com_toggle_proxy, NULL, POST_SM, { 0 } },
+ { { "toggle_block_content", "Toggle block content for current domain" }, 1, (Func) dwb_com_toggle_block_content, NULL, POST_SM, { 0 } },
+ { { "allow_content", "Allow scripts for current domain in the current session" }, 1, (Func) dwb_com_allow_content, NULL, POST_SM, { 0 } },
+ { { "allow_plugins", "Allow plugins for this domain" }, 1, (Func) dwb_com_allow_plugins, NO_URL, POST_SM, { 0 } },
+ { { "print", "Print page" }, 1, (Func) dwb_com_print, NULL, POST_SM, { 0 } },
+ { { "execute_userscript", "Execute userscript" }, 1, (Func) dwb_com_execute_userscript, "No userscripts available", NEVER_SM, { 0 } },
};/*}}}*/
/* DWB_SETTINGS {{{*/
/* SETTINGS_ARRAY {{{*/
// { name, description, builtin, global, type, argument, set-function
static WebSettings DWB_SETTINGS[] = {
- { { "auto-load-images", "Autoload images", }, true, false, Boolean, { .b = true }, (S_Func) dwb_webkit_setting, },
- { { "auto-resize-window", "Autoresize window", }, true, false, Boolean, { .b = false }, (S_Func) dwb_webkit_setting, },
- { { "auto-shrink-images", "Autoshrink images", }, true, false, Boolean, { .b = true }, (S_Func) dwb_webkit_setting, },
- { { "cursive-font-family", "Cursive font family", }, true, false, Char, { .p = "serif" }, (S_Func) dwb_webkit_setting, },
- { { "default-encoding", "Default encoding", }, true, false, Char, { .p = NULL }, (S_Func) dwb_webkit_setting, },
- { { "default-font-family", "Default font family", }, true, false, Char, { .p = "sans-serif" }, (S_Func) dwb_webkit_setting, },
- { { "default-font-size", "Default font size", }, true, false, Integer, { .i = 12 }, (S_Func) dwb_webkit_setting, },
- { { "default-monospace-font-size", "Default monospace font size", }, true, false, Integer, { .i = 10 }, (S_Func) dwb_webkit_setting, },
- { { "enable-caret-browsing", "Caret Browsing", }, true, false, Boolean, { .b = false }, (S_Func) dwb_webkit_setting, },
- { { "enable-default-context-menu", "Enable default context menu", }, true, false, Boolean, { .b = true }, (S_Func) dwb_webkit_setting, },
- { { "enable-developer-extras", "Enable developer extras", }, true, false, Boolean, { .b = false }, (S_Func) dwb_webkit_setting, },
- { { "enable-dom-paste", "Enable DOM paste", }, true, false, Boolean, { .b = false }, (S_Func) dwb_webkit_setting, },
- { { "enable-file-access-from-file-uris", "File access from file uris", }, true, false, Boolean, { .b = true }, (S_Func) dwb_webkit_setting, },
- { { "enable-html5-database", "Enable HTML5-database" }, true, false, Boolean, { .b = true }, (S_Func) dwb_webkit_setting, },
- { { "enable-html5-local-storage", "Enable HTML5 local storage", }, true, false, Boolean, { .b = true }, (S_Func) dwb_webkit_setting, },
- { { "enable-java-applet", "Java Applets", }, true, false, Boolean, { .b = true }, (S_Func) dwb_webkit_setting, },
- { { "enable-offline-web-application-cache", "Offline web application cache", }, true, false, Boolean, { .b = true }, (S_Func) dwb_webkit_setting, },
- { { "enable-page-cache", "Page cache", }, true, false, Boolean, { .b = false }, (S_Func) dwb_webkit_setting, },
- { { "enable-plugins", "Plugins", }, true, false, Boolean, { .b = true }, (S_Func) dwb_webkit_setting, },
- { { "enable-private-browsing", "Private Browsing", }, true, false, Boolean, { .b = false }, (S_Func) dwb_webkit_setting, },
- { { "enable-scripts", "Script", }, true, false, Boolean, { .b = true }, (S_Func) dwb_webkit_setting, },
- { { "enable-site-specific-quirks", "Site specific quirks", }, true, false, Boolean, { .b = false }, (S_Func) dwb_webkit_setting, },
- { { "enable-spatial-navigation", "Spatial navigation", }, true, false, Boolean, { .b = false }, (S_Func) dwb_webkit_setting, },
- { { "enable-spell-checking", "Spell checking", }, true, false, Boolean, { .b = false }, (S_Func) dwb_webkit_setting, },
- { { "enable-universal-access-from-file-uris", "Universal access from file uris", }, true, false, Boolean, { .b = true }, (S_Func) dwb_webkit_setting, },
- { { "enable-xss-auditor", "XSS auditor", }, true, false, Boolean, { .b = true }, (S_Func) dwb_webkit_setting, },
- { { "enforce-96-dpi", "Enforce 96 dpi", }, true, false, Boolean, { .b = false }, (S_Func) dwb_webkit_setting, },
- { { "fantasy-font-family", "Fantasy font family", }, true, false, Char, { .p = "serif" }, (S_Func) dwb_webkit_setting, },
- { { "javascript-can-access-clipboard", "Javascript can access clipboard", }, true, false, Boolean, { .b = false }, (S_Func) dwb_webkit_setting, },
- { { "javascript-can-open-windows-automatically", "Javascript can open windows automatically", }, true, false, Boolean, { .b = false }, (S_Func) dwb_webkit_setting, },
- { { "minimum-font-size", "Minimum font size", }, true, false, Integer, { .i = 5 }, (S_Func) dwb_webkit_setting, },
- { { "minimum-logical-font-size", "Minimum logical font size", }, true, false, Integer, { .i = 5 }, (S_Func) dwb_webkit_setting, },
- { { "monospace-font-family", "Monospace font family", }, true, false, Char, { .p = "monospace" }, (S_Func) dwb_webkit_setting, },
- { { "print-backgrounds", "Print backgrounds", }, true, false, Boolean, { .b = true }, (S_Func) dwb_webkit_setting, },
- { { "resizable-text-areas", "Resizable text areas", }, true, false, Boolean, { .b = true }, (S_Func) dwb_webkit_setting, },
- { { "sans-serif-font-family", "Sans serif font family", }, true, false, Char, { .p = "sans-serif" }, (S_Func) dwb_webkit_setting, },
- { { "serif-font-family", "Serif font family", }, true, false, Char, { .p = "serif" }, (S_Func) dwb_webkit_setting, },
- { { "spell-checking-languages", "Spell checking languages", }, true, false, Char, { .p = NULL }, (S_Func) dwb_webkit_setting, },
- { { "tab-key-cycles-through-elements", "Tab cycles through elements in insert mode", }, true, false, Boolean, { .b = true }, (S_Func) dwb_webkit_setting, },
-
- { { "user-agent", "User agent", }, true, false, Char, { .p = NULL }, (S_Func) dwb_webkit_setting, },
- { { "user-stylesheet-uri", "User stylesheet uri", }, true, false, Char, { .p = NULL }, (S_Func) dwb_webkit_setting, },
- { { "zoom-step", "Zoom Step", }, true, false, Double, { .d = 0.1 }, (S_Func) dwb_webkit_setting, },
- { { "custom-encoding", "Custom encoding", }, false, false, Char, { .p = NULL }, (S_Func) dwb_webview_property, },
- { { "editable", "Content editable", }, false, false, Boolean, { .b = false }, (S_Func) dwb_webview_property, },
- { { "full-content-zoom", "Full content zoom", }, false, false, Boolean, { .b = false }, (S_Func) dwb_webview_property, },
- { { "zoom-level", "Zoom level", }, false, false, Double, { .d = 1.0 }, (S_Func) dwb_webview_property, },
- { { "proxy", "HTTP-proxy", }, false, true, Boolean, { .b = false }, (S_Func) dwb_set_proxy, },
- { { "proxy-url", "HTTP-proxy url", }, false, true, Char, { .p = NULL }, (S_Func) dwb_init_proxy, },
- { { "cookies", "All Cookies allowed", }, false, true, Boolean, { .b = false }, (S_Func) dwb_set_cookies, },
-
- { { "active-fg-color", "UI: Active view foreground", }, false, true, ColorChar, { .p = "#ffffff" }, (S_Func) dwb_reload_layout, },
- { { "active-bg-color", "UI: Active view background", }, false, true, ColorChar, { .p = "#000000" }, (S_Func) dwb_reload_layout, },
- { { "normal-fg-color", "UI: Inactive view foreground", }, false, true, ColorChar, { .p = "#cccccc" }, (S_Func) dwb_reload_layout, },
- { { "normal-bg-color", "UI: Inactive view background", }, false, true, ColorChar, { .p = "#505050" }, (S_Func) dwb_reload_layout, },
-
- { { "tab-active-fg-color", "UI: Active view tabforeground", }, false, true, ColorChar, { .p = "#ffffff" }, (S_Func) dwb_reload_layout, },
- { { "tab-active-bg-color", "UI: Active view tabbackground", }, false, true, ColorChar, { .p = "#000000" }, (S_Func) dwb_reload_layout, },
- { { "tab-normal-fg-color", "UI: Inactive view tabforeground", }, false, true, ColorChar, { .p = "#cccccc" }, (S_Func) dwb_reload_layout, },
- { { "tab-normal-bg-color", "UI: Inactive view tabbackground", }, false, true, ColorChar, { .p = "#505050" }, (S_Func) dwb_reload_layout, },
- { { "hide-tabbar", "Hide tabbar (never, always, tiled)", }, false, true, Char, { .p = "never" }, (S_Func) dwb_set_hide_tabbar, },
-
- { { "active-completion-fg-color", "UI: Completion active foreground", }, false, true, ColorChar, { .p = "#53868b" }, (S_Func) dwb_init_style, },
- { { "active-completion-bg-color", "UI: Completion active background", }, false, true, ColorChar, { .p = "#000000" }, (S_Func) dwb_init_style, },
- { { "normal-completion-fg-color", "UI: Completion inactive foreground", }, false, true, ColorChar, { .p = "#eeeeee" }, (S_Func) dwb_init_style, },
- { { "normal-completion-bg-color", "UI: Completion inactive background", }, false, true, ColorChar, { .p = "#151515" }, (S_Func) dwb_init_style, },
-
- { { "insertmode-fg-color", "UI: Insertmode foreground", }, false, true, ColorChar, { .p = "#000000" }, (S_Func) dwb_init_style, },
- { { "insertmode-bg-color", "UI: Insertmode background", }, false, true, ColorChar, { .p = "#dddddd" }, (S_Func) dwb_init_style, },
- { { "error-color", "UI: Error color", }, false, true, ColorChar, { .p = "#ff0000" }, (S_Func) dwb_init_style, },
-
- { { "settings-fg-color", "UI: Settings view foreground", }, false, true, ColorChar, { .p = "#ffffff" }, (S_Func) dwb_init_style, },
- { { "settings-bg-color", "UI: Settings view background", }, false, true, ColorChar, { .p = "#151515" }, (S_Func) dwb_init_style, },
- { { "settings-border", "UI: Settings view border", }, false, true, Char, { .p = "1px dotted black"}, (S_Func) dwb_init_style, },
+ { { "auto-load-images", "Autoload images", }, true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ { { "auto-resize-window", "Autoresize window", }, true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ { { "auto-shrink-images", "Autoshrink images", }, true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ { { "cursive-font-family", "Cursive font family", }, true, false, CHAR, { .p = "serif" }, (S_Func) dwb_webkit_setting, },
+ { { "default-encoding", "Default encoding", }, true, false, CHAR, { .p = NULL }, (S_Func) dwb_webkit_setting, },
+ { { "default-font-family", "Default font family", }, true, false, CHAR, { .p = "sans-serif" }, (S_Func) dwb_webkit_setting, },
+ { { "default-font-size", "Default font size", }, true, false, INTEGER, { .i = 12 }, (S_Func) dwb_webkit_setting, },
+ { { "default-monospace-font-size", "Default monospace font size", }, true, false, INTEGER, { .i = 10 }, (S_Func) dwb_webkit_setting, },
+ { { "enable-caret-browsing", "Caret Browsing", }, true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ { { "enable-default-context-menu", "Enable default context menu", }, true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ { { "enable-developer-extras", "Enable developer extras", }, true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ { { "enable-dom-paste", "Enable DOM paste", }, true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ { { "enable-file-access-from-file-uris", "File access from file uris", }, true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ { { "enable-html5-database", "Enable HTML5-database" }, true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ { { "enable-html5-local-storage", "Enable HTML5 local storage", }, true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ { { "enable-java-applet", "Java Applets", }, true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ { { "enable-offline-web-application-cache", "Offline web application cache", }, true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ { { "enable-page-cache", "Page cache", }, true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ { { "enable-plugins", "Plugins", }, true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ { { "enable-private-browsing", "Private Browsing", }, true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ { { "enable-scripts", "Script", }, true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ { { "enable-site-specific-quirks", "Site specific quirks", }, true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ { { "enable-spatial-navigation", "Spatial navigation", }, true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ { { "enable-spell-checking", "Spell checking", }, true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ { { "enable-universal-access-from-file-uris", "Universal access from file uris", }, true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ { { "enable-xss-auditor", "XSS auditor", }, true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ { { "enforce-96-dpi", "Enforce 96 dpi", }, true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ { { "fantasy-font-family", "Fantasy font family", }, true, false, CHAR, { .p = "serif" }, (S_Func) dwb_webkit_setting, },
+ { { "javascript-can-access-clipboard", "Javascript can access clipboard", }, true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ { { "javascript-can-open-windows-automatically", "Javascript can open windows automatically", }, true, false, BOOLEAN, { .b = false }, (S_Func) dwb_webkit_setting, },
+ { { "minimum-font-size", "Minimum font size", }, true, false, INTEGER, { .i = 5 }, (S_Func) dwb_webkit_setting, },
+ { { "minimum-logical-font-size", "Minimum logical font size", }, true, false, INTEGER, { .i = 5 }, (S_Func) dwb_webkit_setting, },
+ { { "monospace-font-family", "Monospace font family", }, true, false, CHAR, { .p = "monospace" }, (S_Func) dwb_webkit_setting, },
+ { { "print-backgrounds", "Print backgrounds", }, true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ { { "resizable-text-areas", "Resizable text areas", }, true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+ { { "sans-serif-font-family", "Sans serif font family", }, true, false, CHAR, { .p = "sans-serif" }, (S_Func) dwb_webkit_setting, },
+ { { "serif-font-family", "Serif font family", }, true, false, CHAR, { .p = "serif" }, (S_Func) dwb_webkit_setting, },
+ { { "spell-checking-languages", "Spell checking languages", }, true, false, CHAR, { .p = NULL }, (S_Func) dwb_webkit_setting, },
+ { { "tab-key-cycles-through-elements", "Tab cycles through elements in insert mode", }, true, false, BOOLEAN, { .b = true }, (S_Func) dwb_webkit_setting, },
+
+ { { "user-agent", "User agent", }, true, false, CHAR, { .p = NULL }, (S_Func) dwb_webkit_setting, },
+ { { "user-stylesheet-uri", "User stylesheet uri", }, true, false, CHAR, { .p = NULL }, (S_Func) dwb_webkit_setting, },
+ { { "zoom-step", "Zoom Step", }, true, false, DOUBLE, { .d = 0.1 }, (S_Func) dwb_webkit_setting, },
+ { { "custom-encoding", "Custom encoding", }, false, false, CHAR, { .p = NULL }, (S_Func) dwb_webview_property, },
+ { { "editable", "Content editable", }, false, false, BOOLEAN, { .b = false }, (S_Func) dwb_webview_property, },
+ { { "full-content-zoom", "Full content zoom", }, false, false, BOOLEAN, { .b = false }, (S_Func) dwb_webview_property, },
+ { { "zoom-level", "Zoom level", }, false, false, DOUBLE, { .d = 1.0 }, (S_Func) dwb_webview_property, },
+ { { "proxy", "HTTP-proxy", }, false, true, BOOLEAN, { .b = false }, (S_Func) dwb_set_proxy, },
+ { { "proxy-url", "HTTP-proxy url", }, false, true, CHAR, { .p = NULL }, (S_Func) dwb_init_proxy, },
+ { { "cookies", "All Cookies allowed", }, false, true, BOOLEAN, { .b = false }, (S_Func) dwb_set_cookies, },
+
+ { { "active-fg-color", "UI: Active view foreground", }, false, true, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_reload_layout, },
+ { { "active-bg-color", "UI: Active view background", }, false, true, COLOR_CHAR, { .p = "#000000" }, (S_Func) dwb_reload_layout, },
+ { { "normal-fg-color", "UI: Inactive view foreground", }, false, true, COLOR_CHAR, { .p = "#cccccc" }, (S_Func) dwb_reload_layout, },
+ { { "normal-bg-color", "UI: Inactive view background", }, false, true, COLOR_CHAR, { .p = "#505050" }, (S_Func) dwb_reload_layout, },
+
+ { { "tab-active-fg-color", "UI: Active view tabforeground", }, false, true, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_reload_layout, },
+ { { "tab-active-bg-color", "UI: Active view tabbackground", }, false, true, COLOR_CHAR, { .p = "#000000" }, (S_Func) dwb_reload_layout, },
+ { { "tab-normal-fg-color", "UI: Inactive view tabforeground", }, false, true, COLOR_CHAR, { .p = "#cccccc" }, (S_Func) dwb_reload_layout, },
+ { { "tab-normal-bg-color", "UI: Inactive view tabbackground", }, false, true, COLOR_CHAR, { .p = "#505050" }, (S_Func) dwb_reload_layout, },
+ { { "hide-tabbar", "Hide tabbar (never, always, tiled)", }, false, true, CHAR, { .p = "never" }, (S_Func) dwb_set_hide_tabbar, },
+ { { "tabbed-browsing", "Enable tabbed browsing", }, false, true, CHAR, { .b = true }, (S_Func) dwb_set_dummy, },
+
+ { { "active-completion-fg-color", "UI: Completion active foreground", }, false, true, COLOR_CHAR, { .p = "#53868b" }, (S_Func) dwb_init_style, },
+ { { "active-completion-bg-color", "UI: Completion active background", }, false, true, COLOR_CHAR, { .p = "#000000" }, (S_Func) dwb_init_style, },
+ { { "normal-completion-fg-color", "UI: Completion inactive foreground", }, false, true, COLOR_CHAR, { .p = "#eeeeee" }, (S_Func) dwb_init_style, },
+ { { "normal-completion-bg-color", "UI: Completion inactive background", }, false, true, COLOR_CHAR, { .p = "#151515" }, (S_Func) dwb_init_style, },
+
+ { { "insertmode-fg-color", "UI: Insertmode foreground", }, false, true, COLOR_CHAR, { .p = "#000000" }, (S_Func) dwb_init_style, },
+ { { "insertmode-bg-color", "UI: Insertmode background", }, false, true, COLOR_CHAR, { .p = "#dddddd" }, (S_Func) dwb_init_style, },
+ { { "error-color", "UI: Error color", }, false, true, COLOR_CHAR, { .p = "#ff0000" }, (S_Func) dwb_init_style, },
+
+ { { "settings-fg-color", "UI: Settings view foreground", }, false, true, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_init_style, },
+ { { "settings-bg-color", "UI: Settings view background", }, false, true, COLOR_CHAR, { .p = "#151515" }, (S_Func) dwb_init_style, },
+ { { "settings-border", "UI: Settings view border", }, false, true, CHAR, { .p = "1px dotted black"}, (S_Func) dwb_init_style, },
- { { "active-font-size", "UI: Active view fontsize", }, false, true, Integer, { .i = 12 }, (S_Func) dwb_reload_layout, },
- { { "normal-font-size", "UI: Inactive view fontsize", }, false, true, Integer, { .i = 10 }, (S_Func) dwb_reload_layout, },
+ { { "active-font-size", "UI: Active view fontsize", }, false, true, INTEGER, { .i = 12 }, (S_Func) dwb_reload_layout, },
+ { { "normal-font-size", "UI: Inactive view fontsize", }, false, true, INTEGER, { .i = 10 }, (S_Func) dwb_reload_layout, },
- { { "font", "UI: Font", }, false, true, Char, { .p = "monospace" }, (S_Func) dwb_reload_layout, },
+ { { "font", "UI: Font", }, false, true, CHAR, { .p = "monospace" }, (S_Func) dwb_reload_layout, },
- { { "hint-letter-seq", "Hints: Letter sequence for letter hints", }, false, true, Char, { .p = "FDSARTGBVECWXQYIOPMNHZULKJ" }, (S_Func) dwb_reload_scripts, },
- { { "hint-style", "Hints: Hintstyle (letter or number)", }, false, true, Char, { .p = "letter" }, (S_Func) dwb_reload_scripts, },
- { { "hint-font-size", "Hints: Font size", }, false, true, Char, { .p = "12px" }, (S_Func) dwb_reload_scripts, },
- { { "hint-font-weight", "Hints: Font weight", }, false, true, Char, { .p = "normal" }, (S_Func) dwb_reload_scripts, },
- { { "hint-font-family", "Hints: Font family", }, false, true, Char, { .p = "monospace" }, (S_Func) dwb_reload_scripts, },
- { { "hint-fg-color", "Hints: Foreground color", }, false, true, ColorChar, { .p = "#ffffff" }, (S_Func) dwb_reload_scripts, },
- { { "hint-bg-color", "Hints: Background color", }, false, true, ColorChar, { .p = "#000088" }, (S_Func) dwb_reload_scripts, },
- { { "hint-active-color", "Hints: Active link color", }, false, true, ColorChar, { .p = "#00ff00" }, (S_Func) dwb_reload_scripts, },
- { { "hint-normal-color", "Hints: Inactive link color", }, false, true, ColorChar, { .p = "#ffff99" }, (S_Func) dwb_reload_scripts, },
- { { "hint-border", "Hints: Hint Border", }, false, true, Char, { .p = "2px dashed #000000" }, (S_Func) dwb_reload_scripts, },
- { { "hint-opacity", "Hints: Hint Opacity", }, false, true, Double, { .d = 0.75 }, (S_Func) dwb_reload_scripts, },
- { { "auto-completion", "Show possible keystrokes", }, false, true, Boolean, { .b = true }, (S_Func)dwb_comp_set_autcompletion, },
- { { "startpage", "Default homepage", }, false, true, Char, { .p = "about:blank" }, (S_Func)dwb_set_startpage, },
- { { "single-instance", "Single instance", }, false, true, Boolean, { .b = false }, (S_Func)dwb_set_single_instance, },
- { { "save-session", "Autosave sessions", }, false, true, Boolean, { .b = false }, (S_Func)dwb_set_dummy, },
+ { { "hint-letter-seq", "Hints: Letter sequence for letter hints", }, false, true, CHAR, { .p = "FDSARTGBVECWXQYIOPMNHZULKJ" }, (S_Func) dwb_reload_scripts, },
+ { { "hint-style", "Hints: Hintstyle (letter or number)", }, false, true, CHAR, { .p = "letter" }, (S_Func) dwb_reload_scripts, },
+ { { "hint-font-size", "Hints: Font size", }, false, true, CHAR, { .p = "12px" }, (S_Func) dwb_reload_scripts, },
+ { { "hint-font-weight", "Hints: Font weight", }, false, true, CHAR, { .p = "normal" }, (S_Func) dwb_reload_scripts, },
+ { { "hint-font-family", "Hints: Font family", }, false, true, CHAR, { .p = "monospace" }, (S_Func) dwb_reload_scripts, },
+ { { "hint-fg-color", "Hints: Foreground color", }, false, true, COLOR_CHAR, { .p = "#ffffff" }, (S_Func) dwb_reload_scripts, },
+ { { "hint-bg-color", "Hints: Background color", }, false, true, COLOR_CHAR, { .p = "#000088" }, (S_Func) dwb_reload_scripts, },
+ { { "hint-active-color", "Hints: Active link color", }, false, true, COLOR_CHAR, { .p = "#00ff00" }, (S_Func) dwb_reload_scripts, },
+ { { "hint-normal-color", "Hints: Inactive link color", }, false, true, COLOR_CHAR, { .p = "#ffff99" }, (S_Func) dwb_reload_scripts, },
+ { { "hint-border", "Hints: Hint Border", }, false, true, CHAR, { .p = "2px dashed #000000" }, (S_Func) dwb_reload_scripts, },
+ { { "hint-opacity", "Hints: Hint Opacity", }, false, true, DOUBLE, { .d = 0.75 }, (S_Func) dwb_reload_scripts, },
+ { { "auto-completion", "Show possible keystrokes", }, false, true, BOOLEAN, { .b = true }, (S_Func)dwb_comp_set_autcompletion, },
+ { { "startpage", "Default homepage", }, false, true, CHAR, { .p = "about:blank" }, (S_Func)dwb_set_startpage, },
+ { { "single-instance", "Single instance", }, false, true, BOOLEAN, { .b = false }, (S_Func)dwb_set_single_instance, },
+ { { "save-session", "Autosave sessions", }, false, true, BOOLEAN, { .b = false }, (S_Func)dwb_set_dummy, },
- { { "content-block-regex", "Mimetypes that will be blocked", }, false, false, Char, { .p = "(application|text)/(x-)?(shockwave-flash|javascript)" }, (S_Func) dwb_set_content_block_regex, },
- { { "block-content", "Block ugly content", }, false, false, Boolean, { .b = false }, (S_Func) dwb_set_content_block, },
- { { "plugin-blocker", "Flashblocker", }, false, false, Boolean, { .b = false }, (S_Func) dwb_set_plugin_blocker, },
+ { { "content-block-regex", "Mimetypes that will be blocked", }, false, false, CHAR, { .p = "(application|text)/(x-)?(shockwave-flash|javascript)" }, (S_Func) dwb_set_content_block_regex, },
+ { { "block-content", "Block ugly content", }, false, false, BOOLEAN, { .b = false }, (S_Func) dwb_set_content_block, },
+ { { "plugin-blocker", "Flashblocker", }, false, false, BOOLEAN, { .b = false }, (S_Func) dwb_set_plugin_blocker, },
// downloads
- { { "download-external-command", "Downloads: External download program", }, false, true, Char,
+ { { "download-external-command", "Downloads: External download program", }, false, true, CHAR,
{ .p = "xterm -e wget 'dwb_uri' -O 'dwb_output' --load-cookies 'dwb_cookies'" }, (S_Func)dwb_set_dummy, },
- { { "download-use-external-program", "Downloads: Use external download program", }, false, true, Boolean, { .b = false }, (S_Func)dwb_set_dummy, },
+ { { "download-use-external-program", "Downloads: Use external download program", }, false, true, BOOLEAN, { .b = false }, (S_Func)dwb_set_dummy, },
- { { "complete-history", "Complete browsing history", }, false, true, Boolean, { .b = true }, (S_Func)dwb_init_vars, },
- { { "complete-bookmarks", "Complete bookmarks", }, false, true, Boolean, { .b = true }, (S_Func)dwb_init_vars, },
- { { "complete-searchengines", "Complete searchengines", }, false, true, Boolean, { .b = true }, (S_Func)dwb_init_vars, },
- { { "complete-commands", "Complete input history", }, false, true, Boolean, { .b = true }, (S_Func)dwb_init_vars, },
- { { "complete-userscripts", "Complete userscripts", }, false, true, Boolean, { .b = true }, (S_Func)dwb_init_vars, },
+ { { "complete-history", "Complete browsing history", }, false, true, BOOLEAN, { .b = true }, (S_Func)dwb_init_vars, },
+ { { "complete-bookmarks", "Complete bookmarks", }, false, true, BOOLEAN, { .b = true }, (S_Func)dwb_init_vars, },
+ { { "complete-searchengines", "Complete searchengines", }, false, true, BOOLEAN, { .b = true }, (S_Func)dwb_init_vars, },
+ { { "complete-commands", "Complete input history", }, false, true, BOOLEAN, { .b = true }, (S_Func)dwb_init_vars, },
+ { { "complete-userscripts", "Complete userscripts", }, false, true, BOOLEAN, { .b = true }, (S_Func)dwb_init_vars, },
- { { "use-fifo", "Create a fifo pipe for communication", }, false, true, Boolean, { .b = false }, (S_Func)dwb_set_dummy },
+ { { "use-fifo", "Create a fifo pipe for communication", }, false, true, BOOLEAN, { .b = false }, (S_Func)dwb_set_dummy },
- { { "default-width", "Default width", }, false, true, Integer, { .i = 800 }, (S_Func)dwb_set_dummy, },
- { { "default-height", "Default height", }, false, true, Integer, { .i = 600 }, (S_Func)dwb_set_dummy, },
- { { "message-delay", "Message delay", }, false, true, Integer, { .i = 2 }, (S_Func) dwb_set_message_delay, },
- { { "history-length", "History length", }, false, true, Integer, { .i = 500 }, (S_Func) dwb_set_history_length, },
- { { "size", "UI: Default tiling area size (in %)", }, false, true, Integer, { .i = 30 }, (S_Func)dwb_set_dummy, },
- { { "factor", "UI: Default Zoom factor of tiling area", }, false, true, Double, { .d = 0.3 }, (S_Func)dwb_set_dummy, },
- { { "layout", "UI: Default layout (Normal, Bottomstack, Maximized)", }, false, true, Char, { .p = "Normal Maximized" }, (S_Func)dwb_set_dummy, },
- { { "mail-program", "Mail program", }, false, true, Char, { .p = "xterm -e mutt 'dwb_uri'" }, (S_Func)dwb_set_dummy },
- { { "adblocker", "Block advertisements via a filterlist", }, false, false, Boolean, { .b = false }, (S_Func)dwb_set_adblock },
+ { { "default-width", "Default width", }, false, true, INTEGER, { .i = 800 }, (S_Func)dwb_set_dummy, },
+ { { "default-height", "Default height", }, false, true, INTEGER, { .i = 600 }, (S_Func)dwb_set_dummy, },
+ { { "message-delay", "Message delay", }, false, true, INTEGER, { .i = 2 }, (S_Func) dwb_set_message_delay, },
+ { { "history-length", "History length", }, false, true, INTEGER, { .i = 500 }, (S_Func) dwb_set_history_length, },
+ { { "size", "UI: Default tiling area size (in %)", }, false, true, INTEGER, { .i = 30 }, (S_Func)dwb_set_dummy, },
+ { { "factor", "UI: Default Zoom factor of tiling area", }, false, true, DOUBLE, { .d = 0.3 }, (S_Func)dwb_set_dummy, },
+ { { "layout", "UI: Default layout (Normal, Bottomstack, Maximized)", }, false, true, CHAR, { .p = "Normal MAXIMIZED" }, (S_Func)dwb_set_dummy, },
+ { { "mail-program", "Mail program", }, false, true, CHAR, { .p = "xterm -e mutt 'dwb_uri'" }, (S_Func)dwb_set_dummy },
+ { { "adblocker", "Block advertisements via a filterlist", }, false, false, BOOLEAN, { .b = false }, (S_Func)dwb_set_adblock },
};/*}}}*/
/* SETTINGS_FUNCTIONS{{{*/
@@ -420,10 +421,10 @@ static void
dwb_webkit_setting(GList *gl, WebSettings *s) {
WebKitWebSettings *settings = gl ? webkit_web_view_get_settings(WEBVIEW(gl)) : dwb.state.web_settings;
switch (s->type) {
- case Double: g_object_set(settings, s->n.first, s->arg.d, NULL); break;
- case Integer: g_object_set(settings, s->n.first, s->arg.i, NULL); break;
- case Boolean: g_object_set(settings, s->n.first, s->arg.b, NULL); break;
- case Char: g_object_set(settings, s->n.first, !s->arg.p || !strcmp(s->arg.p, "null") ? NULL : (char*)s->arg.p , NULL); break;
+ case DOUBLE: g_object_set(settings, s->n.first, s->arg.d, NULL); break;
+ case INTEGER: g_object_set(settings, s->n.first, s->arg.i, NULL); break;
+ case BOOLEAN: g_object_set(settings, s->n.first, s->arg.b, NULL); break;
+ case CHAR: g_object_set(settings, s->n.first, !s->arg.p || !strcmp(s->arg.p, "null") ? NULL : (char*)s->arg.p , NULL); break;
default: return;
}
}/*}}}*/
@@ -433,10 +434,10 @@ static void
dwb_webview_property(GList *gl, WebSettings *s) {
WebKitWebView *web = gl ? WEBVIEW(gl) : CURRENT_WEBVIEW();
switch (s->type) {
- case Double: g_object_set(web, s->n.first, s->arg.d, NULL); break;
- case Integer: g_object_set(web, s->n.first, s->arg.i, NULL); break;
- case Boolean: g_object_set(web, s->n.first, s->arg.b, NULL); break;
- case Char: g_object_set(web, s->n.first, (char*)s->arg.p, NULL); break;
+ case DOUBLE: g_object_set(web, s->n.first, s->arg.d, NULL); break;
+ case INTEGER: g_object_set(web, s->n.first, s->arg.i, NULL); break;
+ case BOOLEAN: g_object_set(web, s->n.first, s->arg.b, NULL); break;
+ case CHAR: g_object_set(web, s->n.first, (char*)s->arg.p, NULL); break;
default: return;
}
}/*}}}*//*}}}*/
@@ -463,24 +464,24 @@ dwb_key_press_cb(GtkWidget *w, GdkEventKey *e, View *v) {
dwb_normal_mode(true);
ret = false;
}
- else if (dwb.state.mode == InsertMode) {
+ else if (dwb.state.mode == INSERT_MODE) {
if (CLEAN_STATE(e) & GDK_MODIFIER_MASK) {
ret = dwb_eval_key(e);
}
}
- else if (dwb.state.mode == QuickmarkSave) {
+ else if (dwb.state.mode == QUICK_MARK_SAVE) {
if (key) {
dwb_save_quickmark(key);
}
ret = true;
}
- else if (dwb.state.mode == QuickmarkOpen) {
+ else if (dwb.state.mode == QUICK_MARK_OPEN) {
if (key) {
dwb_open_quickmark(key);
}
ret = true;
}
- else if (gtk_widget_has_focus(dwb.gui.entry) || dwb.state.mode & CompletionMode) {
+ else if (gtk_widget_has_focus(dwb.gui.entry) || dwb.state.mode & COMPLETION_MODE) {
ret = false;
}
else if (DWB_TAB_KEY(e)) {
@@ -488,7 +489,7 @@ dwb_key_press_cb(GtkWidget *w, GdkEventKey *e, View *v) {
ret = true;
}
else {
- if (dwb.state.mode & AutoComplete) {
+ if (dwb.state.mode & AUTO_COMPLETE) {
if (DWB_TAB_KEY(e)) {
dwb_comp_autocomplete(NULL, e);
}
@@ -652,12 +653,12 @@ dwb_toggle_tabbar(void) {
gboolean visible = gtk_widget_get_visible(dwb.gui.topbox);
if (visible ) {
if (dwb.state.tabbar_visible != HIDE_TB_NEVER &&
- (dwb.state.tabbar_visible == HIDE_TB_ALWAYS || (HIDE_TB_TILED && !(dwb.state.layout & Maximized)))) {
+ (dwb.state.tabbar_visible == HIDE_TB_ALWAYS || (HIDE_TB_TILED && !(dwb.state.layout & MAXIMIZED)))) {
gtk_widget_hide(dwb.gui.topbox);
}
}
else if (dwb.state.tabbar_visible != HIDE_TB_ALWAYS &&
- (dwb.state.tabbar_visible == HIDE_TB_NEVER || (HIDE_TB_TILED && (dwb.state.layout & Maximized)))) {
+ (dwb.state.tabbar_visible == HIDE_TB_NEVER || (HIDE_TB_TILED && (dwb.state.layout & MAXIMIZED)))) {
gtk_widget_show(dwb.gui.topbox);
}
}
@@ -665,9 +666,9 @@ dwb_toggle_tabbar(void) {
CompletionType
dwb_eval_completion_type(void) {
switch (dwb.state.mode) {
- case SettingsMode: return COMP_SETTINGS;
- case KeyMode: return COMP_KEY;
- case CommandMode: return COMP_COMMAND;
+ case SETTINGS_MODE: return COMP_SETTINGS;
+ case KEY_MODE: return COMP_KEY;
+ case COMMAND_MODE: return COMP_COMMAND;
default: return COMP_NONE;
}
}/*}}}*/
@@ -858,7 +859,7 @@ dwb_handle_mail(const char *uri) {
/* dwb_resize(double size) {{{*/
void
dwb_resize(double size) {
- int fact = dwb.state.layout & BottomStack;
+ int fact = dwb.state.layout & BOTTOM_STACK;
gtk_widget_set_size_request(dwb.gui.left, (100 - size) * (fact^1), (100 - size) * fact);
gtk_widget_set_size_request(dwb.gui.right, size * (fact^1), size * fact);
@@ -977,17 +978,17 @@ dwb_layout_from_char(const char *desc) {
int i=0;
Layout layout;
while (token[i]) {
- if (!(layout & BottomStack) && !g_ascii_strcasecmp(token[i], "normal")) {
- layout |= NormalLayout;
+ if (!(layout & BOTTOM_STACK) && !g_ascii_strcasecmp(token[i], "normal")) {
+ layout |= NORMAL_LAYOUT;
}
- else if (!(layout & NormalLayout) && !g_ascii_strcasecmp(token[i], "bottomstack")) {
- layout |= BottomStack;
+ else if (!(layout & NORMAL_LAYOUT) && !g_ascii_strcasecmp(token[i], "bottomstack")) {
+ layout |= BOTTOM_STACK;
}
else if (!g_ascii_strcasecmp(token[i], "maximized")) {
- layout |= Maximized;
+ layout |= MAXIMIZED;
}
else {
- layout = NormalLayout;
+ layout = NORMAL_LAYOUT;
}
i++;
}
@@ -1070,7 +1071,7 @@ dwb_update_hints(GdkEventKey *e) {
}
else if (!strcmp(buffer, "_dwb_click_")) {
dwb.state.scriptlock = 1;
- if (dwb.state.nv != OpenDownload) {
+ if (dwb.state.nv != OPEN_DOWNLOAD) {
dwb_normal_mode(true);
}
}
@@ -1283,14 +1284,14 @@ dwb_load_uri(Arg *arg) {
return;
}
/* new window ? */
- if (dwb.state.nv == OpenNewWindow) {
- dwb.state.nv = OpenNormal;
+ if (dwb.state.nv == OPEN_NEW_WINDOW) {
+ dwb.state.nv = OPEN_NORMAL;
dwb_new_window(arg);
return;
}
/* new tab ? */
- else if (dwb.state.nv == OpenNewView) {
- dwb.state.nv = OpenNormal;
+ else if (dwb.state.nv == OPEN_NEW_VIEW) {
+ dwb.state.nv = OPEN_NORMAL;
dwb_add_view(arg);
return;
}
@@ -1355,7 +1356,7 @@ dwb_update_layout() {
gboolean visible = gtk_widget_get_visible(dwb.gui.right);
View *v;
- if (! (dwb.state.layout & Maximized)) {
+ if (! (dwb.state.layout & MAXIMIZED)) {
if (dwb.state.views->next) {
if (!visible) {
gtk_widget_show_all(dwb.gui.right);
@@ -1422,7 +1423,7 @@ dwb_eval_key(GdkEventKey *e) {
}
// don't show backspace in the buffer
if (keyval == GDK_BackSpace ) {
- if (dwb.state.mode & AutoComplete) {
+ if (dwb.state.mode & AUTO_COMPLETE) {
dwb_comp_clean_autocompletion();
}
if (dwb.state.buffer && dwb.state.buffer->str ) {
@@ -1488,7 +1489,7 @@ dwb_eval_key(GdkEventKey *e) {
}
}
// autocompletion
- if (dwb.state.mode & AutoComplete) {
+ if (dwb.state.mode & AUTO_COMPLETE) {
dwb_comp_clean_autocompletion();
}
if (coms && g_list_length(coms) > 0) {
@@ -1508,19 +1509,19 @@ static gboolean
dwb_command_mode(Arg *arg) {
dwb_set_normal_message(dwb.state.fview, false, ":");
dwb_focus_entry();
- dwb.state.mode = CommandMode;
+ dwb.state.mode = COMMAND_MODE;
return true;
}/*}}}*/
/* dwb_insert_mode(Arg *arg) {{{*/
gboolean
dwb_insert_mode(Arg *arg) {
- if (dwb.state.mode == HintMode) {
- dwb_set_normal_message(dwb.state.fview, true, INSERT_MODE);
+ if (dwb.state.mode == HINT_MODE) {
+ dwb_set_normal_message(dwb.state.fview, true, INSERT);
}
dwb_view_modify_style(dwb.state.fview, &dwb.color.insert_fg, &dwb.color.insert_bg, NULL, NULL, NULL, 0);
- dwb.state.mode = InsertMode;
+ dwb.state.mode = INSERT_MODE;
return true;
}/*}}}*/
@@ -1529,25 +1530,25 @@ void
dwb_normal_mode(gboolean clean) {
Mode mode = dwb.state.mode;
- if (dwb.state.mode == HintMode || dwb.state.mode == SearchFieldMode) {
+ if (dwb.state.mode == HINT_MODE || dwb.state.mode == SEARCH_FIELD_MODE) {
webkit_web_view_execute_script(CURRENT_WEBVIEW(), "dwb_clear()");
}
- else if (mode == InsertMode) {
+ else if (mode == INSERT_MODE) {
dwb_view_modify_style(dwb.state.fview, &dwb.color.active_fg, &dwb.color.active_bg, NULL, NULL, NULL, 0);
gtk_entry_set_visibility(GTK_ENTRY(dwb.gui.entry), true);
}
- else if (mode == DownloadGetPath) {
+ else if (mode == DOWNLOAD_GET_PATH) {
dwb_comp_clean_path_completion();
}
- if (mode & CompletionMode) {
+ if (mode & COMPLETION_MODE) {
dwb_comp_clean_completion();
}
- if (mode & AutoComplete) {
+ if (mode & AUTO_COMPLETE) {
dwb_comp_clean_autocompletion();
}
dwb_focus_scroll(dwb.state.fview);
- if (mode & NormalMode) {
+ if (mode & NORMAL_MODE) {
webkit_web_view_execute_script(CURRENT_WEBVIEW(), "dwb_blur()");
}
@@ -1664,7 +1665,7 @@ dwb_get_scripts() {
n = dwb_navigation_new(filename, line[1]);
KeyMap *map = dwb_malloc(sizeof(KeyMap));
Key key = dwb_str_to_key(line[1]);
- FunctionMap fm = { { n->first, n->first }, FM_DONT_SAVE, (Func)dwb_execute_user_script, NULL, PostSM, { .p = path } };
+ FunctionMap fm = { { n->first, n->first }, FM_DONT_SAVE, (Func)dwb_execute_user_script, NULL, POST_SM, { .p = path } };
FunctionMap *fmap = dwb_malloc(sizeof(FunctionMap));
*fmap = fm;
map->map = fmap;
@@ -1698,13 +1699,13 @@ dwb_get_scripts() {
/* dwb_clean_vars() {{{*/
static void
dwb_clean_vars() {
- dwb.state.mode = NormalMode;
+ dwb.state.mode = NORMAL_MODE;
dwb.state.buffer = NULL;
dwb.state.nummod = 0;
dwb.state.nv = 0;
dwb.state.scriptlock = 0;
dwb.state.last_com_history = NULL;
- dwb.state.dl_action = Download;
+ dwb.state.dl_action = DL_ACTION_DOWNLOAD;
}/*}}}*/
static void
@@ -1864,7 +1865,7 @@ dwb_save_files(gboolean end_session) {
dwb_save_settings();
// save session
- if (end_session && GET_BOOL("save-session") && dwb.state.mode != SaveSession) {
+ if (end_session && GET_BOOL("save-session") && dwb.state.mode != SAVE_SESSION) {
dwb_session_save(NULL);
}
@@ -2353,6 +2354,7 @@ dwb_init_vars() {
dwb.misc.history_length = GET_INT("history-length");
dwb.misc.factor = GET_DOUBLE("factor");
dwb.misc.startpage = GET_CHAR("startpage");
+ dwb.misc.tabbed_browsing = GET_BOOL("tabbed-browsing");
dwb.misc.content_block_regex = GET_CHAR("content-block-regex");
dwb.state.tabbar_visible = dwb_eval_tabbar_visible(GET_CHAR("hide-tabbar"));
@@ -2389,7 +2391,7 @@ static void dwb_init() {
dwb_init_cookies();
dwb_init_vars();
- if (dwb.state.layout & BottomStack) {
+ if (dwb.state.layout & BOTTOM_STACK) {
Arg a = { .n = dwb.state.layout };
dwb_com_set_orientation(&a);
}
diff --git a/src/dwb.h b/src/dwb.h
index 898b9dd5..70b7d545 100644
--- a/src/dwb.h
+++ b/src/dwb.h
@@ -69,7 +69,7 @@ function get_value(e) { value = e.value ? e.id + \" \" + e.value : e.id; console
#define HTML_DIV_SETTINGS_CHECKBOX "<div class=\"key\"\n <input id=\"%s\" type=\"checkbox\" onchange=\"get_value(this);\" %s>\n</div>\n"
#define HTML_DIV_END "</div>\n"
/*}}}*/
-#define INSERT_MODE "Insert Mode"
+#define INSERT "Insert Mode"
#define NO_URL "No URL in current context"
#define NO_HINTS "No Hints in current context"
@@ -84,7 +84,7 @@ function get_value(e) { value = e.value ? e.id + \" \" + e.value : e.id; console
#define CLEAN_STATE(X) (X->state & ~(GDK_SHIFT_MASK) & ~(GDK_BUTTON1_MASK) & ~(GDK_BUTTON2_MASK) & ~(GDK_BUTTON3_MASK) & ~(GDK_BUTTON4_MASK) & ~(GDK_BUTTON5_MASK) & ~(GDK_LOCK_MASK) & ~(GDK_MOD2_MASK) &~(GDK_MOD3_MASK) & ~(GDK_MOD5_MASK))
#define CLEAN_SHIFT(X) (X->state & ~(GDK_SHIFT_MASK) & ~(GDK_LOCK_MASK))
-#define CLEAN_COMP_MODE(X) (X & ~(CompletionMode) & ~(AutoComplete))
+#define CLEAN_COMP_MODE(X) (X & ~(COMPLETION_MODE) & ~(AUTO_COMPLETE))
#define GET_TEXT() (gtk_entry_get_text(GTK_ENTRY(dwb.gui.entry)))
#define CURRENT_VIEW() ((View*)dwb.state.fview->data)
@@ -156,84 +156,68 @@ typedef unsigned int TabBarVisible;
#define HIDE_TB_ALWAYS 0x03
#define HIDE_TB_TILED 0x05
-/* ENUMS {{{*/
-enum _Mode {
- NormalMode = 1<<0,
- InsertMode = 1<<1,
- OpenMode = 1<<2,
- QuickmarkSave = 1<<3,
- QuickmarkOpen = 1<<4,
- HintMode = 1<<5,
- FindMode = 1<<6,
- CompletionMode = 1<<7,
- AutoComplete = 1<<8,
- CommandMode = 1<<9,
- SearchFieldMode = 1<<10,
- SearchKeywordMode = 1<<11,
- SettingsMode = 1<<12,
- KeyMode = 1<<13,
- DownloadGetPath = 1<<14,
- SaveSession = 1<<15,
-};
-
-
-enum _ShowMessage {
- NeverSM = 0,
- AlwaysSM,
- PostSM,
-};
-
-enum _Open {
- OpenNormal = 0,
- OpenNewView,
- OpenNewWindow,
- OpenDownload,
-};
-
-enum _Layout {
- NormalLayout = 0,
- BottomStack = 1<<0,
- Maximized = 1<<1,
-};
+typedef unsigned int Mode;
+#define NORMAL_MODE 1<<0
+#define INSERT_MODE 1<<1
+#define QUICK_MARK_SAVE 1<<3
+#define QUICK_MARK_OPEN 1<<4
+#define HINT_MODE 1<<5
+#define FIND_MODE 1<<6
+#define COMPLETION_MODE 1<<7
+#define AUTO_COMPLETE 1<<8
+#define COMMAND_MODE 1<<9
+#define SEARCH_FIELD_MODE 1<<10
+#define SETTINGS_MODE 1<<12
+#define KEY_MODE 1<<13
+#define DOWNLOAD_GET_PATH 1<<14
+#define SAVE_SESSION 1<<15
+
+
+typedef unsigned int ShowMessage;
+#define NEVER_SM 0x00
+#define ALWAYS_SM 0x01
+#define POST_SM 0x02
+
+typedef unsigned int Open;
+#define OPEN_NORMAL 0x00
+#define OPEN_NEW_VIEW 0x01
+#define OPEN_NEW_WINDOW 0x02
+#define OPEN_DOWNLOAD 0x03
+
+typedef unsigned int Layout;
+#define NORMAL_LAYOUT 0
+#define BOTTOM_STACK 1<<0
+#define MAXIMIZED 1<<1
+
+typedef unsigned int DwbType;
+#define CHAR 0x01
+#define INTEGER 0x02
+#define DOUBLE 0x03
+#define BOOLEAN 0x04
+#define COLOR_CHAR 0x05
+
+typedef unsigned int SettingsScope;
+#define APPLY_GLOBAL 0x01
+#define APPLY_PER_VIEW 0x02
+
+typedef unsigned int DownloadAction;
+#define DL_ACTION_DOWNLOAD 0x01
+#define DL_ACTION_EXECUTE 0x02
enum _Direction {
- Up = GDK_SCROLL_UP,
- Down = GDK_SCROLL_DOWN,
- Left = GDK_SCROLL_LEFT,
- Right = GDK_SCROLL_RIGHT,
- HalfPageUp,
- HalfPageDown,
- PageUp,
- PageDown,
- Top,
- Bottom,
-};
-enum _DwbType {
- Char,
- Integer,
- Double,
- Boolean,
- Pointer,
- ColorChar,
-};
-enum _SettingsScope {
- Global,
- PerView,
-};
-enum _DownloadAction {
- Download,
- Execute,
-};
-typedef enum _DownloadAction DownloadAction;
+ SCROLL_UP = GDK_SCROLL_UP,
+ SCROLL_DOWN = GDK_SCROLL_DOWN,
+ SCROLL_LEFT = GDK_SCROLL_LEFT,
+ SCROLL_RIGHT = GDK_SCROLL_RIGHT,
+ SCROLL_HALF_PAGE_UP,
+ SCROLL_HALF_PAGE_DOWN,
+ SCROLL_PAGE_UP,
+ SCROLL_PAGE_DOWN,
+ SCROLL_TOP,
+ SCROLL_BOTTOM,
+} Direction;
/*}}}*/
-typedef enum _Mode Mode;
-typedef enum _Open Open;
-typedef enum _Layout Layout;
-typedef enum _Direction Direction;
-typedef enum _DwbType DwbType;
-typedef enum _SettingsScope SettingsScope;
-typedef enum _ShowMessage ShowMessage;
/* STRUCTS {{{*/
struct _Navigation {
@@ -440,7 +424,9 @@ struct _Misc {
char *settings_border;
int argc;
char **argv;
- gboolean single;
+
+ gboolean tabbed_browsing;
+
char *startpage;
char *download_com;
diff --git a/src/session.c b/src/session.c
index d2fe92d3..39460232 100644
--- a/src/session.c
+++ b/src/session.c
@@ -125,7 +125,7 @@ dwb_session_restore(const char *name) {
if (!dwb.state.views)
dwb_add_view(NULL);
- if (dwb.state.layout & Maximized && dwb.state.views) {
+ if (dwb.state.layout & MAXIMIZED && dwb.state.views) {
gtk_widget_hide(dwb.gui.right);
for (GList *l = dwb.state.views->next; l; l=l->next) {
gtk_widget_hide(((View*)l->data)->vbox);
diff --git a/src/util.c b/src/util.c
index 082d105d..94b54aea 100644
--- a/src/util.c
+++ b/src/util.c
@@ -124,15 +124,15 @@ Arg *
dwb_util_char_to_arg(char *value, DwbType type) {
errno = 0;
Arg *ret = NULL;
- if (type == Boolean && !value) {
+ if (type == BOOLEAN && !value) {
Arg a = { .b = false };
ret = &a;
}
- else if (value || type == Char) {
+ else if (value || type == CHAR) {
if (value) {
g_strstrip(value);
if (strlen(value) == 0) {
- if (type == Char) {
+ if (type == CHAR) {
Arg a = { .p = NULL };
ret = &a;
return ret;
@@ -140,7 +140,7 @@ dwb_util_char_to_arg(char *value, DwbType type) {
return NULL;
}
}
- if (type == Boolean) {
+ if (type == BOOLEAN) {
if(!g_ascii_strcasecmp(value, "false") || !strcmp(value, "0")) {
Arg a = { .b = false };
ret = &a;
@@ -150,25 +150,25 @@ dwb_util_char_to_arg(char *value, DwbType type) {
ret = &a;
}
}
- else if (type == Integer) {
+ else if (type == INTEGER) {
int n = strtol(value, NULL, 10);
if (n != LONG_MAX && n != LONG_MIN && !errno ) {
Arg a = { .i = n };
ret = &a;
}
}
- else if (type == Double) {
+ else if (type == DOUBLE) {
double d;
if ((d = g_strtod(value, NULL)) ) {
Arg a = { .d = d };
ret = &a;
}
}
- else if (type == Char) {
+ else if (type == CHAR) {
Arg a = { .p = !value || (value && !strcmp(value, "null")) ? NULL : g_strdup(value) };
ret = &a;
}
- else if (type == ColorChar) {
+ else if (type == COLOR_CHAR) {
int length = strlen(value);
if (value[0] == '#' && (length == 4 || length == 7) && dwb_util_is_hex(&value[1])) {
Arg a = { .p = g_strdup(value) };
@@ -182,19 +182,19 @@ dwb_util_char_to_arg(char *value, DwbType type) {
char *
dwb_util_arg_to_char(Arg *arg, DwbType type) {
char *value = NULL;
- if (type == Boolean) {
+ if (type == BOOLEAN) {
if (arg->b)
value = g_strdup("true");
else
value = g_strdup("false");
}
- else if (type == Double) {
+ else if (type == DOUBLE) {
value = g_strdup_printf("%.2f", arg->d);
}
- else if (type == Integer) {
+ else if (type == INTEGER) {
value = g_strdup_printf("%d", arg->i);
}
- else if (type == Char || type == ColorChar) {
+ else if (type == CHAR || type == COLOR_CHAR) {
if (arg->p) {
char *tmp = (char*) arg->p;
value = g_strdup_printf(tmp);
diff --git a/src/view.c b/src/view.c
index b9953b46..fcb8ce5c 100644
--- a/src/view.c
+++ b/src/view.c
@@ -208,7 +208,7 @@ dwb_web_view_mime_type_policy_cb(WebKitWebView *web, WebKitWebFrame *frame, WebK
v->status->mimetype = g_strdup(mimetype);
- if (!webkit_web_view_can_show_mime_type(web, mimetype) || dwb.state.nv == OpenDownload) {
+ if (!webkit_web_view_can_show_mime_type(web, mimetype) || dwb.state.nv == OPEN_DOWNLOAD) {
dwb.state.mimetype_request = g_strdup(mimetype);
webkit_web_policy_decision_download(policy);
return true;
@@ -241,25 +241,25 @@ dwb_web_view_navigation_policy_cb(WebKitWebView *web, WebKitWebFrame *frame, Web
}
}
- if (dwb.state.nv == OpenNewView || dwb.state.nv == OpenNewWindow) {
- if (dwb.state.nv == OpenNewView) {
- dwb.state.nv = OpenNormal;
+ if (dwb.state.nv == OPEN_NEW_VIEW || dwb.state.nv == OPEN_NEW_WINDOW) {
+ if (dwb.state.nv == OPEN_NEW_VIEW) {
+ dwb.state.nv = OPEN_NORMAL;
dwb_add_view(&a);
}
else {
dwb_new_window(&a);
}
- dwb.state.nv = OpenNormal;
+ dwb.state.nv = OPEN_NORMAL;
return true;
}
const char *request_uri = webkit_network_request_get_uri(request);
WebKitWebNavigationReason reason = webkit_web_navigation_action_get_reason(action);
if (reason == WEBKIT_WEB_NAVIGATION_REASON_FORM_SUBMITTED) {
- if (dwb.state.mode == InsertMode) {
+ if (dwb.state.mode == INSERT_MODE) {
dwb_normal_mode(true);
}
- if (dwb.state.mode == SearchFieldMode) {
+ if (dwb.state.mode == SEARCH_FIELD_MODE) {
webkit_web_policy_decision_ignore(policy);
dwb.state.search_engine = dwb.state.form_name && !g_strrstr(request_uri, HINT_SEARCH_SUBMIT)
? g_strdup_printf("%s?%s=%s", request_uri, dwb.state.form_name, HINT_SEARCH_SUBMIT)
@@ -419,7 +419,7 @@ static gboolean
dwb_view_entry_keyrelease_cb(GtkWidget* entry, GdkEventKey *e) {
Mode mode = dwb.state.mode;
- if (mode == HintMode) {
+ if (mode == HINT_MODE) {
if (DIGIT(e) || DWB_TAB_KEY(e)) {
return true;
}
@@ -427,7 +427,7 @@ dwb_view_entry_keyrelease_cb(GtkWidget* entry, GdkEventKey *e) {
return dwb_update_hints(e);
}
}
- else if (mode == FindMode) {
+ else if (mode == FIND_MODE) {
dwb_update_search(dwb.state.forward_search);
}
return false;
@@ -441,7 +441,7 @@ dwb_view_entry_keypress_cb(GtkWidget* entry, GdkEventKey *e) {
if (e->keyval == GDK_BackSpace) {
return false;
}
- if (mode == HintMode) {
+ if (mode == HINT_MODE) {
if (DIGIT(e) || DWB_TAB_KEY(e)) {
return dwb_update_hints(e);
}
@@ -449,7 +449,7 @@ dwb_view_entry_keypress_cb(GtkWidget* entry, GdkEventKey *e) {
return true;
}
}
- else if (mode == SearchFieldMode) {
+ else if (mode == SEARCH_FIELD_MODE) {
if (DWB_TAB_KEY(e)) {
return dwb_update_hints(e);
}
@@ -457,7 +457,7 @@ dwb_view_entry_keypress_cb(GtkWidget* entry, GdkEventKey *e) {
return false;
}
}
- else if (mode == DownloadGetPath) {
+ else if (mode == DOWNLOAD_GET_PATH) {
if (DWB_TAB_KEY(e)) {
dwb_comp_complete_download(e->state & GDK_SHIFT_MASK);
return true;
@@ -466,10 +466,10 @@ dwb_view_entry_keypress_cb(GtkWidget* entry, GdkEventKey *e) {
dwb_comp_clean_path_completion();
}
}
- else if (mode & CompletionMode && e->keyval != GDK_Tab && e->keyval != GDK_ISO_Left_Tab && !e->is_modifier && !CLEAN_STATE(e)) {
+ else if (mode & COMPLETION_MODE && e->keyval != GDK_Tab && e->keyval != GDK_ISO_Left_Tab && !e->is_modifier && !CLEAN_STATE(e)) {
dwb_comp_clean_completion();
}
- else if (mode == FindMode) {
+ else if (mode == FIND_MODE) {
return false;
}
else if (DWB_TAB_KEY(e)) {
@@ -488,29 +488,29 @@ dwb_view_entry_activate_cb(GtkEntry* entry) {
gboolean ret = false;
Mode mode = dwb.state.mode;
- if (mode == HintMode) {
+ if (mode == HINT_MODE) {
ret = false;
}
- else if (mode == FindMode) {
+ else if (mode == FIND_MODE) {
dwb_focus_scroll(dwb.state.fview);
dwb_search(NULL);
}
- else if (mode == SearchFieldMode) {
+ else if (mode == SEARCH_FIELD_MODE) {
dwb_submit_searchengine();
}
- else if (mode == SettingsMode) {
+ else if (mode == SETTINGS_MODE) {
dwb_parse_setting(GET_TEXT());
}
- else if (mode == KeyMode) {
+ else if (mode == KEY_MODE) {
dwb_parse_key_setting(GET_TEXT());
}
- else if (mode == CommandMode) {
+ else if (mode == COMMAND_MODE) {
dwb_parse_command_line(GET_TEXT());
}
- else if (mode == DownloadGetPath) {
+ else if (mode == DOWNLOAD_GET_PATH) {
dwb_dl_start();
}
- else if (mode == SaveSession) {
+ else if (mode == SAVE_SESSION) {
dwb_session_save(GET_TEXT());
dwb_end();
}
@@ -750,7 +750,7 @@ dwb_view_new_reorder() {
CLEAR_COMMAND_TEXT(dwb.state.views);
gtk_widget_reparent(views->vbox, dwb.gui.right);
gtk_box_reorder_child(GTK_BOX(dwb.gui.right), views->vbox, 0);
- if (dwb.state.layout & Maximized) {
+ if (dwb.state.layout & MAXIMIZED) {
gtk_widget_hide(((View *)dwb.state.fview->data)->vbox);
if (dwb.state.fview != dwb.state.views) {
gtk_widget_hide(dwb.gui.right);
@@ -791,13 +791,13 @@ dwb_parse_setting(const char *text) {
Arg *a = NULL;
char **token = g_strsplit(text, " ", 2);
- GHashTable *t = dwb.state.setting_apply == Global ? dwb.settings : ((View*)dwb.state.fview->data)->setting;
+ GHashTable *t = dwb.state.setting_apply == APPLY_GLOBAL ? dwb.settings : ((View*)dwb.state.fview->data)->setting;
if (token[0]) {
if ( (s = g_hash_table_lookup(t, token[0])) ) {
- if ( (a = dwb_util_char_to_arg(token[1], s->type)) || (s->type == Char && a->p == NULL)) {
+ if ( (a = dwb_util_char_to_arg(token[1], s->type)) || (s->type == CHAR && a->p == NULL)) {
s->arg = *a;
dwb_apply_settings(s);
- dwb_set_normal_message(dwb.state.fview, true, "Saved setting %s: %s", s->n.first, s->type == Boolean ? ( s->arg.b ? "true" : "false") : token[1]);
+ dwb_set_normal_message(dwb.state.fview, true, "Saved setting %s: %s", s->n.first, s->type == BOOLEAN ? ( s->arg.b ? "true" : "false") : token[1]);
dwb_save_settings();
}
else {
@@ -843,7 +843,7 @@ dwb_parse_key_setting(const char *text) {
static void
dwb_apply_settings(WebSettings *s) {
WebSettings *new;
- if (dwb.state.setting_apply == Global) {
+ if (dwb.state.setting_apply == APPLY_GLOBAL) {
new = g_hash_table_lookup(dwb.settings, s->n.first);
new->arg = s->arg;
for (GList *l = dwb.state.views; l; l=l->next) {