Remove old hotlist, cookies, and history_global_core modules.

New versions of expand/collapse node functions for these modules aren't yet implemented.
This commit is contained in:
Michael Drake 2013-09-02 22:41:04 +01:00
parent e9f65ff9cb
commit cf8ffa412a
47 changed files with 164 additions and 749 deletions

View File

@ -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:

View File

@ -18,7 +18,7 @@
#include <proto/exec.h>
#include "amiga/cookies.h"
#include "desktop/cookies_old.h"
#include "desktop/cookie_manager.h"
#include "amiga/tree.h"
void ami_cookies_initialise(void)

View File

@ -18,7 +18,6 @@
#include "amiga/history.h"
#include "amiga/tree.h"
#include "desktop/history_global_core.h"
#include <proto/exec.h>
#include "amiga/tree.h"

View File

@ -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

View File

@ -19,40 +19,6 @@
#include <proto/exec.h>
#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)

View File

@ -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)

View File

@ -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"

View File

@ -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);

View File

@ -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"

View File

@ -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);
}

View File

@ -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"

View File

@ -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) {

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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))

View File

@ -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"

View File

@ -24,7 +24,6 @@
#include <stdlib.h>
#include "content/urldb.h"
#include "desktop/browser.h"
#include "desktop/cookie_manager.h"
#include "desktop/treeview.h"
#include "utils/messages.h"

View File

@ -24,8 +24,12 @@
#define _NETSURF_DESKTOP_COOKIE_MANAGER_H_
#include <stdbool.h>
#include <stdint.h>
#include "desktop/browser.h"
#include "desktop/core_window.h"
#include "desktop/textinput.h"
#include "utils/errors.h"
struct cookie_data;

View File

@ -1,112 +0,0 @@
/*
* Copyright 2006 Richard Wilson <info@tinct.net>
* Copyright 2009 Paul Blokus <paul_pl@users.sourceforge.net>
*
* 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 <http://www.gnu.org/licenses/>.
*/
/** \file
* Cookies (implementation).
*/
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#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)
{
}

View File

@ -1,41 +0,0 @@
/*
* Copyright 2006 Richard Wilson <info@tinct.net>
*
* 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 <http://www.gnu.org/licenses/>.
*/
/** \file
* Cookies (interface).
*/
#ifndef _NETSURF_DESKTOP_COOKIES_OLD_H_
#define _NETSURF_DESKTOP_COOKIES_OLD_H_
#include <stdbool.h>
#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

View File

@ -20,7 +20,6 @@
#include <stdlib.h>
#include "content/urldb.h"
#include "desktop/browser.h"
#include "desktop/global_history.h"
#include "desktop/treeview.h"
#include "utils/messages.h"

View File

@ -20,8 +20,12 @@
#define _NETSURF_DESKTOP_GLOBAL_HISTORY_H_
#include <stdbool.h>
#include <stdint.h>
#include "desktop/browser.h"
#include "desktop/core_window.h"
#include "desktop/textinput.h"
#include "utils/errors.h"
#include "utils/nsurl.h"

View File

@ -1,125 +0,0 @@
/*
* Copyright 2005 Richard Wilson <info@tinct.net>
* Copyright 2009 Paul Blokus <paul_pl@users.sourceforge.net>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#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)
{
}

View File

@ -1,40 +0,0 @@
/*
* Copyright 2005 Richard Wilson <info@tinct.net>
* Copyright 2009 Paul Blokus <paul_pl@users.sourceforge.net>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef _NETSURF_DESKTOP_HISTORY_GLOBAL_H_
#define _NETSURF_DESKTOP_HISTORY_GLOBAL_H_
#include <stdbool.h>
#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

View File

@ -24,7 +24,6 @@
#include <dom/bindings/hubbub/parser.h>
#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;
}
}

View File

@ -20,8 +20,12 @@
#define _NETSURF_DESKTOP_HOTLIST_H_
#include <stdbool.h>
#include <stdint.h>
#include "desktop/browser.h"
#include "desktop/core_window.h"
#include "desktop/textinput.h"
#include "utils/errors.h"
#include "utils/nsurl.h"

View File

@ -1,209 +0,0 @@
/*
* Copyright 2004, 2005 Richard Wilson <info@tinct.net>
* Copyright 2009 Paul Blokus <paul_pl@users.sourceforge.net>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#include <ctype.h>
#include <stdlib.h>
#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;
}

View File

@ -1,50 +0,0 @@
/*
* Copyright 2004, 2005 Richard Wilson <info@tinct.net>
* Copyright 2009 Paul Blokus <paul_pl@users.sourceforge.net>
*
* 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 <http://www.gnu.org/licenses/>.
*/
/** \file
* Hotlist (interface).
*/
#ifndef _NETSURF_DESKTOP_HOTLIST_OLD_H_
#define _NETSURF_DESKTOP_HOTLIST_OLD_H_
#include <stdbool.h>
#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

View File

@ -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"

View File

@ -22,8 +22,12 @@
#define _NETSURF_DESKTOP_SSLCERT_VIEWER_H_
#include <stdbool.h>
#include <stdint.h>
#include "desktop/browser.h"
#include "desktop/core_window.h"
#include "desktop/textinput.h"
#include "utils/errors.h"
struct sslcert_session_data;

View File

@ -21,7 +21,6 @@
#include <stdio.h>
#include <string.h>
#include "desktop/cookies_old.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/utils.h"

View File

@ -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;
}

View File

@ -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"

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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,

View File

@ -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,

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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)

View File

@ -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 */

View File

@ -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)
{
}

View File

@ -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)
{
}

View File

@ -25,7 +25,6 @@
#include <windows.h>
#include "desktop/cookies_old.h"
#include "utils/messages.h"
#include "utils/utils.h"
#include "utils/url.h"