summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-01-11 22:34:12 +0000
committerVincent Sanders <vince@kyllikki.org>2014-01-11 22:34:12 +0000
commitc8496df3df7d059528f2d5e735be5c55bfa75ef6 (patch)
tree7979e63f7e548c7a9d6bb024afde7b1bc785ff44 /windows
parentd3c392c3d3b516f05fbf71020b2f6774ce20ce8c (diff)
downloadnetsurf-c8496df3df7d059528f2d5e735be5c55bfa75ef6.tar.gz
netsurf-c8496df3df7d059528f2d5e735be5c55bfa75ef6.tar.bz2
move window creation and destruction into table
Diffstat (limited to 'windows')
-rw-r--r--windows/gui.c20
-rw-r--r--windows/gui.h2
-rw-r--r--windows/main.c5
3 files changed, 17 insertions, 10 deletions
diff --git a/windows/gui.c b/windows/gui.c
index e20369a65..a01b6c4df 100644
--- a/windows/gui.c
+++ b/windows/gui.c
@@ -80,7 +80,7 @@ void gui_file_gadget_open(struct gui_window *g, hlcache_handle *hl,
/* browser_window_set_gadget_filename(bw, gadget, "filename"); */
}
-void gui_poll(bool active)
+static void gui_poll(bool active)
{
MSG Msg; /* message from system */
BOOL bRet; /* message fetch result */
@@ -1220,10 +1220,10 @@ static HWND nsws_window_create(struct gui_window *gw)
* create a new gui_window to contain a browser_window
* \param bw the browser_window to connect to the new gui_window
*/
-struct gui_window *
-gui_create_browser_window(struct browser_window *bw,
- struct browser_window *clone,
- bool new_tab)
+static struct gui_window *
+gui_window_create(struct browser_window *bw,
+ struct browser_window *clone,
+ bool new_tab)
{
struct gui_window *gw;
@@ -1399,7 +1399,7 @@ struct browser_window *gui_window_browser_window(struct gui_window *w)
/**
* window cleanup code
*/
-void gui_window_destroy(struct gui_window *w)
+static void gui_window_destroy(struct gui_window *w)
{
if (w == NULL)
return;
@@ -1883,3 +1883,11 @@ nsws_create_main_class(HINSTANCE hinstance) {
return ret;
}
+
+static struct gui_table gui_table = {
+ .poll = gui_poll,
+ .window_create = gui_window_create,
+ .window_destroy = gui_window_destroy,
+};
+
+struct gui_table *win32_gui_table = &gui_table;
diff --git a/windows/gui.h b/windows/gui.h
index 9bcba592e..29c7f8485 100644
--- a/windows/gui.h
+++ b/windows/gui.h
@@ -24,6 +24,8 @@
#include "desktop/gui.h"
#include "windows/localhistory.h"
+extern struct gui_table *win32_gui_table;
+
extern HINSTANCE hInstance;
/* bounding box */
diff --git a/windows/main.c b/windows/main.c
index 320c7e4fb..5f20a70d1 100644
--- a/windows/main.c
+++ b/windows/main.c
@@ -91,9 +91,6 @@ static nserror set_defaults(struct nsoption_s *defaults)
return NSERROR_OK;
}
-static struct gui_table win32_gui_table = {
- .poll = &gui_poll,
-};
/**
@@ -157,7 +154,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE hLastInstance, LPSTR lpcli, int ncmd)
/* common initialisation */
messages = filepath_find(respaths, "messages");
- ret = netsurf_init(messages, &win32_gui_table);
+ ret = netsurf_init(messages, win32_gui_table);
free(messages);
if (ret != NSERROR_OK) {
free(options_file_location);