r10056 stevef - in /branches/paulblokus/treeview/riscos: ./ configure/

netsurf at semichrome.net netsurf at semichrome.net
Sun Feb 14 14:44:32 GMT 2010


Author: stevef
Date: Sun Feb 14 08:44:32 2010
New Revision: 10056

URL: http://source.netsurf-browser.org?rev=10056&view=rev
Log:
First pass at RISC OS core treeview updates: incomplete and still broken in many areas.

Added:
    branches/paulblokus/treeview/riscos/hotlist.h
    branches/paulblokus/treeview/riscos/sslcert.h
Modified:
    branches/paulblokus/treeview/riscos/configure/con_home.c
    branches/paulblokus/treeview/riscos/cookies.c
    branches/paulblokus/treeview/riscos/cookies.h
    branches/paulblokus/treeview/riscos/dialog.c
    branches/paulblokus/treeview/riscos/global_history.c
    branches/paulblokus/treeview/riscos/global_history.h
    branches/paulblokus/treeview/riscos/gui.c
    branches/paulblokus/treeview/riscos/gui.h
    branches/paulblokus/treeview/riscos/help.c
    branches/paulblokus/treeview/riscos/hotlist.c
    branches/paulblokus/treeview/riscos/menus.c
    branches/paulblokus/treeview/riscos/sslcert.c
    branches/paulblokus/treeview/riscos/theme.c
    branches/paulblokus/treeview/riscos/treeview.c
    branches/paulblokus/treeview/riscos/treeview.h
    branches/paulblokus/treeview/riscos/url_complete.c
    branches/paulblokus/treeview/riscos/window.c

Modified: branches/paulblokus/treeview/riscos/configure/con_home.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/configure/con_home.c?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/configure/con_home.c (original)
+++ branches/paulblokus/treeview/riscos/configure/con_home.c Sun Feb 14 08:44:32 2010
@@ -49,7 +49,7 @@
 			option_homepage_url ? option_homepage_url : "", true);
 	ro_gui_set_icon_selected_state(w, HOME_OPEN_STARTUP,
 			option_open_browser_at_startup);
-	global_history_get_recent(&suggestions);
+	/* \TODO -- \SF global_history_get_recent(&suggestions);*/suggestions=0;
 	ro_gui_set_icon_shaded_state(w,
 			HOME_URL_GRIGHT, (suggestions <= 0));
 

Modified: branches/paulblokus/treeview/riscos/cookies.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/cookies.c?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/cookies.c (original)
+++ branches/paulblokus/treeview/riscos/cookies.c Sun Feb 14 08:44:32 2010
@@ -1,5 +1,6 @@
 /*
  * Copyright 2006 Richard Wilson <info at tinct.net>
+ * Copyright 2010 Stephen Fryatt <stevef at netsurf-browser.org>
  *
  * This file is part of NetSurf, http://www.netsurf-browser.org/
  *
@@ -46,33 +47,64 @@
 
 static bool ro_gui_cookies_click(wimp_pointer *pointer);
 
-/* The history window, toolbar and plot origins */
-struct treeview_window cookies_window;
+/* The RISC OS cookie window, toolbar and treeview data. */
+
+static struct ro_cookies_window {
+	wimp_w		window;
+	struct toolbar	*toolbar;
+	ro_treeview	*tv;
+} cookies_window;
 
 /**
  * Initialise cookies tree
  */
+
 void ro_gui_cookies_initialise(void)
 {
-	/* create our window */
+	/* Create our window. */
+
 	cookies_window.window = ro_gui_dialog_create("tree");
 	ro_gui_set_window_title(cookies_window.window,
 			messages_get("Cookies"));
-	ro_gui_wimp_event_register_redraw_window(cookies_window.window,
-			ro_gui_tree_redraw);
-	ro_gui_wimp_event_register_open_window(cookies_window.window,
-			ro_gui_tree_open);
-	ro_gui_wimp_event_register_mouse_click(cookies_window.window,
-			ro_gui_cookies_click);
 
-	/* Create our toolbar */
+	/* Create our toolbar. */
+
 	cookies_window.toolbar = ro_gui_theme_create_toolbar(NULL,
 			THEME_COOKIES_TOOLBAR);
 	if (cookies_window.toolbar)
 		ro_gui_theme_attach_toolbar(cookies_window.toolbar,
 				cookies_window.window);
 
-	cookies_window.tree = cookies_initialise(&cookies_window, NULL);
+	/* Create the treeview with the window and toolbar. */
+
+	cookies_window.tv = ro_treeview_create(cookies_window.window,
+			cookies_window.toolbar,
+			cookies_get_tree_flags());
+	if (cookies_window.tv == NULL) {
+		LOG(("Failed to allocate treeview"));
+		return;
+	}
+
+	/* Initialise the cookies into the tree. */
+
+	cookies_initialise(ro_treeview_get_tree(cookies_window.tv));
+}
+
+/**
+ * \TODO - Open the cookies window.
+ *
+ */
+
+void ro_gui_cookies_open(void)
+{
+	tree_set_redraw(ro_treeview_get_tree(cookies_window.tv), true);
+
+	if (!ro_gui_dialog_open_top(cookies_window.window,
+			cookies_window.toolbar, 600, 800)) {
+		ro_treeview_set_origin(cookies_window.tv, 0,
+				-(ro_gui_theme_toolbar_height(
+				cookies_window.toolbar)));
+	}
 }
 
 
@@ -84,15 +116,23 @@
  */
 bool ro_gui_cookies_click(wimp_pointer *pointer)
 {
-	ro_gui_tree_click(pointer, cookies_window.tree);
+/* SF	ro_gui_tree_click(pointer, cookies_window.tree);
 	if (pointer->buttons == wimp_CLICK_MENU)
 		ro_gui_menu_create(cookies_menu, pointer->pos.x,
 				pointer->pos.y, pointer->w);
 	else
-		ro_gui_menu_prepare_action(pointer->w, TREE_SELECTION, false);
+		ro_gui_menu_prepare_action(pointer->w, TREE_SELECTION, false);*/
 	return true;
 }
 
+/**
+ * Update the theme details of the cookies window.
+ */
+
+void ro_gui_cookies_update_theme(void)
+{
+	ro_treeview_update_theme(cookies_window.tv);
+}
 
 /**
  * Check if a particular window handle is the cookies window
@@ -102,19 +142,9 @@
  */
 bool ro_gui_cookies_check_window(wimp_w window)
 {
-	if (cookies_window.window == window)
+/* SF	if (cookies_window.w == window)
 		return true;
-	else
+	else*/
 		return false;
 }
 
-
-/**
- * Get pointer to the cookie treeview_window
- *
- * \return  pointer to the treeview_window
- */
-struct treeview_window* ro_gui_cookies_get(void)
-{
-	return &cookies_window;
-}

Modified: branches/paulblokus/treeview/riscos/cookies.h
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/cookies.h?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/cookies.h (original)
+++ branches/paulblokus/treeview/riscos/cookies.h Sun Feb 14 08:44:32 2010
@@ -1,5 +1,6 @@
 /*
  * Copyright 2006 Richard Wilson <info at tinct.net>
+ * Copyright 2010 Stephen Fryatt <stevef at netsurf-browser.org>
  *
  * This file is part of NetSurf, http://www.netsurf-browser.org/
  *
@@ -25,6 +26,9 @@
 
 void ro_gui_cookies_initialise(void);
 bool ro_gui_cookies_check_window(wimp_w window);
-struct treeview_window* ro_gui_cookies_get(void);
+
+void ro_gui_cookies_open(void);
+void ro_gui_cookies_update_theme(void);
 
 #endif
+

Modified: branches/paulblokus/treeview/riscos/dialog.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/dialog.c?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/dialog.c (original)
+++ branches/paulblokus/treeview/riscos/dialog.c Sun Feb 14 08:44:32 2010
@@ -39,6 +39,7 @@
 #include "riscos/dialog.h"
 #include "riscos/global_history.h"
 #include "riscos/gui.h"
+#include "riscos/hotlist.h"
 #include "riscos/menus.h"
 #include "riscos/options.h"
 #include "riscos/save.h"
@@ -149,24 +150,6 @@
 	/* object info */
 	dialog_objinfo = ro_gui_dialog_create("objectinfo");
 	ro_gui_wimp_event_set_help_prefix(dialog_objinfo, "HelpObjInfo");
-
-	/* hotlist folder editing */
-	dialog_folder = ro_gui_dialog_create("new_folder");
-	ro_gui_wimp_event_register_text_field(dialog_folder, ICON_FOLDER_NAME);
-	ro_gui_wimp_event_register_cancel(dialog_folder, ICON_FOLDER_CANCEL);
-	ro_gui_wimp_event_register_ok(dialog_folder, ICON_FOLDER_OK,
-			ro_gui_hotlist_dialog_apply);
-	ro_gui_wimp_event_set_help_prefix(dialog_folder, "HelpHotFolder");
-
-	/* hotlist entry editing */
-	dialog_entry = ro_gui_dialog_create("new_entry");
-	ro_gui_wimp_event_register_text_field(dialog_entry, ICON_ENTRY_NAME);
-	ro_gui_wimp_event_register_menu_gright(dialog_entry, ICON_ENTRY_URL,
-			ICON_ENTRY_RECENT, url_suggest_menu);
-	ro_gui_wimp_event_register_cancel(dialog_entry, ICON_ENTRY_CANCEL);
-	ro_gui_wimp_event_register_ok(dialog_entry, ICON_ENTRY_OK,
-			ro_gui_hotlist_dialog_apply);
-	ro_gui_wimp_event_set_help_prefix(dialog_entry, "HelpHotEntry");
 
 	/* save as */
 	dialog_saveas = ro_gui_saveas_create("saveas");
@@ -710,7 +693,7 @@
 	res = url_normalize(url, &url2);
 	if (res == URL_FUNC_OK) {
 		browser_window_create(url2, 0, 0, true, false);
-		global_history_add_recent(url2);
+		/* \TODO - \SF global_history_add_recent(url2);*/
 		free(url2);
 		return true;
 	}
