summaryrefslogtreecommitdiff
path: root/render/html_redraw.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-08-24 12:29:30 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-08-24 12:29:30 +0000
commit63c07ee28d890c4afd83233bb055d482b92162c9 (patch)
treef2fd049d8603c4d9c52b906358b061ebc1e78a84 /render/html_redraw.c
parent85ec83636d60fe945bc3df00cb20d9a850ce7ae8 (diff)
downloadnetsurf-63c07ee28d890c4afd83233bb055d482b92162c9.tar.gz
netsurf-63c07ee28d890c4afd83233bb055d482b92162c9.tar.bz2
Core part of search improvement:
+ Split up browser window and content related elements of html & text search. + Associate search contexts with contents, rather than browser windows. + Remove highlighting of search terms dependency on current_redraw_browser. + Fixes issues with search contexts being applied to the wrong content. svn path=/trunk/netsurf/; revision=12646
Diffstat (limited to 'render/html_redraw.c')
-rw-r--r--render/html_redraw.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/render/html_redraw.c b/render/html_redraw.c
index 426ce2a82..fb9b7b7b4 100644
--- a/render/html_redraw.c
+++ b/render/html_redraw.c
@@ -39,7 +39,6 @@
#include "desktop/selection.h"
#include "desktop/options.h"
#include "desktop/print.h"
-#include "desktop/search.h"
#include "desktop/scrollbar.h"
#include "image/bitmap.h"
#include "render/box.h"
@@ -47,6 +46,7 @@
#include "render/form.h"
#include "render/html_internal.h"
#include "render/layout.h"
+#include "render/search.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/utils.h"
@@ -831,7 +831,9 @@ bool html_redraw_text_box(const html_content *html, struct box *box,
if (!text_redraw(box->text, box->length, box->byte_offset,
box->space, &fstyle, x, y,
- clip, box->height, scale, excluded, &html->sel, ctx))
+ clip, box->height, scale, excluded,
+ (struct content *)html, &html->sel,
+ html->search, ctx))
return false;
return true;
@@ -859,7 +861,8 @@ bool html_redraw_text_box(const html_content *html, struct box *box,
bool text_redraw(const char *utf8_text, size_t utf8_len,
size_t offset, int space, const plot_font_style_t *fstyle,
int x, int y, const struct rect *clip, int height,
- float scale, bool excluded, const struct selection *sel,
+ float scale, bool excluded, struct content *c,
+ const struct selection *sel, struct search_context *search,
const struct redraw_context *ctx)
{
const struct plotter_table *plot = ctx->plot;
@@ -883,14 +886,11 @@ bool text_redraw(const char *utf8_text, size_t utf8_len,
}
/* what about the current search operation, if any? */
- if (!highlighted && (current_redraw_browser->search_context
- != NULL) &&
- search_term_highlighted(
- current_redraw_browser,
+ if (!highlighted && (search != NULL) &&
+ search_term_highlighted(c,
offset, offset + len,
&start_idx, &end_idx,
- current_redraw_browser->
- search_context)) {
+ search)) {
highlighted = true;
}