Author: cwittich
Date: Sun Sep 14 01:08:59 2008
New Revision: 36216
URL:
http://svn.reactos.org/svn/reactos?rev=36216&view=rev
Log:
sync hhctrl.ocx with wine 1.1.4
Added:
trunk/reactos/dll/win32/hhctrl.ocx/Zh.rc (with props)
Modified:
trunk/reactos/dll/win32/hhctrl.ocx/chm.c
trunk/reactos/dll/win32/hhctrl.ocx/help.c
trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.h
trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.rc
trunk/reactos/dll/win32/hhctrl.ocx/webbrowser.c
Added: trunk/reactos/dll/win32/hhctrl.ocx/Zh.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/Zh.rc…
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/Zh.rc (added)
+++ trunk/reactos/dll/win32/hhctrl.ocx/Zh.rc [iso-8859-1] Sun Sep 14 01:08:59 2008
@@ -1,0 +1,100 @@
+/*
+ * HTML Help (Simplified and Traditional Chinese Resources)
+ *
+ * Copyright 2008 Hongbo Ni <hongbo.at.njstar.com>
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+/* Chinese text is encoded in UTF-8 */
+#pragma code_page(65001)
+
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
+
+STRINGTABLE
+BEGIN
+ IDS_CONTENTS "å
容(&C)"
+ IDS_INDEX "ç®å½(&N)"
+ IDS_SEARCH "æ寻(&S)"
+ IDS_FAVORITES "æç±(&I)"
+END
+
+STRINGTABLE
+BEGIN
+ IDTB_EXPAND "æ¾ç¤º"
+ IDTB_CONTRACT "éè"
+ IDTB_STOP "åæ¢"
+ IDTB_REFRESH "å·æ°"
+ IDTB_BACK "åå"
+ IDTB_HOME "é¦é¡µ"
+ IDTB_SYNC "åæ¥"
+ IDTB_PRINT "æå°"
+ IDTB_OPTIONS "é项"
+ IDTB_FORWARD "åå"
+ IDTB_NOTES "说æ"
+ IDTB_BROWSE_FWD "åå"
+ IDTB_BROWSE_BACK "åå"
+ IDTB_CONTENTS "å
容"
+ IDTB_INDEX "ç®å½"
+ IDTB_SEARCH "æ寻"
+ IDTB_HISTORY "åå²"
+ IDTB_FAVORITES "æç±"
+ IDTB_JUMP1 "Jump1"
+ IDTB_JUMP2 "Jump2"
+ IDTB_CUSTOMIZE "个æ§å"
+ IDTB_ZOOM "æ¾å¤§"
+ IDTB_TOC_NEXT "åä¸é¡¹"
+ IDTB_TOC_PREV "åä¸é¡¹"
+END
+
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
+
+STRINGTABLE
+BEGIN
+ IDS_CONTENTS "å
§å®¹(&C)"
+ IDS_INDEX "ç®é(&N)"
+ IDS_SEARCH "æå°(&S)"
+ IDS_FAVORITES "ææ(&I)"
+END
+
+STRINGTABLE
+BEGIN
+ IDTB_EXPAND "顯示"
+ IDTB_CONTRACT "é±è"
+ IDTB_STOP "åæ¢"
+ IDTB_REFRESH "å·æ°"
+ IDTB_BACK "åå¾"
+ IDTB_HOME "é¦é "
+ IDTB_SYNC "åæ¥"
+ IDTB_PRINT "åå°"
+ IDTB_OPTIONS "é¸é
"
+ IDTB_FORWARD "åå"
+ IDTB_NOTES "說æ"
+ IDTB_BROWSE_FWD "åå"
+ IDTB_BROWSE_BACK "åå¾"
+ IDTB_CONTENTS "å
§å®¹"
+ IDTB_INDEX "ç®é"
+ IDTB_SEARCH "æå°"
+ IDTB_HISTORY "æ·å²"
+ IDTB_FAVORITES "ææ"
+ IDTB_JUMP1 "Jump1"
+ IDTB_JUMP2 "Jump2"
+ IDTB_CUSTOMIZE "åæ§å"
+ IDTB_ZOOM "æ¾å¤§"
+ IDTB_TOC_NEXT "å¾ä¸é
"
+ IDTB_TOC_PREV "åä¸é
"
+END
+
+#pragma code_page(default)
Propchange: trunk/reactos/dll/win32/hhctrl.ocx/Zh.rc
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/win32/hhctrl.ocx/chm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/chm.c…
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/chm.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hhctrl.ocx/chm.c [iso-8859-1] Sun Sep 14 01:08:59 2008
@@ -413,7 +413,7 @@
IStream_Release(chm->strings_stream);
if(chm->strings_size) {
- int i;
+ DWORD i;
for(i=0; i<chm->strings_size; i++)
heap_free(chm->strings[i]);
Modified: trunk/reactos/dll/win32/hhctrl.ocx/help.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/help.…
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/help.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hhctrl.ocx/help.c [iso-8859-1] Sun Sep 14 01:08:59 2008
@@ -89,7 +89,7 @@
BOOL ret;
HRESULT hres;
- static const WCHAR url_indicator[] = {':', '/', '/'};
+ static const WCHAR url_indicator[] = {':', '/', '/', 0};
TRACE("%s\n", debugstr_w(surl));
@@ -587,7 +587,7 @@
heap_free(szBuf);
}
- SendMessageW(hToolbar, TB_ADDBUTTONSW, dwNumButtons, (LPARAM)&buttons);
+ SendMessageW(hToolbar, TB_ADDBUTTONSW, dwNumButtons, (LPARAM)buttons);
SendMessageW(hToolbar, TB_AUTOSIZE, 0, 0);
ShowWindow(hToolbar, SW_SHOW);
Modified: trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/hhctr…
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.h [iso-8859-1] Sun Sep 14 01:08:59 2008
@@ -141,22 +141,22 @@
/* memory allocation functions */
-static inline void *heap_alloc(size_t len)
+static inline void __WINE_ALLOC_SIZE(1) *heap_alloc(size_t len)
{
return HeapAlloc(GetProcessHeap(), 0, len);
}
-static inline void *heap_alloc_zero(size_t len)
+static inline void __WINE_ALLOC_SIZE(1) *heap_alloc_zero(size_t len)
{
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
}
-static inline void *heap_realloc(void *mem, size_t len)
+static inline void __WINE_ALLOC_SIZE(2) *heap_realloc(void *mem, size_t len)
{
return HeapReAlloc(GetProcessHeap(), 0, mem, len);
}
-static inline void *heap_realloc_zero(void *mem, size_t len)
+static inline void __WINE_ALLOC_SIZE(2) *heap_realloc_zero(void *mem, size_t len)
{
return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len);
}
Modified: trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/hhctr…
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.rc [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.rc [iso-8859-1] Sun Sep 14 01:08:59 2008
@@ -45,3 +45,4 @@
#include "Si.rc"
#include "Sv.rc"
#include "Tr.rc"
+#include "Zh.rc"
Modified: trunk/reactos/dll/win32/hhctrl.ocx/webbrowser.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/webbr…
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/webbrowser.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hhctrl.ocx/webbrowser.c [iso-8859-1] Sun Sep 14 01:08:59 2008
@@ -20,6 +20,10 @@
#include "hhctrl.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(htmlhelp);
+
#define ICOM_THIS_MULTI(impl,field,iface) impl* const This=(impl*)((char*)(iface) -
offsetof(impl,field))
typedef struct IOleClientSiteImpl
@@ -37,45 +41,62 @@
HWND hwndWindow;
} IOleClientSiteImpl;
+#define CLIENTSITE(x) ((IOleClientSite*) &(x)->lpVtbl)
+#define DOCHOSTUI(x) ((IDocHostUIHandler*) &(x)->lpvtblDocHostUIHandler)
+#define INPLACESITE(x) ((IOleInPlaceSite*) &(x)->lpvtblOleInPlaceSite)
+#define INPLACEFRAME(x) ((IOleInPlaceFrame*) &(x)->lpvtblOleInPlaceFrame)
+
static HRESULT STDMETHODCALLTYPE Site_QueryInterface(IOleClientSite *iface, REFIID riid,
void **ppvObj)
{
ICOM_THIS_MULTI(IOleClientSiteImpl, lpVtbl, iface);
+
*ppvObj = NULL;
- if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid,
&IID_IOleClientSite))
- {
- *ppvObj = This;
+ if (IsEqualIID(riid, &IID_IUnknown)) {
+ TRACE("(%p)->(IID_IUnknown %p)\n", This, ppvObj);
+ *ppvObj = CLIENTSITE(This);
+ }else if(IsEqualIID(riid, &IID_IOleClientSite)) {
+ TRACE("(%p)->(IID_IOleClientSite %p)\n", This, ppvObj);
+ *ppvObj = CLIENTSITE(This);
+ }else if (IsEqualIID(riid, &IID_IOleInPlaceSite)) {
+ TRACE("(%p)->(IID_IOleInPlaceSite %p)\n", This, ppvObj);
+ *ppvObj = &(This->lpvtblOleInPlaceSite);
+ }else if (IsEqualIID(riid, &IID_IOleInPlaceFrame)) {
+ TRACE("(%p)->(IID_IOleInPlaceFrame %p)\n", This, ppvObj);
+ *ppvObj = &(This->lpvtblOleInPlaceSite);
+ }else if (IsEqualIID(riid, &IID_IDocHostUIHandler)) {
+ TRACE("(%p)->(IID_IDocHostUIHandler %p)\n", This, ppvObj);
+ *ppvObj = &(This->lpvtblDocHostUIHandler);
+ }else {
+ TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObj);
+ return E_NOINTERFACE;
}
- else if (IsEqualIID(riid, &IID_IOleInPlaceSite))
- {
- *ppvObj = &(This->lpvtblOleInPlaceSite);
- }
- else if (IsEqualIID(riid, &IID_IDocHostUIHandler))
- {
- *ppvObj = &(This->lpvtblDocHostUIHandler);
- }
- else
- return E_NOINTERFACE;
-
+
+ IUnknown_AddRef((IUnknown*)*ppvObj);
return S_OK;
}
static ULONG STDMETHODCALLTYPE Site_AddRef(IOleClientSite *iface)
{
ICOM_THIS_MULTI(IOleClientSiteImpl, lpVtbl, iface);
- return InterlockedIncrement(&This->ref);
+ LONG ref = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p) ref=%d\n", This, ref);
+
+ return ref;
}
static ULONG STDMETHODCALLTYPE Site_Release(IOleClientSite *iface)
{
ICOM_THIS_MULTI(IOleClientSiteImpl, lpVtbl, iface);
- LONG refCount = InterlockedDecrement(&This->ref);
-
- if (refCount)
- return refCount;
-
- heap_free(This);
- return 0;
+ LONG ref = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p) ref=%d\n", This, ref);
+
+ if(!ref)
+ heap_free(This);
+
+ return ref;
}
static HRESULT STDMETHODCALLTYPE Site_SaveObject(IOleClientSite *iface)
@@ -126,17 +147,22 @@
static HRESULT STDMETHODCALLTYPE UI_QueryInterface(IDocHostUIHandler *iface, REFIID riid,
LPVOID *ppvObj)
{
ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblDocHostUIHandler, iface);
- return Site_QueryInterface((IOleClientSite *)This, riid, ppvObj);
+
+ return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppvObj);
}
static ULONG STDMETHODCALLTYPE UI_AddRef(IDocHostUIHandler *iface)
{
- return 1;
+ ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblDocHostUIHandler, iface);
+
+ return IOleClientSite_AddRef(CLIENTSITE(This));
}
static ULONG STDMETHODCALLTYPE UI_Release(IDocHostUIHandler * iface)
{
- return 2;
+ ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblDocHostUIHandler, iface);
+
+ return IOleClientSite_Release(CLIENTSITE(This));
}
static HRESULT STDMETHODCALLTYPE UI_ShowContextMenu(IDocHostUIHandler *iface, DWORD dwID,
POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved)
@@ -246,17 +272,22 @@
static HRESULT STDMETHODCALLTYPE InPlace_QueryInterface(IOleInPlaceSite *iface, REFIID
riid, LPVOID *ppvObj)
{
ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface);
- return Site_QueryInterface((IOleClientSite *)This, riid, ppvObj);
+
+ return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppvObj);
}
static ULONG STDMETHODCALLTYPE InPlace_AddRef(IOleInPlaceSite *iface)
{
- return 1;
+ ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface);
+
+ return IOleClientSite_AddRef(CLIENTSITE(This));
}
static ULONG STDMETHODCALLTYPE InPlace_Release(IOleInPlaceSite *iface)
{
- return 2;
+ ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface);
+
+ return IOleClientSite_Release(CLIENTSITE(This));
}
static HRESULT STDMETHODCALLTYPE InPlace_GetWindow(IOleInPlaceSite *iface, HWND *lphwnd)
@@ -290,7 +321,10 @@
static HRESULT STDMETHODCALLTYPE InPlace_GetWindowContext(IOleInPlaceSite *iface,
LPOLEINPLACEFRAME *lplpFrame, LPOLEINPLACEUIWINDOW *lplpDoc, LPRECT lprcPosRect, LPRECT
lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
{
ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface);
- *lplpFrame = (LPOLEINPLACEFRAME)&This->lpvtblOleInPlaceFrame;
+
+ *lplpFrame = INPLACEFRAME(This);
+ IOleInPlaceFrame_AddRef(INPLACEFRAME(This));
+
*lplpDoc = NULL;
lpFrameInfo->fMDIApp = FALSE;
@@ -331,8 +365,12 @@
ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceSite, iface);
IOleInPlaceObject *inplace;
- if (!IOleObject_QueryInterface(This->pBrowserObject, &IID_IOleInPlaceObject,
(void **)&inplace))
+ if (IOleObject_QueryInterface(This->pBrowserObject, &IID_IOleInPlaceObject,
+ (void **)&inplace) == S_OK)
+ {
IOleInPlaceObject_SetObjectRects(inplace, lprcPosRect, lprcPosRect);
+ IOleInPlaceObject_Release(inplace);
+ }
return S_OK;
}
@@ -358,17 +396,23 @@
static HRESULT STDMETHODCALLTYPE Frame_QueryInterface(IOleInPlaceFrame *iface, REFIID
riid, LPVOID *ppvObj)
{
- return E_NOTIMPL;
+ ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceFrame, iface);
+
+ return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppvObj);
}
static ULONG STDMETHODCALLTYPE Frame_AddRef(IOleInPlaceFrame *iface)
{
- return 1;
+ ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceFrame, iface);
+
+ return IOleClientSite_AddRef(CLIENTSITE(This));
}
static ULONG STDMETHODCALLTYPE Frame_Release(IOleInPlaceFrame *iface)
{
- return 2;
+ ICOM_THIS_MULTI(IOleClientSiteImpl, lpvtblOleInPlaceFrame, iface);
+
+ return IOleClientSite_Release(CLIENTSITE(This));
}
static HRESULT STDMETHODCALLTYPE Frame_GetWindow(IOleInPlaceFrame *iface, HWND *lphwnd)