Add console_log to gui tables

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2019-05-06 09:46:45 +01:00
parent d27027d4ba
commit d240174741
2 changed files with 31 additions and 0 deletions

View File

@ -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;
}

View File

@ -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