summaryrefslogtreecommitdiff
path: root/desktop/browser.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2012-03-22 09:34:34 +0000
committerVincent Sanders <vince@netsurf-browser.org>2012-03-22 09:34:34 +0000
commit1490b52a6b96b6a69a0c4fe9e0515dc717425128 (patch)
tree8caba44a9da98e6cebf4f188e3232534b1596a4d /desktop/browser.c
parent0797bf5a5731b2c8d55105b453530584ea4e1f5b (diff)
downloadnetsurf-1490b52a6b96b6a69a0c4fe9e0515dc717425128.tar.gz
netsurf-1490b52a6b96b6a69a0c4fe9e0515dc717425128.tar.bz2
NetSurf options rework (a=vince r=daniels,jmb)
svn path=/trunk/netsurf/; revision=13548
Diffstat (limited to 'desktop/browser.c')
-rw-r--r--desktop/browser.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/desktop/browser.c b/desktop/browser.c
index 6f35f7c97..dbdb725e2 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -158,7 +158,8 @@ bool browser_window_redraw(struct browser_window *bw, int x, int y,
/* Browser window has content OR children (frames) */
- if (bw->window != NULL && ctx->plot->option_knockout) {
+ if ((bw->window != NULL) &&
+ (ctx->plot->option_knockout)) {
/* Root browser window: start knockout */
knockout_plot_start(ctx, &new_ctx);
}
@@ -725,7 +726,7 @@ void browser_window_initialise_common(struct browser_window *bw,
bw->reformat_pending = false;
bw->drag_type = DRAGGING_NONE;
- bw->scale = (float) option_scale / 100.0;
+ bw->scale = (float) nsoption_int(scale) / 100.0;
bw->scroll_x = NULL;
bw->scroll_y = NULL;
@@ -2157,7 +2158,7 @@ struct browser_window *browser_window_find_target(struct browser_window *bw,
if ((!(mouse & BROWSER_MOUSE_CLICK_2)) &&
(!((mouse & BROWSER_MOUSE_CLICK_2) &&
(mouse & BROWSER_MOUSE_MOD_2))) &&
- (!option_target_blank)) {
+ (!nsoption_bool(target_blank))) {
/* not a mouse button 2 click
* not a mouse button 1 click with ctrl pressed
* configured to ignore target="_blank" */
@@ -2166,12 +2167,14 @@ struct browser_window *browser_window_find_target(struct browser_window *bw,
}
/* handle reserved keywords */
- if (((option_button_2_tab) && (mouse & BROWSER_MOUSE_CLICK_2)) ||
- ((!option_button_2_tab) &&
- ((mouse & BROWSER_MOUSE_CLICK_1) &&
- (mouse & BROWSER_MOUSE_MOD_2))) ||
- ((option_button_2_tab) && ((target == TARGET_BLANK) ||
- (!strcasecmp(target, "_blank"))))) {
+ if (((nsoption_bool(button_2_tab)) &&
+ (mouse & BROWSER_MOUSE_CLICK_2))||
+ ((!nsoption_bool(button_2_tab)) &&
+ ((mouse & BROWSER_MOUSE_CLICK_1) &&
+ (mouse & BROWSER_MOUSE_MOD_2))) ||
+ ((nsoption_bool(button_2_tab)) &&
+ ((target == TARGET_BLANK) ||
+ (!strcasecmp(target, "_blank"))))) {
/* open in new tab if:
* - button_2 opens in new tab and button_2 was pressed
* OR
@@ -2184,13 +2187,14 @@ struct browser_window *browser_window_find_target(struct browser_window *bw,
if (!bw_target)
return bw;
return bw_target;
- } else if (((!option_button_2_tab) &&
- (mouse & BROWSER_MOUSE_CLICK_2)) ||
- ((option_button_2_tab) &&
- ((mouse & BROWSER_MOUSE_CLICK_1) &&
- (mouse & BROWSER_MOUSE_MOD_2))) ||
- ((!option_button_2_tab) && ((target == TARGET_BLANK) ||
- (!strcasecmp(target, "_blank"))))) {
+ } else if (((!nsoption_bool(button_2_tab)) &&
+ (mouse & BROWSER_MOUSE_CLICK_2)) ||
+ ((nsoption_bool(button_2_tab)) &&
+ ((mouse & BROWSER_MOUSE_CLICK_1) &&
+ (mouse & BROWSER_MOUSE_MOD_2))) ||
+ ((!nsoption_bool(button_2_tab)) &&
+ ((target == TARGET_BLANK) ||
+ (!strcasecmp(target, "_blank"))))) {
/* open in new window if:
* - button_2 doesn't open in new tabs and button_2 was pressed
* OR
@@ -2231,8 +2235,9 @@ struct browser_window *browser_window_find_target(struct browser_window *bw,
return bw_target;
/* we require a new window using the target name */
- if (!option_target_blank)
+ if (!nsoption_bool(target_blank))
return bw;
+
bw_target = browser_window_create(NULL, bw, NULL, false, false);
if (!bw_target)
return bw;