Author: chris_y
Date: Sat Aug 29 05:10:46 2009
New Revision: 9492
URL:
http://source.netsurf-browser.org?rev=9492&view=rev
Log:
Fix for latest changes
Modified:
branches/paulblokus/treeview/amiga/cookies.c
branches/paulblokus/treeview/amiga/history.c
branches/paulblokus/treeview/amiga/hotlist.c
branches/paulblokus/treeview/amiga/menu.c
branches/paulblokus/treeview/amiga/sslcert.c
branches/paulblokus/treeview/amiga/sslcert.h (contents, props changed)
branches/paulblokus/treeview/amiga/tree.c
branches/paulblokus/treeview/amiga/tree.h
Modified: branches/paulblokus/treeview/amiga/cookies.c
URL:
http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/cook...
==============================================================================
--- branches/paulblokus/treeview/amiga/cookies.c (original)
+++ branches/paulblokus/treeview/amiga/cookies.c Sat Aug 29 05:10:46 2009
@@ -23,16 +23,16 @@
void ami_cookies_initialise(void)
{
- cookies_window = AllocVec(sizeof(struct treeview_window),
- MEMF_PRIVATE | MEMF_CLEAR);
+ cookies_window = ami_tree_create(cookies_get_tree_flags(), NULL);
- cookies_window->tree = cookies_initialise(cookies_window,
- &ami_tree_callbacks);
+ if(!cookies_window) return;
+
+ cookies_initialise(ami_tree_get_tree(cookies_window));
}
void ami_cookies_free()
{
cookies_cleanup();
- FreeVec(cookies_window);
+ ami_tree_destroy(cookies_window);
cookies_window = NULL;
}
Modified: branches/paulblokus/treeview/amiga/history.c
URL:
http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/hist...
==============================================================================
--- branches/paulblokus/treeview/amiga/history.c (original)
+++ branches/paulblokus/treeview/amiga/history.c Sat Aug 29 05:10:46 2009
@@ -24,17 +24,16 @@
void ami_global_history_initialise(void)
{
- global_history_window = AllocVec(sizeof(struct treeview_window),
- MEMF_PRIVATE | MEMF_CLEAR);
+ global_history_window = ami_tree_create(history_global_get_tree_flags(), NULL);
- global_history_window->tree = history_global_initialise(
- global_history_window,
- &ami_tree_callbacks);
+ if(!global_history_window) return;
+
+ history_global_initialise(ami_tree_get_tree(global_history_window));
}
void ami_global_history_free()
{
history_global_cleanup();
- FreeVec(global_history_window);
+ ami_tree_destroy(global_history_window);
global_history_window = NULL;
}
Modified: branches/paulblokus/treeview/amiga/hotlist.c
URL:
http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/hotl...
==============================================================================
--- branches/paulblokus/treeview/amiga/hotlist.c (original)
+++ branches/paulblokus/treeview/amiga/hotlist.c Sat Aug 29 05:10:46 2009
@@ -24,17 +24,17 @@
void ami_hotlist_initialise(void)
{
- hotlist_window = AllocVec(sizeof(struct treeview_window),
- MEMF_PRIVATE | MEMF_CLEAR);
+ hotlist_window = ami_tree_create(hotlist_get_tree_flags(), NULL);
- hotlist_window->tree = hotlist_initialise(hotlist_window,
- &ami_tree_callbacks,
+ if(!hotlist_window) return;
+
+ hotlist_initialise(ami_tree_get_tree(hotlist_window),
option_hotlist_file);
}
void ami_hotlist_free()
{
hotlist_cleanup(option_hotlist_file);
- FreeVec(hotlist_window);
+ ami_tree_destroy(hotlist_window);
hotlist_window = NULL;
}
Modified: branches/paulblokus/treeview/amiga/menu.c
URL:
http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/menu...
==============================================================================
--- branches/paulblokus/treeview/amiga/menu.c (original)
+++ branches/paulblokus/treeview/amiga/menu.c Sat Aug 29 05:10:46 2009
@@ -250,7 +250,7 @@
gwin->menu[7].nm_Flags = NM_ITEMDISABLED;
#endif
- ami_menu_scan(hotlist_window->tree, false, gwin);
+ ami_menu_scan(ami_tree_get_tree(hotlist_window), false, gwin);
ami_menu_arexx_scan(gwin);
if(!menualreadyinit)
Modified: branches/paulblokus/treeview/amiga/sslcert.c
URL:
http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/sslc...
==============================================================================
--- branches/paulblokus/treeview/amiga/sslcert.c (original)
+++ branches/paulblokus/treeview/amiga/sslcert.c Sat Aug 29 05:10:46 2009
@@ -18,29 +18,25 @@
#include <proto/exec.h>
#include "amiga/tree.h"
-#include "desktop/sslcert.h"
+#include "amiga/sslcert.h"
void gui_cert_verify(struct browser_window *bw, struct content *c,
const struct ssl_cert_info *certs, unsigned long num)
{
struct sslcert_session_data *data;
-
- struct treeview_window *ssl_window =
- AllocVec(sizeof(struct treeview_window), MEMF_PRIVATE | MEMF_CLEAR);
+ struct treeview_window *ssl_window;
data = sslcert_create_session_data(num, bw, c->url);
- ssl_window->tree = sslcert_create_tree(ssl_window,
- &ami_tree_callbacks,
- certs,
- data);
+ ssl_window = ami_tree_create(sslcert_get_tree_flags(), data);
+ if(!ssl_window) return;
- ssl_window->ssl_data = data;
-// ssl_window->tree = data->tree;
+ sslcert_load_tree(ami_tree_get_tree(ssl_window), certs, data);
+
ami_tree_open(ssl_window, AMI_TREE_SSLCERT);
}
void ami_ssl_free(struct treeview_window *twin)
{
- FreeVec(twin);
+ ami_tree_destroy(twin);
}
Modified: branches/paulblokus/treeview/amiga/sslcert.h
URL:
http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/sslc...
==============================================================================
--- branches/paulblokus/treeview/amiga/sslcert.h (original)
+++ branches/paulblokus/treeview/amiga/sslcert.h Sat Aug 29 05:10:46 2009
@@ -18,49 +18,7 @@
#ifndef AMIGA_SSLCERT_H
#define AMIGA_SSLCERT_H
+#include "desktop/sslcert.h"
+
void ami_ssl_free(struct treeview_window *twin);
#endif
-/*
- * Copyright 2009 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
- *
- * 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 AMIGA_SSLCERT_H
-#define AMIGA_SSLCERT_H
-void ami_ssl_free(struct treeview_window *twin);
-#endif
-/*
- * Copyright 2009 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
- *
- * 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 AMIGA_SSLCERT_H
-#define AMIGA_SSLCERT_H
-void ami_ssl_free(struct treeview_window *twin);
-#endif
Propchange: branches/paulblokus/treeview/amiga/sslcert.h
------------------------------------------------------------------------------
amiga:protection = ----rw-d ---- ----
Modified: branches/paulblokus/treeview/amiga/tree.c
URL:
http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/tree...
==============================================================================
--- branches/paulblokus/treeview/amiga/tree.c (original)
+++ branches/paulblokus/treeview/amiga/tree.c Sat Aug 29 05:10:46 2009
@@ -50,9 +50,33 @@
#include "desktop/history_global_core.h"
#include "desktop/hotlist.h"
#include "amiga/sslcert.h"
+#include "utils/utils.h"
+
+#define AMI_TREE_MENU_ITEMS 19
+
+struct treeview_window {
+ struct Window *win;
+ Object *objects[OID_LAST];
+ struct Gadget *gadgets[GID_LAST];
+ struct nsObject *node;
+ ULONG pad[5];
+ int type;
+ struct NewMenu *menu;
+ char *menu_name[AMI_TREE_MENU_ITEMS];
+ struct tree *tree;
+ struct Hook scrollerhook;
+ uint32 key_state;
+ uint32 mouse_state;
+ int drag_x;
+ int drag_y;
+ struct timeval lastclick;
+ int max_width;
+ int max_height;
+ struct gui_globals globals;
+ struct sslcert_session_data *ssl_data;
+};
void ami_tree_draw(struct treeview_window *twin);
-
static void ami_tree_redraw_request(int x, int y, int width, int height,
void *data);
static void ami_tree_resized(struct tree *tree, int width,
@@ -66,6 +90,37 @@
.scroll_visible = ami_tree_scroll_visible,
.get_window_dimensions = ami_tree_get_window_dimensions
};
+
+struct treeview_window *ami_tree_create(uint8 flags,
+ struct sslcert_session_data *ssl_data)
+{
+ struct treeview_window *twin;
+
+ twin = AllocVec(sizeof(struct treeview_window),
+ MEMF_PRIVATE | MEMF_CLEAR);
+
+ if(!twin)
+ {
+ warn_user("NoMemory", 0);
+ return NULL;
+ }
+
+ twin->ssl_data = ssl_data;
+
+ twin->tree = tree_create(flags, &ami_tree_callbacks, twin);
+ return twin;
+}
+
+void ami_tree_destroy(struct treeview_window *twin)
+{
+ tree_delete(twin->tree);
+ FreeVec(twin);
+}
+
+struct tree *ami_tree_get_tree(struct treeview_window *twin)
+{
+ return twin->tree;
+}
void ami_tree_resized(struct tree *tree, int width, int height, void *data)
{
Modified: branches/paulblokus/treeview/amiga/tree.h
URL:
http://source.netsurf-browser.org/branches/paulblokus/treeview/amiga/tree...
==============================================================================
--- branches/paulblokus/treeview/amiga/tree.h (original)
+++ branches/paulblokus/treeview/amiga/tree.h Sat Aug 29 05:10:46 2009
@@ -25,29 +25,7 @@
#include "desktop/tree.h"
#include "desktop/sslcert.h"
-#define AMI_TREE_MENU_ITEMS 19
-
-struct treeview_window {
- struct Window *win;
- Object *objects[OID_LAST];
- struct Gadget *gadgets[GID_LAST];
- struct nsObject *node;
- ULONG pad[5];
- int type;
- struct NewMenu *menu;
- char *menu_name[AMI_TREE_MENU_ITEMS];
- struct tree *tree;
- struct Hook scrollerhook;
- uint32 key_state;
- uint32 mouse_state;
- int drag_x;
- int drag_y;
- struct timeval lastclick;
- int max_width;
- int max_height;
- struct gui_globals globals;
- struct sslcert_session_data *ssl_data;
-};
+struct treeview_window;
enum
{
@@ -57,6 +35,11 @@
AMI_TREE_SSLCERT
};
+struct treeview_window *ami_tree_create(uint8 flags,
+ struct sslcert_session_data *ssl_data);
+void ami_tree_destroy(struct treeview_window *twin);
+struct tree *ami_tree_get_tree(struct treeview_window *twin);
+
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);