@@ -726,7 +709,7 @@
 {
 	int suggestions;
 	ro_gui_set_icon_string(dialog_openurl, ICON_OPENURL_URL, "", true);
-	global_history_get_recent(&suggestions);
+	/* \TODO - \SF global_history_get_recent(&suggestions);*/ suggestions=0;
 	ro_gui_set_icon_shaded_state(dialog_openurl,
 			ICON_OPENURL_MENU, (suggestions <= 0));
 	ro_gui_wimp_event_memorise(dialog_openurl);

Modified: branches/paulblokus/treeview/riscos/global_history.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/global_history.c?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/global_history.c (original)
+++ branches/paulblokus/treeview/riscos/global_history.c Sun Feb 14 08:44:32 2010
@@ -1,5 +1,6 @@
 /*
  * Copyright 2005 Richard Wilson <info at tinct.net>
+ * Copyright 2010 Stephen Fryatt <stevef at netsurf-browser.org>
  *
  * This file is part of NetSurf, http://www.netsurf-browser.org/
  *
@@ -47,37 +48,66 @@
 
 static bool ro_gui_global_history_click(wimp_pointer *pointer);
 
-/* The history window, toolbar and plot origins */
-struct treeview_window global_history_window;
+/* The RISC OS global history window, toolbar and treeview data */
+
+static struct ro_global_history_window {
+	wimp_w		window;
+	struct toolbar	*toolbar;
+	ro_treeview	*tv;
+} global_history_window;
 
 /**
  * Initialise global history tree
  */
+
 void ro_gui_global_history_initialise(void)
 {
-	/* create our window */
+	/* Create our window. */
+
 	global_history_window.window = ro_gui_dialog_create("tree");
 	ro_gui_set_window_title(global_history_window.window,
 			messages_get("GlobalHistory"));
-	ro_gui_wimp_event_register_redraw_window(global_history_window.window,
-			ro_gui_tree_redraw);
-	ro_gui_wimp_event_register_open_window(global_history_window.window,
-			ro_gui_tree_open);
-	ro_gui_wimp_event_register_mouse_click(global_history_window.window,
-			ro_gui_global_history_click);
 
-	/* Create our toolbar */
+	/* Create our toolbar. */
+
 	global_history_window.toolbar = ro_gui_theme_create_toolbar(NULL,
 			THEME_HISTORY_TOOLBAR);
 	if (global_history_window.toolbar)
 		ro_gui_theme_attach_toolbar(global_history_window.toolbar,
 				global_history_window.window);
 
-	global_history_window.tree =
-			history_global_initialise(&global_history_window,
-					NULL);
+	/* Create the treeview with the window and toolbar. */
+
+	global_history_window.tv =
+			ro_treeview_create(global_history_window.window,
+			global_history_window.toolbar,
+			history_global_get_tree_flags());
+	if (global_history_window.tv == NULL) {
+		LOG(("Failed to allocate treeview"));
+		return;
+	}
+
+	/* Initialise the global history into the tree. */
+
+	history_global_initialise(
+			ro_treeview_get_tree(global_history_window.tv));
 }
 
+/**
+ * Open the global history window.
+ */
+
+void ro_gui_global_history_open(void)
+{
+	tree_set_redraw(ro_treeview_get_tree(global_history_window.tv), true);
+
+	if (!ro_gui_dialog_open_top(global_history_window.window,
+			global_history_window.toolbar, 600, 800)) {
+		ro_treeview_set_origin(global_history_window.tv, 0,
+				-(ro_gui_theme_toolbar_height(
+				global_history_window.toolbar)));
+	}
+}
 
 /**
  * Respond to a mouse click
@@ -87,15 +117,23 @@
  */
 bool ro_gui_global_history_click(wimp_pointer *pointer)
 {
-	ro_gui_tree_click(pointer, global_history_window.tree);
+/* SF	ro_gui_tree_click(pointer, global_history_window.tree);
 	if (pointer->buttons == wimp_CLICK_MENU)
 		ro_gui_menu_create(global_history_menu, pointer->pos.x,
 				pointer->pos.y, pointer->w);
 	else
-		ro_gui_menu_prepare_action(pointer->w, TREE_SELECTION, false);
+		ro_gui_menu_prepare_action(pointer->w, TREE_SELECTION, false); */
 	return true;
 }
 
+/**
+ * Update the theme details of the global history window.
+ */
+
+void ro_gui_global_history_update_theme(void)
+{
+	ro_treeview_update_theme(global_history_window.tv);
+}
 
 /**
  * Check if a particular window handle is the global history window
@@ -105,19 +143,9 @@
  */
 bool ro_gui_global_history_check_window(wimp_w window)
 {
-	if (global_history_window.window == window)
+/*	if (global_history_window.w == window)
 		return true;
-	else
+	else*/
 		return false;
 }
 
-
-/**
- * Get pointer to the cookie treeview_window
- *
- * \return  pointer to the treeview_window
- */
-struct treeview_window* ro_gui_global_history_get(void)
-{
-	return &global_history_window;
-}

Modified: branches/paulblokus/treeview/riscos/global_history.h
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/global_history.h?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/global_history.h (original)
+++ branches/paulblokus/treeview/riscos/global_history.h Sun Feb 14 08:44:32 2010
@@ -1,5 +1,6 @@
 /*
  * Copyright 2005 Richard Wilson <info at tinct.net>
+ * Copyright 2010 Stephen Fryatt <stevef at netsurf-browser.org>
  *
  * This file is part of NetSurf, http://www.netsurf-browser.org/
  *
@@ -26,9 +27,10 @@
 #define GLOBAL_HISTORY_RECENT_URLS 16
 
 void ro_gui_global_history_initialise(void);
+void ro_gui_global_history_open(void);
 void ro_gui_global_history_save(void);
+void ro_gui_global_history_update_theme(void);
 bool ro_gui_global_history_check_window(wimp_w window);
-struct treeview_window* ro_gui_global_history_get(void);
-
 
 #endif
+

Modified: branches/paulblokus/treeview/riscos/gui.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/gui.c?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/gui.c (original)
+++ branches/paulblokus/treeview/riscos/gui.c Sun Feb 14 08:44:32 2010
@@ -508,9 +508,6 @@
 	/* Done with the templates file */
 	wimp_close_template();
 
-	/* Initialise tree views (must be after UI sprites are loaded) */
-	ro_gui_tree_initialise();
-
 	/* Create Iconbar icon */
 	ro_gui_icon_bar_create();
 
@@ -1270,11 +1267,11 @@
 			break;
 
 		case GUI_DRAG_TREE_SELECT:
-			ro_gui_tree_selection_drag_end(drag);
+//			ro_gui_tree_selection_drag_end(drag);
 			break;
 
 		case GUI_DRAG_TREE_MOVE:
-			ro_gui_tree_move_drag_end(drag);
+//			ro_gui_tree_move_drag_end(drag);
 			break;
 
 		case GUI_DRAG_TOOLBAR_CONFIG:
@@ -1541,9 +1538,9 @@
 
 	if (g) {
 		browser_window_go(g->bw, url, 0, true);
-	} else if (ro_gui_hotlist_check_window(message->data.data_xfer.w)) {
-		/* Drop URL into hotlist */
-		ro_gui_hotlist_url_drop(message, url);
+//	} else if (ro_gui_hotlist_check_window(message->data.data_xfer.w)) {
+//		/* Drop URL into hotlist */
+//		ro_gui_hotlist_url_drop(message, url);
 	} else {
 		browser_window_create(url, 0, 0, true, false);
 	}

Modified: branches/paulblokus/treeview/riscos/gui.h
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/gui.h?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/gui.h (original)
+++ branches/paulblokus/treeview/riscos/gui.h Sun Feb 14 08:44:32 2010
@@ -134,10 +134,6 @@
 
 /* in 401login.c */
 void ro_gui_401login_init(void);
-
-/* in sslcert.c */
-void ro_gui_cert_init(void);
-void ro_gui_cert_open(struct tree *tree, struct node *node);
 
 /* in window.c */
 void ro_gui_window_quit(void);
@@ -177,16 +173,6 @@
 		bool pointer);
 void ro_gui_history_mouse_at(wimp_pointer *pointer);
 
-/* in hotlist.c */
-void ro_gui_hotlist_initialise(void);
-void ro_gui_hotlist_save(void);
-void ro_gui_hotlist_prepare_folder_dialog(struct node *node);
-void ro_gui_hotlist_prepare_entry_dialog(struct node *node);
-bool ro_gui_hotlist_dialog_apply(wimp_w w);
-bool ro_gui_hotlist_check_window(wimp_w window);
-void ro_gui_hotlist_url_drop(wimp_message *message, const char *url);
-struct treeview_window* ro_gui_hotlist_get(void);
-
 /* in filetype.c */
 int ro_content_filetype(struct content *content);
 int ro_content_filetype_from_type(content_type type);

Modified: branches/paulblokus/treeview/riscos/help.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/help.c?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/help.c (original)
+++ branches/paulblokus/treeview/riscos/help.c Sun Feb 14 08:44:32 2010
@@ -31,6 +31,7 @@
 #include "riscos/cookies.h"
 #include "riscos/global_history.h"
 #include "riscos/gui.h"
+#include "riscos/hotlist.h"
 #include "riscos/help.h"
 #include "riscos/menus.h"
 #include "riscos/options.h"
@@ -126,7 +127,7 @@
 		sprintf(message_token, "%s%i", auto_text, (int)icon);
 	else if (window == wimp_ICON_BAR)
 		sprintf(message_token, "HelpIconbar");
