From 8474c5d4c0b59e74e2ef001b5033b78d7a99fcad Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 5 May 2019 21:05:27 +0100 Subject: Logging: migrate and provide content interface Migrate the console enums into netsurf/console.h and add support so that contents can raise a message to log to the console. Signed-off-by: Daniel Silverstone --- content/content.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'content/content.h') diff --git a/content/content.h b/content/content.h index 77cc60574..417fb7b95 100644 --- a/content/content.h +++ b/content/content.h @@ -33,6 +33,7 @@ #include "content/content_factory.h" #include "desktop/search.h" /* search flags enum */ #include "netsurf/mouse.h" /* mouse state enums */ +#include "netsurf/console.h" /* console state and flags enums */ struct browser_window; struct browser_window_features; @@ -56,6 +57,7 @@ typedef enum { /** Used in callbacks to indicate what has occurred. */ typedef enum { + CONTENT_MSG_LOG, /**< Content wishes to log something */ CONTENT_MSG_LOADING, /**< fetching or converting */ CONTENT_MSG_READY, /**< may be displayed */ CONTENT_MSG_DONE, /**< finished */ @@ -95,6 +97,13 @@ struct content_rfc5988_link { /** Extra data for some content_msg messages. */ union content_msg_data { + /** CONTENT_MSG_LOG - Information for logging */ + struct { + browser_window_console_source src; /**< The source of the logging */ + const char *msg; /**< The message to log */ + size_t msglen; /**< The length of that message */ + browser_window_console_flags flags; /**< The flags of the logging */ + } log; /** CONTENT_MSG_ERROR - Error message */ const char *error; /** CONTENT_MSG_ERRORCODE - Error code */ -- cgit v1.2.3