summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Docs/Doxyfile2
-rw-r--r--content/fetchers/resource.c1
-rw-r--r--desktop/browser.c1
-rw-r--r--desktop/browser.h16
-rw-r--r--desktop/download.c2
-rw-r--r--desktop/frames.c2
-rw-r--r--desktop/gui.h58
-rw-r--r--desktop/gui_factory.c3
-rw-r--r--desktop/local_history.c2
-rw-r--r--desktop/netsurf.c1
-rw-r--r--desktop/netsurf.h1
-rw-r--r--desktop/search.c1
-rw-r--r--desktop/searchweb.c1
-rw-r--r--desktop/selection.c1
-rw-r--r--desktop/textinput.c1
-rw-r--r--framebuffer/fetch.c1
-rw-r--r--gtk/download.c4
-rw-r--r--gtk/fetch.c2
-rw-r--r--gtk/scaffolding.h2
-rw-r--r--monkey/download.c8
-rw-r--r--render/form.c3
-rw-r--r--render/search.c1
-rw-r--r--render/textplain.c1
-rw-r--r--riscos/download.c2
-rw-r--r--riscos/gui.h1
-rw-r--r--riscos/iconbar.c2
-rw-r--r--riscos/window.c29
-rw-r--r--utils/log.c3
-rw-r--r--utils/log.h5
-rw-r--r--windows/download.c1
30 files changed, 104 insertions, 54 deletions
diff --git a/Docs/Doxyfile b/Docs/Doxyfile
index 40102ea61..90cb0a357 100644
--- a/Docs/Doxyfile
+++ b/Docs/Doxyfile
@@ -1788,7 +1788,7 @@ MSCFILE_DIRS =
# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-DOT_GRAPH_MAX_NODES = 50
+DOT_GRAPH_MAX_NODES = 100
# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
# graphs generated by dot. A depth value of 3 means that only nodes reachable
diff --git a/content/fetchers/resource.c b/content/fetchers/resource.c
index b2791b432..a5c12bbdb 100644
--- a/content/fetchers/resource.c
+++ b/content/fetchers/resource.c
@@ -41,7 +41,6 @@
#include "content/fetch.h"
#include "content/fetchers/resource.h"
#include "content/urldb.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "utils/corestrings.h"
#include "utils/nsoption.h"
diff --git a/desktop/browser.c b/desktop/browser.c
index a33c1b6eb..f46d50eec 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -45,7 +45,6 @@
#include "desktop/download.h"
#include "desktop/frames.h"
#include "desktop/global_history.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "desktop/hotlist.h"
#include "desktop/knockout.h"
diff --git a/desktop/browser.h b/desktop/browser.h
index 0ca2e009b..4901c112e 100644
--- a/desktop/browser.h
+++ b/desktop/browser.h
@@ -27,8 +27,8 @@
#include <stdbool.h>
#include "content/content.h"
+#include "content/hlcache.h"
#include "desktop/frame_types.h"
-#include "desktop/gui.h"
#include "desktop/mouse.h"
#include "utils/types.h"
@@ -243,7 +243,7 @@ bool browser_window_redraw(struct browser_window *bw, int x, int y,
*/
bool browser_window_redraw_ready(struct browser_window *bw);
-/*
+/**
* Update the extent of the inside of a browser window to that of the current
* content
*
@@ -251,7 +251,7 @@ bool browser_window_redraw_ready(struct browser_window *bw);
*/
void browser_window_update_extent(struct browser_window *bw);
-/*
+/**
* Get the position of the current browser window with respect to the root or
* parent browser window
*
@@ -263,7 +263,7 @@ void browser_window_update_extent(struct browser_window *bw);
void browser_window_get_position(struct browser_window *bw, bool root,
int *pos_x, int *pos_y);
-/*
+/**
* Set the position of the current browser window with respect to the parent
* browser window
*
@@ -273,7 +273,7 @@ void browser_window_get_position(struct browser_window *bw, bool root,
*/
void browser_window_set_position(struct browser_window *bw, int x, int y);
-/*
+/**
* Scroll the browser window to display the passed area
*
* \param bw browser window to scroll
@@ -294,7 +294,7 @@ void browser_window_scroll_visible(struct browser_window *bw,
*/
void browser_window_set_scroll(struct browser_window *bw, int x, int y);
-/*
+/**
* Set drag type for a browser window, and inform front end
*
* \param bw browser window to set the type of the current drag for
@@ -304,7 +304,7 @@ void browser_window_set_scroll(struct browser_window *bw, int x, int y);
void browser_window_set_drag_type(struct browser_window *bw,
browser_drag_type type, const struct rect *rect);
-/*
+/**
* Get type of any current drag for a browser window
*
* \param bw browser window to set the type of the current drag for
@@ -312,7 +312,7 @@ void browser_window_set_drag_type(struct browser_window *bw,
*/
browser_drag_type browser_window_get_drag_type(struct browser_window *bw);
-/*
+/**
* Get the root level browser window
*
* \param bw browser window to set the type of the current drag for
diff --git a/desktop/download.c b/desktop/download.c
index b5427b405..b458f577c 100644
--- a/desktop/download.c
+++ b/desktop/download.c
@@ -23,10 +23,10 @@
#include <assert.h>
#include <stdlib.h>
+#include <string.h>
#include "content/llcache.h"
#include "desktop/download.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "utils/corestrings.h"
#include "utils/http.h"
diff --git a/desktop/frames.c b/desktop/frames.c
index 3f7613f32..354c70da4 100644
--- a/desktop/frames.c
+++ b/desktop/frames.c
@@ -28,12 +28,12 @@
#include <string.h>
#include <time.h>
#include <math.h>
+
#include "utils/config.h"
#include "content/hlcache.h"
#include "desktop/browser_private.h"
#include "desktop/frames.h"
#include "desktop/local_history.h"
-#include "desktop/gui.h"
#include "desktop/scrollbar.h"
#include "desktop/selection.h"
#include "utils/log.h"
diff --git a/desktop/gui.h b/desktop/gui.h
index da609b1e3..37066e1a7 100644
--- a/desktop/gui.h
+++ b/desktop/gui.h
@@ -24,10 +24,13 @@
#define _NETSURF_DESKTOP_GUI_H_
#include <stdbool.h>
+#include <stdlib.h>
-#include "content/hlcache.h"
-#include "desktop/download.h"
+#include "utils/types.h"
#include "utils/errors.h"
+#include "utils/nsurl.h"
+#include "desktop/plot_style.h"
+#include "desktop/mouse.h"
typedef enum {
GUI_SAVE_SOURCE,
@@ -58,6 +61,8 @@ struct gui_download_window;
struct browser_window;
struct form_control;
struct ssl_cert_info;
+struct hlcache_handle;
+struct download_context;
typedef struct nsnsclipboard_styles {
size_t start; /**< Start of run */
@@ -155,7 +160,7 @@ struct gui_window_table {
void (*set_url)(struct gui_window *g, const char *url);
/** set favicon */
- void (*set_icon)(struct gui_window *g, hlcache_handle *icon);
+ void (*set_icon)(struct gui_window *g, struct hlcache_handle *icon);
/**
* Set the status bar of a browser window.
@@ -232,10 +237,10 @@ struct gui_window_table {
/**
* Called when file chooser gadget is activated
*/
- void (*file_gadget_open)(struct gui_window *g, hlcache_handle *hl, struct form_control *gadget);
+ void (*file_gadget_open)(struct gui_window *g, struct hlcache_handle *hl, struct form_control *gadget);
/** object dragged to window*/
- void (*drag_save_object)(struct gui_window *g, hlcache_handle *c, gui_save_type type);
+ void (*drag_save_object)(struct gui_window *g, struct hlcache_handle *c, gui_save_type type);
/** drag selection save */
void (*drag_save_selection)(struct gui_window *g, const char *selection);
@@ -248,7 +253,7 @@ struct gui_window_table {
* function table for download windows
*/
struct gui_download_table {
- struct gui_download_window *(*create)(download_context *ctx, struct gui_window *parent);
+ struct gui_download_window *(*create)(struct download_context *ctx, struct gui_window *parent);
nserror (*data)(struct gui_download_window *dw, const char *data, unsigned int size);
@@ -365,6 +370,31 @@ struct gui_fetch_table {
};
+/**
+ * User interface utf8 characterset conversion routines
+ */
+struct gui_utf8_table {
+ /**
+ * Convert a UTF-8 encoded string into the system local encoding
+ *
+ * \param string The string to convert
+ * \param len The length (in bytes) of the string, or 0
+ * \param result Pointer to location in which to store result
+ * \return An nserror code
+ */
+ nserror (*utf8_to_local)(const char *string, size_t len, char **result);
+
+ /**
+ * Convert a string encoded in the system local encoding to UTF-8
+ *
+ * \param string The string to convert
+ * \param len The length (in bytes) of the string, or 0
+ * \param result Pointer to location in which to store result
+ * \return An nserror code
+ */
+ nserror (*local_to_utf8)(const char *string, size_t len, char **result);
+};
+
/** Graphical user interface browser misc function table
*
* function table implementing GUI interface to miscelaneous browser
@@ -392,7 +422,7 @@ struct gui_browser_table {
* \param ico may be NULL for local calls; then access current
* cache from search_web_ico()
*/
- void (*set_search_ico)(hlcache_handle *ico);
+ void (*set_search_ico)(struct hlcache_handle *ico);
/**
* core has no fetcher for url
@@ -424,7 +454,11 @@ struct gui_browser_table {
*/
struct gui_table {
- /** Browser table */
+ /** Browser table.
+ *
+ * Provides miscellaneous browser functionality. The table
+ * is mandantory and must be provided.
+ */
struct gui_browser_table *browser;
/** Window table */
@@ -438,6 +472,14 @@ struct gui_table {
/** Fetcher table */
struct gui_fetch_table *fetch;
+
+ /** UTF8 table
+ *
+ * Provides for conversion between the gui local character
+ * encoding and utf8. The table optional and may be NULL which
+ * implies the local encoding is utf8.
+ */
+ struct gui_utf8_table *utf8;
};
diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c
index dfe775571..b61fdf0be 100644
--- a/desktop/gui_factory.c
+++ b/desktop/gui_factory.c
@@ -16,7 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "desktop/gui.h"
+#include "content/hlcache.h"
+#include "desktop/download.h"
#include "desktop/gui_factory.h"
/** The global GUI interface table */
diff --git a/desktop/local_history.c b/desktop/local_history.c
index d4ecfd3bb..9829f51b6 100644
--- a/desktop/local_history.c
+++ b/desktop/local_history.c
@@ -26,12 +26,12 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
+
#include "content/content.h"
#include "content/hlcache.h"
#include "content/urldb.h"
#include "css/css.h"
#include "desktop/browser.h"
-#include "desktop/gui.h"
#include "desktop/local_history.h"
#include "desktop/plotters.h"
#include "desktop/thumbnail.h"
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index 76da91a89..c3653b574 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -73,7 +73,6 @@
#define HL_CACHE_CLEAN_TIME (2 * IMAGE_CACHE_CLEAN_TIME)
bool netsurf_quit = false;
-bool verbose_log = false;
static void netsurf_lwc_iterator(lwc_string *str, void *pw)
{
diff --git a/desktop/netsurf.h b/desktop/netsurf.h
index e6858ad66..77589c71c 100644
--- a/desktop/netsurf.h
+++ b/desktop/netsurf.h
@@ -23,7 +23,6 @@
#include "utils/errors.h"
extern bool netsurf_quit;
-extern bool verbose_log;
extern const char * const netsurf_version;
extern const int netsurf_version_major;
extern const int netsurf_version_minor;
diff --git a/desktop/search.c b/desktop/search.c
index 3a7c768a5..4a02f6b7c 100644
--- a/desktop/search.c
+++ b/desktop/search.c
@@ -29,7 +29,6 @@
#include "content/content.h"
#include "content/hlcache.h"
#include "desktop/browser_private.h"
-#include "desktop/gui.h"
#include "utils/nsoption.h"
#include "desktop/search.h"
#include "desktop/selection.h"
diff --git a/desktop/searchweb.c b/desktop/searchweb.c
index b3f6162a6..bdcb2ba8a 100644
--- a/desktop/searchweb.c
+++ b/desktop/searchweb.c
@@ -26,7 +26,6 @@
#include "content/content.h"
#include "content/hlcache.h"
#include "desktop/browser.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "utils/nsoption.h"
#include "desktop/searchweb.h"
diff --git a/desktop/selection.c b/desktop/selection.c
index 96c7e0c3c..34292fdce 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -29,7 +29,6 @@
#include <dom/dom.h>
#include "desktop/browser_private.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "desktop/mouse.h"
#include "desktop/plotters.h"
diff --git a/desktop/textinput.c b/desktop/textinput.c
index c61b838fe..fd6ae9ff1 100644
--- a/desktop/textinput.c
+++ b/desktop/textinput.c
@@ -30,7 +30,6 @@
#include <dom/dom.h>
#include "desktop/browser_private.h"
-#include "desktop/gui.h"
#include "desktop/gui_factory.h"
#include "desktop/mouse.h"
#include "desktop/scrollbar.h"
diff --git a/framebuffer/fetch.c b/framebuffer/fetch.c
index 0c9b90f7c..f350f3634 100644
--- a/framebuffer/fetch.c
+++ b/framebuffer/fetch.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <string.h>
+#include <limits.h>
#include "desktop/gui.h"
#include "utils/url.h"
diff --git a/gtk/download.c b/gtk/download.c
index 3d287d4d2..e49e66ef3 100644
--- a/gtk/download.c
+++ b/gtk/download.c
@@ -27,10 +27,12 @@
#include "utils/utils.h"
#include "utils/url.h"
#include "utils/messages.h"
+#include "utils/nsoption.h"
+#include "desktop/download.h"
#include "desktop/gui.h"
+
#include "gtk/gui.h"
#include "gtk/scaffolding.h"
-#include "utils/nsoption.h"
#include "gtk/download.h"
#include "gtk/window.h"
#include "gtk/compat.h"
diff --git a/gtk/fetch.c b/gtk/fetch.c
index f4a42b5f8..0043cd062 100644
--- a/gtk/fetch.c
+++ b/gtk/fetch.c
@@ -20,6 +20,8 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <ctype.h>
+#include <string.h>
#include "utils/hashtable.h"
#include "utils/url.h"
diff --git a/gtk/scaffolding.h b/gtk/scaffolding.h
index 43eb41b19..757da82fd 100644
--- a/gtk/scaffolding.h
+++ b/gtk/scaffolding.h
@@ -20,9 +20,9 @@
#define NETSURF_GTK_SCAFFOLDING_H 1
#include <gtk/gtk.h>
-//#include <glade/glade.h>
#include <glib.h>
+#include "content/hlcache.h"
#include "desktop/gui.h"
#include "desktop/plotters.h"
#include "gtk/menu.h"
diff --git a/monkey/download.c b/monkey/download.c
index d2e3b4b24..721f77ddc 100644
--- a/monkey/download.c
+++ b/monkey/download.c
@@ -16,11 +16,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "desktop/browser.h"
-#include "monkey/browser.h"
+#include <stdio.h>
+
+#include "desktop/gui.h"
+#include "desktop/download.h"
#include "utils/ring.h"
-#include <stdio.h>
+#include "monkey/browser.h"
static uint32_t dwin_ctr = 0;
diff --git a/render/form.c b/render/form.c
index c9d74a1c2..905401a63 100644
--- a/render/form.c
+++ b/render/form.c
@@ -32,12 +32,11 @@
#include <stdio.h>
#include <string.h>
#include <dom/dom.h>
+
#include "content/fetch.h"
#include "content/hlcache.h"
#include "css/css.h"
#include "css/utils.h"
-#include "desktop/browser.h"
-#include "desktop/gui.h"
#include "desktop/mouse.h"
#include "desktop/knockout.h"
#include "desktop/plot_style.h"
diff --git a/render/search.c b/render/search.c
index 895cff0a1..46ec7d1fc 100644
--- a/render/search.c
+++ b/render/search.c
@@ -30,7 +30,6 @@
#include "content/content.h"
#include "content/hlcache.h"
-#include "desktop/gui.h"
#include "desktop/selection.h"
#include "render/box.h"
#include "render/html.h"
diff --git a/render/textplain.c b/render/textplain.c
index 5254e6aba..b459efc6c 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -35,7 +35,6 @@
#include "css/css.h"
#include "css/utils.h"
#include "desktop/browser.h"
-#include "desktop/gui.h"
#include "utils/nsoption.h"
#include "desktop/plotters.h"
#include "desktop/search.h"
diff --git a/riscos/download.c b/riscos/download.c
index 526f30174..b89334f2c 100644
--- a/riscos/download.c
+++ b/riscos/download.c
@@ -33,6 +33,7 @@
#include <sys/time.h>
#include <time.h>
#include <curl/curl.h>
+
#include "oslib/mimemap.h"
#include "oslib/osargs.h"
#include "oslib/osfile.h"
@@ -43,6 +44,7 @@
#include "oslib/wimpspriteop.h"
#include "desktop/gui.h"
#include "desktop/netsurf.h"
+#include "desktop/download.h"
#include "riscos/dialog.h"
#include "utils/nsoption.h"
#include "riscos/mouse.h"
diff --git a/riscos/gui.h b/riscos/gui.h
index 051834a09..56cb70e42 100644
--- a/riscos/gui.h
+++ b/riscos/gui.h
@@ -27,6 +27,7 @@
#include "oslib/wimp.h"
#include "rufl.h"
#include "desktop/browser.h"
+#include "desktop/gui.h"
#include "content/content_type.h"
#include "utils/config.h"
diff --git a/riscos/iconbar.c b/riscos/iconbar.c
index f6c094291..7e3d73230 100644
--- a/riscos/iconbar.c
+++ b/riscos/iconbar.c
@@ -28,6 +28,7 @@
#include <string.h>
#include <time.h>
#include <features.h>
+
#include "oslib/os.h"
#include "oslib/osbyte.h"
#include "oslib/wimp.h"
@@ -37,6 +38,7 @@
#include "riscos/global_history.h"
#include "riscos/hotlist.h"
#include "riscos/iconbar.h"
+#include "desktop/netsurf.h"
#include "desktop/browser.h"
#include "utils/nsoption.h"
#include "riscos/wimp_event.h"
diff --git a/riscos/window.c b/riscos/window.c
index b7146eb4a..ed0f9e297 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -399,9 +399,10 @@ static void gui_window_place_caret(struct gui_window *g, int x, int y, int heigh
/**
* Create and open a new browser window.
*
- * \param bw browser_window structure to update
- * \param clone the browser window to clone options from, or NULL for default
- * \return gui_window, or 0 on error and error reported
+ * \param bw The browser window structure to update
+ * \param clone The browser window to clone options from, or NULL for default
+ * \param new_tab Determines if new browser context should be a tab or window.
+ * \return A gui window, or NULL on error and error reported
*/
static struct gui_window *gui_window_create(struct browser_window *bw,
@@ -731,8 +732,8 @@ void gui_window_redraw_window(struct gui_window *g)
/**
* Redraw an area of a window.
*
- * \param g gui_window
- * \param data content_msg_data union with filled in redraw data
+ * \param g The window to update
+ * \param rect The area of the window to update.
*/
static void gui_window_update_box(struct gui_window *g, const struct rect *rect)
@@ -1292,8 +1293,9 @@ static bool gui_window_drag_start(struct gui_window *g, gui_drag_type type,
/**
* Save the specified content as a link.
*
- * \param g gui_window containing the content
- * \param c the content to save
+ * \param g The window containing the content
+ * \param url The url of the link
+ * \param title The title of the link
*/
static void gui_window_save_link(struct gui_window *g, const char *url,
const char *title)
@@ -3106,7 +3108,7 @@ void ro_gui_window_scroll(wimp_scroll *scroll)
inc = 0.02; /* RO5 sends the msg 5 times;
* don't ask me why
*
- * \TODO -- this is liable to break if
+ * @todo this is liable to break if
* HID is configured optimally for
* frame scrolling. *5 appears to be
* an artifact of non-HID mode scrolling.
@@ -3752,8 +3754,8 @@ void ro_gui_window_toolbar_click(void *data,
/**
* Handle Message_DataLoad (file dragged in) for a toolbar
*
- * \TODO -- This belongs in the toolbar module, and should be moved there
- * once the module is able to usefully handle its own events.
+ * @todo This belongs in the toolbar module, and should be moved there
+ * once the module is able to usefully handle its own events.
*
* \param g window
* \param message Message_DataLoad block
@@ -4607,11 +4609,10 @@ void ro_gui_window_update_theme(void *data, bool ok)
*/
/**
- * Import text file into window or its toolbar
+ * Import text file into window
*
* \param g gui window containing textarea
* \param filename pathname of file to be imported
- * \param toolbar true iff imported to toolbar rather than main window
* \return true iff successful
*/
@@ -4946,8 +4947,8 @@ struct gui_window *ro_gui_window_lookup(wimp_w window)
/**
* Convert a toolbar RISC OS window handle to a gui_window.
*
- * \param w RISC OS window handle of a toolbar
- * \return pointer to a structure if found, 0 otherwise
+ * \param window RISC OS window handle of a toolbar
+ * \return pointer to a structure if found, NULL otherwise
*/
struct gui_window *ro_gui_toolbar_lookup(wimp_w window)
diff --git a/utils/log.c b/utils/log.c
index 2aa39ee41..8ec42c1f7 100644
--- a/utils/log.c
+++ b/utils/log.c
@@ -23,10 +23,11 @@
#include <stdarg.h>
#include <stdio.h>
#include <sys/time.h>
-#include "desktop/netsurf.h"
#include "utils/log.h"
+bool verbose_log = false;
+
nserror nslog_init(nslog_ensure_t *ensure, int *pargc, char **argv)
{
nserror ret = NSERROR_OK;
diff --git a/utils/log.h b/utils/log.h
index ed953f37e..673419b66 100644
--- a/utils/log.h
+++ b/utils/log.h
@@ -21,9 +21,12 @@
#define _NETSURF_LOG_H_
#include <stdio.h>
-#include "desktop/netsurf.h"
+#include <stdbool.h>
+
#include "utils/errors.h"
+extern bool verbose_log;
+
/**
* Ensures the FILE handle is available to write logging to.
*
diff --git a/windows/download.c b/windows/download.c
index 189baa819..8bdff3aac 100644
--- a/windows/download.c
+++ b/windows/download.c
@@ -26,6 +26,7 @@
#include "content/fetch.h"
#include "desktop/gui.h"
+#include "desktop/download.h"
#include "utils/schedule.h"
#include "utils/log.h"
#include "utils/messages.h"