From 095154fa76336fad0763d9ae3516b0c31467f5db Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 9 Oct 2010 18:02:29 +0000 Subject: extend debug clean up sub window creation svn path=/trunk/netsurf/; revision=10875 --- windows/gui.c | 53 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 19 deletions(-) (limited to 'windows') diff --git a/windows/gui.c b/windows/gui.c index c9640ffbb..9eb30e780 100644 --- a/windows/gui.c +++ b/windows/gui.c @@ -679,11 +679,23 @@ static void nsws_drawable_paint(struct gui_window *gw, HWND hwnd) BeginPaint(hwnd, &ps); - if ((gw->bw != NULL) && (gw->bw->current_content != NULL)) { + if ((gw != NULL) && + (gw->bw != NULL) && + (gw->bw->current_content != NULL)) { /* set globals for the plotters */ current_hwnd = gw->drawingarea; current_gui = gw; + LOG(("x %f, y %f, w %d, h %d, left %d, top %d, right %d, bottom %d", + -gw->scrollx / gw->bw->scale, + -gw->scrolly / gw->bw->scale, + gw->width, + gw->height, + ps.rcPaint.left, + ps.rcPaint.top, + ps.rcPaint.right, + ps.rcPaint.bottom)); + content_redraw(gw->bw->current_content, -gw->scrollx / gw->bw->scale, -gw->scrolly / gw->bw->scale, @@ -695,6 +707,7 @@ static void nsws_drawable_paint(struct gui_window *gw, HWND hwnd) ps.rcPaint.bottom, gw->bw->scale, 0xFFFFFF); + LOG(("complete")); } EndPaint(hwnd, &ps); @@ -1435,13 +1448,13 @@ static void create_local_windows_classes(void) { /** * creation of status bar */ -static void nsws_window_statusbar_create(struct gui_window *w) +static HWND nsws_window_statusbar_create(struct gui_window *w) { HWND hwnd = CreateWindowEx(0, STATUSCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, w->main, (HMENU) NSWS_ID_STATUSBAR, hinstance, NULL); SendMessage(hwnd, SB_SETTEXT, 0, (LPARAM)"NetSurf"); - w->statusbar = hwnd; + return hwnd; } @@ -1468,30 +1481,32 @@ static HWND nsws_window_create(struct gui_window *gw) LOG(("creating window for hInstance %p", hinstance)); hwnd = CreateWindowEx(0, windowclassname_main, - "NetSurf Browser", - WS_OVERLAPPEDWINDOW | - WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CS_DBLCLKS, - CW_USEDEFAULT, - CW_USEDEFAULT, - gw->width, - gw->height, - NULL, - gw->mainmenu, - hinstance, - NULL); + "NetSurf Browser", + WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CS_DBLCLKS, + CW_USEDEFAULT, + CW_USEDEFAULT, + gw->width, + gw->height, + NULL, + gw->mainmenu, + hinstance, + NULL); if ((option_window_width >= 100) && (option_window_height >= 100) && (option_window_x >= 0) && - (option_window_y >= 0)) - SetWindowPos(hwnd, HWND_TOPMOST, option_window_x, - option_window_y, option_window_width, - option_window_height, SWP_SHOWWINDOW); + (option_window_y >= 0)) { + SetWindowPos(hwnd, HWND_TOPMOST, + option_window_x, option_window_y, + option_window_width, option_window_height, + SWP_SHOWWINDOW); + } nsws_window_set_accels(gw); nsws_window_set_ico(gw); + gw->toolbar = nsws_window_toolbar_create(gw, hwnd); - nsws_window_statusbar_create(gw); + gw->statusbar = nsws_window_statusbar_create(gw); return hwnd; } -- cgit v1.2.3