diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2016-08-10 18:36:41 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2016-08-10 18:57:36 +0100 |
commit | 9aecf47408f22f4f0a01e41648f25e1a7307b332 (patch) | |
tree | 4a351d67f53edb81096bd8720b79b07179919532 /frontends | |
parent | b63443b243bec435c1650aef2068299674b2a209 (diff) | |
download | netsurf-9aecf47408f22f4f0a01e41648f25e1a7307b332.tar.gz netsurf-9aecf47408f22f4f0a01e41648f25e1a7307b332.tar.bz2 |
Treeview: Rationalise initialisation and finalisation.
Previously the expected behaviour for front ends using the correct
API for hotlist, global history, cookie manager, and ssl cert
viewer was that the front end would initialise the treeview module
on startup and finalise it on application exit.
However, this meant that the front ends had to include the core
treeview header, which they didn't otherwise need.
Since the tree module provided access to the new treeview utilities
through the old tree API, and was used by front ends with no changes
for the new treeview API, the tree layer refcounted initialisations
of treeview-based widgets, and only called the underlying treeview
init/fini functions when needed.
This change moves that refcounting into the treeview module. Now
the hotlist, global history, cookie manager, and ssl cert viewer
widgets call call treeview init/fini as part of their own
initialisation and finalisation. This means that front ends
using the correct APIs for treeview-based widgets don't need to
know anything about the underlying treeview, and the tree module
compatibility layer has had its treeview refcounting removed.
Finally, the treeview_init function took a font size parameter.
Now it does not and lit gets font size from config. We probably
want to add a new `treeview_font_size` option to nsoptions, and
have differnent defaults on different platforms. 12pt on RISC OS,
and 11pt elsewhere, most likely.
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/atari/gui.c | 7 | ||||
-rw-r--r-- | frontends/gtk/cookies.c | 6 | ||||
-rw-r--r-- | frontends/gtk/global_history.c | 6 | ||||
-rw-r--r-- | frontends/gtk/hotlist.c | 6 | ||||
-rw-r--r-- | frontends/gtk/ssl_cert.c | 6 | ||||
-rw-r--r-- | frontends/riscos/gui.c | 6 |
6 files changed, 0 insertions, 37 deletions
diff --git a/frontends/atari/gui.c b/frontends/atari/gui.c index eb15777b4..1cf51d31d 100644 --- a/frontends/atari/gui.c +++ b/frontends/atari/gui.c @@ -40,7 +40,6 @@ #include "netsurf/cookie_db.h" #include "netsurf/url_db.h" #include "content/backing_store.h" -#include "desktop/treeview.h" #include "atari/gemtk/gemtk.h" #include "atari/gui.h" @@ -828,9 +827,6 @@ static void gui_quit(void) atari_hotlist_destroy(); atari_cookie_manager_destroy(); - /* shutdown netsurf treeview framework: */ - treeview_fini(); - /* shutdown the toolbar framework: */ toolbar_exit(); @@ -1037,9 +1033,6 @@ static void gui_init(int argc, char** argv) } gemtk_wm_init(); - /* Initialize the netsurf treeview framework with default font size: */ - treeview_init(0); - /* Initialize the specific treeview windows: */ atari_global_history_init(); atari_hotlist_init(); diff --git a/frontends/gtk/cookies.c b/frontends/gtk/cookies.c index 3c5d93a87..d0fae974f 100644 --- a/frontends/gtk/cookies.c +++ b/frontends/gtk/cookies.c @@ -29,7 +29,6 @@ #include "netsurf/keypress.h" #include "netsurf/plotters.h" #include "desktop/cookie_manager.h" -#include "desktop/treeview.h" #include "gtk/cookies.h" #include "gtk/plotters.h" @@ -247,11 +246,6 @@ static nserror nsgtk_cookies_init(void) return NSERROR_OK; } - res = treeview_init(0); - if (res != NSERROR_OK) { - return res; - } - ncwin = malloc(sizeof(struct nsgtk_cookie_window)); if (ncwin == NULL) { return NSERROR_NOMEM; diff --git a/frontends/gtk/global_history.c b/frontends/gtk/global_history.c index b41d06ef6..7d647057b 100644 --- a/frontends/gtk/global_history.c +++ b/frontends/gtk/global_history.c @@ -30,7 +30,6 @@ #include "netsurf/keypress.h" #include "netsurf/plotters.h" #include "desktop/global_history.h" -#include "desktop/treeview.h" #include "gtk/compat.h" #include "gtk/plotters.h" @@ -300,11 +299,6 @@ static nserror nsgtk_global_history_init(void) return NSERROR_OK; } - res = treeview_init(0); - if (res != NSERROR_OK) { - return res; - } - ncwin = malloc(sizeof(struct nsgtk_global_history_window)); if (ncwin == NULL) { return NSERROR_NOMEM; diff --git a/frontends/gtk/hotlist.c b/frontends/gtk/hotlist.c index 2d0641ff2..c47d1da3f 100644 --- a/frontends/gtk/hotlist.c +++ b/frontends/gtk/hotlist.c @@ -31,7 +31,6 @@ #include "netsurf/keypress.h" #include "netsurf/plotters.h" #include "desktop/hotlist.h" -#include "desktop/treeview.h" #include "gtk/compat.h" #include "gtk/plotters.h" @@ -318,11 +317,6 @@ static nserror nsgtk_hotlist_init(void) return NSERROR_OK; } - res = treeview_init(0); - if (res != NSERROR_OK) { - return res; - } - ncwin = malloc(sizeof(struct nsgtk_hotlist_window)); if (ncwin == NULL) { return NSERROR_NOMEM; diff --git a/frontends/gtk/ssl_cert.c b/frontends/gtk/ssl_cert.c index 1cf0bebac..8270b1563 100644 --- a/frontends/gtk/ssl_cert.c +++ b/frontends/gtk/ssl_cert.c @@ -29,7 +29,6 @@ #include "netsurf/keypress.h" #include "netsurf/plotters.h" #include "desktop/sslcert_viewer.h" -#include "desktop/treeview.h" #include "gtk/plotters.h" #include "gtk/scaffolding.h" @@ -177,11 +176,6 @@ nserror gtk_cert_verify(struct nsurl *url, struct nsgtk_crtvrfy_window *ncwin; nserror res; - res = treeview_init(0); - if (res != NSERROR_OK) { - return res; - } - ncwin = malloc(sizeof(struct nsgtk_crtvrfy_window)); if (ncwin == NULL) { return NSERROR_NOMEM; diff --git a/frontends/riscos/gui.c b/frontends/riscos/gui.c index 7c5216462..9d5f6bb40 100644 --- a/frontends/riscos/gui.c +++ b/frontends/riscos/gui.c @@ -55,7 +55,6 @@ #include "netsurf/cookie_db.h" #include "netsurf/url_db.h" #include "desktop/save_complete.h" -#include "desktop/treeview.h" #include "content/backing_store.h" #include "riscos/gui.h" @@ -1227,11 +1226,6 @@ static nserror gui_init(int argc, char** argv) die(error->errmess); } - ret = treeview_init(12); - if (ret != NSERROR_OK) { - die("Failed to initialise treeview"); - } - /* Initialise themes before dialogs */ ro_gui_theme_initialise(); |