mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 12:12:35 +03:00
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:
parent
8b00dfcfbf
commit
a487f7e611
@ -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"
|
||||||
|
@ -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>
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
1682
windows/gui.c
1682
windows/gui.c
File diff suppressed because it is too large
Load Diff
@ -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
|
||||||
|
@ -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. */
|
||||||
|
1674
windows/window.c
1674
windows/window.c
File diff suppressed because it is too large
Load Diff
@ -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_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user