On Fri, 2009-08-14 at 10:12 +0000, [email protected] wrote: > Modified: branches/MarkieB/gtkmain/desktop/search.h > URL: > http://source.netsurf-browser.org/branches/MarkieB/gtkmain/desktop/search.h?rev=9285&r1=9284&r2=9285&view=diff > ============================================================================== > --- branches/MarkieB/gtkmain/desktop/search.h (original) > +++ branches/MarkieB/gtkmain/desktop/search.h Fri Aug 14 05:12:32 2009 > @@ -29,11 +29,7 @@ > SEARCH_FLAG_FORWARDS = (1 << 1), > SEARCH_FLAG_SHOWALL = (1 << 2) > } search_flags_t; > - > -void search_step(struct browser_window *bw, search_flags_t flags, > - const char * string); > -struct search_context *search_create_context(struct browser_window *bw); > - > + > /** > * called to clear the context; 'renews' the search too > */ > @@ -43,13 +39,13 @@ > * Change the displayed search status. > * \param found search pattern matched in text > */ > -void gui_search_set_status(bool found); > +typedef void (*search_status_callback)(bool found); > > /** > * display hourglass while searching > * \param active start/stop indicator > */ > -void gui_search_set_hourglass(bool active); > +typedef void (*search_hourglass_callback)(bool active); > > /** > * add search string to recent searches list > @@ -57,20 +53,34 @@ > * core gives no guarantee of the integrity of the const char * > * \param string search pattern > */ > -void gui_search_add_recent(const char *string); > +typedef void (*search_add_recent_callback)(const char *string); > > /** > * activate search forwards button in gui > * \param active activate/inactivate > */ > -void gui_search_set_forward_state(bool active, struct browser_window *bw); > +typedef void (*search_forward_state_callback)(bool active, > + struct browser_window *bw); > > /** > - * activate search forwards button in gui > + * activate search back button in gui > * \param active activate/inactivate > */ > -void gui_search_set_back_state(bool active, struct browser_window *bw); > +typedef void (*search_back_state_callback)(bool active, > + struct browser_window *bw); > > +struct search_callbacks { > + search_forward_state_callback forward_state; > + search_back_state_callback back_state; > + search_status_callback status; > + search_hourglass_callback hourglass; > + search_add_recent_callback add_recent; > +};
All of these callbacks should take a void * for the client context. > +void search_step(struct browser_window *bw, search_flags_t flags, > + const char * string, struct search_callbacks *callbacks); Why does this need a pointer to the callbacks? Surely it's stored in the relevant search context? J.