-	else if (ro_gui_hotlist_check_window(message->data.data_xfer.w)) {
+/* \TODO - \SF	else if (ro_gui_hotlist_check_window(message->data.data_xfer.w)) {
 		i = ro_gui_tree_help(message_data->pos.x, message_data->pos.y);
 		sprintf(message_token,
 				(i >= 0) ? "HelpTree%i" :"HelpHotlist%i", i);
@@ -139,7 +140,7 @@
 		i = ro_gui_tree_help(message_data->pos.x, message_data->pos.y);
 		sprintf(message_token,
 				(i >= 0) ? "HelpTree%i" :"HelpCookies%i", i);
-	} else if (ro_gui_window_lookup(window) != NULL)
+	}*/ else if (ro_gui_window_lookup(window) != NULL)
 		sprintf(message_token, "HelpBrowser%i", (int)icon);
 
 	/* if we've managed to find something so far then we broadcast it */

Modified: branches/paulblokus/treeview/riscos/hotlist.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/hotlist.c?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/hotlist.c (original)
+++ branches/paulblokus/treeview/riscos/hotlist.c Sun Feb 14 08:44:32 2010
@@ -1,5 +1,6 @@
 /*
  * Copyright 2004, 2005 Richard Wilson <info at tinct.net>
+ * Copyright 2010 Stephen Fryatt <stevef at netsurf-browser.org>
  *
  * This file is part of NetSurf, http://www.netsurf-browser.org/
  *
@@ -33,6 +34,7 @@
 #include "desktop/hotlist.h"
 #include "desktop/tree.h"
 #include "riscos/dialog.h"
+#include "riscos/hotlist.h"
 #include "riscos/menus.h"
 #include "riscos/options.h"
 #include "riscos/theme.h"
@@ -46,40 +48,76 @@
 
 static bool ro_gui_hotlist_click(wimp_pointer *pointer);
 
+/* The RISC OS hotlist window, toolbar and treeview data. */
 
-/* The hotlist window, toolbar and plot origins */
-struct treeview_window hotlist_window;
+static struct ro_hotlist {
+	wimp_w		window;		/*< The hotlist RO window handle. */
+	struct toolbar	*toolbar;	/*< The hotlist toolbar handle.   */
+	ro_treeview	*tv;		/*< The hotlist treeview handle.  */
+} hotlist_window;
 
 /**
  * Initialise global history tree
  */
+
 void ro_gui_hotlist_initialise(void)
 {
-	/* create our window */
+	/* Create our window. */
+
 	hotlist_window.window = ro_gui_dialog_create("tree");
 	ro_gui_set_window_title(hotlist_window.window,
 			messages_get("Hotlist"));
-	ro_gui_wimp_event_register_redraw_window(hotlist_window.window,
-			ro_gui_tree_redraw);
-	ro_gui_wimp_event_register_open_window(hotlist_window.window,
-			ro_gui_tree_open);
-	ro_gui_wimp_event_register_mouse_click(hotlist_window.window,
-			ro_gui_hotlist_click);
 
-	hotlist_window.tree = hotlist_initialise(&hotlist_window,
-			NULL, option_hotlist_path);
+	/* Create our toolbar. */
 
-	ro_gui_wimp_event_set_user_data(hotlist_window.window,
-			hotlist_window.tree);
-	ro_gui_wimp_event_register_keypress(hotlist_window.window,
-			ro_gui_tree_keypress);
-
-	/* Create our toolbar */
 	hotlist_window.toolbar = ro_gui_theme_create_toolbar(NULL,
 			THEME_HOTLIST_TOOLBAR);
 	if (hotlist_window.toolbar)
 		ro_gui_theme_attach_toolbar(hotlist_window.toolbar,
 				hotlist_window.window);
+
+	/* Create the treeview with the window and toolbar. */
+
+	hotlist_window.tv = ro_treeview_create(hotlist_window.window,
+			hotlist_window.toolbar,
+			hotlist_get_tree_flags());
+	if (hotlist_window.tv == NULL) {
+		LOG(("Failed to allocate treeview"));
+		return;
+	}
+
+	/* Initialise the hotlist into the tree. */
+
+	hotlist_initialise(ro_treeview_get_tree(hotlist_window.tv),
+			option_hotlist_path);
+}
+
+
+/**
+ * Open the hotlist window.
+ *
+ */
+
+void ro_gui_hotlist_open(void)
+{
+	tree_set_redraw(ro_treeview_get_tree(hotlist_window.tv), true);
+
+	if (!ro_gui_dialog_open_top(hotlist_window.window,
+			hotlist_window.toolbar, 600, 800)) {
+
+	xwimp_set_caret_position(hotlist_window.window, -1, -100, -100, 32, -1);
+// \todo	ro_gui_theme_process_toolbar(hotlist_window.toolbar, -1);
+		ro_treeview_set_origin(hotlist_window.tv, 0,
+				-(ro_gui_theme_toolbar_height(
+				hotlist_window.toolbar)));
+//		ro_gui_tree_stop_edit(tree);
+//
+//		if (tree->root->child) {
+//			tree_set_node_selected(tree, tree->root, false);
+//			tree_handle_node_changed(tree, tree->root,
+//				false, true);
+//		}
+	}
 }
 
 
@@ -90,21 +128,29 @@
  */
 bool ro_gui_hotlist_click(wimp_pointer *pointer)
 {
-	ro_gui_tree_click(pointer, hotlist_window.tree);
+/* SF	ro_gui_tree_click(pointer, hotlist_window.tree);
 	if (pointer->buttons == wimp_CLICK_MENU)
 		ro_gui_menu_create(hotlist_menu, pointer->pos.x,
 				pointer->pos.y, pointer->w);
 	else
-		ro_gui_menu_prepare_action(pointer->w, TREE_SELECTION, false);
+		ro_gui_menu_prepare_action(pointer->w, TREE_SELECTION, false); */
 	return true;
 }
 
+/**
+ * Update the theme details of the hotlist window.
+ */
+
+void ro_gui_hotlist_update_theme(void)
+{
+	ro_treeview_update_theme(hotlist_window.tv);
+}
 
 /**
  * Check if a particular window handle is the hotlist window
  *
- * \param window  the window in question
- * \return  true if this window is the hotlist
+ * \param window	The window in question
+ * \return		true if this window is the hotlist
  */
 bool ro_gui_hotlist_check_window(wimp_w window)
 {
@@ -114,7 +160,7 @@
 		return false;
 }
 
-
+#if 0
 /**
  * Handle URL dropped on hotlist
  *
@@ -133,14 +179,5 @@
 				&x, &y);
 	hotlist_add_page_xy(url, x, y);
 }
+#endif
 
-
-/**
- * Get pointer to the hotlist treeview_window
- *
- * \return  pointer to the treeview_window
- */
-struct treeview_window* ro_gui_hotlist_get(void)
-{
-	return &hotlist_window;
-}

Added: branches/paulblokus/treeview/riscos/hotlist.h
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/hotlist.h?rev=10056&view=auto
==============================================================================
--- branches/paulblokus/treeview/riscos/hotlist.h (added)
+++ branches/paulblokus/treeview/riscos/hotlist.h Sun Feb 14 08:44:32 2010
@@ -1,0 +1,34 @@
+/*
+ * Copyright 2006 Richard Wilson <info at tinct.net>
+ * Copyright 2010 Stephen Fryatt <stevef at netsurf-browser.org>
+ *
+ * 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_RISCOS_HOTLIST_H_
+#define _NETSURF_RISCOS_HOTLIST_H_
+
+void ro_gui_hotlist_initialise(void);
+void ro_gui_hotlist_open(void);
+void ro_gui_hotlist_save(void);
+void ro_gui_hotlist_update_theme(void);
+bool ro_gui_hotlist_check_window(wimp_w window);
+
+#endif
+

Modified: branches/paulblokus/treeview/riscos/menus.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/menus.c?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/menus.c (original)
+++ branches/paulblokus/treeview/riscos/menus.c Sun Feb 14 08:44:32 2010
@@ -48,6 +48,7 @@
 #include "riscos/gui.h"
 #include "riscos/global_history.h"
 #include "riscos/help.h"
+#include "riscos/hotlist.h"
 #include "riscos/menus.h"
 #include "riscos/options.h"
 #include "riscos/save.h"
@@ -106,7 +107,7 @@
 		bool ticked);
 static void ro_gui_menu_get_window_details(wimp_w w, struct gui_window **g,
 		struct browser_window **bw, struct content **content,
-		struct toolbar **toolbar, struct tree **tree,
+		struct toolbar **toolbar,
 		bool *is_cookies, bool *is_hotlist, bool *is_global_history);
 static int ro_gui_menu_get_checksum(void);
 static bool ro_gui_menu_prepare_url_suggest(void);
@@ -281,10 +282,10 @@
 	static const struct ns_menu hotlist_definition = {
 		"Hotlist", {
 			{ "Hotlist", NO_ACTION, 0 },
-			{ "Hotlist.New", NO_ACTION, 0 },
-			{ "Hotlist.New.Folder", TREE_NEW_FOLDER, &dialog_folder },
+			{ "Hotlist.New", NO_ACTION, 0 },/*
+\TODO \SF		{ "Hotlist.New.Folder", TREE_NEW_FOLDER, &dialog_folder },
 			{ "Hotlist.New.Link", TREE_NEW_LINK, &dialog_entry },
-			{ "_Hotlist.Export", HOTLIST_EXPORT, &dialog_saveas },
+			{ "_Hotlist.Export", HOTLIST_EXPORT, &dialog_saveas },*/
 			{ "Hotlist.Expand", TREE_EXPAND_ALL, 0 },
 			{ "Hotlist.Expand.All", TREE_EXPAND_ALL, 0 },
 			{ "Hotlist.Expand.Folders", TREE_EXPAND_FOLDERS, 0 },
@@ -610,7 +611,6 @@
 	struct browser_window *bw;
 	struct content *c;
 	struct toolbar *t;
-	struct tree *tree;
 	os_error *error;
 	bool is_cookies, is_hotlist, is_global_history;
 
@@ -623,16 +623,13 @@
 			warn_user("MenuError", error->errmess);
 		}
 		ro_gui_menu_get_window_details(current_menu_window,
-				&g, &bw, &c, &t, &tree,
+				&g, &bw, &c, &t,
 				&is_cookies, &is_hotlist,
 				&is_global_history);
 		current_menu = NULL;
 
 		if (cleanup) {
 		  	ro_gui_wimp_event_menus_closed();
-
-			if (tree)
-				ro_gui_tree_menu_closed(tree);
 		}
 	}
 
@@ -700,7 +697,7 @@
 					data.indirected_text.text;
 			gui_window_set_url(g, url);
 			browser_window_go(g->bw, url, 0, true);
-			global_history_add_recent(url);
+			/* \TODO -- \SF global_history_add_recent(url); */
 		}
 	} else if (current_menu == gui_form_select_menu) {
 		g = ro_gui_window_lookup(current_menu_window);
@@ -824,7 +821,7 @@
  */
 void ro_gui_menu_refresh_toolbar(struct toolbar *toolbar)
 {
-	struct treeview_window *treeview_window;
+//	struct treeview_window *treeview_window;
 
 	assert(toolbar);
 
@@ -833,24 +830,24 @@
 	if (toolbar->type == THEME_BROWSER_TOOLBAR) {
 		gui_window_update_extent(ro_gui_window_lookup(
 				current_menu_window));
-	} else if (toolbar->type == THEME_HOTLIST_TOOLBAR) {
-		treeview_window = ro_gui_hotlist_get();
-		/* TODO: FIX THIS */
-		/* tree_resized(treeview_window->tree); */
-		xwimp_force_redraw(treeview_window->window,
-				0,-16384, 16384, 16384);
-	} else if (toolbar->type == THEME_HISTORY_TOOLBAR) {
-		treeview_window = ro_gui_global_history_get();
-		/* TODO: FIX THIS */
-		/* tree_resized(treeview_window->tree); */
-		xwimp_force_redraw(treeview_window->window,
-				0,-16384, 16384, 16384);
-	} else if (toolbar->type == THEME_COOKIES_TOOLBAR) {
-		treeview_window = ro_gui_cookies_get();
-		/* TODO: FIX THIS */
-		/* tree_resized(treeview_window->tree); */
-		xwimp_force_redraw(treeview_window->window,
-				0,-16384, 16384, 16384);
+//	} else if (toolbar->type == THEME_HOTLIST_TOOLBAR) {
+//		treeview_window = ro_gui_hotlist_get();
+//		/* TODO: FIX THIS */
+//		/* tree_resized(treeview_window->tree); */
+//		xwimp_force_redraw(treeview_window->window,
+//				0,-16384, 16384, 16384);
+//	} else if (toolbar->type == THEME_HISTORY_TOOLBAR) {
+//		treeview_window = ro_gui_global_history_get();
+//		/* TODO: FIX THIS */
+//		/* tree_resized(treeview_window->tree); */
+//		xwimp_force_redraw(treeview_window->window,
+//				0,-16384, 16384, 16384);
+//	} else if (toolbar->type == THEME_COOKIES_TOOLBAR) {
+//		treeview_window = ro_gui_cookies_get();
+//		/* TODO: FIX THIS */
+//		/* tree_resized(treeview_window->tree); */
+//		xwimp_force_redraw(treeview_window->window,
+//				0,-16384, 16384, 16384);
 	}
 }
 
@@ -863,7 +860,7 @@
 	int suggestions;
 	int i;
 
-	suggest_text = global_history_get_recent(&suggestions);
+	/* \TODO - \SF suggest_text = global_history_get_recent(&suggestions); */ suggestions = 0;
 	if (suggestions < 1)
 		return false;
 
@@ -905,9 +902,9 @@
 	ro_gui_menu_prepare_action(gui->window, BROWSER_FIND_TEXT, false);
 
 	if (gui->toolbar) {
-		global_history_get_recent(&suggestions);
+		/* \TODO -- \SF global_history_get_recent(&suggestions);
 		ro_gui_set_icon_shaded_state(gui->toolbar->toolbar_handle,
-				ICON_TOOLBAR_SUGGEST, (suggestions <= 0));
+				ICON_TOOLBAR_SUGGEST, (suggestions <= 0)); */
 	}
 }
 
@@ -1470,18 +1467,16 @@
 bool ro_gui_menu_handle_action(wimp_w owner, menu_action action,
 		bool windows_at_pointer)
 {
-	struct treeview_window *treeview_window;
 	wimp_window_state state;
 	struct gui_window *g = NULL;
 	struct browser_window *bw = NULL;
 	struct content *c = NULL;
 	struct toolbar *t = NULL;
-	struct tree *tree = NULL;
 	os_error *error;
 	char url[80];
 	bool is_cookies, is_hotlist, is_global_history;
 
-	ro_gui_menu_get_window_details(owner, &g, &bw, &c, &t, &tree,
+	ro_gui_menu_get_window_details(owner, &g, &bw, &c, &t,
 			&is_cookies, &is_hotlist, &is_global_history);
 
 	switch (action) {
@@ -1516,26 +1511,22 @@
 						windows_at_pointer);
 			return true;
 		case HISTORY_SHOW_GLOBAL:
-			treeview_window = ro_gui_global_history_get();
-			ro_gui_tree_show(treeview_window->tree);
+			ro_gui_global_history_open();
 			return true;
 
 		/* hotlist actions */
 		case HOTLIST_ADD_URL:
-			treeview_window = ro_gui_hotlist_get();
-			if ((!treeview_window->tree) || (!c) || (!c->url))
+			if (c == NULL || c->url == NULL)
 				return false;
 			hotlist_add_page(c->url);
 			return true;
 		case HOTLIST_SHOW:
-			treeview_window = ro_gui_hotlist_get();
-			ro_gui_tree_show(treeview_window->tree);
+			ro_gui_hotlist_open();
 			return true;
 
 		/* cookies actions */
 		case COOKIES_SHOW:
-			treeview_window = ro_gui_cookies_get();
-			ro_gui_tree_show(treeview_window->tree);
+			ro_gui_cookies_open();
 			return true;
 
 		case COOKIES_DELETE:
@@ -1936,13 +1927,10 @@
 void ro_gui_menu_prepare_action(wimp_w owner, menu_action action,
 		bool windows)
 {
-	struct treeview_window *treeview_window;
 	struct gui_window *g;
 	struct browser_window *bw;
 	struct content *c;
 	struct toolbar *t;
-	struct tree *tree;
-	struct node *node;
 	bool result = false;
 	int checksum = 0;
 	os_error *error;
@@ -1951,7 +1939,7 @@
 	bool compare;
 	bool is_cookies, is_hotlist, is_global_history;
 
-	ro_gui_menu_get_window_details(owner, &g, &bw, &c, &t, &tree,
+	ro_gui_menu_get_window_details(owner, &g, &bw, &c, &t,
 			&is_cookies, &is_hotlist, &is_global_history);
 	if (current_menu_open)
 		checksum = ro_gui_menu_get_checksum();
@@ -1978,43 +1966,11 @@
 				!(c || history_back_available(bw->history) ||
 				history_forward_available(bw->history))));
 			break;
-		case HISTORY_SHOW_GLOBAL:
-			treeview_window = ro_gui_global_history_get();
-			ro_gui_menu_set_entry_shaded(current_menu, action,
-					!treeview_window);
-			break;
 
 		/* hotlist actions */
 		case HOTLIST_ADD_URL:
-			treeview_window = ro_gui_hotlist_get();
 			ro_gui_menu_set_entry_shaded(current_menu, action,
-					(!c || !treeview_window));
-			break;
-		case HOTLIST_SHOW:
-			treeview_window = ro_gui_hotlist_get();
-			ro_gui_menu_set_entry_shaded(current_menu, action,
-					!treeview_window);
-			if ((t) && (!t->editor) &&
-					(t->type == THEME_BROWSER_TOOLBAR))
-				ro_gui_set_icon_shaded_state(
-						t->toolbar_handle,
-						ICON_TOOLBAR_BOOKMARK,
-						!treeview_window);
-			break;
-
-		/* cookies actions */
-		case COOKIES_SHOW:
-			treeview_window = ro_gui_cookies_get();
-			node = tree_get_root(treeview_window->tree);
-			ro_gui_menu_set_entry_shaded(current_menu, action,
-					!treeview_window->tree);
-			break;
-		case COOKIES_DELETE:
-			treeview_window = ro_gui_cookies_get();
-			node = tree_get_root(treeview_window->tree);
-			ro_gui_menu_set_entry_shaded(current_menu, action,
-					!(treeview_window->tree &&
-					tree_node_get_child(node)));
+					c == NULL);
 			break;
 
 		/* page actions */
@@ -2276,12 +2232,12 @@
 						c->url, c->title);
 			break;
 		case HOTLIST_EXPORT:
