From d3c392c3d3b516f05fbf71020b2f6774ce20ce8c Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 11 Jan 2014 14:20:30 +0000 Subject: Initial conversion of netsurf gui to callback vtable --- desktop/gui.h | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) (limited to 'desktop/gui.h') diff --git a/desktop/gui.h b/desktop/gui.h index 9317e8576..2bda996fd 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -24,6 +24,18 @@ #ifndef _NETSURF_DESKTOP_GUI_H_ #define _NETSURF_DESKTOP_GUI_H_ +#include + +#include +#include + +#include "utils/config.h" +#include "content/hlcache.h" +#include "desktop/download.h" +#include "desktop/mouse.h" +#include "desktop/search.h" +#include "utils/errors.h" + typedef enum { GUI_SAVE_SOURCE, GUI_SAVE_DRAW, @@ -53,20 +65,22 @@ struct gui_download_window; struct browser_window; struct form_control; -#include +/** Graphical user interface function table + * + * function table implementing GUI interface to browser core + */ +struct gui_table { + /** called to let the frontend update its state and run any + * I/O operations. + */ + void (*poll)(bool active); /* Mandantory */ -#include -#include + /** called to allow the gui to cleanup */ + void (*quit)(void); /* optional */ -#include "utils/config.h" -#include "content/hlcache.h" -#include "desktop/download.h" -#include "desktop/mouse.h" -#include "desktop/search.h" -#include "utils/errors.h" +}; -void gui_poll(bool active); -void gui_quit(void); +extern struct gui_table *guit; /* the gui vtable */ struct gui_window *gui_create_browser_window(struct browser_window *bw, struct browser_window *clone, bool new_tab); -- cgit v1.2.3