Move win32 window operations into their own module

This splits up a great deal of the win32 window code out from other
gui code. It also remove large quantities of unused and junk
variables and functions.
This commit is contained in:
Vincent Sanders 2015-03-12 23:48:53 +00:00
parent 8b00dfcfbf
commit a487f7e611
8 changed files with 1706 additions and 1702 deletions

View File

@ -27,6 +27,8 @@
* The CURL handles are cached in the curl_handle_ring. * The CURL handles are cached in the curl_handle_ring.
*/ */
#include "utils/config.h"
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <inttypes.h> #include <inttypes.h>
@ -39,7 +41,6 @@
#include <libwapcaplet/libwapcaplet.h> #include <libwapcaplet/libwapcaplet.h>
#include "utils/config.h"
#include "utils/corestrings.h" #include "utils/corestrings.h"
#include "utils/nsoption.h" #include "utils/nsoption.h"
#include "utils/log.h" #include "utils/log.h"

View File

@ -64,7 +64,9 @@ char *strchrnul(const char *s, int c);
#undef HAVE_INETATON #undef HAVE_INETATON
#undef HAVE_SYS_SELECT #undef HAVE_SYS_SELECT
#include <winsock2.h> #include <winsock2.h>
#ifndef EAFNOSUPPORT
#define EAFNOSUPPORT WSAEAFNOSUPPORT #define EAFNOSUPPORT WSAEAFNOSUPPORT
#endif
int inet_aton(const char *cp, struct in_addr *inp); int inet_aton(const char *cp, struct in_addr *inp);
#else #else
#include <netinet/in.h> #include <netinet/in.h>

View File

@ -38,8 +38,6 @@
static const char windowclassname_drawable[] = "nswsdrawablewindow"; static const char windowclassname_drawable[] = "nswsdrawablewindow";
void gui_window_set_scroll(struct gui_window *w, int sx, int sy);
/** /**
* Handle wheel scroll messages. * Handle wheel scroll messages.
*/ */
@ -132,7 +130,7 @@ nsws_drawable_vscroll(struct gui_window *gw, HWND hwnd, WPARAM wparam)
SetScrollInfo(hwnd, SB_VERT, &si, TRUE); SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
GetScrollInfo(hwnd, SB_VERT, &si); GetScrollInfo(hwnd, SB_VERT, &si);
if (si.nPos != mem) { if (si.nPos != mem) {
gui_window_set_scroll(gw, gw->scrollx, gw->scrolly + win32_window_set_scroll(gw, gw->scrollx, gw->scrolly +
gw->requestscrolly + si.nPos - mem); gw->requestscrolly + si.nPos - mem);
} }
@ -196,7 +194,7 @@ nsws_drawable_hscroll(struct gui_window *gw, HWND hwnd, WPARAM wparam)
SetScrollInfo(hwnd, SB_HORZ, &si, TRUE); SetScrollInfo(hwnd, SB_HORZ, &si, TRUE);
GetScrollInfo(hwnd, SB_HORZ, &si); GetScrollInfo(hwnd, SB_HORZ, &si);
if (si.nPos != mem) { if (si.nPos != mem) {
gui_window_set_scroll(gw, win32_window_set_scroll(gw,
gw->scrollx + gw->requestscrollx + si.nPos - mem, gw->scrollx + gw->requestscrollx + si.nPos - mem,
gw->scrolly); gw->scrolly);
} }

File diff suppressed because it is too large Load Diff

View File

@ -20,12 +20,12 @@
#ifndef _NETSURF_WINDOWS_GUI_H_ #ifndef _NETSURF_WINDOWS_GUI_H_
#define _NETSURF_WINDOWS_GUI_H_ #define _NETSURF_WINDOWS_GUI_H_
struct gui_window;
struct gui_file_table *win32_file_table; struct gui_file_table *win32_file_table;
extern struct gui_window_table *win32_window_table; struct gui_clipboard_table *win32_clipboard_table;
extern struct gui_clipboard_table *win32_clipboard_table; struct gui_fetch_table *win32_fetch_table;
extern struct gui_fetch_table *win32_fetch_table; struct gui_browser_table *win32_browser_table;
extern struct gui_browser_table *win32_browser_table; struct gui_utf8_table *win32_utf8_table;
extern struct gui_utf8_table *win32_utf8_table;
extern HINSTANCE hInstance; extern HINSTANCE hInstance;
@ -54,35 +54,15 @@ struct nsws_pointers {
}; };
extern struct gui_window *window_list;
extern char *options_file_location; extern char *options_file_location;
HWND gui_window_main_window(struct gui_window *); HWND gui_window_main_window(struct gui_window *);
HWND gui_window_toolbar(struct gui_window *);
HWND gui_window_urlbar(struct gui_window *);
HWND gui_window_statusbar(struct gui_window *);
HWND gui_window_drawingarea(struct gui_window *);
struct nsws_localhistory *gui_window_localhistory(struct gui_window *); struct nsws_localhistory *gui_window_localhistory(struct gui_window *);
void gui_window_set_localhistory(struct gui_window *,
struct nsws_localhistory *);
RECT *gui_window_redraw_rect(struct gui_window *);
int gui_window_voffset(struct gui_window *);
int gui_window_width(struct gui_window *);
int gui_window_height(struct gui_window *);
int gui_window_scrollingx(struct gui_window *w);
int gui_window_scrollingy(struct gui_window *w);
struct gui_window *gui_window_iterate(struct gui_window *);
struct browser_window *gui_window_browser_window(struct gui_window *);
struct nsws_pointers *nsws_get_pointers(void);
void nsws_window_init_pointers(HINSTANCE hinstance); void nsws_window_init_pointers(HINSTANCE hinstance);
struct nsws_pointers *nsws_get_pointers(void);
nserror nsws_create_main_class(HINSTANCE hinstance);
/** /**
* Cause a browser window to navigate to a url * Cause a browser window to navigate to a url
@ -97,4 +77,7 @@ bool nsws_window_go(HWND hwnd, const char *url);
*/ */
void win32_run(void); void win32_run(void);
/** cause the main message loop to exit */
void win32_set_quit(bool q);
#endif #endif

View File

@ -37,6 +37,7 @@
#include "windows/drawable.h" #include "windows/drawable.h"
#include "windows/download.h" #include "windows/download.h"
#include "windows/localhistory.h" #include "windows/localhistory.h"
#include "windows/window.h"
#include "windows/gui.h" #include "windows/gui.h"
static char **respaths; /** resource search path vector. */ static char **respaths; /** resource search path vector. */

File diff suppressed because it is too large Load Diff

View File

@ -79,5 +79,10 @@ struct gui_window {
*/ */
struct gui_window *nsws_get_gui_window(HWND hwnd); struct gui_window *nsws_get_gui_window(HWND hwnd);
void win32_window_set_scroll(struct gui_window *w, int sx, int sy);
nserror nsws_create_main_class(HINSTANCE hinstance);
extern struct gui_window_table *win32_window_table;
#endif /* _NETSURF_WINDOWS_WINDOW_H_ */ #endif /* _NETSURF_WINDOWS_WINDOW_H_ */