diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2013-09-02 16:19:16 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2013-09-02 16:19:16 +0100 |
commit | 49c7994d0580a655ddcc78e07205eea45d74132c (patch) | |
tree | 7047078437c94d519654fd2ad86f5a8e5be43af3 /riscos | |
parent | 46e569c481f1c5196fd90b05bd801809355f2d84 (diff) | |
download | netsurf-49c7994d0580a655ddcc78e07205eea45d74132c.tar.gz netsurf-49c7994d0580a655ddcc78e07205eea45d74132c.tar.bz2 |
Remove bulk of old treeview implementation.
Diffstat (limited to 'riscos')
-rw-r--r-- | riscos/cookies.c | 7 | ||||
-rw-r--r-- | riscos/global_history.c | 9 | ||||
-rw-r--r-- | riscos/gui.c | 7 | ||||
-rw-r--r-- | riscos/hotlist.c | 9 | ||||
-rw-r--r-- | riscos/sslcert.c | 2 | ||||
-rw-r--r-- | riscos/treeview.c | 20 | ||||
-rw-r--r-- | riscos/treeview.h | 1 |
7 files changed, 13 insertions, 42 deletions
diff --git a/riscos/cookies.c b/riscos/cookies.c index c2dcc4ecd..ea961e2dc 100644 --- a/riscos/cookies.c +++ b/riscos/cookies.c @@ -30,6 +30,7 @@ #include "oslib/wimp.h" #include "oslib/wimpspriteop.h" #include "content/urldb.h" +#include "desktop/cookie_manager.h" #include "desktop/cookies_old.h" #include "desktop/tree.h" #include "riscos/cookies.h" @@ -165,8 +166,6 @@ void ro_gui_cookies_postinitialise(void) void ro_gui_cookies_open(void) { - tree_set_redraw(ro_treeview_get_tree(cookies_window.tv), true); - ro_gui_cookies_toolbar_update_buttons(); if (!ro_gui_dialog_open_top(cookies_window.window, @@ -220,7 +219,7 @@ void ro_gui_cookies_toolbar_update_buttons(void) { ro_toolbar_set_button_shaded_state(cookies_window.toolbar, TOOLBAR_BUTTON_DELETE, - !ro_treeview_has_selection(cookies_window.tv)); + !cookie_manager_has_selection()); } @@ -256,7 +255,7 @@ bool ro_gui_cookies_menu_prepare(wimp_w w, wimp_i i, wimp_menu *menu, if (menu != cookies_window.menu) return false; - selection = ro_treeview_has_selection(cookies_window.tv); + selection = cookie_manager_has_selection(); ro_gui_menu_set_entry_shaded(cookies_window.menu, TREE_SELECTION, !selection); diff --git a/riscos/global_history.c b/riscos/global_history.c index 830f17cd9..704f80426 100644 --- a/riscos/global_history.c +++ b/riscos/global_history.c @@ -31,6 +31,7 @@ #include "oslib/wimpspriteop.h" #include "content/urldb.h" #include "desktop/history_global_core.h" +#include "desktop/global_history.h" #include "desktop/tree.h" #include "riscos/dialog.h" #include "riscos/global_history.h" @@ -171,8 +172,6 @@ void ro_gui_global_history_postinitialise(void) void ro_gui_global_history_open(void) { - tree_set_redraw(ro_treeview_get_tree(global_history_window.tv), true); - ro_gui_global_history_toolbar_update_buttons(); if (!ro_gui_dialog_open_top(global_history_window.window, @@ -230,11 +229,11 @@ void ro_gui_global_history_toolbar_update_buttons(void) { ro_toolbar_set_button_shaded_state(global_history_window.toolbar, TOOLBAR_BUTTON_DELETE, - !ro_treeview_has_selection(global_history_window.tv)); + !global_history_has_selection()); ro_toolbar_set_button_shaded_state(global_history_window.toolbar, TOOLBAR_BUTTON_LAUNCH, - !ro_treeview_has_selection(global_history_window.tv)); + !global_history_has_selection()); } @@ -270,7 +269,7 @@ bool ro_gui_global_history_menu_prepare(wimp_w w, wimp_i i, wimp_menu *menu, if (menu != global_history_window.menu) return false; - selection = ro_treeview_has_selection(global_history_window.tv); + selection = global_history_has_selection(); ro_gui_menu_set_entry_shaded(global_history_window.menu, TREE_SELECTION, !selection); diff --git a/riscos/gui.c b/riscos/gui.c index d450b6dac..c402b887b 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -429,7 +429,6 @@ static void gui_init(int argc, char** argv) int length; char *nsdir_temp; byte *base; - char *tree_icons_dir; /* re-enable all FPU exceptions/traps except inexact operations, * which we're not interested in, and underflow which is incorrectly @@ -458,12 +457,6 @@ static void gui_init(int argc, char** argv) ro_plot_patterned_lines = false; } - tree_icons_dir = strdup("NetSurf:Resources.Icons"); - if (tree_icons_dir == NULL) - die("Failed initialising string options"); - tree_set_icon_dir(tree_icons_dir); - - /* Create our choices directories */ ro_gui_create_dirs(); diff --git a/riscos/hotlist.c b/riscos/hotlist.c index 9b1e9f140..a0a1cf61d 100644 --- a/riscos/hotlist.c +++ b/riscos/hotlist.c @@ -34,6 +34,7 @@ #include "content/hlcache.h" #include "content/urldb.h" #include "desktop/hotlist_old.h" +#include "desktop/hotlist.h" #include "desktop/tree.h" #include "riscos/dialog.h" #include "riscos/hotlist.h" @@ -215,8 +216,6 @@ void ro_gui_hotlist_open(void) error->errmess); } - tree_set_redraw(ro_treeview_get_tree(hotlist_window.tv), true); - ro_gui_hotlist_toolbar_update_buttons(); if (!ro_gui_dialog_open_top(hotlist_window.window, @@ -277,11 +276,11 @@ void ro_gui_hotlist_toolbar_update_buttons(void) { ro_toolbar_set_button_shaded_state(hotlist_window.toolbar, TOOLBAR_BUTTON_DELETE, - !ro_treeview_has_selection(hotlist_window.tv)); + !hotlist_has_selection()); ro_toolbar_set_button_shaded_state(hotlist_window.toolbar, TOOLBAR_BUTTON_LAUNCH, - !ro_treeview_has_selection(hotlist_window.tv)); + !hotlist_has_selection()); } @@ -316,7 +315,7 @@ bool ro_gui_hotlist_menu_prepare(wimp_w w, wimp_i i, wimp_menu *menu, if (menu != hotlist_window.menu) return false; - selection = ro_treeview_has_selection(hotlist_window.tv); + selection = hotlist_has_selection(); ro_gui_menu_set_entry_shaded(hotlist_window.menu, TREE_SELECTION, !selection); diff --git a/riscos/sslcert.c b/riscos/sslcert.c index 4835817da..1395d274e 100644 --- a/riscos/sslcert.c +++ b/riscos/sslcert.c @@ -158,8 +158,6 @@ void gui_cert_verify(nsurl *url, return; } - tree_set_redraw(ro_treeview_get_tree(sslcert_window->tv), true); - /* Set up the certificate window event handling. * * (The action buttons are registered as button events, not OK and diff --git a/riscos/treeview.c b/riscos/treeview.c index 5d1126b2e..004091abe 100644 --- a/riscos/treeview.c +++ b/riscos/treeview.c @@ -284,22 +284,6 @@ wimp_w ro_treeview_get_window(ro_treeview *tv) } /** - * Return an indication of whether the supplied treeview object contains a - * selection. - * - * \param *tv The ro_treeview object of interest. - * \return true if there is a selection in the tree; else false. - */ - -bool ro_treeview_has_selection(ro_treeview *tv) -{ - if (tv != NULL) - return tree_node_has_selection(tree_get_root(tv->tree)); - else - return false; -} - -/** * Callback to force a redraw of part of the treeview window. * * \param x Min X Coordinate of area to be redrawn. @@ -853,8 +837,8 @@ static bool ro_treeview_mouse_click(wimp_pointer *pointer) mouse = 0; if (pointer->buttons == wimp_CLICK_MENU) { - if (!tree_node_has_selection(tree_get_root(tv->tree))) - mouse |= BROWSER_MOUSE_CLICK_1; + /* TODO: test for no selection, and pass click to select node */ + /* mouse |= BROWSER_MOUSE_CLICK_1; */ } else { mouse = ro_gui_mouse_click_state(pointer->buttons, wimp_BUTTON_DOUBLE_CLICK_DRAG); diff --git a/riscos/treeview.h b/riscos/treeview.h index 54919522b..0745e00c3 100644 --- a/riscos/treeview.h +++ b/riscos/treeview.h @@ -50,7 +50,6 @@ const struct toolbar_callbacks *ro_treeview_get_toolbar_callbacks(void); struct tree *ro_treeview_get_tree(ro_treeview *tv); wimp_w ro_treeview_get_window(ro_treeview *tv); -bool ro_treeview_has_selection(ro_treeview *tv); void ro_treeview_set_origin(ro_treeview *tv, int x, int y); void ro_treeview_mouse_at(wimp_pointer *pointer); |