-			if ((tree) && (windows))
+			if (windows)
 				ro_gui_save_prepare(GUI_SAVE_HOTLIST_EXPORT_HTML,
 						NULL, NULL, NULL, NULL);
 			break;
 		case HISTORY_EXPORT:
-			if ((tree) && (windows))
+			if (windows)
 				ro_gui_save_prepare(GUI_SAVE_HISTORY_EXPORT_HTML,
 						NULL, NULL, NULL, NULL);
 			break;
@@ -2422,93 +2378,6 @@
 					option_window_screen_width == 0);
 			break;
 
-		/* tree actions */
-		case TREE_NEW_FOLDER:
-			ro_gui_hotlist_prepare_folder_dialog(NULL);
-			break;
-		case TREE_NEW_LINK:
-			ro_gui_hotlist_prepare_entry_dialog(NULL);
-			break;
-		case TREE_EXPAND_ALL:
-		case TREE_EXPAND_FOLDERS:
-		case TREE_EXPAND_LINKS:
-		case TREE_COLLAPSE_ALL:
-		case TREE_COLLAPSE_FOLDERS:
-		case TREE_COLLAPSE_LINKS:
-			if (tree) {
-				node = tree_get_root(tree);
-				if (node == NULL)
-					break;
-				ro_gui_menu_set_entry_shaded(current_menu,
-						action,
-						!tree_node_get_child(node));
-
-				if ((t) && (!t->editor) && (t->type !=
-						THEME_BROWSER_TOOLBAR)) {
-					ro_gui_set_icon_shaded_state(
-							t->toolbar_handle,
-							ICON_TOOLBAR_EXPAND,
-							!tree_node_get_child(
-								node));
-					ro_gui_set_icon_shaded_state(
-							t->toolbar_handle,
-							ICON_TOOLBAR_OPEN,
-							!tree_node_get_child(
-								node));
-				}
-			}
-			break;
-		case TREE_SELECTION:
-			if (!tree)
-				break;
-			node = tree_get_root(tree);
-			if (node == NULL)
-				break;
-			result = tree_node_has_selection(node);
-			ro_gui_menu_set_entry_shaded(current_menu,
-					action, !result);
-			if ((t) && (!t->editor) &&
-					(t->type != THEME_BROWSER_TOOLBAR)) {
-				ro_gui_set_icon_shaded_state(
-						t->toolbar_handle,
-						ICON_TOOLBAR_DELETE, !result);
-				ro_gui_set_icon_shaded_state(
-						t->toolbar_handle,
-						ICON_TOOLBAR_LAUNCH, !result);
-			}
-			break;
-		case TREE_SELECTION_EDIT:
-			if (!tree)
-				break;
-			node = tree_get_root(tree);
-			if (node == NULL)
-				break;
-			node = tree_get_selected_node(node);
-			ro_gui_menu_set_entry_shaded(current_menu,
-					action, !result);
-			break;
-		case TREE_SELECTION_LAUNCH:
-		case TREE_SELECTION_DELETE:
-		case TREE_CLEAR_SELECTION:
-			if (!tree)
-				break;
-			node = tree_get_root(tree);
-			if (node == NULL)
-				break;
-			result = tree_node_has_selection(node);
-			ro_gui_menu_set_entry_shaded(current_menu,
-					action, !result);
-			break;
-		case TREE_SELECT_ALL:
-			if (!tree)
-				break;
-			node = tree_get_root(tree);
-			if (node == NULL)
-				break;
-			ro_gui_menu_set_entry_shaded(current_menu, action,
-					!tree_node_get_child(node));
-			break;
-
 		/* toolbar actions */
 		case TOOLBAR_BUTTONS:
 			ro_gui_menu_set_entry_shaded(current_menu,
@@ -2561,11 +2430,9 @@
  */
 void ro_gui_menu_get_window_details(wimp_w w, struct gui_window **g,
 		struct browser_window **bw, struct content **content,
-		struct toolbar **toolbar, struct tree **tree,
+		struct toolbar **toolbar,
 		bool *is_cookies, bool *is_hotlist, bool *is_global_history)
 {
-	struct treeview_window *treeview_window;
-
 	*is_cookies = false;
 	*is_hotlist = false;
 	*is_global_history = false;
@@ -2577,27 +2444,19 @@
 		*toolbar = (*g)->toolbar;
 		if (*bw)
 			*content = (*bw)->current_content;
-		*tree = NULL;
 	} else {
 		*bw = NULL;
 		*content = NULL;
 		if (ro_gui_hotlist_check_window(w)) {
 			*is_hotlist = true;
-			treeview_window = ro_gui_hotlist_get();
-			*tree = treeview_window->tree;
-			*toolbar = treeview_window->toolbar;
+//			*toolbar = treeview_window->toolbar;
 		} else if (ro_gui_global_history_check_window(w)) {
 			*is_global_history = true;
-			treeview_window = ro_gui_global_history_get();
-			*tree = treeview_window->tree;
-			*toolbar = treeview_window->toolbar;
+//			*toolbar = treeview_window->toolbar;
 		} else if (ro_gui_cookies_check_window(w)) {
 			*is_cookies = true;
-			treeview_window = ro_gui_cookies_get();
-			*tree = treeview_window->tree;
-			*toolbar = treeview_window->toolbar;
+//			*toolbar = treeview_window->toolbar;
 		} else {
-			*tree = NULL;
 			*toolbar = NULL;
 		}
 	}
@@ -2661,6 +2520,7 @@
 	char *translated;
 	utf8_convert_ret err;
 
+
 	/* read current alphabet */
 	error = xosbyte1(osbyte_ALPHABET_NUMBER, 127, 0, &alphabet);
 	if (error) {

Modified: branches/paulblokus/treeview/riscos/sslcert.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/sslcert.c?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/sslcert.c (original)
+++ branches/paulblokus/treeview/riscos/sslcert.c Sun Feb 14 08:44:32 2010
@@ -35,6 +35,7 @@
 #include "desktop/gui.h"
 #include "desktop/tree.h"
 #include "riscos/dialog.h"
+#include "riscos/sslcert.h"
 #include "riscos/textarea.h"
 #include "riscos/treeview.h"
 #include "riscos/wimp.h"
@@ -47,36 +48,26 @@
 #define ICON_SSL_REJECT 3
 #define ICON_SSL_ACCEPT 4
 
-#define ICON_CERT_VERSION 3
-#define ICON_CERT_VALID_FROM 5
-#define ICON_CERT_TYPE 7
-#define ICON_CERT_VALID_TO 9
-#define ICON_CERT_SERIAL 11
-#define ICON_CERT_ISSUER 13
-#define ICON_CERT_SUBJECT 15
-
-static wimp_window *dialog_tree_template;
-static wimp_window *dialog_cert_template;
-
-static bool ro_gui_cert_click(wimp_pointer *pointer);
 static void ro_gui_cert_close(wimp_w w);
 static bool ro_gui_cert_apply(wimp_w w);
 
+static struct ro_sslcert
+{
+	ro_treeview *tv;
+	wimp_w w;
+} sslcert_window;
+
 /**
  * Load the cert window template
  */
 
 void ro_gui_cert_init(void)
 {
-	dialog_tree_template = ro_gui_dialog_load_template("tree");
-	dialog_cert_template = ro_gui_dialog_load_template("sslcert");
-
-	dialog_tree_template->flags &= ~(wimp_WINDOW_MOVEABLE |
-			wimp_WINDOW_BACK_ICON |
-			wimp_WINDOW_CLOSE_ICON |
-			wimp_WINDOW_TITLE_ICON |
-			wimp_WINDOW_SIZE_ICON |
-			wimp_WINDOW_TOGGLE_ICON);
+	/** \todo Create certificate window */
+
+	/* SF sslcert_window.tv = ro_treeview_create(sslcert_get_tree_flags()); */
+
+	/** \todo Connect event handlers */
 }
 
 /**
@@ -86,7 +77,7 @@
 void gui_cert_verify(struct browser_window *bw, struct content *c,
 		const struct ssl_cert_info *certs, unsigned long num)
 {
-	wimp_w ssl_w;
+/* SF	wimp_w ssl_w;
 	struct sslcert_session_data *data;
 	struct treeview_window sslcert_window;
 	wimp_window_state state;
@@ -96,9 +87,9 @@
 	assert(bw && c && certs);
 
 	data = sslcert_create_session_data(num, bw, c->url);
-
+*/
 	/* create the SSL window */
-	error = xwimp_create_window(dialog_cert_template, &ssl_w);
+/* SF	error = xwimp_create_window(dialog_cert_template, &ssl_w);
 	if (error) {
 		LOG(("xwimp_create_window: 0x%x: %s",
 				error->errnum, error->errmess));
@@ -107,15 +98,15 @@
 
 	sslcert_window.tree = sslcert_create_tree(&sslcert_window,
 			NULL, certs, data);
-
+*/
 	/* automated SSL window event handling */
-	ro_gui_wimp_event_set_user_data(ssl_w, data);
+/* SF	ro_gui_wimp_event_set_user_data(ssl_w, data);
 	ro_gui_wimp_event_register_cancel(ssl_w, ICON_SSL_REJECT);
 	ro_gui_wimp_event_register_ok(ssl_w, ICON_SSL_ACCEPT, ro_gui_cert_apply);
 	ro_gui_dialog_open_persistent(bw->window->window, ssl_w, false);
-
+*/
 	/* create a tree window (styled as a list) */
-	error = xwimp_create_window(dialog_tree_template,
+/* SF	error = xwimp_create_window(dialog_tree_template,
 			&sslcert_window.window);
 	if (error) {
 		ro_gui_cert_close(ssl_w);
@@ -123,9 +114,9 @@
 				error->errnum, error->errmess));
 		return;
 	}
-
+*/
 	/* automated treeview event handling */
-	ro_gui_wimp_event_set_user_data(sslcert_window.window,
+/* SF	ro_gui_wimp_event_set_user_data(sslcert_window.window,
 			sslcert_window.tree);
 	ro_gui_wimp_event_register_keypress(sslcert_window.window,
 			ro_gui_tree_keypress);
@@ -137,9 +128,9 @@
 			ro_gui_wimp_event_finalise);
 	ro_gui_wimp_event_register_mouse_click(sslcert_window.window,
 			ro_gui_cert_click);
-
+*/
 	/* nest the tree window inside the pane window */
-	state.w = ssl_w;
+/* SF	state.w = ssl_w;
 	error = xwimp_get_window_state(&state);
 	if (error) {
 		ro_gui_cert_close(ssl_w);
@@ -177,7 +168,7 @@
 		LOG(("xwimp_open_window_nested: 0x%x: %s",
 				error->errnum, error->errmess));
 		return;
-	}
+	}*/
 }
 
 
@@ -217,12 +208,3 @@
 	return true;
 }
 
-bool ro_gui_cert_click(wimp_pointer *pointer)
-{
-	struct tree *tree;
-
-	tree = (struct tree *)ro_gui_wimp_event_get_user_data(pointer->w);
-	ro_gui_tree_click(pointer, tree);
-	return true;
-}
-

Added: branches/paulblokus/treeview/riscos/sslcert.h
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/sslcert.h?rev=10056&view=auto
==============================================================================
--- branches/paulblokus/treeview/riscos/sslcert.h (added)
+++ branches/paulblokus/treeview/riscos/sslcert.h Sun Feb 14 08:44:32 2010
@@ -1,0 +1,30 @@
+/*
+ * Copyright 2006 Richard Wilson <info at 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
+ * SSL certificate viewer (interface).
+ */
+
+#ifndef _NETSURF_RISCOS_SSLCERT_H_
+#define _NETSURF_RISCOS_SSLCERT_H_
+
+void ro_gui_cert_init(void);
+void ro_gui_cert_open(struct tree *tree, struct node *node);
+
+#endif
+

Modified: branches/paulblokus/treeview/riscos/theme.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/theme.c?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/theme.c (original)
+++ branches/paulblokus/treeview/riscos/theme.c Sun Feb 14 08:44:32 2010
@@ -41,6 +41,7 @@
 #include "riscos/dialog.h"
 #include "riscos/global_history.h"
 #include "riscos/gui.h"
+#include "riscos/hotlist.h"
 #include "riscos/menus.h"
 #include "riscos/options.h"
 #include "riscos/theme.h"
@@ -573,7 +574,6 @@
 bool ro_gui_theme_apply(struct theme_descriptor *descriptor)
 {
 	struct theme_descriptor *theme_previous;
-	struct treeview_window *tw;
 
 	/* check if the theme is already applied */
 	if (descriptor == theme_current)
@@ -587,16 +587,9 @@
 
 	/* apply the theme to all the current windows */
 	ro_gui_window_update_theme();
-
-	tw = ro_gui_hotlist_get();
-	ro_gui_tree_update_theme(tw->tree);
-
-	tw = ro_gui_global_history_get();
-	ro_gui_tree_update_theme(tw->tree);
-
-	tw = ro_gui_cookies_get();
-	ro_gui_tree_update_theme(tw->tree);
-
+	ro_gui_cookies_update_theme();
+	ro_gui_global_history_update_theme();
+	ro_gui_hotlist_update_theme();
 	ro_gui_theme_close(theme_previous, false);
 	return true;
 }
@@ -953,14 +946,7 @@
 	 		ro_gui_wimp_event_register_mouse_click(toolbar->toolbar_handle,
 	 				ro_gui_toolbar_click);
 	 		break;
-		case THEME_HOTLIST_TOOLBAR:
-		case THEME_HOTLIST_EDIT_TOOLBAR:
-		case THEME_HISTORY_TOOLBAR:
-	  	case THEME_HISTORY_EDIT_TOOLBAR:
-		case THEME_COOKIES_TOOLBAR:
-	  	case THEME_COOKIES_EDIT_TOOLBAR:
-			ro_gui_wimp_event_register_mouse_click(toolbar->toolbar_handle,
-					ro_gui_tree_toolbar_click);
+		default:
 			break;
 	}
 
@@ -1168,7 +1154,7 @@
 	/*	Attach/close the windows
 	*/
 	toolbar->parent_handle = parent;
-	height = ro_gui_theme_toolbar_height(toolbar);
+	height = ro_gui_theme_toolbar_height(toolbar);	
 	if (height > 0) {
 		outline.w = parent;
 		xwimp_get_window_outline(&outline);
@@ -1331,6 +1317,7 @@
 				xwimp_force_redraw(toolbar->parent_handle,
 					0, -16384, 16384, 16384);
 		}
+
 	}
 
 	/*	Reformat the buttons starting with the throbber

Modified: branches/paulblokus/treeview/riscos/treeview.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/treeview.c?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/treeview.c (original)
+++ branches/paulblokus/treeview/riscos/treeview.c Sun Feb 14 08:44:32 2010
@@ -1,5 +1,6 @@
 /*
  * Copyright 2005 Richard Wilson <info at tinct.net>
+ * Copyright 2010 Stephen Fryatt <stevef at netsurf-browser.org>
  *
  * This file is part of NetSurf, http://www.netsurf-browser.org/
  *
@@ -19,6 +20,8 @@
 /** \file
  * Generic tree handling (implementation).
  */
