summaryrefslogtreecommitdiff
path: root/frontends/windows/localhistory.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-10-30 12:58:43 +0000
committerVincent Sanders <vince@kyllikki.org>2016-10-30 12:58:43 +0000
commita2388a91cf9ceb7efb203a7b4d6d250395cdb744 (patch)
tree12c969f54fd1b1a688dfe92bc94fde13ec6958d0 /frontends/windows/localhistory.c
parent3ecced92f335f80a372cf3fb0ab1c6f7c564cebb (diff)
downloadnetsurf-a2388a91cf9ceb7efb203a7b4d6d250395cdb744.tar.gz
netsurf-a2388a91cf9ceb7efb203a7b4d6d250395cdb744.tar.bz2
Rationalise the use of win32 application instance handle use
The use of the application instance handle global variable was inconsistent throughout the windows frontend. By rationalising the passing of these handles it showed that some of the toolbar and throbber parent handles were also setup wrong giving odd offset behaviour. All these issues have been addressed and the throbber is now in the correct position.
Diffstat (limited to 'frontends/windows/localhistory.c')
-rw-r--r--frontends/windows/localhistory.c43
1 files changed, 28 insertions, 15 deletions
diff --git a/frontends/windows/localhistory.c b/frontends/windows/localhistory.c
index ce1877f6f..15705d1ad 100644
--- a/frontends/windows/localhistory.c
+++ b/frontends/windows/localhistory.c
@@ -48,7 +48,9 @@ struct nsws_localhistory {
};
-static void nsws_localhistory_scroll_check(struct nsws_localhistory *l, struct gui_window *gw)
+static void
+nsws_localhistory_scroll_check(struct nsws_localhistory *l,
+ struct gui_window *gw)
{
SCROLLINFO si;
@@ -76,8 +78,8 @@ static void nsws_localhistory_scroll_check(struct nsws_localhistory *l, struct g
}
-
-static void nsws_localhistory_up(struct nsws_localhistory *l, struct gui_window *gw)
+static void
+nsws_localhistory_up(struct nsws_localhistory *l, struct gui_window *gw)
{
HDC tmp_hdc;
struct redraw_context ctx = {
@@ -114,6 +116,7 @@ void nsws_localhistory_close(struct gui_window *w)
CloseWindow(l->hwnd);
}
+
static LRESULT CALLBACK
nsws_localhistory_event_callback(HWND hwnd, UINT msg,
WPARAM wparam, LPARAM lparam)
@@ -297,6 +300,7 @@ nsws_localhistory_event_callback(HWND hwnd, UINT msg,
return 0;
}
+
/* exported method documented in windows/localhistory.h */
struct nsws_localhistory *nsws_window_create_localhistory(struct gui_window *gw)
{
@@ -347,23 +351,31 @@ struct nsws_localhistory *nsws_window_create_localhistory(struct gui_window *gw)
#endif
InitCommonControlsEx(&icc);
-
- LOG("creating local history window for hInstance %p", hInstance);
+ LOG("creating local history window for hInstance %p", hinst);
localhistory->hwnd = CreateWindow(windowclassname_localhistory,
- "NetSurf History",
- WS_THICKFRAME | WS_HSCROLL |
- WS_VSCROLL | WS_CLIPCHILDREN |
- WS_CLIPSIBLINGS | WS_SYSMENU | CS_DBLCLKS,
- r.left + margin/2,
- r.top + margin/2,
- localhistory->guiwidth,
- localhistory->guiheight,
- NULL, NULL, hInstance, NULL);
+ "NetSurf History",
+ WS_THICKFRAME |
+ WS_HSCROLL |
+ WS_VSCROLL |
+ WS_CLIPCHILDREN |
+ WS_CLIPSIBLINGS |
+ WS_SYSMENU |
+ CS_DBLCLKS,
+ r.left + margin/2,
+ r.top + margin/2,
+ localhistory->guiwidth,
+ localhistory->guiheight,
+ NULL,
+ NULL,
+ hinst,
+ NULL);
/* set the gui window associated with this browser */
SetProp(localhistory->hwnd, TEXT("GuiWnd"), (HANDLE)gw);
- LOG("gui_window %p width %d height %d hwnd %p", gw, localhistory->guiwidth, localhistory->guiheight, localhistory->hwnd);
+ LOG("gui_window %p width %d height %d hwnd %p",
+ gw, localhistory->guiwidth, localhistory->guiheight,
+ localhistory->hwnd);
nsws_localhistory_up(localhistory, gw);
UpdateWindow(localhistory->hwnd);
@@ -372,6 +384,7 @@ struct nsws_localhistory *nsws_window_create_localhistory(struct gui_window *gw)
return localhistory;
}
+
/* exported method documented in windows/localhistory.h */
nserror
nsws_create_localhistory_class(HINSTANCE hinstance) {