From d24017474174614c630fbfde1c53415cf1a6fdfa Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Mon, 6 May 2019 09:46:45 +0100 Subject: Add console_log to gui tables Signed-off-by: Daniel Silverstone --- desktop/gui_factory.c | 12 ++++++++++++ include/netsurf/window.h | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c index b2b9a3bf8..5628caad5 100644 --- a/desktop/gui_factory.c +++ b/desktop/gui_factory.c @@ -139,6 +139,15 @@ static void gui_default_window_start_selection(struct gui_window *g) { } +static void +gui_default_console_log(struct gui_window *gw, + browser_window_console_source src, + const char *msg, + size_t msglen, + browser_window_console_flags flags) +{ +} + /** verify window table is valid */ static nserror verify_window_register(struct gui_window_table *gwt) @@ -228,6 +237,9 @@ static nserror verify_window_register(struct gui_window_table *gwt) if (gwt->start_selection == NULL) { gwt->start_selection = gui_default_window_start_selection; } + if (gwt->console_log == NULL) { + gwt->console_log = gui_default_console_log; + } return NSERROR_OK; } diff --git a/include/netsurf/window.h b/include/netsurf/window.h index 53d9b30f2..8fc7c7be0 100644 --- a/include/netsurf/window.h +++ b/include/netsurf/window.h @@ -26,6 +26,8 @@ #ifndef NETSURF_WINDOW_H #define NETSURF_WINDOW_H +#include "netsurf/console.h" + typedef enum gui_save_type { GUI_SAVE_SOURCE, GUI_SAVE_DRAW, @@ -341,6 +343,23 @@ struct gui_window_table { * \param gw The gui window to start selection in. */ void (*start_selection)(struct gui_window *gw); + + /** + * console logging happening. + * + * See \ref browser_window_console_log + * + * \param gw The gui window receiving the logging. + * \param src The source of the logging message + * \param msg The text of the logging message + * \param msglen The length of the text of the logging message + * \param flags Flags associated with the logging. + */ + void (*console_log)(struct gui_window *gw, + browser_window_console_source src, + const char *msg, + size_t msglen, + browser_window_console_flags flags); }; #endif -- cgit v1.2.3