+
+#include <oslib/os.h>
 
 #include <assert.h>
 #include <stdbool.h>
@@ -35,6 +38,7 @@
 #include "content/urldb.h"
 #include "desktop/browser.h"
 #include "desktop/plotters.h"
+#include "desktop/textinput.h"
 #include "desktop/tree.h"
 #include "riscos/bitmap.h"
 #include "riscos/dialog.h"
@@ -56,16 +60,845 @@
 #define wimp_KEY_END wimp_KEY_COPY
 #endif
 
-#define TREE_EXPAND 0
-#define TREE_COLLAPSE 1
-
-
-static bool ro_gui_tree_initialise_sprite(const char *name, int number);
-static void ro_gui_tree_launch_selected_node(struct tree *tree, struct node *node, bool all);
-static bool ro_gui_tree_launch_node(struct tree *tree, struct node *node);
-static void tree_handle_node_changed_callback(void *p);
-
-
+/** \todo Ugh! */
+const char tree_directory_icon_name[] = "directory.png";
+const char tree_content_icon_name[] = "content.png";
+
+struct ro_treeview
+{
+	struct tree *tree;	/*< Pointer to treeview tree block.        */
+	wimp_w w;		/*< RO Window Handle for tree window.      */
+	struct toolbar	*tb;	/*< Pointer to toolbar block.              */
+	struct {
+		int x;		/*< X origin of tree, to RO work area.     */
+		int y;		/*< Y origin of tree, to RO work area.     */
+	} origin;
+	struct {
+		int x;		/*< X dimension of the tree, in RO units.  */
+		int y;		/*< Y dimension of the tree, in RO units.  */
+	} size;			/* (Dimensions are 0 until set correctly). */
+	struct {
+		int x;		/*< X extent of the window, in RO units.   */
+		int y;		/*< Y extent of the window, in RO units.   */
+	} extent;		/* (Extents are 0 until set correctly).    */
+};
+
+static void ro_treeview_redraw_request(int x, int y, int width, int height,
+		void *pw);
+static void ro_treeview_resized(struct tree *tree, int width, int height,
+		void *pw);
+static void ro_treeview_scroll_visible(int y, int height, void *pw);
+static void ro_treeview_get_window_dimensions(int *width, int *height,
+		void *pw);
+
+static void ro_treeview_redraw(wimp_draw *redraw);
+static void ro_treeview_open(wimp_open *open);
+static bool ro_treeview_mouse_click(wimp_pointer *pointer);
+static bool ro_treeview_keypress(wimp_key *key);
+
+static void ro_treeview_set_window_extent(ro_treeview *tv,
+		int width, int height);
+
+static const struct treeview_table ro_tree_callbacks = {
+	ro_treeview_redraw_request,
+	ro_treeview_resized,
+	ro_treeview_scroll_visible,
+	ro_treeview_get_window_dimensions
+};
+
+/**
+ * Create a RISC OS GUI implementation of a treeview tree.
+ *
+ * \param  window		The window to create the tree in.
+ * \param  flags		The treeview flags.
+ *
+ * \return			The RISC OS treeview pointer.
+ */
+
+ro_treeview *ro_treeview_create(wimp_w window, struct toolbar *toolbar,
+		unsigned int flags)
+{
+	ro_treeview *tv;
+
+	/* Claim memory for the treeview block, and create a tree. */
+
+	tv = malloc(sizeof(ro_treeview));
+	if (tv == NULL)
+		return NULL;
+
+	tv->w = window;
+	tv->tb = toolbar;
+
+	tv->tree = tree_create(flags, &ro_tree_callbacks, tv);
+	if (tv->tree == NULL) {
+		free(tv);
+		return NULL;
+	}
+
+	/* Set the tree redraw origin at a default 0,0 RO units. */
+
+	tv->origin.x = 0;
+	tv->origin.y = 0;
+
+	/* Set the tree size as 0,0 to indicate that we don't know. */
+
+	tv->size.x = 0;
+	tv->size.y = 0;
+
+	/* Set the tree window extent to 0,0, to indicate that we
+	 * don't know. */
+
+	tv->extent.x = 0;
+	tv->extent.y = 0;
+
+	/* Register wimp events to handle the supplied window. */
+
+	ro_gui_wimp_event_register_redraw_window(tv->w, ro_treeview_redraw);
+	ro_gui_wimp_event_register_open_window(tv->w, ro_treeview_open);
+	ro_gui_wimp_event_register_mouse_click(tv->w, ro_treeview_mouse_click);
+	ro_gui_wimp_event_register_keypress(tv->w, ro_treeview_keypress);
+	ro_gui_wimp_event_set_user_data(tv->w, tv);
+
+	/* \todo Register wimp events to handle the supplied toolbar? */
+
+	return tv;
+}
+
+/**
+ * Delete a RISC OS GUI implementation of a treeview tree.
+ *
+ * \param  tv			The RISC OS treeview to delete.
+ */
+
+void ro_treeview_destroy(ro_treeview *tv)
+{
+	/** \todo Deregister event handlers? */
+
+	/** \todo Destroy WIMP window */
+
+	tree_delete(tv->tree);
+
+	free(tv);
+}
+
+/**
+ * Change the redraw origin of a treeview tree in RISC OS graphics units.
+ *
+ * \param  *tv		The ro_treeview object to update.
+ * \param  x		The X position, in terms of the RO window work area.
+ * \param  y		The Y position, in terms of the RO window work area.
+ *
+ * \todo -- this probably needs a rework.
+ */
+
+void ro_treeview_set_origin(ro_treeview *tv, int x, int y)
+{
+	if (tv != NULL) {
+		tv->origin.x = x;
+		tv->origin.y = y;
+
+		/* Assuming that we know how big the tree currently is, then
+		 * adjust the window work area extent to match.  If we don't,
+		 * then presumably the tree isn't in an open window yet and
+		 * a subsequent Open Window Event should pick it up.
+		 */
+
+		if (tv->size.x != 0 && tv->size.y != 0)
+			ro_treeview_set_window_extent(tv,
+					tv->origin.x + tv->size.x,
+					tv->origin.y + tv->size.y);
+	}
+}
+
+/**
+ * Return details of the tree block associated with an ro_treeview object.
+ *
+ * \param  *tv		The ro_treeview object of interest.
+ * \return		A pointer to the associated tree block.
+ */
+
+struct tree *ro_treeview_get_tree(ro_treeview *tv)
+{
+	return tv->tree;
+}
+
+/**
+ * Return details of the RISC OS window handle associated with an
+ * ro_treeview object.
+ *
+ * \param  *tv		The ro_treeview object of interest.
+ * \return		The associated RISC OS window handle.
+ */
+
+wimp_w ro_treeview_get_window(ro_treeview *tv)
+{
+	return tv->w;
+}
+
+/**
+ * Callback to force a redraw of part of the treeview window.
+ *
+ * \param  x		Min X Coordinate of area to be redrawn.
+ * \param  y		Min Y Coordinate of area to be redrawn.
+ * \param  width	Width of area to be redrawn.
+ * \param  height	Height of area to be redrawn.
+ * \param  pw		The treeview object to be redrawn.
+ */
+
+void ro_treeview_redraw_request(int x, int y, int width, int height,
+		void *pw)
+{
+	if (pw != NULL) {
+		ro_treeview		*tv = (ro_treeview *) pw;
+		os_error		*error;
+
+		error = xwimp_force_redraw(tv->w, (2 * x) + tv->origin.x,
+				(-2 * (y + height)) + tv->origin.y,
+				(2 * (x + width)) + tv->origin.x,
+				(-2 * y) + tv->origin.y);
+
+		if (error) {
+			LOG(("xwimp_force_redraw: 0x%x: %s",
+					error->errnum, error->errmess));
+			warn_user("WimpError", error->errmess);
+			return;
+		}
+	}
+}
+
+/**
+ * Callback to notify us of a new overall tree size.
+ *
+ * \param  tree		The tree being resized.
+ * \param  width	The new width of the window.
+ * \param  height	The new height of the window.
+ * \param  *pw		The treeview object to be resized.
+ */
+
+void ro_treeview_resized(struct tree *tree, int width, int height,
+		void *pw)
+{
+	if (pw != NULL) {
+		ro_treeview		*tv = (ro_treeview *) pw;
+
+		/* Store the width and height in terms of RISC OS work area. */
+
+		tv->size.x = width * 2;
+		tv->size.y = -(height * 2);
+
+		/* Resize the window. */
+
+		ro_treeview_set_window_extent(tv, tv->size.x, tv->size.y);
+	}
+}
+
+/**
+ * Callback to request that a section of the tree is scrolled into view.
+ *
+ * \param  y			The Y coordinate of top of the area in NS units.
+ * \param  height		The height of the area in NS units.
+ * \param  *pw			The treeview object affected.
+ */
+
+void ro_treeview_scroll_visible(int y, int height, void *pw)
+{
+	if (pw != NULL) {
+		ro_treeview		*tv = (ro_treeview *) pw;
+		os_error		*error;
+		wimp_window_state	state;
+		int			visible_t, visible_b;
+		int			request_t, request_b;
+
+		state.w = tv->w;
+		error = xwimp_get_window_state(&state);
+		if (error) {
+			LOG(("xwimp_get_window_state: 0x%x: %s",
+					error->errnum, error->errmess));
+			warn_user("WimpError", error->errmess);
+			return;
+		}
+
+		/* Work out top and bottom of both the currently visible and
+		 * the required areas, in terms of the RO work area.
+		 */
+
+		 visible_t = state.yscroll;
+		 visible_b = state.yscroll
+		 		- (state.visible.y1 - state.visible.y0);
+
+		 request_t = -(2 * y) + tv->origin.y;
+		 request_b = -(2 * (y + height)) + tv->origin.y;
+
+		 /* If the area is outside the visible window, then scroll it
+		  * in to view.
+		  */
+
+		 if (request_t > visible_t || request_b < visible_b) {
+		 	if (request_t > visible_t) {
+		 		state.yscroll = request_t;
+		 	} else if (request_b < visible_b) {
+		 		state.yscroll = request_b
+		 			+ (state.visible.y1 - state.visible.y0);
+		 		if (state.yscroll > request_t)
+		 			state.yscroll = request_t;
+		 	}
+
+		 	error = xwimp_open_window((wimp_open *) &state);
+		 	if (error) {
+				LOG(("xwimp_open_window: 0x%x: %s",
+						error->errnum, error->errmess));
+				warn_user("WimpError", error->errmess);
+				return;
+			}
+		}
+	}
+}
+
+/**
+ * Callback to return the tree window dimensions to the treeview system.
+ *
+ * \param  *width		Return the window width.
+ * \param  *height		Return the window height.
+ * \param  *pw			The treeview object to use.
+ */
+
+void ro_treeview_get_window_dimensions(int *width, int *height,
+		void *pw)
+{
+	if (pw != NULL && (width != NULL || height != NULL)) {
+		ro_treeview		*tv = (ro_treeview *) pw;
+		os_error		*error;
+		wimp_window_info	info;
+
+		info.w = tv->w;
+		error = xwimp_get_window_info_header_only(&info);
+		if (error) {
+			LOG(("xwimp_get_window_info_header_only: 0x%x: %s",
+					error->errnum, error->errmess));
+			warn_user("WimpError", error->errmess);
+			return;
+		}
+
+		/* The window dimension is returned taking into account that
+		 * the X and Y origin offset makes some of the extent
+		 * unusable.
+		 */
+
+		if (width != NULL) {
+			*width = ((info.extent.x1 - info.extent.x0)
+					- tv->origin.x) / 2;
+		}
+
+		if (height != NULL) {
+			*height = ((info.extent.y1 - info.extent.y0)
+					+ tv->origin.y) / 2;
+		}
+	}
+}
+
+/**
+ * Resize the RISC OS window extent of a treeview.
+ *
+ * \param  *tv			The RISC OS treeview object to resize.
+ * \param  width		The new width of the work area, in RO units.
+ * \param  height		The new height of the work area, in RO units.
+ */
+
+void ro_treeview_set_window_extent(ro_treeview *tv, int width, int height)
+{
+	if (tv != NULL) {
+		os_error		*error;
+		os_box			extent;
+		wimp_window_state	state;
+		int			new_x, new_y;
+		int			visible_x, visible_y;
+		int			new_x_scroll, new_y_scroll;
+
+		/* Calculate the new window extents, in RISC OS units. */
+
+		new_x = width + tv->origin.x;
+		new_y = height + tv->origin.y;
+
+		/* Get details of the existing window, and start to sanity
+		 * check the new extents.
+		 */
+
+		state.w = tv->w;
+		error = xwimp_get_window_state(&state);
+		if (error) {
+			LOG(("xwimp_get_window_state: 0x%x: %s",
+					error->errnum, error->errmess));
+			warn_user("WimpError", error->errmess);
+			return;
+		}
+
+		/* If the extent is smaller than the current visible area,
+		 * then extend it so that it matches the visible area.
+		 */
+
+		if (new_x < (state.visible.x1 - state.visible.x0))
+			new_x = state.visible.x1 - state.visible.x0;
+
+		if (new_y > (state.visible.y0 - state.visible.y1))
+			new_y = state.visible.y0 - state.visible.y1;
+
+		/* Calculate the maximum visible coordinates of the existing
+		 * window.
+		 */
+
+		visible_x = state.xscroll +
+				(state.visible.x1 - state.visible.x0);
+		visible_y = state.yscroll +
+				(state.visible.y0 - state.visible.y1);
+
+		/* If the window is currently open, and the exising visible
+		 * area is bigger than the new extent, then we need to reopen
+		 * the window in an appropriare position before setting the
+		 * new extent.
+		 */
+
+		if ((state.flags & wimp_WINDOW_OPEN) &&
+				(visible_x > new_x || visible_y < new_y)) {
+			new_x_scroll = state.xscroll;
+			new_y_scroll = state.yscroll;
+
+			if (visible_x > new_x)
+				new_x_scroll = new_x - (state.visible.x1
+						- state.visible.x0);
+
+			if (visible_y < new_y)
+				new_y_scroll = new_y - (state.visible.y0
+						- state.visible.y1);
+
+			if (new_x_scroll < 0) {
+				state.visible.x1 -= new_x_scroll;
+				state.xscroll = 0;
+			} else {
+				state.xscroll = new_x_scroll;
+			}
+
+			if (new_y_scroll > 0) {
+				state.visible.y0 += new_y_scroll;
+				state.yscroll = 0;
+			} else {
+				state.yscroll = new_y_scroll;
+			}
+
+			error = xwimp_open_window((wimp_open *) &state);
+			if (error) {
+				LOG(("xwimp_get_window_state: 0x%x: %s",
+						error->errnum, error->errmess));
+				warn_user("WimpError", error->errmess);
+				return;
+			}
+
+			/* \todo -- Not sure if we need to reattach the
+			 * toolbar here: the nested wimp seems to take care
+			 * of it for us?
+			 */
+		}
+
+		/* Now that the new extent fits into the visible window, we
+		 * can resize the work area.  If we succeed, the values are
+		 * recorded to save having to ask the Wimp for them
+		 * each time.
+		 */
+
+		extent.x0 = 0;
+		extent.y0 = new_y;
+		extent.x1 = new_x;
+		extent.y1 = 0;
+
+		error = xwimp_set_extent(tv->w, &extent);
+		if (error) {
+			LOG(("xwimp_set_extent: 0x%x: %s",
+					error->errnum, error->errmess));
+			warn_user("WimpError", error->errmess);
+			return;
+		}
+
+		tv->extent.x = new_x;
+		tv->extent.y = new_y;
+	}
+}
+
+/**
+ * Pass RISC OS redraw events on to the treeview widget.
+ *
+ * \param  *redraw		Pointer to Redraw Event block.
+ */
+
+void ro_treeview_redraw(wimp_draw *redraw)
+{
+	osbool		more;
+	os_error	*error;
+	ro_treeview	*tv;
+
+	tv = (ro_treeview *) ro_gui_wimp_event_get_user_data(redraw->w);
+	if (tv == NULL) {
+		LOG(("NULL treeview block for window: 0x%x",
+				(unsigned int) redraw->w));
+		/* Don't return, as not servicing redraw events isn't a good
+		 * idea.  The following code must handle (tv == NULL)
+		 * gracefully while clearing the redraw queue.
+		 */
+	}
+
+	error = xwimp_redraw_window(redraw, &more);
+	if (error) {
+		LOG(("xwimp_redraw_window: 0x%x: %s",
+				error->errnum, error->errmess));
+		warn_user("WimpError", error->errmess);
+		return;
+	}
+
+	while (more) {
+		ro_plot_origin_x = redraw->box.x0 - redraw->xscroll;
+		ro_plot_origin_y = redraw->box.y1 - redraw->yscroll;
+
+		if (tv != NULL && tv->tree != NULL) {
+			tree_draw(tv->tree, tv->origin.x/2, -(tv->origin.y/2),
+					(redraw->clip.x0
+					-(ro_plot_origin_x+tv->origin.x))/2,
+					((ro_plot_origin_y+tv->origin.y)
+					-redraw->clip.y1)/2,
+					(redraw->clip.x1 - redraw->clip.x0)/2,
+					(redraw->clip.y1 - redraw->clip.y0)/2);
+	 	}
+
+		error = xwimp_get_rectangle(redraw, &more);
+		if (error) {
+			LOG(("xwimp_redraw_window: 0x%x: %s",
+					error->errnum, error->errmess));
+			warn_user("WimpError", error->errmess);
+			return;
+		}
+	}
+}
+
+/**
+ * Handle RISC OS Window Open events for a treeview window.
+ *
+ * \param  *open		Pointer to the Window Open Event block.
+ *
+ * \todo -- This needs to be sorted and error checked.
+ */
+
+static void ro_treeview_open(wimp_open *open)
+{
+	ro_treeview	*tv;
+	os_error	*error;
+	os_box		extent;
+	int		width, height;
+
+	tv = (ro_treeview *) ro_gui_wimp_event_get_user_data(open->w);
+	if (tv == NULL) {
+		LOG(("NULL treeview block for window: ox%x",
+				(unsigned int) open->w));
+		return;
+	}
+
+	/* Calculate the window work area.  It must be at least the same as
+	 * the current visible area of the window, and needs to contain the
+	 * tree as defined by size.x + offset.x and size.y + offset.y (note
+	 * that the offset.y should be set to cover any toolbar, so we can
+	 * ignore the size of that).
+	 */
+
+	width = open->visible.x1 - open->visible.x0;
+	height = open->visible.y0 - open->visible.y1;
+
+	if (tv->size.x != 0 && width < (tv->origin.x + tv->size.x))
+		width = (tv->origin.x + tv->size.x);
+
+	if (tv->size.y != 0 && height > (tv->size.y + tv->origin.y))
+		height = (tv->size.y + tv->origin.y);
+
+	if (width != tv->extent.x || height != tv->extent.y) {
+		extent.x0 = 0;
+		extent.y0 = height;
+		extent.x1 = width;
+		extent.y1 = 0;
+
+		error = xwimp_set_extent(tv->w, &extent);
+		if (error) {
+			LOG(("xwimp_set_extent: 0x%x: %s",
+					error->errnum, error->errmess));
+			warn_user("WimpError", error->errmess);
+			return;
+		}
+
+		tv->extent.x = width;
+		tv->extent.y = height;
+	}
+
+
+	error = xwimp_open_window(open);
+	if (error) {
+		LOG(("xwimp_open_window: 0x%x: %s",
+				error->errnum, error->errmess));
+		warn_user("WimpError", error->errmess);
+	}
+
+	if (tv->tb)
+		ro_gui_theme_process_toolbar(tv->tb, -1);
+}
+
+/**
+ * \todo -- This is the hide scrollbar code from the old treeview module.
+ * It might become necessary once we need to support the SSLCert window?
+ *
+		if ((tree->no_vscroll) && (height != tree->window_height)) {
+		  	vscroll = (tree->height > height);
+			if (ro_gui_wimp_check_window_furniture(open->w,
+					wimp_WINDOW_VSCROLL) != vscroll) {
+				ro_gui_wimp_update_window_furniture(open->w,
+					0, wimp_WINDOW_VSCROLL);
+				if (vscroll)
+					open->visible.x1 -= ro_get_vscroll_width(open->w);
+				else
+					open->visible.x1 += ro_get_vscroll_width(open->w);
+			}
+		}
+*/
+
+/**
+ * Pass RISC OS Mouse Click events on to the treeview widget.
+ *
+ * \param  *pointer		Pointer to the Mouse Click Event block.
+ * \return			Return true if click handled; else false.
+ */
+
+static bool ro_treeview_mouse_click(wimp_pointer *pointer)
+{
+	os_error		*error;
+	ro_treeview		*tv;
+	wimp_window_state	state;
+	int			xpos, ypos;
+	browser_mouse_state	mouse = 0;
+	static bool		mouse_drag = false;
+
+	tv = (ro_treeview *) ro_gui_wimp_event_get_user_data(pointer->w);
+	if (tv == NULL) {
+		LOG(("NULL treeview block for window: 0x%x",
+				(unsigned int) pointer->w));
+		return false;
+	}
+
+	state.w = tv->w;
+	error = xwimp_get_window_state(&state);
+	if (error) {
+		LOG(("xwimp_get_window_state: 0x%x: %s",
+				error->errnum, error->errmess));
+		warn_user("WimpError", error->errmess);
+		return false;
+	}
+
+	/* Convert the returned mouse coordinates into NetSurf's internal
+	 * units.
+	 */
+
+	xpos = ((pointer->pos.x - state.visible.x0)
+			 + state.xscroll - tv->origin.x) / 2;
+	ypos = ((state.visible.y1 - pointer->pos.y)
+			- state.yscroll + tv->origin.y) / 2;
+
+	/* Convert the mouse click into NetSurf's internal representation.
+	 *
+	 * The TreeView widget needs:
+	 *  - BROWSER_MOUSE_CLICK_1
+	 *  - BROWSER_MOUSE_CLICK_2
+	 *  - BROWSER_MOUSE_DOUBLE_CLICK
+	 *  - BROWSER_MOUSE_DRAG_1
+	 *  - BROWSER_MOUSE_DRAG_2
+	 *  - BROWSER_MOUSE_HOLDING_1
+	 *  - BROWSER_MOUSE_HOLDING_2
+	 */
+
+	if (pointer->buttons & (wimp_CLICK_MENU)) {
+		/* \todo -- Process menu clicks here. */
+	} else {
+		/* \todo -- Does this get stuck in drags? */
+		if (mouse_drag) {
+		if (pointer->buttons & (wimp_SINGLE_SELECT))
+				mouse |= BROWSER_MOUSE_HOLDING_1;
+			if (pointer->buttons & (wimp_SINGLE_ADJUST))
+				mouse |= BROWSER_MOUSE_HOLDING_2;
+
+			if (!(pointer->buttons & (wimp_SINGLE_SELECT) ||
+					pointer->buttons & (wimp_SINGLE_ADJUST)))
+				mouse_drag = false;
+			if (mouse_drag)
+				mouse |= BROWSER_MOUSE_DRAG_ON;
+		} else {
+			if (pointer->buttons & (wimp_SINGLE_SELECT))
+				mouse |= BROWSER_MOUSE_CLICK_1;
+			if (pointer->buttons & (wimp_SINGLE_ADJUST))
+				mouse |= BROWSER_MOUSE_CLICK_2;
+			if (pointer->buttons & (wimp_DOUBLE_SELECT))
+				mouse |= BROWSER_MOUSE_DOUBLE_CLICK;
+
+			if (pointer->buttons & (wimp_DRAG_SELECT)) {
+				mouse |= BROWSER_MOUSE_DRAG_1;
+				mouse_drag = true;
+			}
+			if (pointer->buttons & (wimp_DRAG_ADJUST)) {
+				mouse |= BROWSER_MOUSE_DRAG_2;
+				mouse_drag = true;
+			}
+		}
+	}
+
+	if (ro_gui_shift_pressed()) mouse |= BROWSER_MOUSE_MOD_1;
+	if (ro_gui_ctrl_pressed())  mouse |= BROWSER_MOUSE_MOD_2;
+
+	tree_mouse_action(tv->tree, mouse, xpos, ypos);
+	return true;
+}
+
+/**
+ * Pass RISC OS keypress events on to the treeview widget.
+ *
+ * \param  *key			Pointer to the Key Pressed Event block.
+ * \return			Return true if keypress handled; else false.
+ */
+
+static bool ro_treeview_keypress(wimp_key *key)
+{
+	ro_treeview		*tv;
+	uint32_t		ns_key;
+
+	tv = (ro_treeview *) ro_gui_wimp_event_get_user_data(key->w);
+	if (tv == NULL) {
+		LOG(("NULL treeview block for window: 0x%x",
+				(unsigned int) key->w));
+		return false;
+	}
+
+	/* Convert special keys: anything not listed is passed through
+	 * as it is.
+	 *
+	 * \todo -- This makes no effort to handle PC Delete!
+	 * \todo -- This does not handle top-bit characters at all!
+	 * \todo -- It's also very broken in many other ways...
+	 */
+
+	switch (key->c) {
+	case (wimp_KEY_BACKSPACE):
+	case (wimp_KEY_DELETE):
+		ns_key = KEY_DELETE_LEFT;
+		break;
+	case (wimp_KEY_COPY):
+		ns_key = KEY_DELETE_RIGHT;
+		break;
+	case (wimp_KEY_TAB):
+		ns_key = KEY_TAB;
+		break;
+	case (wimp_KEY_RETURN):
+		ns_key = KEY_NL;
+		break;
+	case (wimp_KEY_SHIFT + wimp_KEY_TAB):
+		ns_key = KEY_SHIFT_TAB;
+		break;
+	case (wimp_KEY_LEFT):
+		ns_key = KEY_LEFT;
+		break;
+	case (wimp_KEY_RIGHT):
+		ns_key = KEY_RIGHT;
+		break;
+	case (wimp_KEY_UP):
+		ns_key = KEY_UP;
+		break;
+	case (wimp_KEY_DOWN):
+		ns_key = KEY_DOWN;
+		break;
+	case (wimp_KEY_CONTROL + wimp_KEY_LEFT):
+		ns_key = KEY_LINE_START;
+		break;
+	case (wimp_KEY_CONTROL + wimp_KEY_RIGHT):
+		ns_key = KEY_LINE_END;
+		break;
+	case (wimp_KEY_CONTROL + wimp_KEY_UP):
+	case (wimp_KEY_HOME):
+		ns_key = KEY_TEXT_START;
+		break;
+	case (wimp_KEY_CONTROL + wimp_KEY_DOWN):
+		ns_key = KEY_TEXT_END;
+		break;
+	case (wimp_KEY_SHIFT + wimp_KEY_LEFT):
+		ns_key = KEY_WORD_LEFT;
+		break;
+	case (wimp_KEY_SHIFT + wimp_KEY_RIGHT):
+		ns_key = KEY_WORD_RIGHT;
+		break;
+	case (wimp_KEY_SHIFT + wimp_KEY_UP):
+		ns_key = KEY_PAGE_UP;
+		break;
+	case (wimp_KEY_SHIFT + wimp_KEY_DOWN):
+		ns_key = KEY_PAGE_DOWN;
+		break;
+	default:
+		ns_key = key->c;
+		break;
+	}
+
+	tree_keypress(tv->tree, ns_key);
+	return true;
+}
+
+/**
+ * Update a treeview to use a new theme.
+ *
+ * \param  *tv			Pointer to the treeview to update.
+ */
+
+void ro_treeview_update_theme(ro_treeview *tv)
+{
+	if (tv != NULL && tv->tb != NULL){
+		/* \todo -- Check for toolbar editing here. */
+
+		if (!ro_gui_theme_update_toolbar(NULL, tv->tb)) {
+			ro_gui_theme_destroy_toolbar(tv->tb);
+			tv->tb = NULL;
+		}
+
+		/* \todo -- Check for toolbar editing here. */
+
+		ro_gui_theme_attach_toolbar(tv->tb, tv->w);
+		ro_treeview_set_origin(tv, 0,
+				-(ro_gui_theme_toolbar_height(tv->tb)));
+
+		xwimp_force_redraw(tv->w, 0, tv->extent.y, tv->extent.x, 0);
+	}
+}
+
+
+
+#if 0
+	if ((tree) && (tree->toolbar)) {
+		if (tree->toolbar->editor)
+			if (!ro_gui_theme_update_toolbar(NULL, tree->toolbar->editor))
+				tree->toolbar->editor = NULL;
+		if (!ro_gui_theme_update_toolbar(NULL, tree->toolbar)) {
+			ro_gui_theme_destroy_toolbar(tree->toolbar);
+			tree->toolbar = NULL;
+		}
+		ro_gui_theme_toolbar_editor_sync(tree->toolbar);
+		ro_gui_theme_attach_toolbar(tree->toolbar, (wimp_w)tree->handle);
+		tree_resized(tree);
+		xwimp_force_redraw((wimp_w)tree->handle, 0, -16384, 16384, 16384);
+	}
+#endif
+
+
+/**
+ * The code beyond here is from the old treeview system.  It is being retained
+ * to provide an easy reference for the new code.
+ *
+ * \todo -- Delete the following block as soon as implementation is complete!
+ */
+
+#if 0
 /* an array of sprite addresses for Tinct */
 static char *ro_gui_tree_sprites[2];
 
