On Tue, 7 Jul 2009 01:36:26 +0200, Pawe³ Blokus wrote: > > I still can't get it to render direct to the window, as it isn't > > clipping new strings to the correct dimensions. I'm not sure if this > > is a bug in your code or my plotters though. > > Do you mean adding new elements with the redraw flag set already to > 'true' ? Also, does it happen only when the tree is scrolled or on a > x=0 y=0 tree too? Finally - in case of a tree element edit, the > textarea doesn't get scrolled as the code for that is waiting to be > merged from my other branch :)
Further to my previous email, it appears that nodes which move up or down underneath a node which is expanded or shrunk, are the ones which write outside the area they should. Nodes which are added cause problems in the cookie browser. Go to Google and open the cookie browser, and expand google.co.uk (+ cookies). Click reload in the webbrowser and the cookies under google.co.uk shrink and a new one is added, but everything gets overprinted. I've attached the amiga/cookies diffs. Regards Chris
Index: cookies.c =================================================================== --- cookies.c (revision 8375) +++ cookies.c (working copy) @@ -1,6 +1,5 @@ /* - * Copyright 2006 Richard Wilson <[email protected]> - * Copyright 2008 Chris Young <[email protected]> + * Copyright 2008, 2009 Chris Young <[email protected]> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -17,16 +16,24 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include <stdbool.h> +#include <proto/exec.h> +#include "amiga/cookies.h" +#include "desktop/cookies.h" void ami_cookies_initialise(void) { -} + cookies_window = AllocVec(sizeof(struct treeview_window), + MEMF_PRIVATE | MEMF_CLEAR); -bool cookies_update(const char *domain, const struct cookie_data *data) -{ + cookies_initialise(cookies_window, + ami_tree_redraw_start, + ami_tree_redraw_end); + + cookies_window->tree = cookies_tree; } void ami_cookies_free() { + FreeVec(cookies_window); + cookies_window = NULL; } Index: tree.c =================================================================== --- tree.c (revision 8375) +++ tree.c (working copy) @@ -182,8 +182,13 @@ } } -void ami_open_tree(struct treeview_window *twin,int type) +void ami_open_tree(struct tree *tree, int type) { +/* dummy function to be removed once everything migrated */ +} + +void ami_tree_open(struct treeview_window *twin,int type) +{ BOOL msel = TRUE,nothl = TRUE,launchdisable=FALSE; static WORD gen=0; char *wintitle; Index: cookies.h =================================================================== --- cookies.h (revision 8375) +++ cookies.h (working copy) @@ -1,5 +1,5 @@ /* - * Copyright 2008 Chris Young <[email protected]> + * Copyright 2008, 2009 Chris Young <[email protected]> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -19,9 +19,10 @@ #ifndef AMIGA_COOKIES_H #define AMIGA_COOKIES_H #include "desktop/tree.h" +#include "amiga/tree.h" void ami_cookies_initialise(void); void ami_cookies_free(void); -struct tree *cookies_tree; +struct treeview_window *cookies_window; #endif Index: tree.h =================================================================== --- tree.h (revision 8375) +++ tree.h (working copy) @@ -49,7 +49,7 @@ AMI_TREE_SSLCERT }; -void ami_open_tree(struct treeview_window *twin,int type); +void ami_tree_open(struct treeview_window *twin,int type); void ami_tree_close(struct treeview_window *twin); BOOL ami_tree_event(struct treeview_window *twin); Index: menu.c =================================================================== --- menu.c (revision 8375) +++ menu.c (working copy) @@ -659,11 +659,11 @@ break; case 3: // global history - ami_open_tree(global_history_window,AMI_TREE_HISTORY); + ami_tree_open(global_history_window,AMI_TREE_HISTORY); break; case 5: // cookies tree - ami_open_tree(cookies_tree,AMI_TREE_COOKIES); + ami_tree_open(cookies_window,AMI_TREE_COOKIES); break; case 7: // redraw Index: gui.c =================================================================== --- gui.c (revision 8375) +++ gui.c (working copy) @@ -424,8 +424,8 @@ } if(!hotlist) ami_hotlist_init(&hotlist); +#endif ami_cookies_initialise(); -#endif ami_global_history_initialise(); save_complete_init(); @@ -1576,9 +1576,9 @@ #if 0 urldb_save_cookies(option_cookie_file); options_save_tree(hotlist,option_hotlist_file,messages_get("TreeHotlist")); - ami_cookies_free(); history_global_save_recent(); #endif + ami_cookies_free(); ami_global_history_free(); hubbub_finalise(myrealloc,NULL);
