r10881 jmb - in /trunk/netsurf/render: html.c html.h
by netsurf@semichrome.net
Author: jmb
Date: Mon Oct 11 01:54:37 2010
New Revision: 10881
URL: http://source.netsurf-browser.org?rev=10881&view=rev
Log:
Fix crash when top-level content is not HTML and there is a fragment identifier in the URL.
Constify.
Modified:
trunk/netsurf/render/html.c
trunk/netsurf/render/html.h
Modified: trunk/netsurf/render/html.c
URL: http://source.netsurf-browser.org/trunk/netsurf/render/html.c?rev=10881&r...
==============================================================================
--- trunk/netsurf/render/html.c (original)
+++ trunk/netsurf/render/html.c Mon Oct 11 01:54:37 2010
@@ -2220,13 +2220,15 @@
* \param y Updated to global y coord iff id found
* \return true iff id found
*/
-bool html_get_id_offset(hlcache_handle *h, char *frag_id, int *x, int *y)
+bool html_get_id_offset(hlcache_handle *h, const char *frag_id, int *x, int *y)
{
struct box *pos;
- struct box *layout = html_get_box_tree(h);
+ struct box *layout;
if (content_get_type(h) != CONTENT_HTML)
return false;
+
+ layout = html_get_box_tree(h);
if ((pos = box_find_by_id(layout, frag_id)) != 0) {
box_coords(pos, x, y);
Modified: trunk/netsurf/render/html.h
URL: http://source.netsurf-browser.org/trunk/netsurf/render/html.h?rev=10881&r...
==============================================================================
--- trunk/netsurf/render/html.h (original)
+++ trunk/netsurf/render/html.h Mon Oct 11 01:54:37 2010
@@ -247,7 +247,7 @@
struct content_html_object *html_get_objects(struct hlcache_handle *h,
unsigned int *n);
struct hlcache_handle *html_get_favicon(struct hlcache_handle *h);
-bool html_get_id_offset(struct hlcache_handle *h, char *frag_id,
+bool html_get_id_offset(struct hlcache_handle *h, const char *frag_id,
int *x, int *y);
#endif
12 years, 7 months
r10880 vince - in /trunk/netsurf: Makefile.sources windows/gui.c windows/localhistory.c windows/plot.c windows/plot.h windows/thumbnail.c windows/windbg.c windows/windbg.h
by netsurf@semichrome.net
Author: vince
Date: Sun Oct 10 17:42:24 2010
New Revision: 10880
URL: http://source.netsurf-browser.org?rev=10880&view=rev
Log:
make windows frontend build and run again
Fix redraw bugs
Still major issue with frames
Added:
trunk/netsurf/windows/windbg.c
trunk/netsurf/windows/windbg.h
Modified:
trunk/netsurf/Makefile.sources
trunk/netsurf/windows/gui.c
trunk/netsurf/windows/localhistory.c
trunk/netsurf/windows/plot.c
trunk/netsurf/windows/plot.h
trunk/netsurf/windows/thumbnail.c
Modified: trunk/netsurf/Makefile.sources
URL: http://source.netsurf-browser.org/trunk/netsurf/Makefile.sources?rev=1088...
==============================================================================
--- trunk/netsurf/Makefile.sources (original)
+++ trunk/netsurf/Makefile.sources Sun Oct 10 17:42:24 2010
@@ -72,7 +72,7 @@
# S_WINDOWS are sources purely for the windows build
S_WINDOWS := about.c bitmap.c download.c filetype.c findfile.c font.c \
gui.c localhistory.c login.c misc.c plot.c prefs.c schedule.c \
- thumbnail.c tree.c
+ thumbnail.c tree.c windbg.c
S_WINDOWS := $(addprefix windows/,$(S_WINDOWS))
# S_BEOS are sources purely for the BeOS build
Modified: trunk/netsurf/windows/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/gui.c?rev=10880&r...
==============================================================================
--- trunk/netsurf/windows/gui.c (original)
+++ trunk/netsurf/windows/gui.c Sun Oct 10 17:42:24 2010
@@ -60,6 +60,8 @@
#include "windows/resourceid.h"
#include "windows/schedule.h"
+#include "windbg.h"
+
char *default_stylesheet_url;
char *adblock_stylesheet_url;
char *quirks_stylesheet_url;
@@ -86,6 +88,7 @@
/* The front's private data connected to a browser window */
/* currently 1<->1 gui_window<->windows window [non-tabbed] */
struct browser_window *bw; /** the browser_window */
+
HWND main; /**< handle to the actual window */
HWND toolbar; /**< toolbar handle */
HWND urlbar; /**< url bar handle */
@@ -94,6 +97,7 @@
HWND statusbar; /**< status bar handle */
HWND vscroll; /**< vertical scrollbar handle */
HWND hscroll; /**< horizontal scrollbar handle */
+
HMENU mainmenu; /**< the main menu */
HMENU rclick; /**< the right-click menu */
struct nsws_localhistory *localhistory; /**< handle to local history window */
@@ -157,8 +161,9 @@
if (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE) != 0) {
if (!((current_gui == NULL) ||
(TranslateAccelerator(current_gui->main,
- current_gui->acceltable, &Msg))))
+ current_gui->acceltable, &Msg)))) {
TranslateMessage(&Msg);
+ }
DispatchMessage(&Msg);
}
@@ -171,14 +176,11 @@
/**
* callback for url bar events
*/
-LRESULT CALLBACK
+LRESULT CALLBACK
nsws_window_url_callback(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
DWORD i, ii;
SendMessage(hwnd, EM_GETSEL, (WPARAM)&i, (LPARAM)&ii);
- int x,y;
- x = GET_X_LPARAM(lparam);
- y = GET_Y_LPARAM(lparam);
if (msg == WM_PAINT) {
SendMessage(hwnd, EM_SETSEL, (WPARAM)0, (LPARAM)-1);
@@ -189,7 +191,13 @@
/* calculate the dimensions of the url bar relative to the parent toolbar */
static void
-urlbar_dimensions(HWND hWndParent, int toolbuttonsize, int buttonc, int *x, int *y, int *width, int *height)
+urlbar_dimensions(HWND hWndParent,
+ int toolbuttonsize,
+ int buttonc,
+ int *x,
+ int *y,
+ int *width,
+ int *height)
{
RECT rc;
const int cy_edit = 24;
@@ -217,12 +225,14 @@
}
if (gw == NULL) {
- /* unable to fetch from property, try seraching the
+ /* unable to fetch from property, try searching the
* gui window list
*/
gw = window_list;
while (gw != NULL) {
- if ((gw->main == hwnd) || (gw->toolbar == hwnd)) {
+ if ((gw->main == hwnd) ||
+ (gw->drawingarea == hwnd) ||
+ (gw->toolbar == hwnd)) {
break;
}
gw = gw->next;
@@ -241,14 +251,19 @@
struct gui_window *gw;
int urlx, urly, urlwidth, urlheight;
- switch (msg) {
- case WM_SIZE:
+ if (msg == WM_SIZE) {
gw = nsws_get_gui_window(hwnd);
- urlbar_dimensions(hwnd, gw->toolbuttonsize, gw->toolbuttonc, &urlx, &urly, &urlwidth, &urlheight);
+
+ urlbar_dimensions(hwnd,
+ gw->toolbuttonsize,
+ gw->toolbuttonc,
+ &urlx, &urly, &urlwidth, &urlheight);
+
/* resize url */
if (gw->urlbar != NULL) {
MoveWindow(gw->urlbar, urlx, urly, urlwidth, urlheight, true);
}
+
/* move throbber */
if (gw->throbber != NULL) {
MoveWindow(gw->throbber,
@@ -257,7 +272,6 @@
true);
}
- break;
}
/* chain to the next handler */
@@ -271,8 +285,10 @@
{
if (w->bw == NULL)
return;
+
bool forward = history_forward_available(w->bw->history);
bool back = history_back_available(w->bw->history);
+
if (w->mainmenu != NULL) {
EnableMenuItem(w->mainmenu, NSWS_ID_NAV_FORWARD,
(forward ? MF_ENABLED : MF_GRAYED));
@@ -283,6 +299,7 @@
EnableMenuItem(w->rclick, NSWS_ID_NAV_BACK,
(back ? MF_ENABLED : MF_GRAYED));
}
+
if (w->toolbar != NULL) {
SendMessage(w->toolbar, TB_SETSTATE,
(WPARAM) NSWS_ID_NAV_FORWARD,
@@ -300,8 +317,7 @@
bool paste, copy, del;
if (GetFocus() == w->urlbar) {
DWORD i, ii;
- SendMessage(w->urlbar, EM_GETSEL, (WPARAM)&i,
- (LPARAM)&ii);
+ SendMessage(w->urlbar, EM_GETSEL, (WPARAM)&i, (LPARAM)&ii);
paste = true;
copy = (i != ii);
del = (i != ii);
@@ -324,16 +340,13 @@
NSWS_ID_EDIT_PASTE,
(paste ? MF_ENABLED : MF_GRAYED));
-
EnableMenuItem(w->mainmenu,
NSWS_ID_EDIT_COPY,
(copy ? MF_ENABLED : MF_GRAYED));
-
EnableMenuItem(w->rclick,
NSWS_ID_EDIT_COPY,
(copy ? MF_ENABLED : MF_GRAYED));
-
if (del == true) {
EnableMenuItem(w->mainmenu, NSWS_ID_EDIT_CUT, MF_ENABLED);
@@ -426,14 +439,17 @@
static void nsws_window_set_ico(struct gui_window *w)
{
char ico[PATH_MAX];
+
nsws_find_resource(ico, "NetSurf32.ico", "windows/res/NetSurf32.ico");
LOG(("setting ico as %s", ico));
hIcon = LoadImage(NULL, ico, IMAGE_ICON, 32, 32, LR_LOADFROMFILE);
+
if (hIcon != NULL)
SendMessage(w->main, WM_SETICON, ICON_BIG, (LPARAM) hIcon);
nsws_find_resource(ico, "NetSurf16.ico", "windows/res/NetSurf16.ico");
LOG(("setting ico as %s", ico));
hIconS = LoadImage(NULL, ico, IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
+
if (hIconS != NULL)
SendMessage(w->main, WM_SETICON, ICON_SMALL, (LPARAM)hIconS);
}
@@ -470,13 +486,13 @@
w->throbber = hwnd;
}
-static HIMAGELIST
+static HIMAGELIST
nsws_set_imagelist(HWND hwnd, UINT msg, int resid, int bsize, int bcnt)
{
HIMAGELIST hImageList;
HBITMAP hScrBM;
- hImageList = ImageList_Create(bsize, bsize, ILC_COLOR24 |ILC_MASK, 0, bcnt);
+ hImageList = ImageList_Create(bsize, bsize, ILC_COLOR24 | ILC_MASK, 0, bcnt);
hScrBM = LoadImage(hinstance, MAKEINTRESOURCE(resid),
IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
ImageList_AddMasked(hImageList, hScrBM, 0xcccccc);
@@ -487,7 +503,7 @@
}
static HWND
-nsws_window_toolbar_create(struct gui_window *gw, HWND hWndParent)
+nsws_window_toolbar_create(struct gui_window *gw)
{
HWND hWndToolbar;
/* Toolbar buttons */
@@ -498,6 +514,7 @@
{3, NSWS_ID_NAV_RELOAD, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
{4, NSWS_ID_NAV_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
};
+ HWND hWndParent = gw->main;
/* Create the toolbar child window. */
hWndToolbar = CreateWindowEx(0, TOOLBARCLASSNAME, "Toolbar",
@@ -572,22 +589,36 @@
(gw->bw == NULL))
return 0;
- if ((gw->mouse->state & BROWSER_MOUSE_PRESS_1) != 0) {
- browser_window_mouse_click(gw->bw, BROWSER_MOUSE_DRAG_1,
- gw->mouse->pressed_x,
- gw->mouse->pressed_y);
- gw->mouse->state &= ~BROWSER_MOUSE_PRESS_1;
- gw->mouse->state |= BROWSER_MOUSE_HOLDING_1 |
- BROWSER_MOUSE_DRAG_ON;
- }
- else if ((gw->mouse->state & BROWSER_MOUSE_PRESS_2) != 0) {
- browser_window_mouse_click(gw->bw, BROWSER_MOUSE_DRAG_2,
- gw->mouse->pressed_x,
- gw->mouse->pressed_y);
- gw->mouse->state &= ~BROWSER_MOUSE_PRESS_2;
- gw->mouse->state |= BROWSER_MOUSE_HOLDING_2 |
- BROWSER_MOUSE_DRAG_ON;
- }
+ /* scale co-ordinates */
+ x = (x + gw->scrollx) / gw->bw->scale;
+ y = (y + gw->scrolly) / gw->bw->scale;
+
+ /* if mouse button held down and pointer moved more than
+ * minimum distance drag is happening */
+ if (((gw->mouse->state & (BROWSER_MOUSE_PRESS_1 | BROWSER_MOUSE_PRESS_2)) != 0) &&
+ (abs(x - gw->mouse->pressed_x) >= 5) &&
+ (abs(y - gw->mouse->pressed_y) >= 5)) {
+
+ LOG(("Drag start state 0x%x", gw->mouse->state));
+
+ if ((gw->mouse->state & BROWSER_MOUSE_PRESS_1) != 0) {
+ browser_window_mouse_click(gw->bw, BROWSER_MOUSE_DRAG_1,
+ gw->mouse->pressed_x,
+ gw->mouse->pressed_y);
+ gw->mouse->state &= ~BROWSER_MOUSE_PRESS_1;
+ gw->mouse->state |= BROWSER_MOUSE_HOLDING_1 |
+ BROWSER_MOUSE_DRAG_ON;
+ }
+ else if ((gw->mouse->state & BROWSER_MOUSE_PRESS_2) != 0) {
+ browser_window_mouse_click(gw->bw, BROWSER_MOUSE_DRAG_2,
+ gw->mouse->pressed_x,
+ gw->mouse->pressed_y);
+ gw->mouse->state &= ~BROWSER_MOUSE_PRESS_2;
+ gw->mouse->state |= BROWSER_MOUSE_HOLDING_2 |
+ BROWSER_MOUSE_DRAG_ON;
+ }
+ }
+
if (((gw->mouse->state & BROWSER_MOUSE_MOD_1) != 0) && !shift)
gw->mouse->state &= ~BROWSER_MOUSE_MOD_1;
if (((gw->mouse->state & BROWSER_MOUSE_MOD_2) != 0) && !ctrl)
@@ -595,14 +626,16 @@
if (((gw->mouse->state & BROWSER_MOUSE_MOD_3) != 0) && !alt)
gw->mouse->state &= ~BROWSER_MOUSE_MOD_3;
- browser_window_mouse_track(gw->bw, gw->mouse->state,
- (x + gw->scrollx) / gw->bw->scale,
- (y + gw->scrolly) / gw->bw->scale);
+
+ browser_window_mouse_track(gw->bw, gw->mouse->state, x, y);
return 0;
}
-static LRESULT nsws_drawable_mousedown(struct gui_window *gw, int x, int y, browser_mouse_state button)
+static LRESULT
+nsws_drawable_mousedown(struct gui_window *gw,
+ int x, int y,
+ browser_mouse_state button)
{
if ((gw == NULL) ||
(gw->mouse == NULL) ||
@@ -622,6 +655,11 @@
gw->mouse->pressed_x = (x + gw->scrollx) / gw->bw->scale;
gw->mouse->pressed_y = (y + gw->scrolly) / gw->bw->scale;
+ LOG(("mouse click bw %p, state %x, x %f, y %f",gw->bw,
+ gw->mouse->state,
+ (x + gw->scrollx) / gw->bw->scale,
+ (y + gw->scrolly) / gw->bw->scale));
+
browser_window_mouse_click(gw->bw, gw->mouse->state,
(x + gw->scrollx) / gw->bw->scale ,
(y + gw->scrolly) / gw->bw->scale);
@@ -645,7 +683,7 @@
(gw->bw == NULL))
return 0;
-
+ LOG(("state 0x%x, press 0x%x", gw->mouse->state, press));
if ((gw->mouse->state & press) != 0) {
gw->mouse->state &= ~press;
gw->mouse->state |= click;
@@ -658,69 +696,71 @@
if (((gw->mouse->state & BROWSER_MOUSE_MOD_3) != 0) && !alt)
gw->mouse->state &= ~BROWSER_MOUSE_MOD_3;
- if ((gw->mouse->state & click) != 0)
+ if ((gw->mouse->state & click) != 0) {
+ LOG(("mouse click bw %p, state 0x%x, x %f, y %f",gw->bw,
+ gw->mouse->state,
+ (x + gw->scrollx) / gw->bw->scale,
+ (y + gw->scrolly) / gw->bw->scale));
+
browser_window_mouse_click(gw->bw,
gw->mouse->state,
(x + gw->scrollx) / gw->bw->scale,
(y + gw->scrolly) / gw->bw->scale);
- else
+ } else {
browser_window_mouse_drag_end(gw->bw,
0,
(x + gw->scrollx) / gw->bw->scale,
(y + gw->scrolly) / gw->bw->scale);
+ }
gw->mouse->state = 0;
return 0;
}
-static void nsws_drawable_paint(struct gui_window *gw, HWND hwnd)
+static LRESULT
+nsws_drawable_paint(struct gui_window *gw, HWND hwnd)
{
PAINTSTRUCT ps;
BeginPaint(hwnd, &ps);
- if ((gw != NULL) &&
- (gw->bw != 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,
+ content_redraw(gw->bw->current_content,
-gw->scrollx / gw->bw->scale,
-gw->scrolly / gw->bw->scale,
- gw->width,
+ gw->width,
gw->height,
ps.rcPaint.left,
ps.rcPaint.top,
ps.rcPaint.right,
ps.rcPaint.bottom,
- gw->bw->scale,
+ gw->bw->scale,
0xFFFFFF);
- LOG(("complete"));
+
}
EndPaint(hwnd, &ps);
-}
-
-static void
+
+ return 0;
+}
+
+static LRESULT
nsws_drawable_hscroll(struct gui_window *gw, HWND hwnd, WPARAM wparam)
{
- LOG(("HSCROLL!"));
- if (gw->requestscrollx != 0)
- return;
SCROLLINFO si;
int mem;
+
+ LOG(("HSCROLL %d", gw->requestscrollx));
+
+ if (gw->requestscrollx != 0)
+ return 0;
+
si.cbSize = sizeof(si);
si.fMask = SIF_ALL;
GetScrollInfo(hwnd, SB_HORZ, &si);
@@ -749,27 +789,38 @@
default:
break;
}
+
si.fMask = SIF_POS;
- if ((gw->bw != NULL) && (gw->bw->current_content != NULL))
+
+ if ((gw->bw != NULL) &&
+ (gw->bw->current_content != NULL)) {
si.nPos = MIN(si.nPos,
content_get_width(gw->bw->current_content) *
gw->bw->scale - gw->width);
+ }
si.nPos = MAX(si.nPos, 0);
SetScrollInfo(hwnd, SB_HORZ, &si, TRUE);
GetScrollInfo(hwnd, SB_HORZ, &si);
if (si.nPos != mem) {
- gui_window_set_scroll(gw, gw->scrollx + gw->requestscrollx + si.nPos - mem, gw->scrolly);
- }
-}
-
-static void
+ gui_window_set_scroll(gw,
+ gw->scrollx + gw->requestscrollx + si.nPos - mem,
+ gw->scrolly);
+ }
+
+ return 0;
+}
+
+static LRESULT
nsws_drawable_vscroll(struct gui_window *gw, HWND hwnd, WPARAM wparam)
{
- LOG(("VSCROLL!"));
- if (gw->requestscrolly != 0)
- return;
SCROLLINFO si;
int mem;
+
+ LOG(("VSCROLL %d", gw->requestscrolly));
+
+ if (gw->requestscrolly != 0)
+ return 0;
+
si.cbSize = sizeof(si);
si.fMask = SIF_ALL;
GetScrollInfo(hwnd, SB_VERT, &si);
@@ -807,7 +858,7 @@
break;
}
si.fMask = SIF_POS;
- if ((gw->bw != NULL) &&
+ if ((gw->bw != NULL) &&
(gw->bw->current_content != NULL)) {
si.nPos = MIN(si.nPos,
content_get_height(gw->bw->current_content) *
@@ -820,12 +871,15 @@
gui_window_set_scroll(gw, gw->scrollx, gw->scrolly +
gw->requestscrolly + si.nPos - mem);
}
-}
-
-static void nsws_drawable_key(struct gui_window *gw, HWND hwnd, WPARAM wparam)
+
+ return 0;
+}
+
+static LRESULT
+nsws_drawable_key(struct gui_window *gw, HWND hwnd, WPARAM wparam)
{
if (GetFocus() != hwnd)
- return;
+ return 0 ;
uint32_t i;
bool shift = ((GetKeyState(VK_SHIFT) & 0x8000) == 0x8000);
@@ -903,9 +957,10 @@
if (gw != NULL)
browser_window_key_press(gw->bw, i);
-}
-
-static DWORD
+ return 0;
+}
+
+static LRESULT
nsws_drawable_wheel(struct gui_window *gw, HWND hwnd, WPARAM wparam)
{
int i, z = GET_WHEEL_DELTA_WPARAM(wparam) / WHEEL_DELTA;
@@ -921,38 +976,42 @@
z = (z < 0) ? -1 * z : z;
for (i = 0; i < z; i++)
SendMessage(hwnd, newmessage, MAKELONG(command, 0), 0);
+
return 0;
}
-static DWORD
+static LRESULT
nsws_drawable_resize(struct gui_window *gw)
{
browser_window_reformat(gw->bw, gw->width, gw->height);
return 0;
}
+
/* Called when activity occours within the drawable window. */
-LRESULT CALLBACK nsws_window_drawable_event_callback(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
-{
- struct gui_window *gw = window_list;
-
- while (gw != NULL) {
- if (gw->drawingarea == hwnd) {
- break;
- }
- gw = gw->next;
- }
-
- if (gw == NULL)
+LRESULT CALLBACK
+nsws_window_drawable_event_callback(HWND hwnd,
+ UINT msg,
+ WPARAM wparam,
+ LPARAM lparam)
+{
+ struct gui_window *gw;
+
+ gw = nsws_get_gui_window(hwnd);
+
+ LOG(("%s, hwnd %p, gw %p", msg_num_to_name(msg), hwnd, gw));
+
+ if (gw == NULL) {
+ LOG(("Unable to find gui window structure for hwnd %p", hwnd));
return DefWindowProc(hwnd, msg, wparam, lparam);
+ }
switch(msg) {
case WM_MOUSEMOVE:
- nsws_drawable_mousemove(gw,
- GET_X_LPARAM(lparam),
- GET_Y_LPARAM(lparam));
- break;
+ return nsws_drawable_mousemove(gw,
+ GET_X_LPARAM(lparam),
+ GET_Y_LPARAM(lparam));
case WM_LBUTTONDOWN:
nsws_drawable_mousedown(gw,
@@ -961,6 +1020,7 @@
BROWSER_MOUSE_PRESS_1);
SetFocus(hwnd);
nsws_localhistory_close(gw);
+ return 0;
break;
case WM_RBUTTONDOWN:
@@ -969,70 +1029,65 @@
GET_Y_LPARAM(lparam),
BROWSER_MOUSE_PRESS_2);
SetFocus(hwnd);
+ return 0;
break;
case WM_LBUTTONUP:
- nsws_drawable_mouseup(gw,
- GET_X_LPARAM(lparam),
- GET_Y_LPARAM(lparam),
- BROWSER_MOUSE_PRESS_1,
- BROWSER_MOUSE_CLICK_1);
- break;
+ return nsws_drawable_mouseup(gw,
+ GET_X_LPARAM(lparam),
+ GET_Y_LPARAM(lparam),
+ BROWSER_MOUSE_PRESS_1,
+ BROWSER_MOUSE_CLICK_1);
case WM_RBUTTONUP:
- nsws_drawable_mouseup(gw,
- GET_X_LPARAM(lparam),
- GET_Y_LPARAM(lparam),
- BROWSER_MOUSE_PRESS_2,
- BROWSER_MOUSE_CLICK_2);
- break;
-
- case WM_ERASEBKGND:
+ return nsws_drawable_mouseup(gw,
+ GET_X_LPARAM(lparam),
+ GET_Y_LPARAM(lparam),
+ BROWSER_MOUSE_PRESS_2,
+ BROWSER_MOUSE_CLICK_2);
+
+ case WM_ERASEBKGND: /* ignore as drawable window is redrawn on paint */
return 0;
- case WM_PAINT:
- nsws_drawable_paint(gw, hwnd);
- break;
+ case WM_PAINT: /* redraw the exposed part of the window */
+ return nsws_drawable_paint(gw, hwnd);
case WM_KEYDOWN:
- nsws_drawable_key(gw, hwnd, wparam);
- break;
+ return nsws_drawable_key(gw, hwnd, wparam);
case WM_SIZE:
- nsws_drawable_resize(gw);
- break;
+ return nsws_drawable_resize(gw);
case WM_HSCROLL:
- nsws_drawable_hscroll(gw, hwnd, wparam);
- break;
+ return nsws_drawable_hscroll(gw, hwnd, wparam);
case WM_VSCROLL:
- nsws_drawable_vscroll(gw, hwnd, wparam);
- break;
+ return nsws_drawable_vscroll(gw, hwnd, wparam);
case WM_MOUSEWHEEL:
return nsws_drawable_wheel(gw, hwnd, wparam);
- default:
- break;
- }
-
+ }
return DefWindowProc(hwnd, msg, wparam, lparam);
}
-static void
+static LRESULT
nsws_window_resize(struct gui_window *w,
HWND hwnd,
WPARAM wparam,
LPARAM lparam)
{
+ int x, y;
+ RECT rmain, rstatus, rtool;
+
if ((w->toolbar == NULL) ||
(w->urlbar == NULL) ||
(w->statusbar == NULL))
- return;
-
- int x, y;
- RECT rmain, rstatus, rtool;
+ return 0;
+
+ SendMessage(w->statusbar, WM_SIZE, wparam, lparam);
+ SendMessage(w->toolbar, WM_SIZE, wparam, lparam);
+
GetClientRect(hwnd, &rmain);
GetClientRect(w->toolbar, &rtool);
GetWindowRect(w->statusbar, &rstatus);
@@ -1052,60 +1107,335 @@
gui_window_set_scroll(w, x, y);
- if (w->toolbar != NULL)
+ if (w->toolbar != NULL) {
SendMessage(w->toolbar, TB_SETSTATE,
(WPARAM) NSWS_ID_NAV_STOP,
MAKELONG(TBSTATE_INDETERMINATE, 0));
-
+ }
+
+ return 0;
+}
+
+static LRESULT
+nsws_window_command(struct gui_window *gw,
+ int notification_code,
+ int identifier,
+ HWND ctrl_window)
+{
+
+ switch(identifier) {
+
+ case NSWS_ID_FILE_QUIT:
+ {
+ struct gui_window *w;
+ w = window_list;
+ while (w != NULL) {
+ browser_window_destroy(w->bw);
+ w = w->next;
+ }
+ netsurf_quit = true;
+ break;
+ }
+
+ case NSWS_ID_FILE_OPEN_LOCATION:
+ SetFocus(gw->urlbar);
+ break;
+
+ case NSWS_ID_FILE_OPEN_WINDOW:
+ browser_window_create(NULL, gw->bw, NULL, false, false);
+ break;
+
+ case NSWS_ID_FILE_CLOSE_WINDOW:
+ PostMessage(gw->main, WM_CLOSE, 0, 0);
+ break;
+
+ case NSWS_ID_FILE_SAVE_PAGE:
+ break;
+
+ case NSWS_ID_FILE_SAVEAS_TEXT:
+ break;
+
+ case NSWS_ID_FILE_SAVEAS_PDF:
+ break;
+
+ case NSWS_ID_FILE_SAVEAS_DRAWFILE:
+ break;
+
+ case NSWS_ID_FILE_SAVEAS_POSTSCRIPT:
+ break;
+
+ case NSWS_ID_FILE_PRINT_PREVIEW:
+ break;
+
+ case NSWS_ID_FILE_PRINT:
+ break;
+
+ case NSWS_ID_EDIT_CUT:
+ OpenClipboard(gw->main);
+ EmptyClipboard();
+ CloseClipboard();
+ if (GetFocus() == gw->urlbar) {
+ SendMessage(gw->urlbar, WM_CUT, 0, 0);
+ } else if (gw->bw != NULL) {
+ browser_window_key_press(gw->bw, KEY_CUT_SELECTION);
+ }
+ break;
+
+ case NSWS_ID_EDIT_COPY:
+ OpenClipboard(gw->main);
+ EmptyClipboard();
+ CloseClipboard();
+ if (GetFocus() == gw->urlbar) {
+ SendMessage(gw->urlbar, WM_COPY, 0, 0);
+ } else if (gw->bw != NULL) {
+ gui_copy_to_clipboard(gw->bw->sel);
+ }
+ break;
+
+ case NSWS_ID_EDIT_PASTE: {
+ OpenClipboard(gw->main);
+ HANDLE h = GetClipboardData(CF_TEXT);
+ if (h != NULL) {
+ char *content = GlobalLock(h);
+ LOG(("pasting %s\n", content));
+ GlobalUnlock(h);
+ }
+ CloseClipboard();
+ if (GetFocus() == gw->urlbar)
+ SendMessage(gw->urlbar, WM_PASTE, 0, 0);
+ else
+ gui_paste_from_clipboard(gw, 0, 0);
+ break;
+ }
+
+ case NSWS_ID_EDIT_DELETE:
+ if (GetFocus() == gw->urlbar)
+ SendMessage(gw->urlbar, WM_CUT, 0, 0);
+ else
+ browser_window_key_press(gw->bw, KEY_DELETE_RIGHT);
+ break;
+
+ case NSWS_ID_EDIT_SELECT_ALL:
+ if (GetFocus() == gw->urlbar)
+ SendMessage(gw->urlbar, EM_SETSEL, 0, -1);
+ else
+ selection_select_all(gw->bw->sel);
+ break;
+
+ case NSWS_ID_EDIT_SEARCH:
+ break;
+
+ case NSWS_ID_EDIT_PREFERENCES:
+ nsws_prefs_dialog_init(gw->main);
+ break;
+
+ case NSWS_ID_NAV_BACK:
+ if ((gw->bw != NULL) &&
+ (history_back_available(gw->bw->history))) {
+ history_back(gw->bw, gw->bw->history);
+ }
+ nsws_window_update_forward_back(gw);
+ break;
+
+ case NSWS_ID_NAV_FORWARD:
+ if ((gw->bw != NULL) &&
+ (history_forward_available(gw->bw->history))) {
+ history_forward(gw->bw, gw->bw->history);
+ }
+ nsws_window_update_forward_back(gw);
+ break;
+
+ case NSWS_ID_NAV_HOME:
+ browser_window_go(gw->bw, default_page, 0, true);
+ break;
+
+ case NSWS_ID_NAV_STOP:
+ browser_window_stop(gw->bw);
+ break;
+
+ case NSWS_ID_NAV_RELOAD:
+ browser_window_reload(gw->bw, true);
+ break;
+
+ case NSWS_ID_NAV_LOCALHISTORY:
+ nsws_localhistory_init(gw);
+ break;
+
+ case NSWS_ID_NAV_GLOBALHISTORY:
+ break;
+
+ case NSWS_ID_VIEW_ZOOMPLUS: {
+ int x, y;
+ gui_window_get_scroll(gw, &x, &y);
+ if (gw->bw != NULL) {
+ browser_window_set_scale(gw->bw, gw->bw->scale * 1.1, true);
+ browser_window_reformat(gw->bw, gw->width, gw->height);
+ }
+ gui_window_redraw_window(gw);
+ gui_window_set_scroll(gw, x, y);
+ break;
+ }
+
+ case NSWS_ID_VIEW_ZOOMMINUS: {
+ int x, y;
+ gui_window_get_scroll(gw, &x, &y);
+ if (gw->bw != NULL) {
+ browser_window_set_scale(gw->bw,
+ gw->bw->scale * 0.9, true);
+ browser_window_reformat(gw->bw, gw->width, gw->height);
+ }
+ gui_window_redraw_window(gw);
+ gui_window_set_scroll(gw, x, y);
+ break;
+ }
+
+ case NSWS_ID_VIEW_ZOOMNORMAL: {
+ int x, y;
+ gui_window_get_scroll(gw, &x, &y);
+ if (gw->bw != NULL) {
+ browser_window_set_scale(gw->bw, 1.0, true);
+ browser_window_reformat(gw->bw, gw->width, gw->height);
+ }
+ gui_window_redraw_window(gw);
+ gui_window_set_scroll(gw, x, y);
+ break;
+ }
+
+ case NSWS_ID_VIEW_SOURCE:
+ break;
+
+ case NSWS_ID_VIEW_SAVE_WIN_METRICS: {
+ RECT r;
+ GetWindowRect(gw->main, &r);
+ option_window_x = r.left;
+ option_window_y = r.top;
+ option_window_width = r.right - r.left;
+ option_window_height = r.bottom - r.top;
+ options_write(options_file_location);
+ break;
+ }
+
+ case NSWS_ID_VIEW_FULLSCREEN: {
+ RECT rdesk;
+ if (gw->fullscreen == NULL) {
+ HWND desktop = GetDesktopWindow();
+ gw->fullscreen = malloc(sizeof(RECT));
+ if ((desktop == NULL) ||
+ (gw->fullscreen == NULL)) {
+ warn_user("NoMemory", 0);
+ break;
+ }
+ GetWindowRect(desktop, &rdesk);
+ GetWindowRect(gw->main, gw->fullscreen);
+ DeleteObject(desktop);
+ SetWindowLong(gw->main, GWL_STYLE, 0);
+ SetWindowPos(gw->main, HWND_TOPMOST, 0, 0,
+ rdesk.right - rdesk.left,
+ rdesk.bottom - rdesk.top,
+ SWP_SHOWWINDOW);
+ } else {
+ SetWindowLong(gw->main, GWL_STYLE,
+ WS_OVERLAPPEDWINDOW |
+ WS_HSCROLL | WS_VSCROLL |
+ WS_CLIPCHILDREN |
+ WS_CLIPSIBLINGS | CS_DBLCLKS);
+ SetWindowPos(gw->main, HWND_TOPMOST,
+ gw->fullscreen->left,
+ gw->fullscreen->top,
+ gw->fullscreen->right -
+ gw->fullscreen->left,
+ gw->fullscreen->bottom -
+ gw->fullscreen->top,
+ SWP_SHOWWINDOW | SWP_FRAMECHANGED);
+ free(gw->fullscreen);
+ gw->fullscreen = NULL;
+ }
+ break;
+ }
+
+ case NSWS_ID_VIEW_DOWNLOADS:
+ break;
+
+ case NSWS_ID_VIEW_TOGGLE_DEBUG_RENDERING:
+ html_redraw_debug = !html_redraw_debug;
+ if (gw->bw != NULL) {
+ browser_window_reformat(gw->bw, gw->width, gw->height);
+ }
+ break;
+
+ case NSWS_ID_VIEW_DEBUGGING_SAVE_BOXTREE:
+ break;
+
+ case NSWS_ID_VIEW_DEBUGGING_SAVE_DOMTREE:
+ break;
+
+ case NSWS_ID_HELP_CONTENTS:
+ break;
+
+ case NSWS_ID_HELP_GUIDE:
+ break;
+
+ case NSWS_ID_HELP_INFO:
+ break;
+
+ case NSWS_ID_HELP_ABOUT:
+ nsws_about_dialog_init(hinstance, gw->main);
+ break;
+
+ case NSWS_ID_LAUNCH_URL:
+ {
+ if (GetFocus() != gw->urlbar)
+ break;
+ int len = SendMessage(gw->urlbar, WM_GETTEXTLENGTH, 0, 0);
+ char addr[len + 1];
+ SendMessage(gw->urlbar, WM_GETTEXT, (WPARAM)(len + 1), (LPARAM)addr);
+ LOG(("launching %s\n", addr));
+ browser_window_go(gw->bw, addr, 0, true);
+ break;
+ }
+
+ case NSWS_ID_URLBAR:
+ break;
+
+ default:
+ break;
+ }
+ return 0; /* control message handled */
}
/**
* callback for window events generally
*/
-LRESULT CALLBACK nsws_window_event_callback(HWND hwnd, UINT msg, WPARAM wparam,
- LPARAM lparam)
+LRESULT CALLBACK
+nsws_window_event_callback(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
bool match = false;
bool historyactive = false;
- struct gui_window *w = window_list;
- while (w != NULL) {
- if (w->main == hwnd) {
- match = true;
- break;
- }
- w = w->next;
- }
- if (!match) { /* during initial window creation */
- w = window_list;
- while (w != NULL) {
- if (w->main == NULL) {
- w->main = hwnd;
- break;
- }
- w = w->next;
- }
- }
- if ((match) && (current_gui == NULL)) {
- /* local history window is active */
- if ((msg == WM_LBUTTONDOWN) || (msg == WM_PAINT))
- historyactive = true;
- else if ((msg == WM_NCHITTEST) || (msg == WM_SETCURSOR))
- return DefWindowProc(hwnd, msg, wparam, lparam);
- else
- return 0;
- }
- current_gui = w;
+ struct gui_window *gw;
+
+ gw = nsws_get_gui_window(hwnd);
+
+ LOG(("%s, hwnd %p, gw %p", msg_num_to_name(msg), hwnd, gw));
+
+ if (gw == NULL) {
+ LOG(("Unable to find gui window structure for hwnd %p", hwnd));
+ return DefWindowProc(hwnd, msg, wparam, lparam);
+ }
+
+ current_gui = gw;
+
switch(msg) {
+/*
case WM_LBUTTONDBLCLK: {
int x,y;
x = GET_X_LPARAM(lparam);
y = GET_Y_LPARAM(lparam);
- if ((w != NULL) && (w->bw != NULL) )
- browser_window_mouse_click(w->bw,
+ if ((gw != NULL) && (gw->bw != NULL) )
+ browser_window_mouse_click(gw->bw,
BROWSER_MOUSE_DOUBLE_CLICK,
- (x + w->scrollx) / w->bw->scale,
- (y + w->scrolly) / w->bw->scale);
+ (x + gw->scrollx) / gw->bw->scale,
+ (y + gw->scrolly) / gw->bw->scale);
return DefWindowProc(hwnd, msg, wparam, lparam);
break;
}
@@ -1127,300 +1457,30 @@
break;
+*/
+
case WM_COMMAND:
- {
- switch(LOWORD(wparam)) {
- case NSWS_ID_FILE_QUIT:
- w = window_list;
- while (w != NULL) {
- browser_window_destroy(w->bw);
- w = w->next;
- }
- netsurf_quit = true;
- break;
-
- case NSWS_ID_FILE_OPEN_LOCATION:
- SetFocus(w->urlbar);
- break;
-
- case NSWS_ID_FILE_OPEN_WINDOW:
- browser_window_create(NULL, w->bw, NULL, false, false);
- break;
-
- case NSWS_ID_FILE_CLOSE_WINDOW:
- PostMessage(hwnd, WM_CLOSE, 0, 0);
- break;
- case NSWS_ID_FILE_SAVE_PAGE:
- break;
- case NSWS_ID_FILE_SAVEAS_TEXT:
- break;
- case NSWS_ID_FILE_SAVEAS_PDF:
- break;
- case NSWS_ID_FILE_SAVEAS_DRAWFILE:
- break;
- case NSWS_ID_FILE_SAVEAS_POSTSCRIPT:
- break;
- case NSWS_ID_FILE_PRINT_PREVIEW:
- break;
- case NSWS_ID_FILE_PRINT:
- break;
- case NSWS_ID_EDIT_CUT:
- OpenClipboard(hwnd);
- EmptyClipboard();
- CloseClipboard();
- if (GetFocus() == w->urlbar)
- SendMessage(w->urlbar, WM_CUT, 0, 0);
- else if (w->bw != NULL)
- browser_window_key_press(w->bw,
- KEY_CUT_SELECTION);
- break;
- case NSWS_ID_EDIT_COPY:
- OpenClipboard(hwnd);
- EmptyClipboard();
- CloseClipboard();
- if (GetFocus() == w->urlbar)
- SendMessage(w->urlbar, WM_COPY, 0, 0);
- else if (w->bw != NULL)
- gui_copy_to_clipboard(w->bw->sel);
- break;
- case NSWS_ID_EDIT_PASTE: {
- OpenClipboard(hwnd);
- HANDLE h = GetClipboardData(CF_TEXT);
- if (h != NULL) {
- char *content = GlobalLock(h);
- LOG(("pasting %s\n", content));
- GlobalUnlock(h);
- }
- CloseClipboard();
- if (GetFocus() == w->urlbar)
- SendMessage(w->urlbar, WM_PASTE, 0, 0);
- else
- gui_paste_from_clipboard(w, 0, 0);
- break;
- }
- case NSWS_ID_EDIT_DELETE:
- if (GetFocus() == w->urlbar)
- SendMessage(w->urlbar, WM_CUT, 0, 0);
- else
- browser_window_key_press(w->bw,
- KEY_DELETE_RIGHT);
- break;
- case NSWS_ID_EDIT_SELECT_ALL:
- if (GetFocus() == w->urlbar)
- SendMessage(w->urlbar, EM_SETSEL, 0, -1);
- else
- selection_select_all(w->bw->sel);
- break;
- case NSWS_ID_EDIT_SEARCH:
- break;
- case NSWS_ID_EDIT_PREFERENCES:
- nsws_prefs_dialog_init(w->main);
- break;
- case NSWS_ID_NAV_BACK:
- if ((w->bw != NULL) && (history_back_available(
- w->bw->history))) {
- history_back(w->bw, w->bw->history);
- }
- nsws_window_update_forward_back(w);
- break;
- case NSWS_ID_NAV_FORWARD:
- if ((w->bw != NULL) && (history_forward_available(
- w->bw->history))) {
- history_forward(w->bw, w->bw->history);
- }
- nsws_window_update_forward_back(w);
- break;
- case NSWS_ID_NAV_HOME:
- browser_window_go(w->bw, default_page, 0, true);
- break;
- case NSWS_ID_NAV_STOP:
- browser_window_stop(w->bw);
- break;
- case NSWS_ID_NAV_RELOAD:
- browser_window_reload(w->bw, true);
- break;
- case NSWS_ID_NAV_LOCALHISTORY:
- nsws_localhistory_init(w);
- break;
- case NSWS_ID_NAV_GLOBALHISTORY:
- break;
- case NSWS_ID_VIEW_ZOOMPLUS: {
- int x, y;
- gui_window_get_scroll(w, &x, &y);
- if (w->bw != NULL) {
- browser_window_set_scale(w->bw,
- w->bw->scale * 1.1, true);
- browser_window_reformat(w->bw, w->width,
- w->height);
- }
- gui_window_redraw_window(w);
- gui_window_set_scroll(w, x, y);
- break;
- }
- case NSWS_ID_VIEW_ZOOMMINUS: {
- int x, y;
- gui_window_get_scroll(w, &x, &y);
- if (w->bw != NULL) {
- browser_window_set_scale(w->bw,
- w->bw->scale * 0.9, true);
- browser_window_reformat(w->bw, w->width,
- w->height);
- }
- gui_window_redraw_window(w);
- gui_window_set_scroll(w, x, y);
- break;
- }
- case NSWS_ID_VIEW_ZOOMNORMAL: {
- int x, y;
- gui_window_get_scroll(w, &x, &y);
- if (w->bw != NULL) {
- browser_window_set_scale(w->bw,
- 1.0, true);
- browser_window_reformat(w->bw, w->width,
- w->height);
- }
- gui_window_redraw_window(w);
- gui_window_set_scroll(w, x, y);
- break;
- }
- case NSWS_ID_VIEW_SOURCE:
- break;
- case NSWS_ID_VIEW_SAVE_WIN_METRICS: {
- RECT r;
- GetWindowRect(hwnd, &r);
- option_window_x = r.left;
- option_window_y = r.top;
- option_window_width = r.right - r.left;
- option_window_height = r.bottom - r.top;
- options_write(options_file_location);
- break;
- }
-/* case NSWS_ID_VIEW_FULLSCREEN: {
- RECT rdesk;
- if (w->fullscreen == NULL) {
- HWND desktop = GetDesktopWindow();
- w->fullscreen = malloc(sizeof(RECT));
- if ((desktop == NULL) ||
- (w->fullscreen == NULL)) {
- warn_user("NoMemory", 0);
- break;
- }
- GetWindowRect(desktop, &rdesk);
- GetWindowRect(hwnd, w->fullscreen);
- DeleteObject(desktop);
- SetWindowLong(hwnd, GWL_STYLE, 0);
- SetWindowPos(hwnd, HWND_TOPMOST, 0, 0,
- rdesk.right - rdesk.left,
- rdesk.bottom - rdesk.top,
- SWP_SHOWWINDOW);
- } else {
- SetWindowLong(hwnd, GWL_STYLE,
- WS_OVERLAPPEDWINDOW |
- WS_HSCROLL | WS_VSCROLL |
- WS_CLIPCHILDREN |
- WS_CLIPSIBLINGS | CS_DBLCLKS);
- SetWindowPos(hwnd, HWND_TOPMOST,
- w->fullscreen->left,
- w->fullscreen->top,
- w->fullscreen->right -
- w->fullscreen->left,
- w->fullscreen->bottom -
- w->fullscreen->top,
- SWP_SHOWWINDOW |
- SWP_FRAMECHANGED);
- free(w->fullscreen);
- w->fullscreen = NULL;
- }
- break;
- }*/
- case NSWS_ID_VIEW_DOWNLOADS:
- break;
- case NSWS_ID_VIEW_TOGGLE_DEBUG_RENDERING:
- html_redraw_debug = !html_redraw_debug;
- if (w->bw != NULL) {
- browser_window_reformat(w->bw, w->width, w->height);
- }
- break;
- case NSWS_ID_VIEW_DEBUGGING_SAVE_BOXTREE:
- break;
- case NSWS_ID_VIEW_DEBUGGING_SAVE_DOMTREE:
- break;
- case NSWS_ID_HELP_CONTENTS:
- break;
- case NSWS_ID_HELP_GUIDE:
- break;
- case NSWS_ID_HELP_INFO:
- break;
- case NSWS_ID_HELP_ABOUT:
- nsws_about_dialog_init(hinstance, hwnd);
- break;
- case NSWS_ID_LAUNCH_URL:
- {
- if (GetFocus() != w->urlbar)
- break;
- int len = SendMessage(w->urlbar, WM_GETTEXTLENGTH, 0,
- 0);
- char addr[len + 1];
- SendMessage(w->urlbar, WM_GETTEXT, (WPARAM) (len + 1),
- (LPARAM) addr);
- LOG(("launching %s\n", addr));
- browser_window_go(w->bw, addr, 0, true);
- break;
- }
- case NSWS_ID_URLBAR:
- /* main message should already have been handled */
- break;
- default:
- break;
- }
- break;
- }
- case WM_CREATE:
- {
- HDC hdc = GetDC(hwnd);
- int dpi = GetDeviceCaps(hdc,LOGPIXELSY);
- if (dpi > 10)
- nscss_screen_dpi = INTTOFIX(dpi);
- ReleaseDC(hwnd, hdc);
- return DefWindowProc(hwnd, msg, wparam, lparam);
- break;
- }
-
- case WM_PAINT:
- {
- DWORD ret = DefWindowProc(hwnd, msg, wparam, lparam);
- if (historyactive)
- current_gui = NULL;
- return ret;
- }
+ return nsws_window_command(gw, HIWORD(wparam), LOWORD(wparam), (HWND)lparam);
case WM_SIZE:
- SendMessage(w->statusbar, WM_SIZE, wparam, lparam);
- SendMessage(w->toolbar, WM_SIZE, wparam, lparam);
- nsws_window_resize(w, hwnd, wparam, lparam);
- return DefWindowProc(hwnd, msg, wparam, lparam);
+ return nsws_window_resize(gw, hwnd, wparam, lparam);
case WM_CLOSE:
- if (--open_windows == 0) {
+ if (--open_windows <= 0) {
netsurf_quit = true;
}
- browser_window_destroy(w->bw);
- break;
-
- case WM_DESTROY:
- PostQuitMessage(0);
- break;
-
- default:
- return DefWindowProc(hwnd, msg, wparam, lparam);
- }
- return 0;
+ browser_window_destroy(gw->bw);
+ break;
+
+ }
+ return DefWindowProc(hwnd, msg, wparam, lparam);
}
static void create_local_windows_classes(void) {
WNDCLASSEX w;
+ /* main window */
w.cbSize = sizeof(WNDCLASSEX);
w.style = 0;
w.lpfnWndProc = nsws_window_event_callback;
@@ -1428,13 +1488,14 @@
w.cbWndExtra = 0;
w.hInstance = hinstance;
w.hIcon = LoadIcon(NULL, IDI_APPLICATION); /* -> NetSurf */
- w.hCursor = LoadCursor(NULL, IDC_ARROW);
+ w.hCursor = NULL;
w.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
w.lpszMenuName = NULL;
w.lpszClassName = windowclassname_main;
w.hIconSm = LoadIcon(NULL, IDI_APPLICATION); /* -> NetSurf */
RegisterClassEx(&w);
+ /* drawable area */
w.lpfnWndProc = nsws_window_drawable_event_callback;
w.hIcon = NULL;
w.lpszMenuName = NULL;
@@ -1450,9 +1511,15 @@
*/
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);
+ 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");
return hwnd;
}
@@ -1492,21 +1559,24 @@
hinstance,
NULL);
+ HDC hdc = GetDC(hwnd);
+ int dpi = GetDeviceCaps(hdc,LOGPIXELSY);
+ if (dpi > 10)
+ nscss_screen_dpi = INTTOFIX(dpi);
+ ReleaseDC(hwnd, hdc);
+
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,
+ 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);
- gw->statusbar = nsws_window_statusbar_create(gw);
return hwnd;
}
@@ -1532,7 +1602,7 @@
gw->width = 800;
gw->height = 600;
- gw->toolbuttonsize = 24;
+ gw->toolbuttonsize = 24;
gw->requestscrollx = 0;
gw->requestscrolly = 0;
gw->localhistory = NULL;
@@ -1547,7 +1617,7 @@
gw->mouse->pressed_x = 0;
gw->mouse->pressed_y = 0;
- /* add window to list */
+ /* add window to list */
if (window_list != NULL)
window_list->prev = gw;
gw->next = window_list;
@@ -1556,32 +1626,36 @@
switch(bw->browser_window_type) {
case BROWSER_WINDOW_NORMAL:
gw->main = nsws_window_create(gw);
+ gw->toolbar = nsws_window_toolbar_create(gw);
+ gw->statusbar = nsws_window_statusbar_create(gw);
gw->drawingarea = CreateWindow(windowclassname_drawable,
- NULL,
- WS_VISIBLE | WS_CHILD,
- 0, 0, 0, 0,
- gw->main,
- NULL,
- hinstance,
- NULL);
+ NULL,
+ WS_VISIBLE | WS_CHILD,
+ 0, 0, 0, 0,
+ gw->main,
+ NULL,
+ hinstance,
+ NULL);
/* set the gui window associated with this toolbar */
SetProp(gw->drawingarea, TEXT("GuiWnd"), (HANDLE)gw);
+
input_window = gw;
open_windows++;
ShowWindow(gw->main, SW_SHOWNORMAL);
+
break;
case BROWSER_WINDOW_FRAME:
gw->drawingarea = CreateWindow(windowclassname_drawable,
- NULL,
- WS_VISIBLE | WS_CHILD,
- 0, 0, 0, 0,
- bw->parent->window->drawingarea,
- NULL,
- hinstance,
- NULL);
+ NULL,
+ WS_VISIBLE | WS_CHILD,
+ 0, 0, 0, 0,
+ bw->parent->window->drawingarea,
+ NULL,
+ hinstance,
+ NULL);
/* set the gui window associated with this toolbar */
SetProp(gw->drawingarea, TEXT("GuiWnd"), (HANDLE)gw);
@@ -1596,13 +1670,13 @@
case BROWSER_WINDOW_IFRAME:
LOG(("create iframe"));
gw->drawingarea = CreateWindow(windowclassname_drawable,
- NULL,
- WS_VISIBLE | WS_CHILD,
- 0, 0, 0, 0,
- bw->parent->window->drawingarea,
- NULL,
- hinstance,
- NULL);
+ NULL,
+ WS_VISIBLE | WS_CHILD,
+ 0, 0, 0, 0,
+ bw->parent->window->drawingarea,
+ NULL,
+ hinstance,
+ NULL);
/* set the gui window associated with this toolbar */
SetProp(gw->drawingarea, TEXT("GuiWnd"), (HANDLE)gw);
@@ -1810,7 +1884,7 @@
LOG(("redraw %p %d,%d %d,%d", w, x0, y0, x1, y1));
if (w == NULL)
return;
-
+
redrawrect.left = x0;
redrawrect.top = y0;
redrawrect.right = x1;
@@ -1838,7 +1912,7 @@
return;
RECT redrawrect;
-
+
redrawrect.left = (long)data->redraw.x;
redrawrect.top = (long)data->redraw.y;
redrawrect.right =(long)(data->redraw.x + data->redraw.width);
@@ -1969,6 +2043,8 @@
{
if (w == NULL)
return;
+
+ LOG(("shape %d", shape));
switch (shape) {
case GUI_POINTER_POINT: /* link */
case GUI_POINTER_MENU:
@@ -2173,8 +2249,8 @@
return true;
}
-void gui_window_save_link(struct gui_window *g, const char *url,
- const char *title)
+void gui_window_save_link(struct gui_window *g, const char *url,
+ const char *title)
{
}
@@ -2295,9 +2371,9 @@
{
}
-void gui_cert_verify(const char *url, const struct ssl_cert_info *certs,
- unsigned long num,
- nserror (*cb)(bool proceed, void *pw), void *cbpw)
+void gui_cert_verify(const char *url, const struct ssl_cert_info *certs,
+ unsigned long num,
+ nserror (*cb)(bool proceed, void *pw), void *cbpw)
{
cb(false, cbpw);
}
Modified: trunk/netsurf/windows/localhistory.c
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/localhistory.c?re...
==============================================================================
--- trunk/netsurf/windows/localhistory.c (original)
+++ trunk/netsurf/windows/localhistory.c Sun Oct 10 17:42:24 2010
@@ -73,7 +73,6 @@
localhistory.height = 0;
current_gui = NULL;
current_hwnd = NULL;
- doublebuffering = false;
if ((bw != NULL) && (bw->history != NULL))
history_size(bw->history, &(localhistory.width),
&(localhistory.height));
Modified: trunk/netsurf/windows/plot.c
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/plot.c?rev=10880&...
==============================================================================
--- trunk/netsurf/windows/plot.c (original)
+++ trunk/netsurf/windows/plot.c Sun Oct 10 17:42:24 2010
@@ -48,9 +48,7 @@
HWND current_hwnd;
struct gui_window *current_gui;
-bool doublebuffering;
bool thumbnail = false;
-HDC bufferdc;
static float nsws_plot_scale = 1.0;
static RECT localhistory_clip;
@@ -82,7 +80,7 @@
{
#if NSWS_PLOT_DEBUG
LOG(("ligne from %d,%d to %d,%d thumbnail %d", x0, y0, x1, y1,
- thumbnail));
+ thumbnail));
#endif
RECT *clipr = gui_window_clip_rect(current_gui);
if (clipr == NULL)
@@ -92,7 +90,7 @@
return false;
}
- HDC hdc = doublebuffering ? bufferdc : GetDC(current_hwnd);
+ HDC hdc = GetDC(current_hwnd);
if (hdc == NULL) {
DeleteObject(clipregion);
return false;
@@ -100,23 +98,23 @@
COLORREF col = (DWORD)(style->stroke_colour & 0x00FFFFFF);
/* windows 0x00bbggrr */
DWORD penstyle = PS_GEOMETRIC | ((style->stroke_type ==
- PLOT_OP_TYPE_DOT) ? PS_DOT :
- (style->stroke_type == PLOT_OP_TYPE_DASH) ? PS_DASH:
- 0);
+ PLOT_OP_TYPE_DOT) ? PS_DOT :
+ (style->stroke_type == PLOT_OP_TYPE_DASH) ? PS_DASH:
+ 0);
LOGBRUSH lb = {BS_SOLID, col, 0};
HPEN pen = ExtCreatePen(penstyle, style->stroke_width, &lb, 0, NULL);
if (pen == NULL) {
DeleteObject(clipregion);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return false;
}
HGDIOBJ bak = SelectObject(hdc, (HGDIOBJ) pen);
if (bak == NULL) {
DeleteObject(pen);
DeleteObject(clipregion);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return false;
}
RECT r;
@@ -133,32 +131,122 @@
SelectClipRgn(hdc, NULL);
/* ValidateRect(current_hwnd, &r);
-*/
+ */
pen = SelectObject(hdc, bak);
DeleteObject(pen);
DeleteObject(clipregion);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return true;
}
static bool rectangle(int x0, int y0, int x1, int y1, const plot_style_t
- *style)
+ *style)
{
x1++;
y1++;
- x0 = MAX(x0, 0);
+/* x0 = MAX(x0, 0);
y0 = MAX(y0, 0);
if (!((current_gui == NULL) || (thumbnail))) {
- x1 = MIN(x1, gui_window_width(current_gui));
- y1 = MIN(y1, gui_window_height(current_gui));
- }
-
+ x1 = MIN(x1, gui_window_width(current_gui));
+ y1 = MIN(y1, gui_window_height(current_gui));
+ }
+*/
#if NSWS_PLOT_DEBUG
LOG(("rectangle from %d,%d to %d,%d thumbnail %d", x0, y0, x1, y1,
- thumbnail));
-#endif
- HDC hdc = doublebuffering ? bufferdc : GetDC(current_hwnd);
+ thumbnail));
+#endif
+ HDC hdc = GetDC(current_hwnd);
+ if (hdc == NULL) {
+ return false;
+ }
+/* RECT *clipr = gui_window_clip_rect(current_gui);
+ if (clipr == NULL)
+ clipr = &localhistory_clip;
+ HRGN clipregion = CreateRectRgnIndirect(clipr);
+ if (clipregion == NULL) {
+
+ ReleaseDC(current_hwnd, hdc);
+ return false;
+ }
+*/
+ COLORREF pencol = (DWORD)(style->stroke_colour & 0x00FFFFFF);
+ DWORD penstyle = PS_GEOMETRIC |
+ (style->stroke_type == PLOT_OP_TYPE_DOT ? PS_DOT :
+ (style->stroke_type == PLOT_OP_TYPE_DASH ? PS_DASH :
+ (style->stroke_type == PLOT_OP_TYPE_NONE ? PS_NULL :
+ 0)));
+ LOGBRUSH lb = {BS_SOLID, pencol, 0};
+ LOGBRUSH lb1 = {BS_SOLID, style->fill_colour, 0};
+ if (style->fill_type == PLOT_OP_TYPE_NONE)
+ lb1.lbStyle = BS_HOLLOW;
+
+ HPEN pen = ExtCreatePen(penstyle, style->stroke_width, &lb, 0, NULL);
+ if (pen == NULL) {
+// DeleteObject(clipregion);
+
+ ReleaseDC(current_hwnd, hdc);
+ return false;
+ }
+ HGDIOBJ penbak = SelectObject(hdc, (HGDIOBJ) pen);
+ if (penbak == NULL) {
+// DeleteObject(clipregion);
+ DeleteObject(pen);
+
+ ReleaseDC(current_hwnd, hdc);
+ return false;
+ }
+ HBRUSH brush = CreateBrushIndirect(&lb1);
+ if (brush == NULL) {
+// DeleteObject(clipregion);
+ SelectObject(hdc, penbak);
+ DeleteObject(pen);
+
+ ReleaseDC(current_hwnd, hdc);
+ return false;
+ }
+ HGDIOBJ brushbak = SelectObject(hdc, (HGDIOBJ) brush);
+ if (brushbak == NULL) {
+// DeleteObject(clipregion);
+ SelectObject(hdc, penbak);
+ DeleteObject(pen);
+ DeleteObject(brush);
+
+ ReleaseDC(current_hwnd, hdc);
+ return false;
+ }
+ RECT r;
+ r.left = x0;
+ r.top = y0;
+ r.right = x1;
+ r.bottom = y1;
+
+ //SelectClipRgn(hdc, clipregion);
+
+ Rectangle(hdc, x0, y0, x1, y1);
+
+ //SelectClipRgn(hdc, NULL);
+/* ValidateRect(current_hwnd, &r);
+ */
+ pen = SelectObject(hdc, penbak);
+ brush = SelectObject(hdc, brushbak);
+// DeleteObject(clipregion);
+ DeleteObject(pen);
+ DeleteObject(brush);
+
+ ReleaseDC(current_hwnd, hdc);
+ return true;
+}
+
+
+static bool polygon(const int *p, unsigned int n, const plot_style_t *style)
+{
+#if NSWS_PLOT_DEBUG
+ LOG(("polygon %d points thumbnail %d", n, thumbnail));
+#endif
+ POINT points[n];
+ unsigned int i;
+ HDC hdc = GetDC(current_hwnd);
if (hdc == NULL) {
return false;
}
@@ -167,87 +255,83 @@
clipr = &localhistory_clip;
HRGN clipregion = CreateRectRgnIndirect(clipr);
if (clipregion == NULL) {
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
- return false;
- }
- COLORREF pencol = (DWORD)(style->stroke_colour & 0x00FFFFFF);
- DWORD penstyle = PS_GEOMETRIC |
- (style->stroke_type == PLOT_OP_TYPE_DOT ? PS_DOT :
- (style->stroke_type == PLOT_OP_TYPE_DASH ? PS_DASH :
- (style->stroke_type == PLOT_OP_TYPE_NONE ? PS_NULL :
- 0)));
- LOGBRUSH lb = {BS_SOLID, pencol, 0};
- LOGBRUSH lb1 = {BS_SOLID, style->fill_colour, 0};
- if (style->fill_type == PLOT_OP_TYPE_NONE)
- lb1.lbStyle = BS_HOLLOW;
-
- HPEN pen = ExtCreatePen(penstyle, style->stroke_width, &lb, 0, NULL);
+
+ ReleaseDC(current_hwnd, hdc);
+ return false;
+ }
+ COLORREF pencol = (DWORD)(style->fill_colour & 0x00FFFFFF);
+ COLORREF brushcol = (DWORD)(style->fill_colour & 0x00FFFFFF);
+ HPEN pen = CreatePen(PS_GEOMETRIC | PS_NULL, 1, pencol);
if (pen == NULL) {
DeleteObject(clipregion);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
- return false;
- }
- HGDIOBJ penbak = SelectObject(hdc, (HGDIOBJ) pen);
+ ReleaseDC(current_hwnd, hdc);
+ return false;
+ }
+ HPEN penbak = SelectObject(hdc, pen);
if (penbak == NULL) {
DeleteObject(clipregion);
DeleteObject(pen);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
- return false;
- }
- HBRUSH brush = CreateBrushIndirect(&lb1);
- if (brush == NULL) {
+
+ ReleaseDC(current_hwnd, hdc);
+ return false;
+ }
+ HBRUSH brush = CreateSolidBrush(brushcol);
+ if (brush == NULL) {
DeleteObject(clipregion);
SelectObject(hdc, penbak);
DeleteObject(pen);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
- return false;
- }
- HGDIOBJ brushbak = SelectObject(hdc, (HGDIOBJ) brush);
+
+ ReleaseDC(current_hwnd, hdc);
+ return false;
+ }
+ HBRUSH brushbak = SelectObject(hdc, brush);
if (brushbak == NULL) {
DeleteObject(clipregion);
SelectObject(hdc, penbak);
DeleteObject(pen);
DeleteObject(brush);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
- return false;
- }
- RECT r;
- r.left = x0;
- r.top = y0;
- r.right = x1;
- r.bottom = y1;
-
+
+ ReleaseDC(current_hwnd, hdc);
+ return false;
+ }
+ SetPolyFillMode(hdc, WINDING);
+ for (i = 0; i < n; i++) {
+ points[i].x = (long) p[2 * i];
+ points[i].y = (long) p[2 * i + 1];
+
+#if NSWS_PLOT_DEBUG
+ printf ("%ld,%ld ", points[i].x, points[i].y);
+#endif
+ }
+
SelectClipRgn(hdc, clipregion);
- Rectangle(hdc, x0, y0, x1, y1);
+ if (n >= 2)
+ Polygon(hdc, points, n);
SelectClipRgn(hdc, NULL);
-/* ValidateRect(current_hwnd, &r);
-*/
+
pen = SelectObject(hdc, penbak);
brush = SelectObject(hdc, brushbak);
DeleteObject(clipregion);
DeleteObject(pen);
DeleteObject(brush);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
- return true;
-}
-
-
-static bool polygon(const int *p, unsigned int n, const plot_style_t *style)
-{
-#if NSWS_PLOT_DEBUG
- LOG(("polygon %d points thumbnail %d", n, thumbnail));
-#endif
- POINT points[n];
- unsigned int i;
- HDC hdc = doublebuffering ? bufferdc : GetDC(current_hwnd);
+
+ ReleaseDC(current_hwnd, hdc);
+#if NSWS_PLOT_DEBUG
+ printf("\n");
+#endif
+ return true;
+}
+
+
+static bool text(int x, int y, const char *text, size_t length,
+ const plot_font_style_t *style)
+{
+#if NSWS_PLOT_DEBUG
+ LOG(("words %s at %d,%d thumbnail %d", text, x, y, thumbnail));
+#endif
+ HDC hdc = GetDC(current_hwnd);
if (hdc == NULL) {
return false;
}
@@ -256,102 +340,15 @@
clipr = &localhistory_clip;
HRGN clipregion = CreateRectRgnIndirect(clipr);
if (clipregion == NULL) {
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
- return false;
- }
- COLORREF pencol = (DWORD)(style->fill_colour & 0x00FFFFFF);
- COLORREF brushcol = (DWORD)(style->fill_colour & 0x00FFFFFF);
- HPEN pen = CreatePen(PS_GEOMETRIC | PS_NULL, 1, pencol);
- if (pen == NULL) {
- DeleteObject(clipregion);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
- return false;
- }
- HPEN penbak = SelectObject(hdc, pen);
- if (penbak == NULL) {
- DeleteObject(clipregion);
- DeleteObject(pen);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
- return false;
- }
- HBRUSH brush = CreateSolidBrush(brushcol);
- if (brush == NULL) {
- DeleteObject(clipregion);
- SelectObject(hdc, penbak);
- DeleteObject(pen);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
- return false;
- }
- HBRUSH brushbak = SelectObject(hdc, brush);
- if (brushbak == NULL) {
- DeleteObject(clipregion);
- SelectObject(hdc, penbak);
- DeleteObject(pen);
- DeleteObject(brush);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
- return false;
- }
- SetPolyFillMode(hdc, WINDING);
- for (i = 0; i < n; i++) {
- points[i].x = (long) p[2 * i];
- points[i].y = (long) p[2 * i + 1];
-
-#if NSWS_PLOT_DEBUG
- printf ("%ld,%ld ", points[i].x, points[i].y);
-#endif
- }
-
- SelectClipRgn(hdc, clipregion);
-
- if (n >= 2)
- Polygon(hdc, points, n);
-
- SelectClipRgn(hdc, NULL);
-
- pen = SelectObject(hdc, penbak);
- brush = SelectObject(hdc, brushbak);
- DeleteObject(clipregion);
- DeleteObject(pen);
- DeleteObject(brush);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
-#if NSWS_PLOT_DEBUG
- printf("\n");
-#endif
- return true;
-}
-
-
-static bool text(int x, int y, const char *text, size_t length,
- const plot_font_style_t *style)
-{
-#if NSWS_PLOT_DEBUG
- LOG(("words %s at %d,%d thumbnail %d", text, x, y, thumbnail));
-#endif
- HDC hdc = doublebuffering ? bufferdc : GetDC(current_hwnd);
- if (hdc == NULL) {
- return false;
- }
- RECT *clipr = gui_window_clip_rect(current_gui);
- if (clipr == NULL)
- clipr = &localhistory_clip;
- HRGN clipregion = CreateRectRgnIndirect(clipr);
- if (clipregion == NULL) {
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+ ReleaseDC(current_hwnd, hdc);
return false;
}
HFONT fontbak, font = get_font(style);
if (font == NULL) {
DeleteObject(clipregion);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return false;
}
int wlen;
@@ -385,13 +382,13 @@
SelectClipRgn(hdc, NULL);
/* ValidateRect(current_hwnd, &r);
-*/
+ */
free(wstring);
font = SelectObject(hdc, fontbak);
DeleteObject(clipregion);
DeleteObject(font);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return true;
}
@@ -400,7 +397,7 @@
#if NSWS_PLOT_DEBUG
LOG(("disc at %d,%d radius %d thumbnail %d", x, y, radius, thumbnail));
#endif
- HDC hdc = doublebuffering ? bufferdc : GetDC(current_hwnd);
+ HDC hdc = GetDC(current_hwnd);
if (hdc == NULL) {
return false;
}
@@ -409,26 +406,26 @@
clipr = &localhistory_clip;
HRGN clipregion = CreateRectRgnIndirect(clipr);
if (clipregion == NULL) {
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return false;
}
COLORREF col = (DWORD)((style->fill_colour | style->stroke_colour)
- & 0x00FFFFFF);
+ & 0x00FFFFFF);
HPEN pen = CreatePen(PS_GEOMETRIC | PS_SOLID, 1, col);
if (pen == NULL) {
DeleteObject(clipregion);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return false;
}
HGDIOBJ penbak = SelectObject(hdc, (HGDIOBJ) pen);
if (penbak == NULL) {
DeleteObject(clipregion);
DeleteObject(pen);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return false;
}
HBRUSH brush = CreateSolidBrush(col);
@@ -436,8 +433,8 @@
DeleteObject(clipregion);
SelectObject(hdc, penbak);
DeleteObject(pen);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return false;
}
HGDIOBJ brushbak = SelectObject(hdc, (HGDIOBJ) brush);
@@ -446,8 +443,8 @@
SelectObject(hdc, penbak);
DeleteObject(pen);
DeleteObject(brush);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return false;
}
RECT r;
@@ -460,32 +457,32 @@
if (style->fill_type == PLOT_OP_TYPE_NONE)
Arc(hdc, x - radius, y - radius, x + radius, y + radius,
- x - radius, y - radius,
- x - radius, y - radius);
+ x - radius, y - radius,
+ x - radius, y - radius);
else
Ellipse(hdc, x - radius, y - radius, x + radius, y + radius);
SelectClipRgn(hdc, NULL);
/* ValidateRect(current_hwnd, &r);
-*/
+ */
pen = SelectObject(hdc, penbak);
brush = SelectObject(hdc, brushbak);
DeleteObject(clipregion);
DeleteObject(pen);
DeleteObject(brush);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return true;
}
static bool arc(int x, int y, int radius, int angle1, int angle2,
- const plot_style_t *style)
+ const plot_style_t *style)
{
#if NSWS_PLOT_DEBUG
LOG(("arc centre %d,%d radius %d from %d to %d", x, y, radius,
- angle1, angle2));
-#endif
- HDC hdc = doublebuffering ? bufferdc : GetDC(current_hwnd);
+ angle1, angle2));
+#endif
+ HDC hdc = GetDC(current_hwnd);
if (hdc == NULL) {
return false;
}
@@ -494,24 +491,24 @@
clipr = &localhistory_clip;
HRGN clipregion = CreateRectRgnIndirect(clipr);
if (clipregion == NULL) {
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return false;
}
COLORREF col = (DWORD)(style->stroke_colour & 0x00FFFFFF);
HPEN pen = CreatePen(PS_GEOMETRIC | PS_SOLID, 1, col);
if (pen == NULL) {
DeleteObject(clipregion);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return false;
}
HGDIOBJ penbak = SelectObject(hdc, (HGDIOBJ) pen);
if (penbak == NULL) {
DeleteObject(clipregion);
DeleteObject(pen);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return false;
}
RECT r;
@@ -576,32 +573,32 @@
SelectClipRgn(hdc, clipregion);
Arc(hdc, x - radius, y - radius, x + radius, y + radius,
- x + (int)(a1 * radius), y + (int)(b1 * radius),
- x + (int)(a2 * radius), y + (int)(b2 * radius));
+ x + (int)(a1 * radius), y + (int)(b1 * radius),
+ x + (int)(a2 * radius), y + (int)(b2 * radius));
SelectClipRgn(hdc, NULL);
/* ValidateRect(current_hwnd, &r);
-*/
+ */
pen = SelectObject(hdc, penbak);
DeleteObject(clipregion);
DeleteObject(pen);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return true;
}
static bool bitmap(int x, int y, int width, int height,
- struct bitmap *bitmap, colour bg,
- bitmap_flags_t flags)
+ struct bitmap *bitmap, colour bg,
+ bitmap_flags_t flags)
{
#if NSWS_PLOT_DEBUG
LOG(("%p bitmap %d,%d width %d height %d", current_hwnd, x, y, width,
- height));
+ height));
#endif
if (bitmap == NULL)
return false;
- HDC hdc = doublebuffering ? bufferdc : GetDC(current_hwnd);
+ HDC hdc = GetDC(current_hwnd);
if (hdc == NULL) {
return false;
}
@@ -610,15 +607,14 @@
cliprect = &localhistory_clip;
HRGN clipregion = CreateRectRgnIndirect(cliprect);
if (clipregion == NULL) {
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return false;
}
HDC Memhdc = CreateCompatibleDC(hdc);
if (Memhdc == NULL) {
DeleteObject(clipregion);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+ ReleaseDC(current_hwnd, hdc);
return false;
}
BITMAPINFOHEADER bmih;
@@ -637,8 +633,8 @@
if ((flags & BITMAPF_REPEAT_X) || (flags & BITMAPF_REPEAT_Y)) {
struct bitmap *prebitmap = bitmap_pretile(bitmap,
- cliprect->right - x,
- cliprect->bottom - y, flags);
+ cliprect->right - x,
+ cliprect->bottom - y, flags);
if (prebitmap == NULL)
return false;
if (modifying) {
@@ -650,29 +646,29 @@
}
BITMAP MemBM;
BITMAPINFO *bmi = (BITMAPINFO *) malloc(sizeof(BITMAPINFOHEADER) +
- (bitmap->width * bitmap->height * 4));
+ (bitmap->width * bitmap->height * 4));
if (bmi == NULL) {
DeleteObject(clipregion);
DeleteDC(Memhdc);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return false;
}
HBITMAP MemBMh = CreateCompatibleBitmap(
- hdc, bitmap->width, bitmap->height);
+ hdc, bitmap->width, bitmap->height);
if (MemBMh == NULL){
DeleteObject(clipregion);
free(bmi);
DeleteDC(Memhdc);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return false;
}
/* save 'background' data for alpha channel work */
SelectObject(Memhdc, MemBMh);
BitBlt(Memhdc, 0, 0, bitmap->width, bitmap->height, hdc, x, y,
- SRCCOPY);
+ SRCCOPY);
GetObject(MemBMh, sizeof(BITMAP), &MemBM);
bmih.biSize = sizeof(bmih);
@@ -689,77 +685,77 @@
bmi->bmiHeader = bmih;
GetDIBits(hdc, MemBMh, 0, bitmap->height, bmi->bmiColors, bmi,
- DIB_RGB_COLORS);
+ DIB_RGB_COLORS);
/* then load 'foreground' bits from bitmap->pixdata */
width4 = bitmap->width * 4;
for (v = 0, vv = 0, vi = (bitmap->height - 1) * width4;
- v < bitmap->height;
- v++, vv += bitmap->width, vi -= width4) {
+ v < bitmap->height;
+ v++, vv += bitmap->width, vi -= width4) {
for (h = 0, hh = 0; h < bitmap->width; h++, hh += 4) {
alpha = bitmap->pixdata[vi + hh + 3];
/* multiplication of alpha value; subject to profiling could be optional */
if (alpha == 0xFF) {
bmi->bmiColors[vv + h].rgbBlue =
- bitmap->pixdata[vi + hh + 2];
+ bitmap->pixdata[vi + hh + 2];
bmi->bmiColors[vv + h].rgbGreen =
- bitmap->pixdata[vi + hh + 1];
+ bitmap->pixdata[vi + hh + 1];
bmi->bmiColors[vv + h].rgbRed =
- bitmap->pixdata[vi + hh];
+ bitmap->pixdata[vi + hh];
} else if (alpha > 0) {
transparency = 0x100 - alpha;
bmi->bmiColors[vv + h].rgbBlue =
- (bmi->bmiColors[vv + h].rgbBlue
- * transparency +
- (bitmap->pixdata[vi + hh + 2]) *
- alpha) >> 8;
+ (bmi->bmiColors[vv + h].rgbBlue
+ * transparency +
+ (bitmap->pixdata[vi + hh + 2]) *
+ alpha) >> 8;
bmi->bmiColors[vv + h].rgbGreen =
- (bmi->bmiColors[vv + h].
- rgbGreen
- * transparency +
- (bitmap->pixdata[vi + hh + 1]) *
- alpha) >> 8;
+ (bmi->bmiColors[vv + h].
+ rgbGreen
+ * transparency +
+ (bitmap->pixdata[vi + hh + 1]) *
+ alpha) >> 8;
bmi->bmiColors[vv + h].rgbRed =
- (bmi->bmiColors[vv + h].rgbRed
- * transparency +
- bitmap->pixdata[vi + hh]
- * alpha) >> 8;
+ (bmi->bmiColors[vv + h].rgbRed
+ * transparency +
+ bitmap->pixdata[vi + hh]
+ * alpha) >> 8;
}
/* alternative simple 2/3 stage alpha value handling */
/* if (bitmap->pixdata[vi + hh + 3] > 0xAA) {
- bmi->bmiColors[vv + h].rgbBlue =
- bitmap->pixdata[vi + hh + 2];
- bmi->bmiColors[vv + h].rgbGreen =
- bitmap->pixdata[vi + hh + 1];
- bmi->bmiColors[vv + h].rgbRed =
- bitmap->pixdata[vi + hh];
+ bmi->bmiColors[vv + h].rgbBlue =
+ bitmap->pixdata[vi + hh + 2];
+ bmi->bmiColors[vv + h].rgbGreen =
+ bitmap->pixdata[vi + hh + 1];
+ bmi->bmiColors[vv + h].rgbRed =
+ bitmap->pixdata[vi + hh];
} else if (bitmap->pixdata[vi + hh + 3] > 0x70){
- bmi->bmiColors[vv + h].rgbBlue =
- (bmi->bmiColors[vv + h].rgbBlue +
- bitmap->pixdata[vi + hh + 2]) / 2;
- bmi->bmiColors[vv + h].rgbRed =
- (bmi->bmiColors[vv + h].rgbRed +
- bitmap->pixdata[vi + hh]) / 2;
- bmi->bmiColors[vv + h].rgbGreen =
- (bmi->bmiColors[vv + h].rgbGreen +
- bitmap->pixdata[vi + hh + 1]) / 2;
+ bmi->bmiColors[vv + h].rgbBlue =
+ (bmi->bmiColors[vv + h].rgbBlue +
+ bitmap->pixdata[vi + hh + 2]) / 2;
+ bmi->bmiColors[vv + h].rgbRed =
+ (bmi->bmiColors[vv + h].rgbRed +
+ bitmap->pixdata[vi + hh]) / 2;
+ bmi->bmiColors[vv + h].rgbGreen =
+ (bmi->bmiColors[vv + h].rgbGreen +
+ bitmap->pixdata[vi + hh + 1]) / 2;
} else if (bitmap->pixdata[vi + hh + 3] > 0x30){
- bmi->bmiColors[vv + h].rgbBlue =
- (bmi->bmiColors[vv + h].rgbBlue * 3 +
- bitmap->pixdata[vi + hh + 2]) / 4;
- bmi->bmiColors[vv + h].rgbRed =
- (bmi->bmiColors[vv + h].rgbRed * 3 +
- bitmap->pixdata[vi + hh]) / 4;
- bmi->bmiColors[vv + h].rgbGreen =
- (bmi->bmiColors[vv + h].rgbGreen * 3 +
- bitmap->pixdata[vi + hh + 1]) / 4;
+ bmi->bmiColors[vv + h].rgbBlue =
+ (bmi->bmiColors[vv + h].rgbBlue * 3 +
+ bitmap->pixdata[vi + hh + 2]) / 4;
+ bmi->bmiColors[vv + h].rgbRed =
+ (bmi->bmiColors[vv + h].rgbRed * 3 +
+ bitmap->pixdata[vi + hh]) / 4;
+ bmi->bmiColors[vv + h].rgbGreen =
+ (bmi->bmiColors[vv + h].rgbGreen * 3 +
+ bitmap->pixdata[vi + hh + 1]) / 4;
}
*/ }
}
SetDIBitsToDevice(hdc, x, y, bitmap->width, bitmap->height,
- 0, 0, 0, bitmap->height, (const void *) bmi->bmiColors,
- bmi, DIB_RGB_COLORS);
+ 0, 0, 0, bitmap->height, (const void *) bmi->bmiColors,
+ bmi, DIB_RGB_COLORS);
r.left = x;
r.top = y;
@@ -771,13 +767,13 @@
}
/* ValidateRect(current_hwnd, &r);
-*/ free(bmi);
+ */ free(bmi);
/* SelectClipRgn(hdc, NULL);
-*/ DeleteObject(clipregion);
+ */ DeleteObject(clipregion);
DeleteObject(MemBMh);
DeleteDC(Memhdc);
- if (!doublebuffering)
- ReleaseDC(current_hwnd, hdc);
+
+ ReleaseDC(current_hwnd, hdc);
return true;
}
Modified: trunk/netsurf/windows/plot.h
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/plot.h?rev=10880&...
==============================================================================
--- trunk/netsurf/windows/plot.h (original)
+++ trunk/netsurf/windows/plot.h Sun Oct 10 17:42:24 2010
@@ -21,8 +21,6 @@
extern HWND current_hwnd;
extern struct gui_window *current_gui;
-extern HDC bufferdc;
-extern bool doublebuffering;
extern bool thumbnail;
void nsws_plot_set_scale(float s);
Modified: trunk/netsurf/windows/thumbnail.c
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/thumbnail.c?rev=1...
==============================================================================
--- trunk/netsurf/windows/thumbnail.c (original)
+++ trunk/netsurf/windows/thumbnail.c Sun Oct 10 17:42:24 2010
@@ -41,7 +41,7 @@
BITMAPINFOHEADER bmih;
LOG(("creating thumbnail %p for url %s content %p", bitmap, url, content));
-
+ return false;
bmi = malloc(sizeof(BITMAPINFOHEADER) + (bitmap->width * bitmap->height * 4));
if (bmi == NULL) {
return false;
@@ -59,7 +59,7 @@
bmih.biClrUsed = 0;
bmih.biClrImportant = 0;
bmi->bmiHeader = bmih;
-
+/*
doublebuffering = true;
if (bufferdc != NULL)
@@ -85,9 +85,9 @@
content_redraw(content, 0, 0, width, height, 0, 0,
width, height, 1.0, 0xFFFFFF);
thumbnail = false;
-
+*/
/* scale bufferbm to minibm */
-
+/*
minidc = CreateCompatibleDC(hdc);
if (minidc == NULL) {
doublebuffering = false;
@@ -123,9 +123,9 @@
return false;
}
SelectObject(minidc, minibm2);
-
+*/
/* save data from minibm bmi */
- GetDIBits(minidc, minibm, 0, 1 - bitmap->height,
+/* GetDIBits(minidc, minibm, 0, 1 - bitmap->height,
bmi->bmiColors, bmi, DIB_RGB_COLORS);
pixdata = (uint8_t *)(bitmap->pixdata);
@@ -147,4 +147,5 @@
doublebuffering = false;
return true;
+*/
}
Added: trunk/netsurf/windows/windbg.c
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/windbg.c?rev=1088...
==============================================================================
--- trunk/netsurf/windows/windbg.c (added)
+++ trunk/netsurf/windows/windbg.c Sun Oct 10 17:42:24 2010
@@ -1,0 +1,612 @@
+#include <stdio.h>
+
+#include "windbg.h"
+
+const char *msg_num_to_name(int msg)
+{
+ static char str[256];
+
+ switch (msg) {
+ case 32768:
+ return "WM_APP";
+
+ case 6:
+ return "WM_ACTIVATE ";
+
+ case 28:
+ return "WM_ACTIVATEAPP ";
+
+ case 864:
+ return "WM_AFXFIRST ";
+
+ case 895:
+ return "WM_AFXLAST ";
+
+ case 780:
+ return "WM_ASKCBFORMATNAME ";
+
+ case 75:
+ return "WM_CANCELJOURNAL ";
+
+ case 31:
+ return "WM_CANCELMODE ";
+
+ case 533:
+ return "WM_CAPTURECHANGED ";
+
+ case 781:
+ return "WM_CHANGECBCHAIN ";
+
+ case 258:
+ return "WM_CHAR ";
+
+ case 47:
+ return "WM_CHARTOITEM ";
+
+ case 34:
+ return "WM_CHILDACTIVATE ";
+
+ case 771:
+ return "WM_CLEAR ";
+
+ case 16:
+ return "WM_CLOSE ";
+
+ case 273:
+ return "WM_COMMAND ";
+
+ case 68:
+ return "WM_COMMNOTIFY ";
+
+ case 65:
+ return "WM_COMPACTING ";
+
+ case 57:
+ return "WM_COMPAREITEM ";
+
+ case 123:
+ return "WM_CONTEXTMENU ";
+
+ case 769:
+ return "WM_COPY ";
+
+ case 74:
+ return "WM_COPYDATA ";
+
+ case 1:
+ return "WM_CREATE ";
+
+ case 309:
+ return "WM_CTLCOLORBTN ";
+
+ case 310:
+ return "WM_CTLCOLORDLG ";
+
+ case 307:
+ return "WM_CTLCOLOREDIT ";
+
+ case 308:
+ return "WM_CTLCOLORLISTBOX ";
+
+ case 306:
+ return "WM_CTLCOLORMSGBOX ";
+
+ case 311:
+ return "WM_CTLCOLORSCROLLBAR ";
+
+ case 312:
+ return "WM_CTLCOLORSTATIC ";
+
+ case 768:
+ return "WM_CUT ";
+
+ case 259:
+ return "WM_DEADCHAR ";
+
+ case 45:
+ return "WM_DELETEITEM ";
+
+ case 2:
+ return "WM_DESTROY ";
+
+ case 775:
+ return "WM_DESTROYCLIPBOARD ";
+
+ case 537:
+ return "WM_DEVICECHANGE ";
+
+ case 27:
+ return "WM_DEVMODECHANGE ";
+
+ case 126:
+ return "WM_DISPLAYCHANGE ";
+
+ case 776:
+ return "WM_DRAWCLIPBOARD ";
+
+ case 43:
+ return "WM_DRAWITEM ";
+
+ case 563:
+ return "WM_DROPFILES ";
+
+ case 10:
+ return "WM_ENABLE ";
+
+ case 22:
+ return "WM_ENDSESSION ";
+
+ case 289:
+ return "WM_ENTERIDLE ";
+
+ case 529:
+ return "WM_ENTERMENULOOP ";
+
+ case 561:
+ return "WM_ENTERSIZEMOVE ";
+
+ case 20:
+ return "WM_ERASEBKGND ";
+
+ case 530:
+ return "WM_EXITMENULOOP ";
+
+ case 562:
+ return "WM_EXITSIZEMOVE ";
+
+ case 29:
+ return "WM_FONTCHANGE ";
+
+ case 135:
+ return "WM_GETDLGCODE ";
+
+ case 49:
+ return "WM_GETFONT ";
+
+ case 51:
+ return "WM_GETHOTKEY ";
+
+ case 127:
+ return "WM_GETICON ";
+
+ case 36:
+ return "WM_GETMINMAXINFO ";
+
+ case 13:
+ return "WM_GETTEXT ";
+
+ case 14:
+ return "WM_GETTEXTLENGTH ";
+
+ case 856:
+ return "WM_HANDHELDFIRST ";
+
+ case 863:
+ return "WM_HANDHELDLAST ";
+
+ case 83:
+ return "WM_HELP ";
+
+ case 786:
+ return "WM_HOTKEY ";
+
+ case 276:
+ return "WM_HSCROLL ";
+
+ case 782:
+ return "WM_HSCROLLCLIPBOARD ";
+
+ case 39:
+ return "WM_ICONERASEBKGND ";
+
+ case 272:
+ return "WM_INITDIALOG ";
+
+ case 278:
+ return "WM_INITMENU ";
+
+ case 279:
+ return "WM_INITMENUPOPUP ";
+
+ case 0x00FF:
+ return "WM_INPUT ";
+
+ case 81:
+ return "WM_INPUTLANGCHANGE ";
+
+ case 80:
+ return "WM_INPUTLANGCHANGEREQUEST ";
+
+ case 256:
+ return "WM_KEYDOWN ";
+
+ case 257:
+ return "WM_KEYUP ";
+
+ case 8:
+ return "WM_KILLFOCUS ";
+
+ case 546:
+ return "WM_MDIACTIVATE ";
+
+ case 551:
+ return "WM_MDICASCADE ";
+
+ case 544:
+ return "WM_MDICREATE ";
+
+ case 545:
+ return "WM_MDIDESTROY ";
+
+ case 553:
+ return "WM_MDIGETACTIVE ";
+
+ case 552:
+ return "WM_MDIICONARRANGE ";
+
+ case 549:
+ return "WM_MDIMAXIMIZE ";
+
+ case 548:
+ return "WM_MDINEXT ";
+
+ case 564:
+ return "WM_MDIREFRESHMENU ";
+
+ case 547:
+ return "WM_MDIRESTORE ";
+
+ case 560:
+ return "WM_MDISETMENU ";
+
+ case 550:
+ return "WM_MDITILE ";
+
+ case 44:
+ return "WM_MEASUREITEM ";
+
+ case 0x003D:
+ return "WM_GETOBJECT ";
+
+ case 0x0127:
+ return "WM_CHANGEUISTATE ";
+
+ case 0x0128:
+ return "WM_UPDATEUISTATE ";
+
+ case 0x0129:
+ return "WM_QUERYUISTATE ";
+
+ case 0x0125:
+ return "WM_UNINITMENUPOPUP ";
+
+ case 290:
+ return "WM_MENURBUTTONUP ";
+
+ case 0x0126:
+ return "WM_MENUCOMMAND ";
+
+ case 0x0124:
+ return "WM_MENUGETOBJECT ";
+
+ case 0x0123:
+ return "WM_MENUDRAG ";
+
+ case 0x0319:
+ return "WM_APPCOMMAND ";
+
+ case 288:
+ return "WM_MENUCHAR ";
+
+ case 287:
+ return "WM_MENUSELECT ";
+
+ case 531:
+ return "WM_NEXTMENU ";
+
+ case 3:
+ return "WM_MOVE ";
+
+ case 534:
+ return "WM_MOVING ";
+
+ case 134:
+ return "WM_NCACTIVATE ";
+
+ case 131:
+ return "WM_NCCALCSIZE ";
+
+ case 129:
+ return "WM_NCCREATE ";
+
+ case 130:
+ return "WM_NCDESTROY ";
+
+ case 132:
+ return "WM_NCHITTEST ";
+
+ case 163:
+ return "WM_NCLBUTTONDBLCLK ";
+
+ case 161:
+ return "WM_NCLBUTTONDOWN ";
+
+ case 162:
+ return "WM_NCLBUTTONUP ";
+
+ case 169:
+ return "WM_NCMBUTTONDBLCLK ";
+
+ case 167:
+ return "WM_NCMBUTTONDOWN ";
+
+ case 168:
+ return "WM_NCMBUTTONUP ";
+
+ case 171:
+ return "WM_NCXBUTTONDOWN ";
+
+ case 172:
+ return "WM_NCXBUTTONUP ";
+
+ case 173:
+ return "WM_NCXBUTTONDBLCLK ";
+
+ case 0x02A0:
+ return "WM_NCMOUSEHOVER ";
+
+ case 0x02A2:
+ return "WM_NCMOUSELEAVE ";
+
+ case 160:
+ return "WM_NCMOUSEMOVE ";
+
+ case 133:
+ return "WM_NCPAINT ";
+
+ case 166:
+ return "WM_NCRBUTTONDBLCLK ";
+
+ case 164:
+ return "WM_NCRBUTTONDOWN ";
+
+ case 165:
+ return "WM_NCRBUTTONUP ";
+
+ case 40:
+ return "WM_NEXTDLGCTL ";
+
+ case 78:
+ return "WM_NOTIFY ";
+
+ case 85:
+ return "WM_NOTIFYFORMAT ";
+
+ case 0:
+ return "WM_NULL ";
+
+ case 15:
+ return "WM_PAINT ";
+
+ case 777:
+ return "WM_PAINTCLIPBOARD ";
+
+ case 38:
+ return "WM_PAINTICON ";
+
+ case 785:
+ return "WM_PALETTECHANGED ";
+
+ case 784:
+ return "WM_PALETTEISCHANGING ";
+
+ case 528:
+ return "WM_PARENTNOTIFY ";
+
+ case 770:
+ return "WM_PASTE ";
+
+ case 896:
+ return "WM_PENWINFIRST ";
+
+ case 911:
+ return "WM_PENWINLAST ";
+
+ case 72:
+ return "WM_POWER ";
+
+ case 536:
+ return "WM_POWERBROADCAST ";
+
+ case 791:
+ return "WM_PRINT ";
+
+ case 792:
+ return "WM_PRINTCLIENT ";
+
+ case 55:
+ return "WM_QUERYDRAGICON ";
+
+ case 17:
+ return "WM_QUERYENDSESSION ";
+
+ case 783:
+ return "WM_QUERYNEWPALETTE ";
+
+ case 19:
+ return "WM_QUERYOPEN ";
+
+ case 35:
+ return "WM_QUEUESYNC ";
+
+ case 18:
+ return "WM_QUIT ";
+
+ case 774:
+ return "WM_RENDERALLFORMATS ";
+
+ case 773:
+ return "WM_RENDERFORMAT ";
+
+ case 32:
+ return "WM_SETCURSOR ";
+
+ case 7:
+ return "WM_SETFOCUS ";
+
+ case 48:
+ return "WM_SETFONT ";
+
+ case 50:
+ return "WM_SETHOTKEY ";
+
+ case 128:
+ return "WM_SETICON ";
+
+ case 11:
+ return "WM_SETREDRAW ";
+
+ case 12:
+ return "WM_SETTEXT ";
+
+ case 26:
+ return "WM_SETTINGCHANGE ";
+
+ case 24:
+ return "WM_SHOWWINDOW ";
+
+ case 5:
+ return "WM_SIZE ";
+
+ case 779:
+ return "WM_SIZECLIPBOARD ";
+
+ case 532:
+ return "WM_SIZING ";
+
+ case 42:
+ return "WM_SPOOLERSTATUS ";
+
+ case 125:
+ return "WM_STYLECHANGED ";
+
+ case 124:
+ return "WM_STYLECHANGING ";
+
+ case 262:
+ return "WM_SYSCHAR ";
+
+ case 21:
+ return "WM_SYSCOLORCHANGE ";
+
+ case 274:
+ return "WM_SYSCOMMAND ";
+
+ case 263:
+ return "WM_SYSDEADCHAR ";
+
+ case 260:
+ return "WM_SYSKEYDOWN ";
+
+ case 261:
+ return "WM_SYSKEYUP ";
+
+ case 82:
+ return "WM_TCARD ";
+
+ case 794:
+ return "WM_THEMECHANGED ";
+
+ case 30:
+ return "WM_TIMECHANGE ";
+
+ case 275:
+ return "WM_TIMER ";
+
+ case 772:
+ return "WM_UNDO ";
+
+ case 1024:
+ return "WM_USER ";
+
+ case 84:
+ return "WM_USERCHANGED ";
+
+ case 46:
+ return "WM_VKEYTOITEM ";
+
+ case 277:
+ return "WM_VSCROLL ";
+
+ case 778:
+ return "WM_VSCROLLCLIPBOARD ";
+
+ case 71:
+ return "WM_WINDOWPOSCHANGED ";
+
+ case 70:
+ return "WM_WINDOWPOSCHANGING ";
+
+ case 264:
+ return "WM_KEYLAST ";
+
+ case 136:
+ return "WM_SYNCPAINT ";
+
+ case 33:
+ return "WM_MOUSEACTIVATE ";
+
+ case 512:
+ return "WM_MOUSEMOVE ";
+
+ case 513:
+ return "WM_LBUTTONDOWN ";
+
+ case 514:
+ return "WM_LBUTTONUP ";
+
+ case 515:
+ return "WM_LBUTTONDBLCLK ";
+
+ case 516:
+ return "WM_RBUTTONDOWN ";
+
+ case 517:
+ return "WM_RBUTTONUP ";
+
+ case 518:
+ return "WM_RBUTTONDBLCLK ";
+
+ case 519:
+ return "WM_MBUTTONDOWN ";
+
+ case 520:
+ return "WM_MBUTTONUP ";
+
+ case 521:
+ return "WM_MBUTTONDBLCLK ";
+
+ case 522:
+ return "WM_MOUSEWHEEL ";
+
+ case 523:
+ return "WM_XBUTTONDOWN ";
+
+ case 524:
+ return "WM_XBUTTONUP ";
+
+ case 525:
+ return "WM_XBUTTONDBLCLK ";
+
+ case 0x2A1:
+ return "WM_MOUSEHOVER ";
+
+ case 0x2A3:
+ return "WM_MOUSELEAVE ";
+
+ }
+
+ sprintf(str,"%d",msg);
+
+ return str;
+}
Added: trunk/netsurf/windows/windbg.h
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/windbg.h?rev=1088...
==============================================================================
--- trunk/netsurf/windows/windbg.h (added)
+++ trunk/netsurf/windows/windbg.h Sun Oct 10 17:42:24 2010
@@ -1,0 +1,1 @@
+const char *msg_num_to_name(int msg);
12 years, 7 months
r10879 chris_y - /trunk/netsurf/amiga/bitmap.c
by netsurf@semichrome.net
Author: chris_y
Date: Sun Oct 10 04:30:22 2010
New Revision: 10879
URL: http://source.netsurf-browser.org?rev=10879&view=rev
Log:
Use function instead of directly calling DTM_WRITE
Modified:
trunk/netsurf/amiga/bitmap.c
Modified: trunk/netsurf/amiga/bitmap.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/bitmap.c?rev=10879&...
==============================================================================
--- trunk/netsurf/amiga/bitmap.c (original)
+++ trunk/netsurf/amiga/bitmap.c Sun Oct 10 04:30:22 2010
@@ -130,21 +130,17 @@
bool bitmap_save(void *bitmap, const char *path, unsigned flags)
{
- BPTR fh = 0;
+ int err = 0;
Object *dto = NULL;
if(dto = ami_datatype_object_from_bitmap(bitmap))
{
- if(fh = Open(path,MODE_NEWFILE))
- {
- DoDTMethod(dto,NULL,NULL,DTM_WRITE,NULL,fh,DTWM_IFF,NULL);
- Close(fh);
- }
-
+ err = SaveDTObjectA(dto, NULL, NULL, path, DTWM_IFF, FALSE, NULL);
DisposeDTObject(dto);
}
- return true;
+ if(err == 0) return false;
+ else return true;
}
12 years, 7 months
r10878 chris_y - /trunk/netsurf/amiga/plotters.c
by netsurf@semichrome.net
Author: chris_y
Date: Sun Oct 10 04:24:19 2010
New Revision: 10878
URL: http://source.netsurf-browser.org?rev=10878&view=rev
Log:
Fix full Cairo build
Modified:
trunk/netsurf/amiga/plotters.c
Modified: trunk/netsurf/amiga/plotters.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/plotters.c?rev=1087...
==============================================================================
--- trunk/netsurf/amiga/plotters.c (original)
+++ trunk/netsurf/amiga/plotters.c Sun Oct 10 04:24:19 2010
@@ -344,9 +344,9 @@
/* core expects horizontal and vertical lines to be on pixels, not
* between pixels */
- cairo_move_to(current_cr, (x0 == x1) ? x0 + 0.5 : x0,
+ cairo_move_to(glob->cr, (x0 == x1) ? x0 + 0.5 : x0,
(y0 == y1) ? y0 + 0.5 : y0);
- cairo_line_to(current_cr, (x0 == x1) ? x1 + 0.5 : x1,
+ cairo_line_to(glob->cr, (x0 == x1) ? x1 + 0.5 : x1,
(y0 == y1) ? y1 + 0.5 : y1);
cairo_stroke(glob->cr);
#endif
12 years, 7 months
r10877 stevef - /trunk/netsurf/riscos/url_suggest.c
by netsurf@semichrome.net
Author: stevef
Date: Sun Oct 10 04:13:18 2010
New Revision: 10877
URL: http://source.netsurf-browser.org?rev=10877&view=rev
Log:
Assert is more appropriate; tidy up.
Modified:
trunk/netsurf/riscos/url_suggest.c
Modified: trunk/netsurf/riscos/url_suggest.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/url_suggest.c?rev=...
==============================================================================
--- trunk/netsurf/riscos/url_suggest.c (original)
+++ trunk/netsurf/riscos/url_suggest.c Sun Oct 10 04:13:18 2010
@@ -111,12 +111,7 @@
list = next;
}
- /* If i hasn't reached 0, then something went wrong -- get
- * out now!
- */
-
- if (i > 0)
- return false;
+ assert(i == 0);
suggest_menu->entries[0].menu_flags |=
wimp_MENU_TITLE_INDIRECTED;
@@ -146,7 +141,7 @@
/* Ignore unvisited URLs, and those that don't apply to HTML or Text. */
- if (data->visits <= 0 ||(data->type != CONTENT_HTML &&
+ if (data->visits <= 0 || (data->type != CONTENT_HTML &&
data->type != CONTENT_TEXTPLAIN))
return true;
12 years, 7 months
r10876 stevef - /trunk/netsurf/desktop/tree.c
by netsurf@semichrome.net
Author: stevef
Date: Sun Oct 10 04:10:44 2010
New Revision: 10876
URL: http://source.netsurf-browser.org?rev=10876&view=rev
Log:
- Request correct redraw area when changing a node's size in tree_handle_node_changed().
- Update parameter documentation to match function definitions.
Modified:
trunk/netsurf/desktop/tree.c
Modified: trunk/netsurf/desktop/tree.c
URL: http://source.netsurf-browser.org/trunk/netsurf/desktop/tree.c?rev=10876&...
==============================================================================
--- trunk/netsurf/desktop/tree.c (original)
+++ trunk/netsurf/desktop/tree.c Sun Oct 10 04:10:44 2010
@@ -148,13 +148,10 @@
/**
* Creates and initialises a new tree.
*
- * \param flags flag word for flags to create the new tree with
- * \param redraw_request function to be called each time the tree wants to
- * be redrawn
- * \param client_data data to be passed to start_redraw and end_redraw
- * \param root gets updated to point at the root of the tree,
- * if not NULL
- * \return the newly created tree, or NULL on memory exhaustion
+ * \param flags Flag word for flags to create the new tree with
+ * \param callbacks Callback functions to support the tree in the frontend.
+ * \param client_data Data to be passed to start_redraw and end_redraw
+ * \return The newly created tree, or NULL on memory exhaustion
*/
struct tree *tree_create(unsigned int flags,
const struct treeview_table *callbacks, void *client_data)
@@ -260,7 +257,7 @@
* \param node the node to calculate the height of
* \return the total height of the node and children
*/
-static int tree_get_node_height(struct node *node)
+static int tree_get_node_height(struct node *node)
{
int y1;
@@ -276,7 +273,7 @@
}
node = node->child;
- while ((node->next != NULL) ||
+ while ((node->next != NULL) ||
((node->child != NULL) && (node->expanded))) {
for (; node->next != NULL; node = node->next);
@@ -323,7 +320,7 @@
* \param tree the tree to which 'root' belongs
* \param root the root node to update from
*/
-static void tree_recalculate_node_positions(struct tree *tree,
+static void tree_recalculate_node_positions(struct tree *tree,
struct node *root)
{
struct node *parent;
@@ -543,7 +540,7 @@
struct node_element *element;
element = calloc(sizeof(struct node_element), 1);
- if (element == NULL)
+ if (element == NULL)
return NULL;
element->parent = parent;
@@ -631,12 +628,13 @@
static void tree_handle_node_changed(struct tree *tree, struct node *node,
bool recalculate_sizes, bool expansion)
{
- int width, height, tree_height;
+ int node_width, node_height, tree_width, tree_height;
assert(node != NULL);
- width = node->box.width;
- height = node->box.height;
+ node_width = node->box.width;
+ node_height = node->box.height;
+ tree_width = tree->width;
tree_height = tree->height;
if ((recalculate_sizes) || (expansion)) {
@@ -644,24 +642,26 @@
}
if (tree != NULL) {
- if ((node->box.height != height) || (expansion)) {
+ if ((node->box.height != node_height) || (expansion)) {
tree_recalculate_node_positions(tree, tree->root);
tree_recalculate_size(tree);
- tree_height = (tree_height > tree->height) ?
- tree_height : tree->height;
+ if (tree->width > tree_width)
+ tree_width = tree->width;
+ if (tree->height > tree_height)
+ tree_height = tree->height;
if (tree->redraw) {
tree->callbacks->redraw_request(0, node->box.y,
- tree->width,
+ tree_width,
tree_height - node->box.y,
tree->client_data);
}
} else {
- width = (width > node->box.width) ?
- width : node->box.width;
+ if (node->box.width > node_width)
+ node_width = node->box.width;
if (tree->redraw)
tree->callbacks->redraw_request(node->box.x,
node->box.y,
- width, node->box.height,
+ node_width, node->box.height,
tree->client_data);
if (recalculate_sizes) {
tree_recalculate_size(tree);
@@ -782,7 +782,7 @@
if (tree->redraw) {
tree->callbacks->redraw_request(element->box.x,
element->box.y,
- width,
+ width,
element->box.height,
tree->client_data);
}
@@ -1495,7 +1495,7 @@
* \param tree_x X coordinate of the tree
* \param tree_y Y coordinate of the tree
*/
-static void tree_draw_node_element(struct tree *tree,
+static void tree_draw_node_element(struct tree *tree,
struct node_element *element, int tree_x, int tree_y)
{
@@ -1589,8 +1589,8 @@
*/
static void tree_draw_node(struct tree *tree, struct node *node,
int tree_x, int tree_y,
- int clip_x, int clip_y,
- int clip_width, int clip_height)
+ int clip_x, int clip_y,
+ int clip_width, int clip_height)
{
struct node_element *element;
struct node *parent;
@@ -1874,7 +1874,7 @@
* \param furniture whether the returned area was in an elements furniture
* \return the node at the specified position, or NULL for none
*/
-static struct node *tree_get_node_at(struct node *root, int x, int y,
+static struct node *tree_get_node_at(struct node *root, int x, int y,
bool *furniture)
{
struct node_element *result;
@@ -2179,7 +2179,7 @@
* \param height the height of the selection rectangle
* \param invert whether to invert the selected state
*/
-static void tree_handle_selection_area_node(struct tree *tree,
+static void tree_handle_selection_area_node(struct tree *tree,
struct node *node, int y, int height, bool invert)
{
struct node_element *element;
@@ -2302,7 +2302,7 @@
* inside of folders)
* \return the node moved
*/
-static struct node *tree_move_processing_node(struct tree *tree,
+static struct node *tree_move_processing_node(struct tree *tree,
struct node *node, struct node *link, bool before, bool first)
{
struct node *result;
@@ -2339,7 +2339,7 @@
* \param before whether to link siblings before or after the supplied
* node
*/
-static void tree_move_selected_nodes(struct tree *tree,
+static void tree_move_selected_nodes(struct tree *tree,
struct node *destination, bool before)
{
struct node *link;
12 years, 7 months
r10875 vince - /trunk/netsurf/windows/gui.c
by netsurf@semichrome.net
Author: vince
Date: Sat Oct 9 13:02:29 2010
New Revision: 10875
URL: http://source.netsurf-browser.org?rev=10875&view=rev
Log:
extend debug
clean up sub window creation
Modified:
trunk/netsurf/windows/gui.c
Modified: trunk/netsurf/windows/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/gui.c?rev=10875&r...
==============================================================================
--- trunk/netsurf/windows/gui.c (original)
+++ trunk/netsurf/windows/gui.c Sat Oct 9 13:02:29 2010
@@ -679,10 +679,22 @@
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,
@@ -695,6 +707,7 @@
ps.rcPaint.bottom,
gw->bw->scale,
0xFFFFFF);
+ LOG(("complete"));
}
EndPaint(hwnd, &ps);
@@ -1435,13 +1448,13 @@
/**
* 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 @@
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;
}
12 years, 7 months
r10874 vince - in /trunk/netsurf: Docs/BUILDING-Windows utils/config.h utils/findresource.c windows/gui.c windows/misc.c windows/tree.c
by netsurf@semichrome.net
Author: vince
Date: Sat Oct 9 13:00:32 2010
New Revision: 10874
URL: http://source.netsurf-browser.org?rev=10874&view=rev
Log:
Update build instructions
Remove warnings from treeview branch merge
Modified:
trunk/netsurf/Docs/BUILDING-Windows
trunk/netsurf/utils/config.h
trunk/netsurf/utils/findresource.c
trunk/netsurf/windows/gui.c
trunk/netsurf/windows/misc.c
trunk/netsurf/windows/tree.c
Modified: trunk/netsurf/Docs/BUILDING-Windows
URL: http://source.netsurf-browser.org/trunk/netsurf/Docs/BUILDING-Windows?rev...
==============================================================================
--- trunk/netsurf/Docs/BUILDING-Windows (original)
+++ trunk/netsurf/Docs/BUILDING-Windows Sat Oct 9 13:00:32 2010
@@ -80,6 +80,18 @@
For other OS the apropriate packages and environment must be installed.
+ pkg-config
+------------
+
+ A pkg-config wrapper script is required to make things easier
+
+cat > /usr/i586-mingw32msvc/bin/pkg-config <<EOF
+#!/bin/bash
+export PKG_CONFIG_LIBDIR=/usr/i586-mingw32msvc/lib/pkgconfig
+/usr/bin/pkg-config $*
+EOF
+
+
Base libraries
----------------
@@ -109,71 +121,53 @@
regex:
- $ wget http://downloads.sourceforge.net/project/mingw/User%20Contributed/regex/m...
+ $ wget http://downloads.sourceforge.net/project/mingw/UserContributed/regex/ming...
$ tar -zxf mingw-libgnurx-2.5.1-src.tar.gz
+ $ cd mingw-libgnurx-2.5.1
$ ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc
$ make
$ sudo make install
openssl:
- $ wget http://www.openssl.org/source/openssl-0.9.8l.tar.gz
- $ tar -zxf openssl-0.9.8l.tar.gz
- $ cd openssl-0.9.8l
-
---- openssl-0.9.8l/Configure 2009-11-05 12:07:06.000000000 +0000
-+++ openssl-0.9.8l-work/Configure 2010-01-25 12:35:13.000000000 +0000
-@@ -1059,7 +1059,7 @@
-
- my $IsMK1MF=scalar grep /^$target$/,@MK1MF_Builds;
-
--$IsMK1MF=1 if ($target eq "mingw" && $^O ne "cygwin" && !is_msys());
-+#$IsMK1MF=1 if ($target eq "mingw" && $^O ne "cygwin" && !is_msys());
-
- $no_shared = 0 if ($fipsdso && !$IsMK1MF);
-
---- openssl-0.9.8l/e_os2.h 2005-12-18 18:57:07.000000000 +0000
-+++ openssl-0.9.8l-work/e_os2.h 2010-01-25 12:42:48.000000000 +0000
-@@ -264,7 +264,7 @@
- # define OPENSSL_IMPLEMENT_GLOBAL(type,name) \
- extern type _hide_##name; \
- type *_shadow_##name(void) { return &_hide_##name; } \
-- static type _hide_##name
-+ type _hide_##name
- # define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void)
- # define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name()))
- #else
-
- $ ./Configure no-shared --prefix=/usr/i586-mingw32msvc/ mingw
- $ make CC=i586-mingw32msvc-gcc RANLIB=i586-mingw32msvc-ranlib
+ $ wget http://www.openssl.org/source/openssl-1.0.0a.tar.gz
+ $ tar -zxf openssl-1.0.0a.tar.gz
+ $ cd openssl-1.0.0a
+ $ PATH=/usr/i586-mingw32msvc/bin/:$PATH ./Configure no-shared disable-capieng --prefix=/usr/i586-mingw32msvc/ mingw
+ $ PATH=/usr/i586-mingw32msvc/bin/:$PATH make CC=i586-mingw32msvc-gcc RANLIB=i586-mingw32msvc-ranlib
+ $ sudo make install
libxml:
$ apt-get source libxml2
- $ cd libxml2-2.6.32.dfsg/
- $ ./configure --prefix=/usr/i586-mingw32msvc/ --disable-shared --host=i586-mingw32msvc
+ $ cd libxml2-2.7.6.dfsg
+ $ ./configure --prefix=/usr/i586-mingw32msvc/ --disable-shared --without-python --host=i586-mingw32msvc
$ make
$ sudo make install
libcurl:
- $ LDFLAGS=-mwindows ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc --disable-shared --disable-ldap
+ $ wget -q http://curl.haxx.se/download/curl-7.21.1.tar.gz
+ $ tar -zxf curl-7.21.1.tar.gz
+ $ cd curl-7.21.1
+ $ LDFLAGS=-mwindows ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc --disable-shared --disable-ldap --without-random
$ make
$ sudo make install
libpng:
- $ wget "http://downloads.sourceforge.net/project/libpng/01-libpng-master/1.4.0/li..."
- $ tar -zxf libpng-1.4.0.tar.gz
- $ cd libpng-1.4.0
+ $ wget http://download.sourceforge.net/libpng/libpng-1.4.4.tar.gz
+ $ tar -zxf libpng-1.4.4.tar.gz
+ $ cd libpng-1.4.4
+ $ ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc
$ make
$ sudo make install
libjpeg:
- $ wget http://www.ijg.org/files/jpegsrc.v8.tar.gz
- $ tar -zxf jpegsrc.v8.tar.gz
- $ cd jpeg-8
+ $ wget http://www.ijg.org/files/jpegsrc.v8b.tar.gz
+ $ tar -zxf jpegsrc.v8b.tar.gz
+ $ cd jpeg-8b
$ ./configure --prefix=/usr/i586-mingw32msvc/ --host=i586-mingw32msvc --disable-shared
$ make
$ sudo make install
Modified: trunk/netsurf/utils/config.h
URL: http://source.netsurf-browser.org/trunk/netsurf/utils/config.h?rev=10874&...
==============================================================================
--- trunk/netsurf/utils/config.h (original)
+++ trunk/netsurf/utils/config.h Sat Oct 9 13:00:32 2010
@@ -56,6 +56,7 @@
#define HAVE_REALPATH
#if (defined(_WIN32))
#undef HAVE_REALPATH
+char *realpath(const char *path, char *resolved_path);
#endif
#define HAVE_MKDIR
Modified: trunk/netsurf/utils/findresource.c
URL: http://source.netsurf-browser.org/trunk/netsurf/utils/findresource.c?rev=...
==============================================================================
--- trunk/netsurf/utils/findresource.c (original)
+++ trunk/netsurf/utils/findresource.c Sat Oct 9 13:00:32 2010
@@ -32,6 +32,7 @@
#include <unistd.h>
#include <string.h>
+#include "utils/config.h"
#include "utils/findresource.h"
#define MAX_RESPATH 128 /* maximum number of elements in the resource vector */
Modified: trunk/netsurf/windows/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/gui.c?rev=10874&r...
==============================================================================
--- trunk/netsurf/windows/gui.c (original)
+++ trunk/netsurf/windows/gui.c Sat Oct 9 13:00:32 2010
@@ -58,6 +58,7 @@
#include "windows/plot.h"
#include "windows/prefs.h"
#include "windows/resourceid.h"
+#include "windows/schedule.h"
char *default_stylesheet_url;
char *adblock_stylesheet_url;
Modified: trunk/netsurf/windows/misc.c
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/misc.c?rev=10874&...
==============================================================================
--- trunk/netsurf/windows/misc.c (original)
+++ trunk/netsurf/windows/misc.c Sat Oct 9 13:00:32 2010
@@ -41,11 +41,6 @@
exit(1);
}
-bool cookies_update(const char *domain, const struct cookie_data *data)
-{
- return true;
-}
-
/**
* Return the filename part of a full path
*
Modified: trunk/netsurf/windows/tree.c
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/tree.c?rev=10874&...
==============================================================================
--- trunk/netsurf/windows/tree.c (original)
+++ trunk/netsurf/windows/tree.c Sat Oct 9 13:00:32 2010
@@ -17,11 +17,10 @@
*/
#include "desktop/tree.h"
+#include "desktop/tree_url_node.h"
const char tree_directory_icon_name[] = "directory.png";
const char tree_content_icon_name[] = "content.png";
-
-
/**
12 years, 7 months
r10873 vince - in /trunk/netsurf/utils: config.h utils.c
by netsurf@semichrome.net
Author: vince
Date: Sat Oct 9 12:11:28 2010
New Revision: 10873
URL: http://source.netsurf-browser.org?rev=10873&view=rev
Log:
add realpath compatability for windows
Modified:
trunk/netsurf/utils/config.h
trunk/netsurf/utils/utils.c
Modified: trunk/netsurf/utils/config.h
URL: http://source.netsurf-browser.org/trunk/netsurf/utils/config.h?rev=10873&...
==============================================================================
--- trunk/netsurf/utils/config.h (original)
+++ trunk/netsurf/utils/config.h Sat Oct 9 12:11:28 2010
@@ -53,6 +53,11 @@
#undef HAVE_UTSNAME
#endif
+#define HAVE_REALPATH
+#if (defined(_WIN32))
+#undef HAVE_REALPATH
+#endif
+
#define HAVE_MKDIR
#if (defined(_WIN32))
#undef HAVE_MKDIR
Modified: trunk/netsurf/utils/utils.c
URL: http://source.netsurf-browser.org/trunk/netsurf/utils/utils.c?rev=10873&r...
==============================================================================
--- trunk/netsurf/utils/utils.c (original)
+++ trunk/netsurf/utils/utils.c Sat Oct 9 12:11:28 2010
@@ -490,3 +490,18 @@
return 0;
}
#endif
+
+#ifndef HAVE_REALPATH
+char *realpath(const char *path, char *resolved_path)
+{
+ char *ret;
+ if (resolved_path == NULL) {
+ ret=strdup(path);
+ } else {
+ ret = resolved_path;
+ strcpy(resolved_path, path);
+ }
+ return ret;
+}
+
+#endif
12 years, 7 months