From cf8ffa412a55a8884fdd8f348b3fb28108d59b6c Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 2 Sep 2013 22:41:04 +0100 Subject: Remove old hotlist, cookies, and history_global_core modules. New versions of expand/collapse node functions for these modules aren't yet implemented. --- amiga/context_menu.c | 17 +++- amiga/cookies.c | 2 +- amiga/history.c | 1 - amiga/history.h | 1 - amiga/hotlist.c | 36 ------- amiga/menu.c | 4 +- amiga/misc.c | 2 +- amiga/tree.c | 32 +++--- atari/history.c | 2 +- atari/hotlist.c | 19 ++-- atari/misc.c | 2 +- beos/gui.cpp | 6 -- cocoa/BookmarksController.m | 13 ++- cocoa/HistoryWindowController.m | 2 +- content/urldb.c | 1 - desktop/Makefile | 8 +- desktop/browser.c | 2 - desktop/cookie_manager.c | 1 - desktop/cookie_manager.h | 4 + desktop/cookies_old.c | 112 --------------------- desktop/cookies_old.h | 41 -------- desktop/global_history.c | 1 - desktop/global_history.h | 4 + desktop/history_global_core.c | 125 ------------------------ desktop/history_global_core.h | 40 -------- desktop/hotlist.c | 3 +- desktop/hotlist.h | 4 + desktop/hotlist_old.c | 209 ---------------------------------------- desktop/hotlist_old.h | 50 ---------- desktop/sslcert_viewer.c | 1 - desktop/sslcert_viewer.h | 4 + framebuffer/misc.c | 1 - gtk/cookies.c | 12 ++- gtk/gui.c | 2 - gtk/history.c | 16 +-- gtk/hotlist.c | 18 ++-- gtk/scaffolding.c | 4 +- riscos/cookies.c | 10 +- riscos/global_history.c | 13 ++- riscos/gui.c | 3 - riscos/hotlist.c | 52 ++++++---- riscos/menus.c | 3 +- riscos/save.c | 8 +- riscos/window.c | 5 +- test/llcache.c | 10 +- test/urldbtest.c | 6 +- windows/misc.c | 1 - 47 files changed, 164 insertions(+), 749 deletions(-) delete mode 100644 desktop/cookies_old.c delete mode 100644 desktop/cookies_old.h delete mode 100644 desktop/history_global_core.c delete mode 100644 desktop/history_global_core.h delete mode 100644 desktop/hotlist_old.c delete mode 100644 desktop/hotlist_old.h diff --git a/amiga/context_menu.c b/amiga/context_menu.c index 4d4d73aec..5a3da5566 100644 --- a/amiga/context_menu.c +++ b/amiga/context_menu.c @@ -41,7 +41,7 @@ #include "amiga/utf8.h" #include "desktop/browser_private.h" #include "desktop/local_history.h" -#include "desktop/hotlist_old.h" +#include "desktop/hotlist.h" #include "desktop/searchweb.h" #include "desktop/textinput.h" #include "render/form.h" @@ -767,7 +767,14 @@ static uint32 ami_context_menu_hook(struct Hook *hook,Object *item,APTR reserved case CMID_URLHOTLIST: case CMID_PAGEHOTLIST: - hotlist_old_add_page(userdata); + { + nsurl *nsurl; + if (nsurl_create(url, &nsurl) != NSERROR_OK) + break; + + hotlist_add_url(nsurl); + nsurl_unref(nsurl); + } break; case CMID_FRAMECOPYURL: @@ -1215,7 +1222,7 @@ static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR r break; case CMID_TREE_EDITFOLDER: - hotlist_old_edit_selected(); + hotlist_edit_selection(); break; case CMID_TREE_EDITTITLE: @@ -1227,11 +1234,11 @@ static uint32 ami_context_menu_hook_tree(struct Hook *hook, Object *item, APTR r break; case CMID_TREE_NEWFOLDER: - hotlist_old_add_folder(true); + hotlist_add_folder(NULL, false, 0); break; case CMID_TREE_NEWITEM: - hotlist_old_add_entry(true); + hotlist_add_entry(NULL, NULL, false, 0); break; case CMID_TREE_SETDEFAULT: diff --git a/amiga/cookies.c b/amiga/cookies.c index 0c3e9081c..e29df343f 100755 --- a/amiga/cookies.c +++ b/amiga/cookies.c @@ -18,7 +18,7 @@ #include #include "amiga/cookies.h" -#include "desktop/cookies_old.h" +#include "desktop/cookie_manager.h" #include "amiga/tree.h" void ami_cookies_initialise(void) diff --git a/amiga/history.c b/amiga/history.c index 8543d8d3e..663c2d910 100755 --- a/amiga/history.c +++ b/amiga/history.c @@ -18,7 +18,6 @@ #include "amiga/history.h" #include "amiga/tree.h" -#include "desktop/history_global_core.h" #include #include "amiga/tree.h" diff --git a/amiga/history.h b/amiga/history.h index b69d46c6a..1f064746a 100755 --- a/amiga/history.h +++ b/amiga/history.h @@ -19,7 +19,6 @@ #ifndef AMIGA_HISTORY_H #define AMIGA_HISTORY_H #include "desktop/tree.h" -#include "desktop/history_global_core.h" #define GLOBAL_HISTORY_RECENT_URLS 16 diff --git a/amiga/hotlist.c b/amiga/hotlist.c index 1b195b4ea..6fa1568fb 100755 --- a/amiga/hotlist.c +++ b/amiga/hotlist.c @@ -19,40 +19,6 @@ #include #include "amiga/hotlist.h" #include "amiga/tree.h" -#include "desktop/hotlist_old.h" -#include "utils/messages.h" - -bool ami_hotlist_find_dir(struct tree *tree, const char *dir_name) -{ - struct node *root = tree_node_get_child(tree_get_root(tree)); - struct node *node; - struct node_element *element; - - for (node = root; node; node = tree_node_get_next(node)) - { - element = tree_node_find_element(node, TREE_ELEMENT_TITLE, NULL); - if(!element) element = tree_node_find_element(node, TREE_ELEMENT_TITLE, NULL); - if(element && (strcmp(tree_node_element_get_text(element), dir_name) == 0)) - { - return true; - } - } - - return false; -} - -void ami_hotlist_add_default_dirs(struct tree *tree) -{ - if(ami_hotlist_find_dir(tree, messages_get("HotlistMenu")) == false) { - tree_create_folder_node(tree, tree_get_root(tree), - messages_get("HotlistMenu"), true, true, false); - } - - if(ami_hotlist_find_dir(tree, messages_get("HotlistToolbar")) == false) { - tree_create_folder_node(tree, tree_get_root(tree), - messages_get("HotlistToolbar"), true, true, false); - } -} void ami_hotlist_initialise(const char *hotlist_file) { @@ -60,8 +26,6 @@ void ami_hotlist_initialise(const char *hotlist_file) hotlist_window = ami_tree_create(TREE_HOTLIST, NULL); if(!hotlist_window) return; - - ami_hotlist_add_default_dirs(ami_tree_get_tree(hotlist_window)); } void ami_hotlist_free(const char *hotlist_file) diff --git a/amiga/menu.c b/amiga/menu.c index f114253a1..d2db1f16f 100644 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -58,7 +58,7 @@ #include "amiga/theme.h" #include "amiga/tree.h" #include "amiga/utf8.h" -#include "desktop/hotlist_old.h" +#include "desktop/hotlist.h" #include "desktop/browser_private.h" #include "desktop/gui.h" #include "desktop/textinput.h" @@ -1037,7 +1037,7 @@ static void ami_menu_item_hotlist_add(struct Hook *hook, APTR window, struct Int nsurl_access(hlcache_handle_get_url(bw->current_content)) == NULL) return; - hotlist_old_add_page(nsurl_access(hlcache_handle_get_url(bw->current_content))); + hotlist_add_url(hlcache_handle_get_url(bw->current_content)); } static void ami_menu_item_hotlist_show(struct Hook *hook, APTR window, struct IntuiMessage *msg) diff --git a/amiga/misc.c b/amiga/misc.c index 11af05147..003a5fb6e 100755 --- a/amiga/misc.c +++ b/amiga/misc.c @@ -32,7 +32,7 @@ #include "amiga/gui.h" #include "amiga/utf8.h" -#include "desktop/cookies_old.h" +#include "desktop/cookie_manager.h" #include "utils/log.h" #include "utils/messages.h" #include "utils/url.h" diff --git a/amiga/tree.c b/amiga/tree.c index 27e4cdb15..15a771157 100644 --- a/amiga/tree.c +++ b/amiga/tree.c @@ -55,9 +55,9 @@ #include "amiga/filetype.h" #include "utils/nsoption.h" #include "content/urldb.h" -#include "desktop/cookies_old.h" -#include "desktop/history_global_core.h" -#include "desktop/hotlist_old.h" +#include "desktop/cookie_manager.h" +#include "desktop/global_history.h" +#include "desktop/hotlist.h" #include "desktop/sslcert_viewer.h" #include "utils/utils.h" #include "utils/messages.h" @@ -324,11 +324,13 @@ void ami_tree_drag_end(struct treeview_window *twin, int x, int y) } } +#if 0 else if((tw = ami_window_at_pointer(AMINS_TVWINDOW)) && (tw != twin) && (tw->type == AMI_TREE_HOTLIST)) { - hotlist_old_add_page_xy(tree_url_node_get_url(selected_node), x, y); + hotlist_add_entry(tree_url_node_get_url(selected_node), NULL, true, y); } +#endif } tree_drag_end(twin->tree, twin->mouse_state, twin->drag_x, twin->drag_y, @@ -997,9 +999,9 @@ BOOL ami_tree_event(struct treeview_window *twin) AddPart(fname,savereq->fr_File,1024); ami_update_pointer(twin->win, GUI_POINTER_WAIT); if(twin->type == AMI_TREE_HISTORY) - history_global_export(fname); + global_history_export(fname, NULL); else if(twin->type == AMI_TREE_HOTLIST) - hotlist_old_export(fname); + hotlist_export(fname, NULL); ami_update_pointer(twin->win, GUI_POINTER_DEFAULT); } break; @@ -1142,13 +1144,13 @@ BOOL ami_tree_event(struct treeview_window *twin) switch(twin->type) { case AMI_TREE_HISTORY: - history_global_delete_selected(); + global_history_keypress(KEY_DELETE_LEFT); break; case AMI_TREE_COOKIES: - cookies_delete_selected(); + cookie_manager_keypress(KEY_DELETE_LEFT); break; case AMI_TREE_HOTLIST: - hotlist_old_delete_selected(); + hotlist_keypress(KEY_DELETE_LEFT); break; } ami_tree_update_buttons(twin); @@ -1158,13 +1160,13 @@ BOOL ami_tree_event(struct treeview_window *twin) switch(twin->type) { case AMI_TREE_HISTORY: - history_global_select_all(); + global_history_keypress(KEY_SELECT_ALL); break; case AMI_TREE_COOKIES: - cookies_select_all(); + cookie_manager_keypress(KEY_SELECT_ALL); break; case AMI_TREE_HOTLIST: - hotlist_old_select_all(); + hotlist_keypress(KEY_SELECT_ALL); break; } ami_tree_update_buttons(twin); @@ -1174,13 +1176,13 @@ BOOL ami_tree_event(struct treeview_window *twin) switch(twin->type) { case AMI_TREE_HISTORY: - history_global_clear_selection(); + global_history_keypress(KEY_CLEAR_SELECTION); break; case AMI_TREE_COOKIES: - cookies_clear_selection(); + cookie_manager_keypress(KEY_CLEAR_SELECTION); break; case AMI_TREE_HOTLIST: - hotlist_old_clear_selection(); + hotlist_keypress(KEY_CLEAR_SELECTION); break; } ami_tree_update_buttons(twin); diff --git a/atari/history.c b/atari/history.c index 97636e294..1a19d4adc 100755 --- a/atari/history.c +++ b/atari/history.c @@ -25,7 +25,7 @@ #include "utils/nsoption.h" #include "desktop/tree.h" #include "desktop/gui.h" -#include "desktop/history_global_core.h" +#include "desktop/global_history.h" #include "desktop/browser.h" #include "utils/messages.h" #include "content/content.h" diff --git a/atari/hotlist.c b/atari/hotlist.c index 9211f3c4f..57cf0c08b 100755 --- a/atari/hotlist.c +++ b/atari/hotlist.c @@ -28,7 +28,7 @@ #include "content/hlcache.h" #include "content/urldb.h" #include "utils/nsoption.h" -#include "desktop/hotlist_old.h" +#include "desktop/hotlist.h" #include "desktop/tree.h" #include "desktop/gui.h" #include "utils/log.h" @@ -61,20 +61,20 @@ static short handle_event(GUIWIN *win, EVMULT_OUT *ev_out, short msg[8]) switch (msg[4]) { case TOOLBAR_HOTLIST_CREATE_FOLDER: - hotlist_old_add_folder(true); + hotlist_add_folder(NULL, false, 0); break; case TOOLBAR_HOTLIST_ADD: - atari_hotlist_add_page("http://www.de", ""); + atari_hotlist_add_page(NULL, NULL); break; case TOOLBAR_HOTLIST_DELETE: - hotlist_old_delete_selected(); + hotlist_keypress(KEY_DELETE_LEFT); gemtk_wm_exec_redraw(tv->window, NULL); break; case TOOLBAR_HOTLIST_EDIT: - hotlist_old_edit_selected(); + hotlist_edit_selection(); break; } @@ -207,15 +207,20 @@ void atari_hotlist_add_page( const char * url, const char * title ) struct node * root; struct node * selected = NULL; struct node * folder = NULL; + nsurl *nsurl; NSTREEVIEW tv = hl.tv; if(hl.tv == NULL ) return; atari_hotlist_open(); + if (nsurl_create(url, &nsurl) != NSERROR_OK) + return; + if( hl.tv->click.x >= 0 && hl.tv->click.y >= 0 ){ - hotlist_old_add_page_xy( url, hl.tv->click.x, hl.tv->click.y ); + hotlist_add_entry( nsurl, title, true, hl.tv->click.y ); } else { - hotlist_old_add_page( url ); + hotlist_add_url( nsurl ); } + nsurl_unref(nsurl); } diff --git a/atari/misc.c b/atari/misc.c index 75410d2e6..974d37e69 100755 --- a/atari/misc.c +++ b/atari/misc.c @@ -27,7 +27,7 @@ #include "content/content.h" #include "content/hlcache.h" -#include "desktop/cookies_old.h" +#include "desktop/cookie_manager.h" #include "desktop/mouse.h" #include "desktop/tree.h" #include "utils/nsoption.h" diff --git a/beos/gui.cpp b/beos/gui.cpp index 0abef08c1..ffaccc83b 100644 --- a/beos/gui.cpp +++ b/beos/gui.cpp @@ -50,7 +50,6 @@ extern "C" { #include "content/urldb.h" #include "desktop/401login.h" #include "desktop/browser_private.h" -#include "desktop/cookies_old.h" #include "desktop/gui.h" #include "desktop/netsurf.h" #include "utils/nsoption.h" @@ -1078,11 +1077,6 @@ char *url_to_path(const char *url) return path; } -bool cookies_update(const char *domain, const struct cookie_data *data) -{ - return true; -} - static void *myrealloc(void *ptr, size_t len, void *pw) { if (len == 0) { diff --git a/cocoa/BookmarksController.m b/cocoa/BookmarksController.m index 035d950e1..9c20c544c 100644 --- a/cocoa/BookmarksController.m +++ b/cocoa/BookmarksController.m @@ -24,7 +24,7 @@ #import "cocoa/gui.h" #import "desktop/browser_private.h" -#import "desktop/hotlist_old.h" +#import "desktop/hotlist.h" #import "desktop/tree.h" #import "utils/messages.h" @@ -66,7 +66,7 @@ static const char *cocoa_hotlist_path( void ) - (void) save; { - hotlist_old_export( cocoa_hotlist_path() ); + hotlist_export( cocoa_hotlist_path(), NULL ); } - (void) dealloc; @@ -164,8 +164,7 @@ static const char *cocoa_hotlist_path( void ) { struct browser_window *bw = [[(NetSurfApp *)NSApp frontTab] browser]; if (bw && bw->current_content) { - const char *url = nsurl_access(hlcache_handle_get_url( bw->current_content )); - hotlist_old_add_page( url ); + hotlist_add_url( nsurl_access(hlcache_handle_get_url( bw->current_content )) ); } } @@ -198,17 +197,17 @@ static const char *cocoa_hotlist_path( void ) - (IBAction) editSelected: (id) sender; { - hotlist_old_edit_selected(); + hotlist_edit_selection(); } - (IBAction) deleteSelected: (id) sender; { - hotlist_old_delete_selected(); + hotlist_keypress(KEY_DELETE_LEFT); } - (IBAction) addFolder: (id) sender; { - hotlist_old_add_folder(true); + hotlist_add_folder(NULL, false, 0); } @end diff --git a/cocoa/HistoryWindowController.m b/cocoa/HistoryWindowController.m index d62f458b1..cae679b9d 100644 --- a/cocoa/HistoryWindowController.m +++ b/cocoa/HistoryWindowController.m @@ -20,7 +20,7 @@ #import "cocoa/Tree.h" #import "cocoa/TreeView.h" -#import "desktop/history_global_core.h" +#import "desktop/global_history.h" @implementation HistoryWindowController diff --git a/content/urldb.c b/content/urldb.c index 0dbb392fb..3cf65494a 100644 --- a/content/urldb.c +++ b/content/urldb.c @@ -100,7 +100,6 @@ #include "image/bitmap.h" #include "content/content.h" #include "content/urldb.h" -#include "desktop/cookies_old.h" #include "desktop/cookie_manager.h" #include "utils/nsoption.h" #include "utils/log.h" diff --git a/desktop/Makefile b/desktop/Makefile index 8dccc226b..f7020074e 100644 --- a/desktop/Makefile +++ b/desktop/Makefile @@ -1,9 +1,9 @@ # Sources for desktop -S_DESKTOP := cookie_manager.c cookies_old.c history_global_core.c hotlist_old.c knockout.c \ - hotlist.c mouse.c plot_style.c print.c search.c searchweb.c \ - scrollbar.c sslcert_viewer.c textarea.c thumbnail.c tree.c \ - version.c system_colour.c global_history.c treeview.c +S_DESKTOP := cookie_manager.c knockout.c hotlist.c mouse.c \ + plot_style.c print.c search.c searchweb.c scrollbar.c \ + sslcert_viewer.c textarea.c thumbnail.c tree.c version.c \ + system_colour.c global_history.c treeview.c S_DESKTOP := $(addprefix desktop/,$(S_DESKTOP)) diff --git a/desktop/browser.c b/desktop/browser.c index de0373507..99994442e 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -47,9 +47,7 @@ #include "desktop/frames.h" #include "desktop/global_history.h" #include "desktop/gui.h" -#include "desktop/history_global_core.h" #include "desktop/hotlist.h" -#include "desktop/hotlist_old.h" #include "desktop/knockout.h" #include "desktop/local_history.h" #include "utils/nsoption.h" diff --git a/desktop/cookie_manager.c b/desktop/cookie_manager.c index 5f7f038d3..d9fd21cbf 100644 --- a/desktop/cookie_manager.c +++ b/desktop/cookie_manager.c @@ -24,7 +24,6 @@ #include #include "content/urldb.h" -#include "desktop/browser.h" #include "desktop/cookie_manager.h" #include "desktop/treeview.h" #include "utils/messages.h" diff --git a/desktop/cookie_manager.h b/desktop/cookie_manager.h index b84490726..4da85a895 100644 --- a/desktop/cookie_manager.h +++ b/desktop/cookie_manager.h @@ -24,8 +24,12 @@ #define _NETSURF_DESKTOP_COOKIE_MANAGER_H_ #include +#include +#include "desktop/browser.h" #include "desktop/core_window.h" +#include "desktop/textinput.h" +#include "utils/errors.h" struct cookie_data; diff --git a/desktop/cookies_old.c b/desktop/cookies_old.c deleted file mode 100644 index 7981e910e..000000000 --- a/desktop/cookies_old.c +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2006 Richard Wilson - * Copyright 2009 Paul Blokus - * - * This file is part of NetSurf, http://www.netsurf-browser.org/ - * - * NetSurf is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * NetSurf is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** \file - * Cookies (implementation). - */ - -#include -#include -#include -#include -#include -#include -#include "content/content.h" -#include "content/hlcache.h" -#include "content/urldb.h" -#include "desktop/cookies_old.h" -#include "utils/nsoption.h" -#include "desktop/tree.h" -#include "utils/log.h" -#include "utils/messages.h" -#include "utils/schedule.h" -#include "utils/url.h" -#include "utils/utils.h" - -/* Actions to be connected to front end specific toolbars */ - -/** - * Delete nodes which are currently selected. - */ -void cookies_delete_selected(void) -{ -} - -/** - * Delete all nodes. - */ -void cookies_delete_all(void) -{ -} - -/** - * Select all nodes in the tree. - */ -void cookies_select_all(void) -{ -} - -/** - * Unselect all nodes. - */ -void cookies_clear_selection(void) -{ -} - -/** - * Expand both domain and cookie nodes. - */ -void cookies_expand_all(void) -{ -} - -/** - * Expand domain nodes only. - */ -void cookies_expand_domains(void) -{ -} - -/** - * Expand cookie nodes only. - */ -void cookies_expand_cookies(void) -{ -} - -/** - * Collapse both domain and cookie nodes. - */ -void cookies_collapse_all(void) -{ -} - -/** - * Collapse domain nodes only. - */ -void cookies_collapse_domains(void) -{ -} - -/** - * Collapse cookie nodes only. - */ -void cookies_collapse_cookies(void) -{ -} diff --git a/desktop/cookies_old.h b/desktop/cookies_old.h deleted file mode 100644 index dba5f1710..000000000 --- a/desktop/cookies_old.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2006 Richard Wilson - * - * This file is part of NetSurf, http://www.netsurf-browser.org/ - * - * NetSurf is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * NetSurf is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** \file - * Cookies (interface). - */ - -#ifndef _NETSURF_DESKTOP_COOKIES_OLD_H_ -#define _NETSURF_DESKTOP_COOKIES_OLD_H_ - -#include - -#include "desktop/tree.h" - -void cookies_delete_selected(void); -void cookies_delete_all(void); -void cookies_select_all(void); -void cookies_clear_selection(void); -void cookies_expand_all(void); -void cookies_expand_domains(void); -void cookies_expand_cookies(void); -void cookies_collapse_all(void); -void cookies_collapse_domains(void); -void cookies_collapse_cookies(void); - -#endif diff --git a/desktop/global_history.c b/desktop/global_history.c index 2b384b1ef..d20eb37e1 100644 --- a/desktop/global_history.c +++ b/desktop/global_history.c @@ -20,7 +20,6 @@ #include #include "content/urldb.h" -#include "desktop/browser.h" #include "desktop/global_history.h" #include "desktop/treeview.h" #include "utils/messages.h" diff --git a/desktop/global_history.h b/desktop/global_history.h index 6e5ff1ecc..a720d3016 100644 --- a/desktop/global_history.h +++ b/desktop/global_history.h @@ -20,8 +20,12 @@ #define _NETSURF_DESKTOP_GLOBAL_HISTORY_H_ #include +#include +#include "desktop/browser.h" #include "desktop/core_window.h" +#include "desktop/textinput.h" +#include "utils/errors.h" #include "utils/nsurl.h" diff --git a/desktop/history_global_core.c b/desktop/history_global_core.c deleted file mode 100644 index 1f788adc3..000000000 --- a/desktop/history_global_core.c +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2005 Richard Wilson - * Copyright 2009 Paul Blokus - * - * This file is part of NetSurf, http://www.netsurf-browser.org/ - * - * NetSurf is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * NetSurf is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -#include - -#include "content/content.h" -#include "content/hlcache.h" -#include "content/urldb.h" -#include "desktop/browser.h" -#include "desktop/history_global_core.h" -#include "desktop/global_history.h" -#include "desktop/plotters.h" -#include "desktop/tree.h" -#include "utils/messages.h" -#include "utils/utils.h" -#include "utils/log.h" - - -/* Actions to be connected to front end specific toolbars */ - -/** - * Save the global history in a human-readable form under the given location. - * - * \param path the path where the history will be saved - */ -bool history_global_export(const char *path) -{ - return global_history_export(path, NULL) == NSERROR_OK; -} - -/** - * Delete nodes which are currently selected. - */ -void history_global_delete_selected(void) -{ -} - -/** - * Delete all nodes. - */ -void history_global_delete_all(void) -{ -} - -/** - * Select all nodes in the tree. - */ -void history_global_select_all(void) -{ -} - -/** - * Unselect all nodes. - */ -void history_global_clear_selection(void) -{ -} - -/** - * Expand grouping folders and history entries. - */ -void history_global_expand_all(void) -{ -} - -/** - * Expand grouping folders only. - */ -void history_global_expand_directories(void) -{ -} - -/** - * Expand history entries only. - */ -void history_global_expand_addresses(void) -{ -} - -/** - * Collapse grouping folders and history entries. - */ -void history_global_collapse_all(void) -{ -} - -/** - * Collapse grouping folders only. - */ -void history_global_collapse_directories(void) -{ -} - -/** - * Collapse history entries only. - */ -void history_global_collapse_addresses(void) -{ -} - -/** - * Open the selected entries in seperate browser windows. - * - * \param tabs open multiple entries in tabs in the new window - */ -void history_global_launch_selected(bool tabs) -{ -} diff --git a/desktop/history_global_core.h b/desktop/history_global_core.h deleted file mode 100644 index 29b3f09c9..000000000 --- a/desktop/history_global_core.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2005 Richard Wilson - * Copyright 2009 Paul Blokus - * - * This file is part of NetSurf, http://www.netsurf-browser.org/ - * - * NetSurf is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * NetSurf is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef _NETSURF_DESKTOP_HISTORY_GLOBAL_H_ -#define _NETSURF_DESKTOP_HISTORY_GLOBAL_H_ - -#include - -#include "desktop/tree.h" - -bool history_global_export(const char *path); -void history_global_delete_selected(void); -void history_global_delete_all(void); -void history_global_select_all(void); -void history_global_clear_selection(void); -void history_global_expand_all(void); -void history_global_expand_directories(void); -void history_global_expand_addresses(void); -void history_global_collapse_all(void); -void history_global_collapse_directories(void); -void history_global_collapse_addresses(void); -void history_global_launch_selected(bool tabs); - -#endif diff --git a/desktop/hotlist.c b/desktop/hotlist.c index 683fdc4b1..ce9156308 100644 --- a/desktop/hotlist.c +++ b/desktop/hotlist.c @@ -24,7 +24,6 @@ #include #include "content/urldb.h" -#include "desktop/browser.h" #include "desktop/hotlist.h" #include "desktop/treeview.h" #include "utils/corestrings.h" @@ -1336,7 +1335,7 @@ nserror hotlist_add_entry(nsurl *url, const char *title, bool at_y, int y) if (title != NULL) { title = strdup(title); if (title == NULL) { - nsurl_ref(url); + nsurl_unref(url); return NSERROR_NOMEM; } } diff --git a/desktop/hotlist.h b/desktop/hotlist.h index 171fdd723..d192eaa48 100644 --- a/desktop/hotlist.h +++ b/desktop/hotlist.h @@ -20,8 +20,12 @@ #define _NETSURF_DESKTOP_HOTLIST_H_ #include +#include +#include "desktop/browser.h" #include "desktop/core_window.h" +#include "desktop/textinput.h" +#include "utils/errors.h" #include "utils/nsurl.h" diff --git a/desktop/hotlist_old.c b/desktop/hotlist_old.c deleted file mode 100644 index a2c094a16..000000000 --- a/desktop/hotlist_old.c +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright 2004, 2005 Richard Wilson - * Copyright 2009 Paul Blokus - * - * This file is part of NetSurf, http://www.netsurf-browser.org/ - * - * NetSurf is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * NetSurf is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include -#include - -#include "utils/nsoption.h" -#include "content/content.h" -#include "content/hlcache.h" -#include "content/urldb.h" -#include "desktop/browser.h" -#include "desktop/hotlist.h" -#include "desktop/hotlist_old.h" -#include "desktop/plotters.h" -#include "desktop/textinput.h" -#include "desktop/tree.h" - -#include "utils/messages.h" -#include "utils/utils.h" -#include "utils/log.h" - -/** - * Save the hotlist in a human-readable form under the given location. - * - * \param path the path where the hotlist will be saved - */ -bool hotlist_old_export(const char *path) -{ - nserror err; - err = hotlist_export(path, NULL); - return (err == NSERROR_OK); -} - -/** - * Edit the node which is currently selected. Works only if one node is - * selected. - */ -void hotlist_old_edit_selected(void) -{ - /* Update new hotlist */ - hotlist_edit_selection(); -} - -/** - * Delete nodes which are currently selected. - */ -void hotlist_old_delete_selected(void) -{ - hotlist_keypress(KEY_DELETE_LEFT); -} - -/** - * Select all nodes in the tree. - */ -void hotlist_old_select_all(void) -{ - hotlist_keypress(KEY_SELECT_ALL); -} - -/** - * Unselect all nodes. - */ -void hotlist_old_clear_selection(void) -{ - hotlist_keypress(KEY_CLEAR_SELECTION); -} - -/** - * Expand grouping folders and history entries. - */ -void hotlist_old_expand_all(void) -{ -} - -/** - * Expand grouping folders only. - */ -void hotlist_old_expand_directories(void) -{ -} - -/** - * Expand history entries only. - */ -void hotlist_old_expand_addresses(void) -{ -} - -/** - * Collapse grouping folders and history entries. - */ -void hotlist_old_collapse_all(void) -{ -} - -/** - * Collapse grouping folders only. - */ -void hotlist_old_collapse_directories(void) -{ -} - -/** - * Collapse history entries only. - */ -void hotlist_old_collapse_addresses(void) -{ -} - -/** - * Add a folder node. - * - * \param selected create the folder in the currently-selected node - */ -void hotlist_old_add_folder(bool selected) -{ - hotlist_add_folder(NULL, false, 0); -} - -/** - * Add an entry node. - * - * \param selected add the entry in the currently-selected node - */ -void hotlist_old_add_entry(bool selected) -{ - nsurl *url; - - if (nsurl_create("http://netsurf-browser.org/", &url) != NSERROR_OK) - return; - - hotlist_add_entry(url, "New untitled entry", false, 0); - nsurl_unref(url); -} - -/** - * Adds the currently viewed page to the hotlist - */ -void hotlist_old_add_page(const char *url) -{ - nsurl *nsurl; - - if (url == NULL) - return; - - if (nsurl_create(url, &nsurl) != NSERROR_OK) - return; - - /* Update new hotlist */ - hotlist_add_url(nsurl); - nsurl_unref(nsurl); -} - -/** - * Adds the currently viewed page to the hotlist at the given co-ordinates - * \param url url of the page - * \param x X cooridinate with respect to tree origin - * \param y Y cooridinate with respect to tree origin - */ -void hotlist_old_add_page_xy(const char *url, int x, int y) -{ - nsurl *nsurl; - - if (url == NULL) - return; - - if (nsurl_create(url, &nsurl) != NSERROR_OK) - return; - - /* Update new hotlist */ - hotlist_add_entry(nsurl, NULL, true, y); - nsurl_unref(nsurl); -} - -/** - * Open the selected entries in separate browser windows. - * - * \param tabs open multiple entries in tabs in the new window - */ -void hotlist_old_launch_selected(bool tabs) -{ - hotlist_keypress(KEY_CR); -} - -/** - * Set the hotlist's default folder to the selected node. - * - * \param clear reset the default to tree root - */ -bool hotlist_old_set_default_folder(bool clear) -{ - return false; -} diff --git a/desktop/hotlist_old.h b/desktop/hotlist_old.h deleted file mode 100644 index 9e88d847e..000000000 --- a/desktop/hotlist_old.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2004, 2005 Richard Wilson - * Copyright 2009 Paul Blokus - * - * This file is part of NetSurf, http://www.netsurf-browser.org/ - * - * NetSurf is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * NetSurf is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - - -/** \file - * Hotlist (interface). - */ - -#ifndef _NETSURF_DESKTOP_HOTLIST_OLD_H_ -#define _NETSURF_DESKTOP_HOTLIST_OLD_H_ - -#include - -#include "desktop/tree.h" - -bool hotlist_old_export(const char *path); -void hotlist_old_edit_selected(void); -void hotlist_old_delete_selected(void); -void hotlist_old_select_all(void); -void hotlist_old_clear_selection(void); -void hotlist_old_expand_all(void); -void hotlist_old_expand_directories(void); -void hotlist_old_expand_addresses(void); -void hotlist_old_collapse_all(void); -void hotlist_old_collapse_directories(void); -void hotlist_old_collapse_addresses(void); -void hotlist_old_add_folder(bool selected); -void hotlist_old_add_entry(bool selected); -void hotlist_old_add_page(const char *url); -void hotlist_old_add_page_xy(const char *url, int x, int y); -void hotlist_old_launch_selected(bool tabs); -bool hotlist_old_set_default_folder(bool clear); -#endif diff --git a/desktop/sslcert_viewer.c b/desktop/sslcert_viewer.c index 736237173..f1cfcca14 100644 --- a/desktop/sslcert_viewer.c +++ b/desktop/sslcert_viewer.c @@ -27,7 +27,6 @@ #include "content/fetch.h" #include "content/urldb.h" -#include "desktop/browser.h" #include "desktop/sslcert_viewer.h" #include "desktop/treeview.h" #include "utils/messages.h" diff --git a/desktop/sslcert_viewer.h b/desktop/sslcert_viewer.h index c5bb5c049..002e919ff 100644 --- a/desktop/sslcert_viewer.h +++ b/desktop/sslcert_viewer.h @@ -22,8 +22,12 @@ #define _NETSURF_DESKTOP_SSLCERT_VIEWER_H_ #include +#include +#include "desktop/browser.h" #include "desktop/core_window.h" +#include "desktop/textinput.h" +#include "utils/errors.h" struct sslcert_session_data; diff --git a/framebuffer/misc.c b/framebuffer/misc.c index 0568e3670..2dd03677d 100644 --- a/framebuffer/misc.c +++ b/framebuffer/misc.c @@ -21,7 +21,6 @@ #include #include -#include "desktop/cookies_old.h" #include "utils/log.h" #include "utils/messages.h" #include "utils/utils.h" diff --git a/gtk/cookies.c b/gtk/cookies.c index 4c56563a2..e020c53f7 100644 --- a/gtk/cookies.c +++ b/gtk/cookies.c @@ -21,9 +21,10 @@ */ -#include "desktop/cookies_old.h" +#include "desktop/cookie_manager.h" #include "desktop/plotters.h" #include "desktop/tree.h" +#include "desktop/textinput.h" #include "utils/log.h" #include "gtk/gui.h" #include "gtk/cookies.h" @@ -160,25 +161,26 @@ void nsgtk_cookies_destroy(void) /* edit menu */ MENUHANDLER(delete_selected) { - cookies_delete_selected(); + cookie_manager_keypress(KEY_DELETE_LEFT); return TRUE; } MENUHANDLER(delete_all) { - cookies_delete_all(); + cookie_manager_keypress(KEY_SELECT_ALL); + cookie_manager_keypress(KEY_DELETE_LEFT); return TRUE; } MENUHANDLER(select_all) { - cookies_select_all(); + cookie_manager_keypress(KEY_SELECT_ALL); return TRUE; } MENUHANDLER(clear_selection) { - cookies_clear_selection(); + cookie_manager_keypress(KEY_CLEAR_SELECTION); return TRUE; } diff --git a/gtk/gui.c b/gtk/gui.c index 1f191d67c..226d718b0 100644 --- a/gtk/gui.c +++ b/gtk/gui.c @@ -45,9 +45,7 @@ #include "content/hlcache.h" #include "content/urldb.h" #include "desktop/browser_private.h" -#include "desktop/cookies_old.h" #include "desktop/gui.h" -#include "desktop/history_global_core.h" #include "desktop/netsurf.h" #include "utils/nsoption.h" #include "desktop/save_complete.h" diff --git a/gtk/history.c b/gtk/history.c index bfdb90b35..c44373939 100644 --- a/gtk/history.c +++ b/gtk/history.c @@ -18,9 +18,10 @@ */ -#include "desktop/history_global_core.h" +#include "desktop/global_history.h" #include "desktop/plotters.h" #include "desktop/tree.h" +#include "desktop/textinput.h" #include "gtk/gui.h" #include "gtk/history.h" #include "gtk/plotters.h" @@ -184,7 +185,7 @@ MENUHANDLER(export) gchar *filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(save_dialog)); - history_global_export(filename); + global_history_export(filename, NULL); g_free(filename); } @@ -196,25 +197,26 @@ MENUHANDLER(export) /* edit menu */ MENUHANDLER(delete_selected) { - history_global_delete_selected(); + global_history_keypress(KEY_DELETE_LEFT); return TRUE; } MENUHANDLER(delete_all) { - history_global_delete_all(); + global_history_keypress(KEY_SELECT_ALL); + global_history_keypress(KEY_DELETE_LEFT); return TRUE; } MENUHANDLER(select_all) { - history_global_select_all(); + global_history_keypress(KEY_SELECT_ALL); return TRUE; } MENUHANDLER(clear_selection) { - history_global_clear_selection(); + global_history_keypress(KEY_CLEAR_SELECTION); return TRUE; } @@ -257,6 +259,6 @@ MENUHANDLER(collapse_addresses) MENUHANDLER(launch) { - history_global_launch_selected(true); + global_history_keypress(KEY_CR); return TRUE; } diff --git a/gtk/hotlist.c b/gtk/hotlist.c index 618d9d42f..9506ed74f 100644 --- a/gtk/hotlist.c +++ b/gtk/hotlist.c @@ -17,7 +17,7 @@ */ -#include "desktop/hotlist_old.h" +#include "desktop/hotlist.h" #include "utils/nsoption.h" #include "desktop/plotters.h" #include "desktop/tree.h" @@ -190,7 +190,7 @@ MENUHANDLER(export) gchar *filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(save_dialog)); - hotlist_old_export(filename); + hotlist_export(filename, NULL); g_free(filename); } @@ -201,38 +201,38 @@ MENUHANDLER(export) MENUHANDLER(new_folder) { - hotlist_old_add_folder(true); + hotlist_add_folder(NULL, false, 0); return TRUE; } MENUHANDLER(new_entry) { - hotlist_old_add_entry(true); + hotlist_add_entry(NULL, NULL, false, 0); return TRUE; } /* edit menu */ MENUHANDLER(edit_selected) { - hotlist_old_edit_selected(); + hotlist_edit_selection(); return TRUE; } MENUHANDLER(delete_selected) { - hotlist_old_delete_selected(); + hotlist_keypress(KEY_DELETE_LEFT); return TRUE; } MENUHANDLER(select_all) { - hotlist_old_select_all(); + hotlist_keypress(KEY_SELECT_ALL); return TRUE; } MENUHANDLER(clear_selection) { - hotlist_old_clear_selection(); + hotlist_keypress(KEY_CLEAR_SELECTION); return TRUE; } @@ -275,6 +275,6 @@ MENUHANDLER(collapse_addresses) MENUHANDLER(launch) { - hotlist_old_launch_selected(true); + hotlist_keypress(KEY_CR); return TRUE; } diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c index d2aabafb4..fdc3cc727 100644 --- a/gtk/scaffolding.c +++ b/gtk/scaffolding.c @@ -34,7 +34,7 @@ #include "css/utils.h" #include "desktop/browser_private.h" #include "desktop/local_history.h" -#include "desktop/hotlist_old.h" +#include "desktop/hotlist.h" #include "desktop/gui.h" #include "desktop/netsurf.h" #include "utils/nsoption.h" @@ -1540,7 +1540,7 @@ MULTIHANDLER(addbookmarks) if (bw == NULL || bw->current_content == NULL || hlcache_handle_get_url(bw->current_content) == NULL) return TRUE; - hotlist_old_add_page(nsurl_access(hlcache_handle_get_url(bw->current_content))); + hotlist_add_url(hlcache_handle_get_url(bw->current_content)); return TRUE; } diff --git a/riscos/cookies.c b/riscos/cookies.c index eb74f515e..dfdbc5d20 100644 --- a/riscos/cookies.c +++ b/riscos/cookies.c @@ -31,8 +31,8 @@ #include "oslib/wimpspriteop.h" #include "content/urldb.h" #include "desktop/cookie_manager.h" -#include "desktop/cookies_old.h" #include "desktop/tree.h" +#include "desktop/textinput.h" #include "riscos/cookies.h" #include "riscos/dialog.h" #include "riscos/menus.h" @@ -179,7 +179,7 @@ void ro_gui_cookies_toolbar_click(button_bar_action action) { switch (action) { case TOOLBAR_BUTTON_DELETE: - cookies_delete_selected(); + cookie_manager_keypress(KEY_DELETE_LEFT); break; case TOOLBAR_BUTTON_EXPAND: @@ -318,13 +318,13 @@ bool ro_gui_cookies_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, cookies_collapse_cookies(); return true; case TREE_SELECTION_DELETE: - cookies_delete_selected(); + cookie_manager_keypress(KEY_DELETE_LEFT); return true; case TREE_SELECT_ALL: - cookies_select_all(); + cookie_manager_keypress(KEY_SELECT_ALL); return true; case TREE_CLEAR_SELECTION: - cookies_clear_selection(); + cookie_manager_keypress(KEY_CLEAR_SELECTION); return true; case TOOLBAR_BUTTONS: ro_toolbar_set_display_buttons(cookies_window.toolbar, diff --git a/riscos/global_history.c b/riscos/global_history.c index 3a060c02d..aecc98903 100644 --- a/riscos/global_history.c +++ b/riscos/global_history.c @@ -30,7 +30,6 @@ #include "oslib/wimp.h" #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" @@ -186,7 +185,7 @@ void ro_gui_global_history_toolbar_click(button_bar_action action) { switch (action) { case TOOLBAR_BUTTON_DELETE: - history_global_delete_selected(); + global_history_keypress(KEY_DELETE_LEFT); break; case TOOLBAR_BUTTON_EXPAND: @@ -206,7 +205,7 @@ void ro_gui_global_history_toolbar_click(button_bar_action action) break; case TOOLBAR_BUTTON_LAUNCH: - history_global_launch_selected(false); + global_history_keypress(KEY_CR); break; default: @@ -343,16 +342,16 @@ bool ro_gui_global_history_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, history_global_collapse_addresses(); return true; case TREE_SELECTION_LAUNCH: - history_global_launch_selected(false); + global_history_keypress(KEY_CR); return true; case TREE_SELECTION_DELETE: - history_global_delete_selected(); + global_history_keypress(KEY_DELETE_LEFT); return true; case TREE_SELECT_ALL: - history_global_select_all(); + global_history_keypress(KEY_SELECT_ALL); return true; case TREE_CLEAR_SELECTION: - history_global_clear_selection(); + global_history_keypress(KEY_CLEAR_SELECTION); return true; case TOOLBAR_BUTTONS: ro_toolbar_set_display_buttons(global_history_window.toolbar, diff --git a/riscos/gui.c b/riscos/gui.c index 39a34de9a..58114540e 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -55,10 +55,7 @@ #include "content/hlcache.h" #include "content/urldb.h" #include "content/fetchers/resource.h" -#include "desktop/cookies_old.h" #include "desktop/gui.h" -#include "desktop/history_global_core.h" -#include "desktop/hotlist_old.h" #include "desktop/netsurf.h" #include "utils/nsoption.h" #include "desktop/save_complete.h" diff --git a/riscos/hotlist.c b/riscos/hotlist.c index 721e532bb..73c800280 100644 --- a/riscos/hotlist.c +++ b/riscos/hotlist.c @@ -33,7 +33,6 @@ #include "content/content.h" #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" @@ -228,7 +227,7 @@ void ro_gui_hotlist_toolbar_click(button_bar_action action) { switch (action) { case TOOLBAR_BUTTON_DELETE: - hotlist_old_delete_selected(); + hotlist_keypress(KEY_DELETE_LEFT); break; case TOOLBAR_BUTTON_EXPAND: @@ -248,11 +247,11 @@ void ro_gui_hotlist_toolbar_click(button_bar_action action) break; case TOOLBAR_BUTTON_LAUNCH: - hotlist_old_launch_selected(false); + hotlist_keypress(KEY_CR); break; case TOOLBAR_BUTTON_CREATE: - hotlist_old_add_folder(true); + hotlist_add_folder(NULL, false, 0); break; default: @@ -367,10 +366,10 @@ bool ro_gui_hotlist_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, ro_gui_dialog_open_persistent(w, dialog_saveas, true); return true; case TREE_NEW_FOLDER: - hotlist_old_add_folder(true); + hotlist_add_folder(NULL, false, 0); return true; case TREE_NEW_LINK: - hotlist_old_add_entry(true); + hotlist_add_entry(NULL, NULL, false, 0); return true; case TREE_EXPAND_ALL: hotlist_old_expand_all(); @@ -391,19 +390,19 @@ bool ro_gui_hotlist_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, hotlist_old_collapse_addresses(); return true; case TREE_SELECTION_EDIT: - hotlist_old_edit_selected(); + hotlist_edit_selection(); return true; case TREE_SELECTION_LAUNCH: - hotlist_old_launch_selected(false); + hotlist_keypress(KEY_CR); return true; case TREE_SELECTION_DELETE: - hotlist_old_delete_selected(); + hotlist_keypress(KEY_DELETE_LEFT); return true; case TREE_SELECT_ALL: - hotlist_old_select_all(); + hotlist_keypress(KEY_SELECT_ALL); return true; case TREE_CLEAR_SELECTION: - hotlist_old_clear_selection(); + hotlist_keypress(KEY_CLEAR_SELECTION); return true; case TOOLBAR_BUTTONS: ro_toolbar_set_display_buttons(hotlist_window.toolbar, @@ -469,12 +468,16 @@ void ro_gui_hotlist_add_page(const char *url) if (url == NULL) return; + if (nsurl_create(url, &nsurl) != NSERROR_OK) + return; + /* If we're not using external hotlists, add the page to NetSurf's * own hotlist and return... */ if (!nsoption_bool(external_hotlists)) { - hotlist_old_add_page(url); + hotlist_add_url(nsurl); + nsurl_unref(nsurl); return; } @@ -487,8 +490,6 @@ void ro_gui_hotlist_add_page(const char *url) LOG(("Sending Hotlist AddURL to potential hotlist clients.")); - if (nsurl_create(url, &nsurl) != NSERROR_OK) - return; data = urldb_get_url_data(nsurl); if (data == NULL) return; @@ -534,8 +535,15 @@ static void ro_gui_hotlist_addurl_bounce(wimp_message *message) { LOG(("Hotlist AddURL Bounced")); - if (hotlist_url != NULL) - hotlist_old_add_page(hotlist_url); + if (hotlist_url != NULL) { + nsurl *nsurl; + + if (nsurl_create(hotlist_url, &nsurl) != NSERROR_OK) + return; + + hotlist_add_page(nsurl); + nsurl_unref(nsurl); + } ro_gui_hotlist_add_cleanup(); @@ -591,14 +599,24 @@ void ro_gui_hotlist_add_cleanup(void) void ro_gui_hotlist_url_drop(wimp_message *message, const char *url) { int x, y; + nsurl *nsurl; + if (hotlist_window.window != message->data.data_xfer.w) return; + if (url == NULL) + return; + + if (nsurl_create(url, &nsurl) != NSERROR_OK) + return; + ro_gui_tree_get_tree_coordinates(hotlist_window.tree, message->data.data_xfer.pos.x, message->data.data_xfer.pos.y, &x, &y); - hotlist_old_add_page_xy(url, x, y); + + hotlist_add_entry(nsurl, NULL, true, y); + nsurl_unref(nsurl); } #endif diff --git a/riscos/menus.c b/riscos/menus.c index 5a576f879..e51fc34c5 100644 --- a/riscos/menus.c +++ b/riscos/menus.c @@ -34,10 +34,9 @@ #include "content/content.h" #include "content/hlcache.h" #include "content/urldb.h" -#include "desktop/cookies_old.h" +#include "desktop/cookie_manager.h" #include "desktop/browser.h" #include "desktop/gui.h" -#include "desktop/history_global_core.h" #include "desktop/local_history.h" #include "desktop/netsurf.h" #include "desktop/textinput.h" diff --git a/riscos/save.c b/riscos/save.c index 0a9114080..ad2d4c467 100644 --- a/riscos/save.c +++ b/riscos/save.c @@ -37,8 +37,8 @@ #include "oslib/wimpspriteop.h" #include "content/content.h" #include "content/hlcache.h" -#include "desktop/hotlist_old.h" -#include "desktop/history_global_core.h" +#include "desktop/hotlist.h" +#include "desktop/global_history.h" #include "desktop/netsurf.h" #include "desktop/save_complete.h" #include "desktop/save_text.h" @@ -882,7 +882,7 @@ bool ro_gui_save_content(hlcache_handle *h, char *path, bool force_overwrite) LINK_TEXT, path); case GUI_SAVE_HOTLIST_EXPORT_HTML: - if (!hotlist_old_export(path)) + if (hotlist_export(path, NULL) != NSERROR_OK) return false; error = xosfile_set_type(path, 0xfaf); if (error) @@ -890,7 +890,7 @@ bool ro_gui_save_content(hlcache_handle *h, char *path, bool force_overwrite) error->errnum, error->errmess)); break; case GUI_SAVE_HISTORY_EXPORT_HTML: - if (!history_global_export(path)) + if (global_history_export(path, NULL) != NSERROR_OK) return false; error = xosfile_set_type(path, 0xfaf); if (error) diff --git a/riscos/window.c b/riscos/window.c index 797176378..d3375bebe 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -46,7 +46,7 @@ #include "content/urldb.h" #include "css/css.h" #include "desktop/browser_private.h" -#include "desktop/cookies_old.h" +#include "desktop/cookie_manager.h" #include "desktop/scrollbar.h" #include "desktop/frames.h" #include "desktop/local_history.h" @@ -2763,7 +2763,8 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, break; case COOKIES_DELETE: - cookies_delete_all(); + cookie_manager_keypress(KEY_SELECT_ALL); + cookie_manager_keypress(KEY_DELETE_LEFT); break; /* page actions */ diff --git a/test/llcache.c b/test/llcache.c index b3eb0d25a..643ff7f87 100644 --- a/test/llcache.c +++ b/test/llcache.c @@ -105,24 +105,24 @@ char *url_to_path(const char *url) * Things that are absolutely not reasonable, and should disappear * ******************************************************************************/ -#include "desktop/cookies_old.h" +#include "desktop/cookie_manager.h" #include "desktop/gui.h" #include "desktop/tree.h" -/* desktop/cookies_old.h -- used by urldb +/* desktop/cookie_manager.h -- used by urldb * * URLdb should have a cookies update event + handler registration */ -bool cookies_schedule_update(const struct cookie_data *data) +bool cookie_manager_add(const struct cookie_data *data) { return true; } -/* desktop/cookies_old.h -- used by urldb +/* desktop/cookie_manager.h -- used by urldb * * URLdb should have a cookies removal handler registration */ -void cookies_remove(const struct cookie_data *data) +void cookie_manager_remove(const struct cookie_data *data) { } diff --git a/test/urldbtest.c b/test/urldbtest.c index 7c72ed7d1..cc657ed11 100644 --- a/test/urldbtest.c +++ b/test/urldbtest.c @@ -32,7 +32,7 @@ #include "image/bitmap.h" #include "content/content.h" #include "content/urldb.h" -#include "desktop/cookies_old.h" +#include "desktop/cookie_manager.h" #include "utils/nsoption.h" #ifdef riscos /** \todo lose this */ @@ -52,12 +52,12 @@ static void netsurf_lwc_iterator(lwc_string *str, void *pw) LOG(("[%3u] %.*s", str->refcnt, (int) lwc_string_length(str), lwc_string_data(str))); } -bool cookies_schedule_update(const struct cookie_data *data) +bool cookie_manager_add(const struct cookie_data *data) { return true; } -void cookies_remove(const struct cookie_data *data) +void cookie_manager_remove(const struct cookie_data *data) { } diff --git a/windows/misc.c b/windows/misc.c index 51c02ca11..d820a5bca 100644 --- a/windows/misc.c +++ b/windows/misc.c @@ -25,7 +25,6 @@ #include -#include "desktop/cookies_old.h" #include "utils/messages.h" #include "utils/utils.h" #include "utils/url.h" -- cgit v1.2.3