@@ -93,35 +926,6 @@
 	struct tree *tree;
 	struct node *node;
 };
-
-
-/**
- * Informs the current window manager that an area requires updating.
- *
- * \param tree	  the tree that is requesting a redraw
- * \param x	  the x co-ordinate of the redraw area
- * \param y	  the y co-ordinate of the redraw area
- * \param width	  the width of the redraw area
- * \param height  the height of the redraw area
- */
-void tree_redraw_area(struct tree *tree, int x, int y, int width, int height)
-{
-	os_error *error;
-
-	assert(tree);
-	assert(tree->handle);
-
-	if (tree->toolbar)
-		y += ro_gui_theme_toolbar_height(tree->toolbar);
-	error = xwimp_force_redraw((wimp_w)tree->handle, tree->offset_x + x - 2,
-			-tree->offset_y - y - height, tree->offset_x + x + width + 4,
-			-tree->offset_y - y);
-	if (error) {
-		LOG(("xwimp_force_redraw: 0x%x: %s",
-				error->errnum, error->errmess));
-		warn_user("WimpError", error->errmess);
-	}
-}
 
 
 /**
@@ -151,64 +955,8 @@
 }
 
 
-/**
- * Updates the tree owner following a tree resize
- *
- * \param tree  the tree to update the owner of
- */
-void tree_resized(struct tree *tree)
-{
-	os_error *error;
-	wimp_window_state state;
-
-	assert(tree->handle);
-
-
-	state.w = (wimp_w)tree->handle;
-	error = xwimp_get_window_state(&state);
-	if (error) {
-		LOG(("xwimp_get_window_state: 0x%x: %s",
-				error->errnum, error->errmess));
-		warn_user("WimpError", error->errmess);
-		return;
-	}
-	if (state.flags & wimp_WINDOW_OPEN)
-		ro_gui_tree_open(PTR_WIMP_OPEN(&state));
-}
-
-
-/**
- * Redraws a tree window
- *
- * \param redraw  the area to redraw
- * \param tree	  the tree to redraw
- */
-void ro_gui_tree_redraw(wimp_draw *redraw)
-{
-	struct tree *tree;
-	osbool more;
-	int clip_x0, clip_x1, clip_y0, clip_y1, origin_x, origin_y;
-
-	tree = (struct tree *)ro_gui_wimp_event_get_user_data(redraw->w);
-
-	assert(tree);
-
-	more = wimp_redraw_window(redraw);
-	while (more) {
-		clip_x0 = redraw->clip.x0;
-		clip_y0 = redraw->clip.y0;
-		clip_x1 = redraw->clip.x1;
-		clip_y1 = redraw->clip.y1;
-		origin_x = redraw->box.x0 - redraw->xscroll;
-		origin_y = redraw->box.y1 - redraw->yscroll;
-		if (tree->toolbar)
-			origin_y -= ro_gui_theme_toolbar_height(tree->toolbar);
-		tree_draw(tree, clip_x0 - origin_x - tree->offset_x,
-				origin_y - clip_y1 - tree->offset_y,
-				clip_x1 - clip_x0, clip_y1 - clip_y0);
-		more = wimp_get_rectangle(redraw);
-	}
-}
+
+
 
 
 /**
@@ -562,48 +1310,6 @@
 }
 
 
-/**
- * Scrolls the tree to make an element visible
- *
- * \param tree	   the tree to scroll
- * \param element  the element to display
- */
-void ro_gui_tree_scroll_visible(struct tree *tree, struct node_element *element)
-{
-	wimp_window_state state;
-	int x0, x1, y0, y1;
-	os_error *error;
-	int toolbar_height = 0;
-
-	assert(element);
-
-	if (tree->toolbar)
-		toolbar_height = ro_gui_theme_toolbar_height(tree->toolbar);
-
-	state.w = (wimp_w)tree->handle;
-	error = xwimp_get_window_state(&state);
-	if (error)
-		LOG(("xwimp_get_window_state: 0x%x: %s",
-				error->errnum, error->errmess));
-	if (!(state.flags & wimp_WINDOW_OPEN))
-		return;
-	x0 = state.xscroll;
-	y0 = -state.yscroll;
-	x1 = x0 + state.visible.x1 - state.visible.x0 - tree->offset_x;
-	y1 = y0 - state.visible.y0 + state.visible.y1 - tree->offset_y - toolbar_height;
-
-	state.yscroll = state.visible.y1 - state.visible.y0 - tree->offset_y -
-			toolbar_height - y1;
-	if ((element->box.y >= y0) && (element->box.y + element->box.height <= y1))
-		return;
-	if (element->box.y < y0)
-		state.yscroll = -element->box.y;
-	if (element->box.y + element->box.height > y1)
-		state.yscroll = state.visible.y1 - state.visible.y0 -
-				tree->offset_y - toolbar_height -
-				(element->box.y + element->box.height);
-	ro_gui_tree_open(PTR_WIMP_OPEN(&state));
-}
 
 
 /**
@@ -632,72 +1338,6 @@
 }
 
 
-/**
- * Handles a window open request
- *
- * \param open  the window state
- */
-void ro_gui_tree_open(wimp_open *open)
-{
-	struct tree *tree;
-	os_error *error;
-	int width;
-	int height;
-	int toolbar_height = 0;
-	bool vscroll;
-
-	tree = (struct tree *)ro_gui_wimp_event_get_user_data(open->w);
-
-	if (!tree)
-		return;
-	if (tree->toolbar)
-		toolbar_height = ro_gui_theme_toolbar_height(tree->toolbar);
-
-	width = open->visible.x1 - open->visible.x0;
-	if (width < (tree->offset_x + tree->width))
-		width = tree->offset_x + tree->width;
-	height = open->visible.y1 - open->visible.y0;
-	if (height < (tree->offset_y + toolbar_height + tree->height))
-		height = tree->offset_y + toolbar_height + tree->height;
-
-	if ((height != tree->window_height) || (width != tree->window_width)) {
-		os_box extent = { 0, -height, width, 0};
-		error = xwimp_set_extent((wimp_w)tree->handle, &extent);
-		if (error) {
-			LOG(("xwimp_set_extent: 0x%x: %s",
-					error->errnum, error->errmess));
-			warn_user("WimpError", error->errmess);
-		}
-
-		/* hide the scroll bar? */
-		if ((tree->no_vscroll) && (height != tree->window_height)) {
-		  	vscroll = (tree->height > height);
-			if (ro_gui_wimp_check_window_furniture(open->w,
-					wimp_WINDOW_VSCROLL) != vscroll) {
-				ro_gui_wimp_update_window_furniture(open->w,
-					0, wimp_WINDOW_VSCROLL);
-				if (vscroll)
-					open->visible.x1 -= ro_get_vscroll_width(open->w);
-				else
-					open->visible.x1 += ro_get_vscroll_width(open->w);
-			}
-		}
-
-		tree->window_width = width;
-		tree->window_height = height;
-	}
-
-	error = xwimp_open_window(open);
-	if (error) {
-		LOG(("xwimp_open_window: 0x%x: %s",
-				error->errnum, error->errmess));
-		warn_user("WimpError", error->errmess);
-	}
-	if (tree->toolbar)
-		ro_gui_theme_process_toolbar(tree->toolbar, -1);
-	ro_gui_menu_prepare_action((wimp_w)tree->handle, TREE_SELECTION, false);
-	ro_gui_menu_prepare_action((wimp_w)tree->handle, TREE_EXPAND_ALL, false);
-}
 
 
 /**
@@ -1034,26 +1674,11 @@
 }
 
 
-void ro_gui_tree_update_theme(struct tree *tree)
-{
-	if ((tree) && (tree->toolbar)) {
-		if (tree->toolbar->editor)
-			if (!ro_gui_theme_update_toolbar(NULL, tree->toolbar->editor))
-				tree->toolbar->editor = NULL;
-		if (!ro_gui_theme_update_toolbar(NULL, tree->toolbar)) {
-			ro_gui_theme_destroy_toolbar(tree->toolbar);
-			tree->toolbar = NULL;
-		}
-		ro_gui_theme_toolbar_editor_sync(tree->toolbar);
-		ro_gui_theme_attach_toolbar(tree->toolbar, (wimp_w)tree->handle);
-		tree_resized(tree);
-		xwimp_force_redraw((wimp_w)tree->handle, 0, -16384, 16384, 16384);
-	}
-}
-
+#endif
 void tree_icon_name_from_content_type(char *buffer, content_type type)
 {
-	sprintf(buffer, "small_%.3x", ro_content_filetype_from_type(data->type));
-	if (!ro_gui_wimp_sprite_exists(buffer))
+/*	sprintf(buffer, "small_%.3x", ro_content_filetype_from_type(data->type));
+	if (!ro_gui_wimp_sprite_exists(buffer))*/
 		sprintf(buffer, "%s", "small_xxx");
 }
