2 * Copyright 2005 James Hawkins
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
39 #include "wine/itss.h"
42 #define WB_GOFORWARD 1
48 typedef struct CHMInfo
50 IITStorage *pITStorage;
54 IStream *strings_stream;
62 IOleClientSite *pOleClientSite;
63 IWebBrowser2 *pWebBrowser2;
64 IOleObject *pBrowserObject;
68 BOOL WB_EmbedBrowser(WBInfo *pWBInfo, HWND hwndParent);
69 void WB_UnEmbedBrowser(WBInfo *pWBInfo);
70 void WB_ResizeBrowser(WBInfo *pWBInfo, DWORD dwWidth, DWORD dwHeight);
71 void WB_DoPageAction(WBInfo *pWBInfo, DWORD dwAction);
73 CHMInfo *OpenCHM(LPCWSTR szFile);
74 BOOL CHM_LoadWinTypeFromCHM(CHMInfo *pCHMInfo, HH_WINTYPEW *pHHWinType);
75 CHMInfo *CloseCHM(CHMInfo *pCHMInfo);
77 /* memory allocation functions */
79 static inline void *hhctrl_alloc(size_t len)
81 return HeapAlloc(GetProcessHeap(), 0, len);
84 static inline void *hhctrl_alloc_zero(size_t len)
86 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
89 static inline void *hhctrl_realloc(void *mem, size_t len)
91 return HeapReAlloc(GetProcessHeap(), 0, mem, len);
94 static inline void *hhctrl_realloc_zero(void *mem, size_t len)
96 return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len);
99 static inline BOOL hhctrl_free(void *mem)
101 return HeapFree(GetProcessHeap(), 0, mem);
104 static inline LPWSTR strdupAtoW(LPCSTR str)
112 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
113 ret = hhctrl_alloc(len*sizeof(WCHAR));
114 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);