summaryrefslogtreecommitdiff
path: root/render
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 /render
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 'render')
-rw-r--r--render/box_construct.c13
-rw-r--r--render/font.c4
-rw-r--r--render/html.c8
-rw-r--r--render/html_interaction.c2
-rw-r--r--render/html_redraw.c2
-rw-r--r--render/layout.c4
-rw-r--r--render/search.c1
-rw-r--r--render/textplain.c2
8 files changed, 18 insertions, 18 deletions
diff --git a/render/box_construct.c b/render/box_construct.c
index 4b280fbe9..b53328d1f 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -404,9 +404,9 @@ static bool box_construct_marker(struct box *box, const char *title,
break;
}
- if (css_computed_list_style_image(box->style, &image_uri) ==
- CSS_LIST_STYLE_IMAGE_URI && image_uri != NULL &&
- option_foreground_images == true) {
+ if (css_computed_list_style_image(box->style, &image_uri) == CSS_LIST_STYLE_IMAGE_URI &&
+ (image_uri != NULL) &&
+ (nsoption_bool(foreground_images) == true)) {
nsurl *url;
nserror error;
@@ -712,7 +712,7 @@ bool box_construct_element(struct box_construct_ctx *ctx,
/* Kick off fetch for any background image */
if (css_computed_background_image(box->style, &bgimage_uri) ==
CSS_BACKGROUND_IMAGE_IMAGE && bgimage_uri != NULL &&
- option_background_images == true) {
+ nsoption_bool(background_images) == true) {
nsurl *url;
nserror error;
@@ -1380,8 +1380,9 @@ bool box_image(BOX_SPECIAL_PARAMS)
box->length = strlen(box->text);
}
- if (option_foreground_images == false)
+ if (nsoption_bool(foreground_images) == false) {
return true;
+ }
/* imagemap associated with this image */
if (!box_get_attribute(n, "usemap", content, &box->usemap))
@@ -2041,7 +2042,7 @@ bool box_input(BOX_SPECIAL_PARAMS)
if (box->style && css_computed_display(box->style,
n->parent == NULL) != CSS_DISPLAY_NONE &&
- option_foreground_images == true) {
+ nsoption_bool(foreground_images) == true) {
if ((s = (char *) xmlGetProp(n,
(const xmlChar*) "src"))) {
error = nsurl_join(content->base_url, s, &url);
diff --git a/render/font.c b/render/font.c
index 87511b261..a98a89ada 100644
--- a/render/font.c
+++ b/render/font.c
@@ -49,8 +49,8 @@ void font_plot_style_from_css(const css_computed_style *css,
INTTOFIX(FONT_SIZE_SCALE)));
/* Clamp font size to configured minimum */
- if (fstyle->size < (option_font_min_size * FONT_SIZE_SCALE) / 10)
- fstyle->size = (option_font_min_size * FONT_SIZE_SCALE) / 10;
+ if (fstyle->size < (nsoption_int(font_min_size) * FONT_SIZE_SCALE) / 10)
+ fstyle->size = (nsoption_int(font_min_size) * FONT_SIZE_SCALE) / 10;
fstyle->weight = plot_font_weight(css_computed_font_weight(css));
fstyle->flags = plot_font_flags(css_computed_font_style(css),
diff --git a/render/html.c b/render/html.c
index 1e447b1c1..26232a230 100644
--- a/render/html.c
+++ b/render/html.c
@@ -1205,7 +1205,7 @@ bool html_find_stylesheets(html_content *c, xmlNode *html)
c->base.active++;
}
- if (option_block_ads) {
+ if (nsoption_bool(block_ads)) {
ns_error = hlcache_handle_retrieve(html_adblock_stylesheet_url,
0, content_get_url(&c->base), NULL,
html_convert_css_callback, c, &child, accept,
@@ -1791,7 +1791,7 @@ nserror html_object_callback(hlcache_handle *object,
* 5) the time since the previous reformat is more than the
* configured minimum time between reformats
* then reformat the page to display newly fetched objects */
- else if (option_incremental_reflow &&
+ else if (nsoption_bool(incremental_reflow) &&
event->type == CONTENT_MSG_DONE &&
!(box->flags & REPLACE_DIM) &&
(c->base.status == CONTENT_STATUS_READY ||
@@ -1966,8 +1966,8 @@ void html_reformat(struct content *c, int width, int height)
time_taken = wallclock() - time_before;
c->reformat_time = wallclock() +
- ((time_taken * 3 < option_min_reflow_period ?
- option_min_reflow_period : time_taken * 3));
+ ((time_taken * 3 < nsoption_int(min_reflow_period) ?
+ nsoption_int(min_reflow_period) : time_taken * 3));
}
diff --git a/render/html_interaction.c b/render/html_interaction.c
index 91bbd920e..0078b3070 100644
--- a/render/html_interaction.c
+++ b/render/html_interaction.c
@@ -372,7 +372,7 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
status = messages_get("FormSelect");
pointer = GUI_POINTER_MENU;
if (mouse & BROWSER_MOUSE_CLICK_1 &&
- option_core_select_menu) {
+ nsoption_bool(core_select_menu)) {
html->visible_select_menu = gadget;
form_open_select_menu(c, gadget,
form_select_menu_callback,
diff --git a/render/html_redraw.c b/render/html_redraw.c
index bfef82406..5473152e5 100644
--- a/render/html_redraw.c
+++ b/render/html_redraw.c
@@ -2252,7 +2252,7 @@ bool html_redraw_inline_background(int x, int y, struct box *box, float scale,
plot_content = (box->background != NULL);
- if (html_redraw_printing && option_remove_backgrounds)
+ if (html_redraw_printing && nsoption_bool(remove_backgrounds))
return true;
if (plot_content) {
diff --git a/render/layout.c b/render/layout.c
index d1eefdc46..ac6339757 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -2402,7 +2402,7 @@ bool layout_line(struct box *first, int *width, int *y,
opt_maxwidth =opt_width;
}
b->width = opt_maxwidth;
- if (option_core_select_menu)
+ if (nsoption_bool(core_select_menu))
b->width += SCROLLBAR_WIDTH;
} else {
font_func->font_width(&fstyle, b->text,
@@ -3076,7 +3076,7 @@ struct box *layout_minmax_line(struct box *first,
}
b->width = opt_maxwidth;
- if (option_core_select_menu)
+ if (nsoption_bool(core_select_menu))
b->width += SCROLLBAR_WIDTH;
} else {
diff --git a/render/search.c b/render/search.c
index a1852c22a..a51b279da 100644
--- a/render/search.c
+++ b/render/search.c
@@ -29,7 +29,6 @@
#include "content/hlcache.h"
#include "desktop/browser.h"
#include "desktop/gui.h"
-#include "desktop/options.h"
#include "desktop/selection.h"
#include "render/box.h"
#include "render/html.h"
diff --git a/render/textplain.c b/render/textplain.c
index eabc19b20..f397689ee 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -267,7 +267,7 @@ nserror textplain_create_internal(textplain_content *c, lwc_string *encoding)
parserutils_error error;
union content_msg_data msg_data;
- textplain_style.size = (option_font_size * FONT_SIZE_SCALE) / 10;
+ textplain_style.size = (nsoption_int(font_size) * FONT_SIZE_SCALE) / 10;
utf8_data = talloc_array(c, char, CHUNK);
if (utf8_data == NULL)