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);
83 /* memory allocation functions */
85 static inline void *hhctrl_alloc(size_t len)
87 return HeapAlloc(GetProcessHeap(), 0, len);
90 static inline void *hhctrl_alloc_zero(size_t len)
92 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
95 static inline void *hhctrl_realloc(void *mem, size_t len)
97 return HeapReAlloc(GetProcessHeap(), 0, mem, len);
100 static inline void *hhctrl_realloc_zero(void *mem, size_t len)
102 return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len);
105 static inline BOOL hhctrl_free(void *mem)
107 return HeapFree(GetProcessHeap(), 0, mem);
110 static inline LPWSTR strdupW(LPCWSTR str)
118 size = (strlenW(str)+1)*sizeof(WCHAR);
119 ret = hhctrl_alloc(size);
120 memcpy(ret, str, size);
125 static inline LPWSTR strdupAtoW(LPCSTR str)
133 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
134 ret = hhctrl_alloc(len*sizeof(WCHAR));
135 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
140 extern HINSTANCE hhctrl_hinstance;