NetSurf
|
Interface to HTML searching. More...
Go to the source code of this file.
Functions | |
struct search_context * | search_create_context (struct content *c, content_type type, void *context) |
create a search_context More... | |
void | search_destroy_context (struct search_context *context) |
Ends the search process, invalidating all state freeing the list of found boxes. More... | |
void | search_step (struct search_context *context, search_flags_t flags, const char *string) |
Begins/continues the search process. More... | |
bool | search_term_highlighted (struct content *c, unsigned start_offset, unsigned end_offset, unsigned *start_idx, unsigned *end_idx, struct search_context *context) |
Determines whether any portion of the given text box should be selected because it matches the current search string. More... | |
Interface to HTML searching.
Definition in file search.h.
struct search_context* search_create_context | ( | struct content * | c, |
content_type | type, | ||
void * | context | ||
) |
create a search_context
c | The content the search_context is connected to |
type | The content type of c |
context | A context pointer passed to the provider routines. |
Definition at line 80 of file search.c.
References search_context::c, CONTENT_HTML, CONTENT_TEXTPLAIN, search_context::current, list_entry::end_box, list_entry::end_idx, search_context::found, search_context::gui_p, search_context::is_html, search_context::newsearch, list_entry::next, list_entry::prev, search_context::prev_case_sens, list_entry::sel, list_entry::start_box, list_entry::start_idx, and search_context::string.
Referenced by html_search(), and textplain_search().
void search_destroy_context | ( | struct search_context * | context | ) |
Ends the search process, invalidating all state freeing the list of found boxes.
Definition at line 648 of file search.c.
References gui_search_table::add_recent, gui_search_table::back_state, gui_search_table::forward_state, free_matches(), search_context::gui_p, guit, netsurf_table::search, and search_context::string.
Referenced by html_close(), html_search(), html_search_clear(), textplain_close(), textplain_search(), and textplain_search_clear().
void search_step | ( | struct search_context * | context, |
search_flags_t | flags, | ||
const char * | string | ||
) |
Begins/continues the search process.
context | The search context in use. |
flags | The flags forward/back etc |
string | The string to match |
Definition at line 592 of file search.c.
References gui_search_table::add_recent, content_msg_data::area, gui_search_table::back_state, search_context::c, content_broadcast(), CONTENT_MSG_SCROLL, gui_search_table::forward_state, free_matches(), search_context::gui_p, guit, content_msg_data::scroll, netsurf_table::search, search_text(), gui_search_table::status, content_msg_data::x0, and content_msg_data::y0.
Referenced by html_search(), and textplain_search().
bool search_term_highlighted | ( | struct content * | c, |
unsigned | start_offset, | ||
unsigned | end_offset, | ||
unsigned * | start_idx, | ||
unsigned * | end_idx, | ||
struct search_context * | context | ||
) |
Determines whether any portion of the given text box should be selected because it matches the current search string.
c | The content to hilight within. |
start_offset | byte offset within text of string to be checked |
end_offset | byte offset within text |
start_idx | byte offset within string of highlight start |
end_idx | byte offset of highlight end |
context | The search context to hilight entries from. |
Definition at line 626 of file search.c.
References search_context::c, search_context::found, list_entry::next, list_entry::sel, selection_defined, and selection_highlighted().
Referenced by text_draw(), text_redraw(), and textplain_redraw().