71#define NSWS_THROBBER_WIDTH 24
76#define NSWS_URLBAR_HEIGHT 23
81#define NSW32_PGIBUTTON_HEIGHT 16
99 for (i = 0; i < nitems; i++) {
100 accels[i].fVirt = FCONTROL | FVIRTKEY;
103 accels[0].key = 0x51;
105 accels[1].key = 0x4E;
107 accels[2].key = VK_LEFT;
109 accels[3].key = VK_RIGHT;
111 accels[4].key = VK_UP;
113 accels[5].key = VK_BACK;
115 accels[6].key = VK_SPACE;
117 accels[7].key = 0x4C;
119 accels[8].key = 0x57;
121 accels[9].key = 0x41;
123 accels[10].key = VK_F8;
125 accels[11].key = VK_RETURN;
126 accels[11].fVirt = FVIRTKEY;
128 accels[12].key = VK_F11;
129 accels[12].fVirt = FVIRTKEY;
132 gw->
acceltable = CreateAcceleratorTable(accels, nitems);
146 INITCOMMONCONTROLSEX icc;
147 int xpos = CW_USEDEFAULT;
148 int ypos = CW_USEDEFAULT;
149 int width = CW_USEDEFAULT;
150 int height = CW_USEDEFAULT;
161 NSLOG(netsurf, DEBUG,
"Setting Window position %d,%d %d,%d",
165 icc.dwSize =
sizeof(icc);
166 icc.dwICC = ICC_BAR_CLASSES | ICC_WIN95_CLASSES;
168 icc.dwICC |= ICC_STANDARD_CLASSES;
170 InitCommonControlsEx(&icc);
175 hwnd = CreateWindowExW(0,
178 WS_OVERLAPPEDWINDOW |
192 NSLOG(netsurf, INFO,
"Window create failed");
213 int notification_code,
217 NSLOG(netsurf, DEBUG,
218 "notification_code %d identifier %d ctrl_window %p",
226 switch (notification_code) {
228 NSLOG(netsurf, DEBUG,
"EN_CHANGE");
232 NSLOG(netsurf, DEBUG,
"EN_ERRSPACE");
236 NSLOG(netsurf, DEBUG,
"EN_HSCROLL");
240 NSLOG(netsurf, DEBUG,
"EN_KILLFOCUS");
244 NSLOG(netsurf, DEBUG,
"EN_MAXTEXT");
248 NSLOG(netsurf, DEBUG,
"EN_SETFOCUS");
252 NSLOG(netsurf, DEBUG,
"EN_UPDATE");
256 NSLOG(netsurf, DEBUG,
"EN_VSCROLL");
260 NSLOG(netsurf, DEBUG,
"Unknown notification_code");
296 GetClientRect(hWndParent, &rc);
298 *y = ((((rc.bottom - 1) - cy_edit) >> 1) * 2) / 3;
314static LRESULT CALLBACK
318 int urlx, urly, urlwidth, urlheight;
323 toolproc = (WNDPROC)GetProp(hwnd, TEXT(
"OrigMsgProc"));
324 assert(toolproc != NULL);
334 &urlx, &urly, &urlwidth, &urlheight);
359 (HWND)lparam) == 0) {
366 RemoveProp(hwnd, TEXT(
"GuiWnd"));
367 RemoveProp(hwnd, TEXT(
"OrigMsgProc"));
369 SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)toolproc);
375 return CallWindowProc(toolproc, hwnd, msg, wparam, lparam);
382 GetClientRect(hwnd, &rc);
384 SendMessage(hwnd, EM_SETRECT, 0, (LPARAM)&rc);
385 NSLOG(netsurf, DEBUG,
"left:%ld right:%ld top:%ld bot:%ld",
386 rc.left,rc.right,rc.top,rc.bottom);
400static LRESULT CALLBACK
410 urlproc = (WNDPROC)GetProp(hwnd, TEXT(
"OrigMsgProc"));
411 assert(urlproc != NULL);
421 SendMessage(hwnd, EM_SETSEL, 0, -1);
423 }
else if (wparam == 13) {
430 hFont = (HFONT)SendMessage(hwnd, WM_GETFONT, 0, 0);
432 NSLOG(netsurf, INFO,
"Destroyed font object");
439 RemoveProp(hwnd, TEXT(
"GuiWnd"));
440 RemoveProp(hwnd, TEXT(
"OrigMsgProc"));
442 SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)urlproc);
446 result = CallWindowProc(urlproc, hwnd, msg, wparam, lparam);
453 return CallWindowProc(urlproc, hwnd, msg, wparam, lparam);
471 int urlx, urly, urlwidth, urlheight;
480 &urlx, &urly, &urlwidth, &urlheight);
483 hwnd = CreateWindowEx(0L,
486 WS_CHILD | WS_BORDER | WS_VISIBLE |
487 ES_LEFT | ES_AUTOHSCROLL | ES_MULTILINE,
502 SetProp(hwnd, TEXT(
"GuiWnd"), (HANDLE)gw);
505 urlproc = (WNDPROC)SetWindowLongPtr(hwnd,
510 SetProp(hwnd, TEXT(
"OrigMsgProc"), (HANDLE)urlproc);
512 hFont = CreateFont(urlheight - 4, 0, 0, 0, FW_BOLD, FALSE, FALSE,
513 FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS,
514 CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
515 DEFAULT_PITCH | FF_SWISS,
"Arial");
517 NSLOG(netsurf, INFO,
"Setting font object");
518 SendMessage(hwnd, WM_SETFONT, (WPARAM)hFont, 0);
523 hbutton = CreateWindowEx(0L,
526 WS_CHILD | WS_VISIBLE | BS_BITMAP | BS_FLAT,
537 SetProp(hWndParent, TEXT(
"hPGIbutton"), (HANDLE)hbutton);
544 "Created url bar hwnd:%p, x:%d, y:%d, w:%d, h:%d", hwnd, urlx,
545 urly, urlwidth, urlheight);
565 int urlx, urly, urlwidth, urlheight;
570 &urlx, &urly, &urlwidth, &urlheight);
572 hwnd = CreateWindow(ANIMATE_CLASS,
574 WS_CHILD | WS_VISIBLE | ACS_TRANSPARENT,
587 Animate_Play(hwnd, 0, -1, -1);
589 Animate_Seek(hwnd, 0);
609 HIMAGELIST hImageList;
612 NSLOG(netsurf, INFO,
"resource id %d, bzize %d, bcnt %d", resid,
615 hImageList = ImageList_Create(bsize, bsize,
616 ILC_COLOR24 | ILC_MASK, 0,
618 if (hImageList == NULL) {
622 hScrBM = LoadImage(hInstance,
623 MAKEINTRESOURCE(resid),
628 if (hScrBM == NULL) {
633 if (ImageList_AddMasked(hImageList, hScrBM, 0xcccccc) == -1) {
635 ImageList_Destroy(hImageList);
638 DeleteObject(hScrBM);
660 HIMAGELIST hImageList;
663 TBBUTTON tbButtons[] = {
664 {0,
IDM_NAV_BACK, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
666 {2,
IDM_NAV_HOME, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
668 {4,
IDM_NAV_STOP, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0},
673 hWndToolbar = CreateWindowEx(0,
676 WS_CHILD | TBSTYLE_FLAT,
687 SetProp(hWndToolbar, TEXT(
"GuiWnd"), (HANDLE)gw);
690 toolproc = (WNDPROC)SetWindowLongPtr(hWndToolbar,
695 SetProp(hWndToolbar, TEXT(
"OrigMsgProc"), (HANDLE)toolproc);
698 gw->
toolbuttonc =
sizeof(tbButtons) /
sizeof(TBBUTTON);
705 if (hImageList != NULL) {
706 SendMessage(hWndToolbar,
717 if (hImageList != NULL) {
718 SendMessage(hWndToolbar,
719 TB_SETDISABLEDIMAGELIST,
729 if (hImageList != NULL) {
730 SendMessage(hWndToolbar,
737 SendMessage(hWndToolbar,
739 (WPARAM)
sizeof(TBBUTTON),
742 SendMessage(hWndToolbar,
753 SendMessage(hWndToolbar, TB_AUTOSIZE, 0, 0);
773 hwnd = CreateWindowEx(0,
776 WS_CHILD | WS_VISIBLE,
783 SendMessage(hwnd, SB_SETTEXT, 0, (LPARAM)
"NetSurf");
798 bool paste, copy, del;
801 if (GetFocus() == w->
urlbar) {
803 SendMessage(w->
urlbar, EM_GETSEL, (WPARAM)&i, (LPARAM)&ii);
819 (paste ? MF_ENABLED : MF_GRAYED));
823 (paste ? MF_ENABLED : MF_GRAYED));
827 (copy ? MF_ENABLED : MF_GRAYED));
831 (copy ? MF_ENABLED : MF_GRAYED));
863 GetClientRect(hwnd, &rc);
866 ScreenToClient(hwnd, &pt);
869 if (PtInRect(&rc, pt)) {
870 ClientToScreen(hwnd, &pt);
872 TrackPopupMenu(GetSubMenu(gw->
rclick, 0),
873 TPM_CENTERALIGN | TPM_TOPALIGN,
903 (
forward ? MF_ENABLED : MF_GRAYED));
905 (
back ? MF_ENABLED : MF_GRAYED));
907 (
forward ? MF_ENABLED : MF_GRAYED));
909 (
back ? MF_ENABLED : MF_GRAYED));
913 SendMessage(w->
toolbar, TB_SETSTATE,
915 MAKELONG((
forward ? TBSTATE_ENABLED :
916 TBSTATE_INDETERMINATE), 0));
917 SendMessage(w->
toolbar, TB_SETSTATE,
919 MAKELONG((
back ? TBSTATE_ENABLED :
920 TBSTATE_INDETERMINATE), 0));
936 RECT *redrawrectp = NULL;
942 redrawrectp = &redrawrect;
946 redrawrect.right =(long)
rect->
x1;
947 redrawrect.bottom = (
long)
rect->
y1;
953 RDW_INVALIDATE | RDW_NOERASE);
974 addr = NETSURF_HOMEPAGE;
1004 int notification_code,
1010 NSLOG(netsurf, INFO,
1011 "notification_code %x identifier %x ctrl_window %p",
1016 switch(identifier) {
1023 PostMessage(w->
main, WM_CLOSE, 0, 0);
1041 PostMessage(gw->
main, WM_CLOSE, 0, 0);
1063 if (GetFocus() == gw->
urlbar) {
1064 SendMessage(gw->
urlbar, WM_CUT, 0, 0);
1071 if (GetFocus() == gw->
urlbar) {
1072 SendMessage(gw->
urlbar, WM_COPY, 0, 0);
1079 if (GetFocus() == gw->
urlbar) {
1080 SendMessage(gw->
urlbar, WM_PASTE, 0, 0);
1088 if (GetFocus() == gw->
urlbar)
1089 SendMessage(gw->
urlbar, WM_CLEAR, 0, 0);
1095 if (GetFocus() == gw->
urlbar)
1096 SendMessage(gw->
urlbar, EM_SETSEL, 0, -1);
1109 if ((gw->
bw != NULL) &&
1117 if ((gw->
bw != NULL) &&
1185 GetWindowRect(gw->
main, &r);
1198 HWND desktop = GetDesktopWindow();
1200 if ((desktop == NULL) ||
1205 GetWindowRect(desktop, &rdesk);
1207 DeleteObject(desktop);
1208 SetWindowLong(gw->
main, GWL_STYLE, 0);
1209 SetWindowPos(gw->
main, HWND_TOPMOST, 0, 0,
1210 rdesk.right - rdesk.left,
1211 rdesk.bottom - rdesk.top,
1214 SetWindowLong(gw->
main, GWL_STYLE,
1215 WS_OVERLAPPEDWINDOW |
1216 WS_HSCROLL | WS_VSCROLL |
1218 WS_CLIPSIBLINGS | CS_DBLCLKS);
1219 SetWindowPos(gw->
main, HWND_TOPMOST,
1226 SWP_SHOWWINDOW | SWP_FRAMECHANGED);
1237 if (gw->
bw != NULL) {
1253 "https://www.netsurf-browser.org/documentation/");
1258 "https://www.netsurf-browser.org/documentation/guide");
1263 "https://www.netsurf-browser.org/documentation/info");
1275 if (GetFocus() != gw->
urlbar)
1278 int len = SendMessage(gw->
urlbar, WM_GETTEXTLENGTH, 0, 0);
1280 SendMessage(gw->
urlbar, WM_GETTEXT, (WPARAM)(len + 1), (LPARAM)addr);
1281 NSLOG(netsurf, INFO,
"launching %s\n", addr);
1320 NSLOG(netsurf, INFO,
"get scroll");
1346 RECT rstatus, rtool;
1353 SendMessage(gw->
statusbar, WM_SIZE, wparam, lparam);
1354 SendMessage(gw->
toolbar, WM_SIZE, wparam, lparam);
1356 GetClientRect(gw->
toolbar, &rtool);
1358 gw->
width = LOWORD(lparam);
1359 gw->
height = HIWORD(lparam) - (rtool.bottom - rtool.top) - (rstatus.bottom - rstatus.top);
1372 SendMessage(gw->
toolbar, TB_SETSTATE,
1374 MAKELONG(TBSTATE_INDETERMINATE, 0));
1389static LRESULT CALLBACK
1394 LPCREATESTRUCTW createstruct;
1403 createstruct = (LPCREATESTRUCTW)lparam;
1404 gw = (
struct gui_window *)createstruct->lpCreateParams;
1407 SetProp(hwnd, TEXT(
"GuiWnd"), (HANDLE)gw);
1409 NSLOG(netsurf, INFO,
1410 "created hWnd:%p hInstance %p GUI window %p",
1411 hwnd, createstruct->hInstance, gw);
1425 GetClientRect(hwnd, &rmain);
1426 PostMessage(hwnd, WM_SIZE, 0,
1427 MAKELPARAM(rmain.right, rmain.bottom));
1430 case WM_CONTEXTMENU:
1432 GET_Y_LPARAM(lparam))) {
1439 LOWORD(wparam), (HWND)lparam) == 0) {
1448 RemoveProp(hwnd, TEXT(
"GuiWnd"));
1458 return DefWindowProcW(hwnd, msg, wparam, lparam);
1534 NSLOG(netsurf, INFO,
"Creating gui window for browser window %p",
bw);
1554 if (gw->
mouse == NULL) {
1556 NSLOG(netsurf, INFO,
"Unable to allocate mouse state");
1576 NSLOG(netsurf, INFO,
1577 "new window: main:%p toolbar:%p statusbar %p drawingarea %p",
1601 if (w->
prev != NULL)
1606 if (w->
next != NULL)
1669 NSLOG(netsurf, INFO,
"%p, title %s", w, title);
1670 fulltitle = malloc(strlen(title) +
SLEN(
" - NetSurf") + 1);
1671 if (fulltitle == NULL) {
1672 NSLOG(netsurf, ERROR,
"%s",
1677 strcpy(fulltitle, title);
1678 strcat(fulltitle,
" - NetSurf");
1680 wlen = MultiByteToWideChar(CP_UTF8, 0, fulltitle, -1, NULL, 0);
1682 NSLOG(netsurf, ERROR,
"failed encoding \"%s\"", fulltitle);
1687 enctitle = malloc(2 * (wlen + 1));
1688 if (enctitle == NULL) {
1689 NSLOG(netsurf, ERROR,
"%s encoding \"%s\" len %d",
1695 MultiByteToWideChar(CP_UTF8, 0, fulltitle, -1, enctitle, wlen);
1696 SetWindowTextW(w->
main, enctitle);
1801 MAKELONG(TBSTATE_ENABLED, 0));
1802 SendMessage(w->
toolbar, TB_SETSTATE,
1804 MAKELONG(TBSTATE_INDETERMINATE, 0));
1807 Animate_Play(w->
throbber, 0, -1, -1);
1834 MAKELONG(TBSTATE_INDETERMINATE, 0));
1835 SendMessage(w->
toolbar, TB_SETSTATE,
1837 MAKELONG(TBSTATE_ENABLED, 0));
1856 hbutton = GetProp(gw->
toolbar, TEXT(
"hPGIbutton"));
1860 SendMessageW(hbutton, BM_SETIMAGE, IMAGE_BITMAP,
1931 while (phwnd != NULL) {
1932 gw = GetProp(phwnd, TEXT(
"GuiWnd"));
1935 phwnd = GetParent(phwnd);
1941 while (phwnd != NULL) {
1942 gw = GetProp(phwnd, TEXT(
"GuiWnd"));
1945 phwnd = GetWindow(phwnd, GW_OWNER);
1991 if ((gw == NULL) || (gw->
bw == NULL)) {
2018 NSLOG(netsurf, DEEPDEBUG,
2019 "requestscroll x,y:%d,%d",
2023 si.cbSize =
sizeof(si);
2030 SetScrollInfo(gw->
drawingarea, SB_VERT, &si, TRUE);
2031 NSLOG(netsurf, DEEPDEBUG,
2032 "SetScrollInfo VERT min:%d max:%d page:%d pos:%d",
2033 si.nMin, si.nMax, si.nPage, si.nPos);
2036 si.cbSize =
sizeof(si);
2040 si.nPage = gw->
width;
2043 SetScrollInfo(gw->
drawingarea, SB_HORZ, &si, TRUE);
2044 NSLOG(netsurf, DEEPDEBUG,
2045 "SetScrollInfo HORZ min:%d max:%d page:%d pos:%d",
2046 si.nMin, si.nMax, si.nPage, si.nPos);
2056 r.bottom = gw->
height + 1;
2058 r.right = gw->
width + 1;
2067 NSLOG(netsurf, DEEPDEBUG,
2068 "ScrollWindowEx %d, %d",
2089 wc.cbSize =
sizeof(WNDCLASSEX);
2094 wc.hInstance = hinstance;
2097 wc.hbrBackground = (HBRUSH)(COLOR_MENU + 1);
2098 wc.lpszMenuName = NULL;
2102 if (RegisterClassExW(&wc) == 0) {
nserror browser_window_history_forward(struct browser_window *bw, bool new_window)
Go forward in the history.
bool browser_window_history_forward_available(struct browser_window *bw)
Check whether it is pssible to go forwards in the history.
bool browser_window_history_back_available(struct browser_window *bw)
Check whether it is pssible to go back in the history.
nserror browser_window_history_back(struct browser_window *bw, bool new_window)
Go back in the history.
Interface to browser history operations.
Browser window creation and manipulation interface.
nserror browser_window_schedule_reformat(struct browser_window *bw)
Reformat the browser window contents in a safe context.
nserror browser_window_navigate(struct browser_window *bw, struct nsurl *url, struct nsurl *referrer, enum browser_window_nav_flags flags, char *post_urlenc, struct fetch_multipart_data *post_multipart, struct hlcache_handle *parent)
Start fetching a page in a browser window.
nserror browser_window_debug(struct browser_window *bw, enum content_debug op)
Set debug options on a window.
void browser_window_destroy(struct browser_window *bw)
Close and destroy a browser window.
nserror browser_window_reload(struct browser_window *bw, bool all)
Reload the page in a browser window.
@ BW_EDITOR_CAN_PASTE
Can paste, input.
@ BW_EDITOR_NONE
No selection, no editing.
@ BW_EDITOR_CAN_CUT
Selection not read-only.
@ BW_EDITOR_CAN_COPY
Have selection.
browser_window_page_info_state
Browser window page information states.
@ PAGE_STATE_INSECURE
Insecure page load.
@ PAGE_STATE_UNKNOWN
Unable to determine.
@ PAGE_STATE_SECURE_ISSUES
Secure load, but has insecure elements.
@ PAGE_STATE_SECURE
Secure load.
@ PAGE_STATE_SECURE_OVERRIDE
Secure load, but had to override.
@ PAGE_STATE_LOCAL
Page loaded from file:/// etc.
@ PAGE_STATE_INTERNAL
Page loaded from internal handler.
nserror browser_window_get_extents(struct browser_window *bw, bool scaled, int *width, int *height)
Get a browser window's content extents.
nserror browser_window_create(enum browser_window_create_flags flags, struct nsurl *url, struct nsurl *referrer, struct browser_window *existing, struct browser_window **bw)
Create and open a new root browser window with the given page.
void browser_window_stop(struct browser_window *bw)
Stop all fetching activity in a browser window.
nserror browser_window_set_scale(struct browser_window *bw, float scale, bool absolute)
Sets the scale of a browser window.
browser_window_page_info_state browser_window_get_page_info_state(const struct browser_window *bw)
Request the current browser window page info state.
browser_editor_flags browser_window_get_editor_flags(struct browser_window *bw)
Check whether browser window can accept a cut/copy/paste, or has a selection that could be saved.
@ BW_CREATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
@ BW_NAVIGATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
Content handling interface.
@ CONTENT_DEBUG_REDRAW
Debug redraw operations.
HWND nsws_window_create_drawable(HINSTANCE hinstance, HWND hparent, struct gui_window *gw)
Create a drawable window.
nserror
Enumeration of error codes.
@ NSERROR_INIT_FAILED
Initialisation failed.
@ NSERROR_BAD_PARAMETER
Bad Parameter.
@ NSERROR_NOMEM
Memory exhaustion.
The interface to the win32 font and utf8 handling.
nserror nsw32_global_history_present(HINSTANCE hInstance)
make the global history window visible.
Interface to win32 global history manager using nsw32 core window.
nserror nsw32_hotlist_present(HINSTANCE hInstance)
make the hotlist window visible.
Interface to win32 bookmark manager (hotlist).
nserror nsw32_local_history_hide(void)
hide the local history window.
nserror nsw32_local_history_present(HWND hWndParent, struct browser_window *bw)
make the local history window visible.
Interface to win32 local history manager using nsw32 core window.
struct gui_window * window_list
Interface to platform-specific graphical user interface window operations.
gui_window_create_flags
Window creation control flags.
gui_window_event
Window events.
@ GW_EVENT_PAGE_INFO_CHANGE
Page status has changed and so the padlock should be updated.
@ GW_EVENT_REMOVE_CARET
Remove the caret, if present.
@ GW_EVENT_STOP_THROBBER
stop the navigation throbber.
@ GW_EVENT_UPDATE_EXTENT
Update the extent of the inside of a browser window to that of the current content.
@ GW_EVENT_START_THROBBER
start the navigation throbber.
Interface to key press operations.
bool browser_window_key_press(struct browser_window *bw, uint32_t key)
Handle key presses in a browser window.
#define NSLOG(catname, level, logmsg, args...)
const char * messages_get_errorcode(nserror code)
lookup of a message by errorcode from the standard Messages hash.
Localised message support (interface).
NetSurf URL handling (interface).
nserror nsurl_create(const char *const url_s, nsurl **url)
Create a NetSurf URL object from a URL string.
void nsurl_unref(nsurl *url)
Drop a reference to a NetSurf URL object.
const char * nsurl_access(const nsurl *url)
Access a NetSurf URL object as a string.
struct nsurl nsurl
NetSurf URL object.
HCURSOR nsws_get_pointer(gui_pointer_shape shape)
get a win32 cursor handle for a pointer shape
Windows mouse cursor interface.
nserror nsws_prefs_save(void)
Save the users preferances.
void nsws_prefs_dialog_init(HINSTANCE hinst, HWND parent)
open the preferences dialog and respond to user.
#define IDM_VIEW_SAVE_WIN_METRICS
#define IDC_MAIN_THROBBER
#define IDM_NAV_BOOKMARKS
#define IDB_PAGEINFO_SECURE
#define IDM_HELP_CONTENTS
#define IDM_FILE_PRINT_PREVIEW
#define IDC_MAIN_LAUNCH_URL
#define IDM_VIEW_FULLSCREEN
#define IDM_VIEW_ZOOMNORMAL
#define IDR_TOOLBAR_BITMAP
#define IDB_PAGEINFO_LOCAL
#define IDM_FILE_SAVE_PAGE
#define IDR_TOOLBAR_BITMAP_GREY
#define IDM_NAV_LOCALHISTORY
#define IDM_FILE_SAVEAS_POSTSCRIPT
#define IDB_PAGEINFO_WARNING
#define IDM_FILE_SAVEAS_TEXT
#define IDB_PAGEINFO_INTERNAL
#define IDM_FILE_CLOSE_WINDOW
#define IDM_EDIT_PREFERENCES
#define IDM_FILE_SAVEAS_PDF
#define IDM_FILE_OPEN_LOCATION
#define IDC_MAIN_STATUSBAR
#define IDB_PAGEINFO_INSECURE
#define IDM_VIEW_ZOOMMINUS
#define IDM_TOOLS_COOKIES
#define IDR_TOOLBAR_BITMAP_HOT
#define IDM_VIEW_DEBUGGING_SAVE_DOMTREE
#define IDM_FILE_OPEN_WINDOW
#define IDM_EDIT_SELECT_ALL
#define IDM_TOOLS_DOWNLOADS
#define IDM_NAV_GLOBALHISTORY
#define IDM_VIEW_DEBUGGING_SAVE_BOXTREE
#define IDM_VIEW_ZOOMPLUS
#define IDM_VIEW_TOGGLE_DEBUG_RENDERING
Graphical user interface window function table.
struct gui_window *(* create)(struct browser_window *bw, struct gui_window *existing, gui_window_create_flags flags)
Create and open a gui window for a browsing context.
first entry in window list
struct gui_window * prev
Previous in linked list.
HWND main
handle to the actual window
struct nsws_localhistory * localhistory
handle to local history window
HMENU mainmenu
the main menu
HACCEL acceltable
accelerators
struct fbtk_widget_s * toolbar
int toolbuttonsize
width, height of buttons
struct gui_window * next
list for cleanup
bool throbbing
whether currently throbbing
int toolbuttonc
number of toolbar buttons
struct fbtk_widget_s * back
RECT * fullscreen
memorize non-fullscreen area
int height
height of drawing area
int requestscrolly
scolling requested.
int scrollx
current scroll location
HMENU rclick
the right-click menu
RECT redraw
Area needing redraw.
HWND drawingarea
throbber handle
struct fbtk_widget_s * throbber
HWND urlbar
url bar handle
struct fbtk_widget_s * forward
struct gui_window::@32 mouse
HWND statusbar
status bar handle
HBITMAP hPageInfo[8]
page info handles
int scrolly
current scroll location
struct browser_window * bw
The 'content' window that is rendered in the gui_window.
Option reading and saving interface.
#define nsoption_charp(OPTION)
Get the value of a string option.
#define nsoption_int(OPTION)
Get the value of an integer option.
#define nsoption_set_int(OPTION, VALUE)
set an integer option in the default table
Interface to a number of general purpose functionality.
#define fallthrough
switch fall through
#define SLEN(x)
Calculate length of constant C string.
void win_perror(const char *lpszFunction)
#define LOG_WIN_MSG(h, m, w, l)
log windows message
void nsw32_about_dialog_init(HINSTANCE hinst, HWND parent)
nserror nsw32_cookies_present(const char *search_term)
make the cookie window visible.
Interface to win32 cookie viewing using nsw32 core windows.
nserror win32_warning(const char *warning, const char *detail)
Warn the user of an event.
nserror win32_report_nserror(nserror error, const char *detail)
Warn the user of an unexpected nserror.
void win32_set_quit(bool q)
cause the main message loop to exit
HINSTANCE hinst
win32 application instance handle.
static nserror text(const struct redraw_context *ctx, const struct plot_font_style *fstyle, int x, int y, const char *text, size_t length)
Text plotting.
static nserror clip(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.
static void nsws_window_set_accels(struct gui_window *gw)
create and attach accelerator table to main window
struct gui_window_table * win32_window_table
The window operation function table for win32.
static void win32_window_page_info_change(struct gui_window *gw)
win32 page info change.
static LRESULT nsws_window_toolbar_command(struct gui_window *gw, int notification_code, int identifier, HWND ctrl_window)
toolbar command message handler
static void win32_window_update_extent(struct gui_window *gw)
Update the extent of the inside of a browser window to that of the current content.
static void win32_window_set_title(struct gui_window *w, const char *title)
set win32 browser window title
nserror nsws_create_main_class(HINSTANCE hinstance)
Create the main browser window class.
static void win32_window_remove_caret(struct gui_window *gw)
Remove the win32 input focus from window.
HWND gui_window_main_window(struct gui_window *w)
Get the main win32 window handle from a gui window.
static void set_urlbar_edit_size(HWND hwnd)
static bool nsws_ctx_menu(struct gui_window *gw, HWND hwnd, int x, int y)
Handle win32 context menu message.
static LRESULT CALLBACK nsws_window_toolbar_callback(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
callback for toolbar events
static LRESULT nsws_window_resize(struct gui_window *gw, HWND hwnd, WPARAM wparam, LPARAM lparam)
handle WM_SIZE message on main browser window
static LRESULT CALLBACK nsws_window_event_callback(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
callback for browser window win32 events
static struct gui_window_table window_table
win32 frontend browser window handling operation table
static void load_page_info_bitmaps(HINSTANCE hInstance, struct gui_window *gw)
static void win32_window_set_pointer(struct gui_window *w, gui_pointer_shape shape)
Change the win32 mouse pointer shape.
static bool win32_window_get_scroll(struct gui_window *gw, int *sx, int *sy)
Get the scroll position of a win32 browser window.
static const LPCWSTR windowclassname_main
The main window class name.
static nserror win32_window_event(struct gui_window *gw, enum gui_window_event event)
process miscellaneous window events
static LRESULT CALLBACK nsws_window_urlbar_callback(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
callback for url bar events
static void win32_window_set_status(struct gui_window *w, const char *text)
Set the status bar of a win32 browser window.
static HWND nsws_window_create(HINSTANCE hInstance, struct gui_window *gw)
creation of a new full browser window
static LRESULT nsws_window_command(HWND hwnd, struct gui_window *gw, int notification_code, int identifier, HWND ctrl_window)
handle command message on main browser window
static void urlbar_dimensions(HWND hWndParent, int toolbuttonsize, int buttonc, int *x, int *y, int *width, int *height)
calculate the dimensions of the url bar relative to the parent toolbar
static void win32_window_start_throbber(struct gui_window *w)
start a win32 navigation throbber.
struct gui_window * nsws_get_gui_window(HWND hwnd)
Obtain gui window structure from window handle.
static void nsws_update_edit(struct gui_window *w)
Update popup context menu editing functionality.
static struct gui_window * win32_window_create(struct browser_window *bw, struct gui_window *existing, gui_window_create_flags flags)
create a new gui_window to contain a browser_window.
static HWND nsws_window_create_toolbar(HINSTANCE hInstance, HWND hWndParent, struct gui_window *gw)
create win32 main window toolbar and add controls and message handler
static void nsws_window_update_forward_back(struct gui_window *w)
update state of forward/back buttons/menu items when page changes
static nserror win32_window_invalidate_area(struct gui_window *gw, const struct rect *rect)
Invalidate an area of a win32 browser window.
static int open_windows
Number of open windows.
static nserror win32_window_set_url(struct gui_window *gw, nsurl *url)
Set the navigation url in a win32 browser window.
static HWND nsws_window_create_statusbar(HINSTANCE hInstance, HWND hWndParent, struct gui_window *gw)
creation of status bar
static nserror win32_window_get_dimensions(struct gui_window *gw, int *width, int *height)
Find the current dimensions of a win32 browser window's content area.
static nserror win32_open_new_window(struct gui_window *gw)
Create a new window due to menu selection.
bool nsws_window_go(HWND hwnd, const char *urltxt)
Cause a browser window to navigate to a url.
#define NSWS_URLBAR_HEIGHT
height of the url entry box
nserror win32_window_set_scroll(struct gui_window *gw, const struct rect *rect)
Set the scroll position of a win32 browser window.
static HIMAGELIST get_imagelist(HINSTANCE hInstance, int resid, int bsize, int bcnt)
create a win32 image list for the toolbar.
static HWND nsws_window_urlbar_create(HINSTANCE hInstance, HWND hWndParent, struct gui_window *gw)
create a urlbar and message handler
static void win32_window_place_caret(struct gui_window *w, int x, int y, int height, const struct rect *clip)
Give the win32 input focus to a window.
static void win32_window_destroy(struct gui_window *w)
Destroy previously created win32 window.
static HWND nsws_window_throbber_create(HINSTANCE hInstance, HWND hWndParent, struct gui_window *gw)
creation of throbber
static void win32_window_stop_throbber(struct gui_window *w)
stop a win32 navigation throbber.
#define NSW32_PGIBUTTON_HEIGHT
height of the Page Information bitmap button
#define NSWS_THROBBER_WIDTH
width of the throbber element
static void destroy_page_info_bitmaps(struct gui_window *gw)