+

Modified: branches/paulblokus/treeview/riscos/treeview.h
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/treeview.h?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/treeview.h (original)
+++ branches/paulblokus/treeview/riscos/treeview.h Sun Feb 14 08:44:32 2010
@@ -1,5 +1,6 @@
 /*
  * Copyright 2004 Richard Wilson <not_ginger_matt at users.sourceforge.net>
+ * Copyright 2010 Stephen Fryatt <stevef at netsurf-browser.org>
  *
  * This file is part of NetSurf, http://www.netsurf-browser.org/
  *
@@ -24,44 +25,22 @@
 #define _NETSURF_RISCOS_TREEVIEW_H_
 
 #include <stdbool.h>
-#include "oslib/osspriteop.h"
-#include "oslib/wimp.h"
+#include <oslib/wimp.h>
+
 #include "desktop/tree.h"
-#include "image/bitmap.h"
 
-#define TREE_TEXT_HEIGHT 40
-#define TREE_SPRITE_WIDTH 40	/* text plus sprite entries only */
+typedef struct ro_treeview ro_treeview;
 
-struct node_sprite {
-	osspriteop_area *area;
-	char name[12];
-	char expanded_name[12];
-};
+ro_treeview *ro_treeview_create(wimp_w window, struct toolbar *toolbar,
+		unsigned int flags);
+void ro_treeview_destroy(ro_treeview *tv);
 
