From dd59552f6e9be9b4d81b6153e1a6f5bbbb39cc2c Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 25 Oct 2014 15:34:22 +0100 Subject: [PATCH] Attempt to remove dependancy of search implementation on bw internals. --- atari/rootwin.c | 2 +- atari/search.c | 22 +++++++++++----------- atari/search.h | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/atari/rootwin.c b/atari/rootwin.c index 544bb8a65..3ef150b6c 100755 --- a/atari/rootwin.c +++ b/atari/rootwin.c @@ -663,7 +663,7 @@ void window_open_search(ROOTWIN *rootwin, bool reformat) obj = toolbar_get_form(rootwin->toolbar); if (gw->search == NULL) { - gw->search = nsatari_search_session_create(obj, bw); + gw->search = nsatari_search_session_create(obj, gw); } toolbar_set_visible(rootwin->toolbar, TOOLBAR_AREA_SEARCH, true); diff --git a/atari/search.c b/atari/search.c index cb2770e88..089b1c1e6 100644 --- a/atari/search.c +++ b/atari/search.c @@ -83,9 +83,9 @@ void nsatari_search_set_hourglass(bool active, void *p) SEARCH_FORM_SESSION s = (SEARCH_FORM_SESSION)p; LOG(("active: %d, session: %p", active, p)); if (active) - gui_window_set_pointer(s->bw->window, GUI_POINTER_PROGRESS); + gui_window_set_pointer(s->g, GUI_POINTER_PROGRESS); else - gui_window_set_pointer(s->bw->window, GUI_POINTER_DEFAULT); + gui_window_set_pointer(s->g, GUI_POINTER_DEFAULT); } /** @@ -117,7 +117,7 @@ void nsatari_search_set_forward_state(bool active, void *p) /* deactivate back cb */ LOG(("%p: set forward state: %d\n", p, active)); - gw = s->bw->window; + gw = s->g; toolbar = toolbar_get_form(gw->root->toolbar); if(active) @@ -145,7 +145,7 @@ void nsatari_search_set_back_state(bool active, void *p) LOG(("%p: set back state: %d\n", p, active)); s->state.back_avail = active; - gw = s->bw->window; + gw = s->g; toolbar = toolbar_get_form(gw->root->toolbar); if(active) @@ -222,7 +222,7 @@ void nsatari_search_session_destroy(struct s_search_form_session *s) { if (s != NULL) { LOG(("")); - browser_window_search_clear(s->bw); + browser_window_search_clear(s->g->browser->bw); free(s); } } @@ -259,11 +259,11 @@ void nsatari_search_perform(struct s_search_form_session *s, OBJECT *obj, search_flags_t f) { assert(s!=null); - assert(input_window->browser->bw == s->bw); + assert(input_window->browser->bw == s->g->browser->bw); if(search_session_compare(s, obj)){ - browser_window_search_clear(s->bw); + browser_window_search_clear(s->g->browser->bw); apply_form(obj, &s->state); } else { @@ -275,7 +275,7 @@ void nsatari_search_perform(struct s_search_form_session *s, OBJECT *obj, else s->state.flags &= (~SEARCH_FLAG_FORWARDS); - browser_window_search(s->bw, s, + browser_window_search(s->g->browser->bw, s, s->state.flags, gemtk_obj_get_text(obj, TOOLBAR_TB_SRCH)); @@ -283,7 +283,7 @@ void nsatari_search_perform(struct s_search_form_session *s, OBJECT *obj, struct s_search_form_session * nsatari_search_session_create(OBJECT * obj, - struct browser_window *bw) + struct gui_window *gw) { struct s_search_form_session *sfs; @@ -292,11 +292,11 @@ struct s_search_form_session * nsatari_search_session_create(OBJECT * obj, assert(obj); assert(sfs); - sfs->bw = bw; + sfs->g = gw; apply_form(obj, &sfs->state); - browser_window_search_clear(bw); + browser_window_search_clear(gw->browser->bw); return(sfs); } diff --git a/atari/search.h b/atari/search.h index 0f427d62c..ee5256778 100644 --- a/atari/search.h +++ b/atari/search.h @@ -32,14 +32,14 @@ struct s_search_form_state { }; struct s_search_form_session { - struct browser_window *bw; + struct gui_window *g; struct s_search_form_state state; }; typedef struct s_search_form_session * SEARCH_FORM_SESSION; struct s_search_form_session * nsatari_search_session_create(OBJECT * obj, - struct browser_window *bw); + struct gui_window *gw); struct gui_search_table *atari_search_table;