Commit 3e507e3c authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

- Add the WebBrowser implementation.

- Load the default Url in the HTML Pane.
parent 7bb00b1c
......@@ -3,14 +3,16 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = hhctrl.ocx
IMPORTS = advapi32 comctl32 shell32 ole32 user32 gdi32 kernel32
IMPORTS = advapi32 comctl32 shell32 ole32 oleaut32 user32 gdi32 kernel32
EXTRALIBS = -luuid
C_SRCS = \
chm.c \
help.c \
hhctrl.c \
main.c \
regsvr.c
regsvr.c \
webbrowser.c
RC_SRCS = hhctrl.rc
......
......@@ -32,6 +32,7 @@
#include "resource.h"
#include "chm.h"
#include "webbrowser.h"
/* Window type defaults */
......@@ -45,6 +46,7 @@ typedef struct tagHHInfo
{
HH_WINTYPEW *pHHWinType;
CHMInfo *pCHMInfo;
WBInfo *pWBInfo;
HINSTANCE hInstance;
LPWSTR szCmdLine;
HWND hwndTabCtrl;
......@@ -387,6 +389,9 @@ static BOOL HH_AddHTMLPane(HHInfo *pHHInfo)
if (!hWnd)
return FALSE;
if (!WB_EmbedBrowser(pHHInfo->pWBInfo, hwndParent))
return FALSE;
/* store the pointer to the HH info struct */
SetWindowLongPtrW(hWnd, GWLP_USERDATA, (LONG_PTR)pHHInfo);
......@@ -572,6 +577,7 @@ static HHInfo *HH_OpenHH(HINSTANCE hInstance, LPWSTR szCmdLine)
pHHInfo->pHHWinType = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(HH_WINTYPEW));
pHHInfo->pCHMInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(CHMInfo));
pHHInfo->pWBInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(WBInfo));
pHHInfo->hInstance = hInstance;
pHHInfo->szCmdLine = szCmdLine;
......@@ -607,6 +613,21 @@ static void HH_Close(HHInfo *pHHInfo)
CHM_CloseCHM(pHHInfo->pCHMInfo);
HeapFree(GetProcessHeap(), 0, pHHInfo->pCHMInfo);
}
if (pHHInfo->pWBInfo)
{
WB_UnEmbedBrowser(pHHInfo->pWBInfo);
HeapFree(GetProcessHeap(), 0, pHHInfo->pWBInfo);
}
}
static void HH_OpenDefaultTopic(HHInfo *pHHInfo)
{
WCHAR url[MAX_PATH];
LPCWSTR defTopic = pHHInfo->pHHWinType->pszFile;
CHM_CreateITSUrl(pHHInfo->pCHMInfo, defTopic, url);
WB_Navigate(pHHInfo->pWBInfo, url);
}
static BOOL HH_OpenCHM(HHInfo *pHHInfo)
......@@ -636,6 +657,8 @@ int WINAPI doWinMain(HINSTANCE hInstance, LPSTR szCmdLine)
return -1;
}
HH_OpenDefaultTopic(pHHInfo);
while (GetMessageW(&msg, 0, 0, 0))
{
TranslateMessage(&msg);
......
/*
* WebBrowser Include
*
* Copyright 2005 James Hawkins
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __WINE_WEBBROWSER_H
#define __WINE_WEBBROWSER_H
#include "exdisp.h"
#include "mshtml.h"
#include "mshtmhst.h"
#define WB_GOBACK 0
#define WB_GOFORWARD 1
#define WB_GOHOME 2
#define WB_SEARCH 3
#define WB_REFRESH 4
#define WB_STOP 5
typedef struct WBInfo
{
IOleClientSite *pOleClientSite;
IWebBrowser2 *pWebBrowser2;
IOleObject *pBrowserObject;
HWND hwndParent;
} WBInfo;
BOOL WB_EmbedBrowser(WBInfo *pWBInfo, HWND hwndParent);
void WB_UnEmbedBrowser(WBInfo *pWBInfo);
BOOL WB_Navigate(WBInfo *pWBInfo, LPCWSTR szUrl);
void WB_ResizeBrowser(WBInfo *pWBInfo, DWORD dwWidth, DWORD dwHeight);
void WB_DoPageAction(WBInfo *pWBInfo, DWORD dwAction);
#endif /* __WINE_WEBBROWSER_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment