From 452a27e74c159096f588e6d27dfabb3b6915ccaa Mon Sep 17 00:00:00 2001 From: Adrian Lees Date: Sun, 17 Apr 2005 03:30:35 +0000 Subject: [project @ 2005-04-17 03:30:35 by adrianl] Search text highlighting in browser windows svn path=/import/netsurf/; revision=1657 --- desktop/gui.h | 6 ++++++ desktop/selection.c | 5 ++--- desktop/selection.h | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'desktop') diff --git a/desktop/gui.h b/desktop/gui.h index df87c16ca..df4fe24f0 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -41,6 +41,8 @@ typedef enum { GUI_POINTER_DEFAULT, GUI_POINTER_POINT, GUI_POINTER_CARET, #include "netsurf/content/content.h" #include "netsurf/desktop/browser.h" +extern struct gui_window *search_current_window; + void gui_init(int argc, char** argv); void gui_init2(int argc, char** argv); void gui_multitask(void); @@ -89,4 +91,8 @@ void gui_create_form_select_menu(struct browser_window *bw, void gui_launch_url(const char *url); +bool gui_search_term_highlighted(struct gui_window *g, struct box *box, + unsigned *start_idx, unsigned *end_idx); + + #endif diff --git a/desktop/selection.c b/desktop/selection.c index afec4180a..fc906f692 100644 --- a/desktop/selection.c +++ b/desktop/selection.c @@ -40,8 +40,6 @@ static inline bool before(const struct box *a, unsigned a_idx, unsigned b); static bool redraw_handler(struct box *box, int offset, size_t length, void *handle); static void selection_redraw(struct selection *s, unsigned start_idx, unsigned end_idx); static unsigned selection_label_subtree(struct selection *s, struct box *node, unsigned idx); -static void selection_set_start(struct selection *s, struct box *box, int idx); -static void selection_set_end(struct selection *s, struct box *box, int idx); static bool save_handler(struct box *box, int offset, size_t length, void *handle); static bool traverse_tree(struct box *box, unsigned start_idx, unsigned end_idx, seln_traverse_handler handler, void *handle); @@ -656,7 +654,8 @@ void selection_set_end(struct selection *s, struct box *box, int idx) bool selection_highlighted(struct selection *s, struct box *box, unsigned *start_idx, unsigned *end_idx) { - assert(selection_defined(s)); /* caller should have checked for efficiency */ + /* caller should have checked first for efficiency */ + assert(selection_defined(s)); assert(s && box); if (box->length > 0) { diff --git a/desktop/selection.h b/desktop/selection.h index 4a5d74980..59af2da9a 100644 --- a/desktop/selection.h +++ b/desktop/selection.h @@ -59,6 +59,8 @@ void selection_reinit(struct selection *s, struct box *root); void selection_clear(struct selection *s, bool redraw); void selection_select_all(struct selection *s); +void selection_set_start(struct selection *s, struct box *box, int idx); +void selection_set_end(struct selection *s, struct box *box, int idx); bool selection_click(struct selection *s, struct box *box, browser_mouse_state mouse, int dx, int dy); void selection_track(struct selection *s, struct box *box, browser_mouse_state mouse, int dx, int dy); -- cgit v1.2.3