summaryrefslogtreecommitdiff
path: root/desktop/gui.h
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-01-11 14:20:30 +0000
committerVincent Sanders <vince@kyllikki.org>2014-01-11 14:20:30 +0000
commitd3c392c3d3b516f05fbf71020b2f6774ce20ce8c (patch)
treebad0d50f6d2d7bfc52774745ce10e69ce0ff5bff /desktop/gui.h
parenta856439afb743c7fa16f51108862b99a1f56c82a (diff)
downloadnetsurf-d3c392c3d3b516f05fbf71020b2f6774ce20ce8c.tar.gz
netsurf-d3c392c3d3b516f05fbf71020b2f6774ce20ce8c.tar.bz2
Initial conversion of netsurf gui to callback vtable
Diffstat (limited to 'desktop/gui.h')
-rw-r--r--desktop/gui.h36
1 files changed, 25 insertions, 11 deletions
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 <stdbool.h>
+
+#include <libwapcaplet/libwapcaplet.h>
+#include <libcss/libcss.h>
+
+#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 <stdbool.h>
+/** 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 <libwapcaplet/libwapcaplet.h>
-#include <libcss/libcss.h>
+ /** 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);