-struct treeview_window {
-	wimp_w window;
-	struct toolbar *toolbar;
-	struct tree *tree;
-};
+struct tree *ro_treeview_get_tree(ro_treeview *tv);
+wimp_w ro_treeview_get_window(ro_treeview *tv);
 
-bool ro_gui_tree_initialise(void);
-void ro_gui_tree_redraw(wimp_draw *redraw);
-bool ro_gui_tree_click(wimp_pointer *pointer, struct tree *tree);
-void ro_gui_tree_menu_closed(struct tree *tree);
-bool ro_gui_tree_toolbar_click(wimp_pointer* pointer);
-void ro_gui_tree_stop_edit(struct tree *tree);
-void ro_gui_tree_open(wimp_open *open);
-void ro_gui_tree_show(struct tree *tree);
-bool ro_gui_tree_keypress(wimp_key *key);
-void ro_gui_tree_selection_drag_end(wimp_dragged *drag);
-void ro_gui_tree_move_drag_end(wimp_dragged *drag);
-void ro_gui_tree_launch_selected(struct tree *tree);
-void ro_gui_tree_start_edit(struct tree *tree, struct node_element *element,
-		wimp_pointer *pointer);
-void ro_gui_tree_scroll_visible(struct tree *tree, struct node_element *element);
-void ro_gui_tree_get_tree_coordinates(struct tree *tree, int x, int y,
-		int *tree_x, int *tree_y);
-int ro_gui_tree_help(int x, int y);
-void ro_gui_tree_update_theme(struct tree *tree);
+void ro_treeview_set_origin(ro_treeview *tv, int x, int y);
+
+void ro_treeview_update_theme(ro_treeview *tv);
 
 #endif
+

Modified: branches/paulblokus/treeview/riscos/url_complete.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/url_complete.c?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/url_complete.c (original)
+++ branches/paulblokus/treeview/riscos/url_complete.c Sun Feb 14 08:44:32 2010
@@ -726,8 +726,8 @@
 				ICON_TOOLBAR_URL,
 				url_complete_matches[
 					url_complete_matches_selection], true);
-		global_history_add_recent(url_complete_matches[
-					url_complete_matches_selection]);
+		/* \TODO - \SF global_history_add_recent(url_complete_matches[
+					url_complete_matches_selection]); */
 
 		/** \todo The interaction of components here is hideous */
 		/* Do NOT make any attempt to use any of the global url

Modified: branches/paulblokus/treeview/riscos/window.c
URL: http://source.netsurf-browser.org/branches/paulblokus/treeview/riscos/window.c?rev=10056&r1=10055&r2=10056&view=diff
==============================================================================
--- branches/paulblokus/treeview/riscos/window.c (original)
+++ branches/paulblokus/treeview/riscos/window.c Sun Feb 14 08:44:32 2010
@@ -1698,7 +1698,7 @@
 	if (res == URL_FUNC_OK) {
 		gui_window_set_url(g, url_norm);
 		browser_window_go(g->bw, url_norm, 0, true);
-		global_history_add_recent(url_norm);
+		/* \TODO - \SF global_history_add_recent(url_norm);*/
 		free(url_norm);
 	}
 }




More information about the netsurf-commits mailing list