2 * Copyright 2005 James Hawkins
3 * Copyright 2007 Jacek Caban for CodeWeavers
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
40 #include "wine/itss.h"
41 #include "wine/unicode.h"
44 #define WB_GOFORWARD 1
50 typedef struct CHMInfo
52 IITStorage *pITStorage;
56 IStream *strings_stream;
63 IOleClientSite *client_site;
64 IWebBrowser2 *web_browser;
65 IOleObject *wb_object;
74 BOOL InitWebBrowser(HHInfo*,HWND);
75 void ReleaseWebBrowser(HHInfo*);
76 void ResizeWebBrowser(HHInfo*,DWORD,DWORD);
77 void DoPageAction(HHInfo*,DWORD);
79 CHMInfo *OpenCHM(LPCWSTR szFile);
80 BOOL LoadWinTypeFromCHM(CHMInfo *pCHMInfo, HH_WINTYPEW *pHHWinType);
81 CHMInfo *CloseCHM(CHMInfo *pCHMInfo);
82 LPWSTR FindContextAlias(CHMInfo*,DWORD);
84 HHInfo *CreateHelpViewer(LPCWSTR);
85 void ReleaseHelpViewer(HHInfo*);
86 BOOL NavigateToUrl(HHInfo*,LPCWSTR);
87 BOOL NavigateToChm(HHInfo*,LPCWSTR,LPCWSTR);
89 /* memory allocation functions */
91 static inline void *hhctrl_alloc(size_t len)
93 return HeapAlloc(GetProcessHeap(), 0, len);
96 static inline void *hhctrl_alloc_zero(size_t len)
98 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
101 static inline void *hhctrl_realloc(void *mem, size_t len)
103 return HeapReAlloc(GetProcessHeap(), 0, mem, len);
106 static inline void *hhctrl_realloc_zero(void *mem, size_t len)
108 return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len);
111 static inline BOOL hhctrl_free(void *mem)
113 return HeapFree(GetProcessHeap(), 0, mem);
116 static inline LPWSTR strdupW(LPCWSTR str)
124 size = (strlenW(str)+1)*sizeof(WCHAR);
125 ret = hhctrl_alloc(size);
126 memcpy(ret, str, size);
131 static inline LPWSTR strdupAtoW(LPCSTR str)
139 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
140 ret = hhctrl_alloc(len*sizeof(WCHAR));
141 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
146 extern HINSTANCE hhctrl_hinstance;
147 extern BOOL hh_process;