Autosyncing with Wine HEAD

svn path=/trunk/; revision=27906
This commit is contained in:
The Wine Synchronizer 2007-07-27 09:34:02 +00:00
parent cdcd38e9ae
commit 0f86de1a3a
6 changed files with 139 additions and 69 deletions

View file

@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
LANGUAGE LANG_KOREAN, SUBLANG_NEUTRAL
STRINGTABLE
BEGIN

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL
LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
STRINGTABLE
BEGIN

View file

@ -32,6 +32,24 @@ typedef enum {
INSERT_CHILD
} insert_type_t;
static void free_content_item(ContentItem *item)
{
ContentItem *next;
while(item) {
next = item->next;
free_content_item(item->child);
hhctrl_free(item->name);
hhctrl_free(item->local);
hhctrl_free(item->merge.chm_file);
hhctrl_free(item->merge.chm_index);
item = next;
}
}
typedef struct {
char *buf;
int size;
@ -207,6 +225,9 @@ static ContentItem *insert_item(ContentItem *item, ContentItem *new_item, insert
if(!item)
return new_item;
if(!new_item)
return item;
switch(insert_type) {
case INSERT_NEXT:
item->next = new_item;
@ -265,6 +286,11 @@ static ContentItem *parse_sitemap_object(HHInfo *info, stream_t *stream, Content
}else {
WARN("Could not get %s::%s stream\n", debugstr_w(item->merge.chm_file),
debugstr_w(item->merge.chm_file));
if(!item->name) {
free_content_item(item);
item = NULL;
}
}
}
@ -411,24 +437,6 @@ void InitContent(HHInfo *info)
fill_content_tree(info->tabs[TAB_CONTENTS].hwnd, NULL, info->content);
}
static void free_content_item(ContentItem *item)
{
ContentItem *next;
while(item) {
next = item->next;
free_content_item(item->child);
hhctrl_free(item->name);
hhctrl_free(item->local);
hhctrl_free(item->merge.chm_file);
hhctrl_free(item->merge.chm_index);
item = next;
}
}
void ReleaseContent(HHInfo *info)
{
free_content_item(info->content);

View file

@ -78,6 +78,7 @@ static const char *command_to_string(UINT command)
X( HH_SET_EXCLUSIVE_FILTER );
X( HH_INITIALIZE );
X( HH_UNINITIALIZE );
X( HH_SAFE_DISPLAY_TOPIC );
X( HH_PRETRANSLATEMESSAGE );
X( HH_SET_GLOBAL_PROPERTY );
default: return "???";
@ -86,11 +87,11 @@ static const char *command_to_string(UINT command)
}
/******************************************************************
* HtmlHelpW (hhctrl.ocx.15)
* HtmlHelpW (HHCTRL.OCX.15)
*/
HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD data)
HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR data)
{
TRACE("(%p, %s, command=%s, data=%d)\n",
TRACE("(%p, %s, command=%s, data=%lx)\n",
caller, debugstr_w( filename ),
command_to_string( command ), data);
@ -99,16 +100,37 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD data)
case HH_DISPLAY_TOPIC:
case HH_DISPLAY_TOC:
case HH_DISPLAY_SEARCH:{
static const WCHAR delimW[] = {':',':',0};
HHInfo *info;
BOOL res;
WCHAR chm_file[MAX_PATH];
const WCHAR *index;
FIXME("Not all HH cases handled correctly\n");
index = strstrW(filename, delimW);
if (index)
{
memcpy(chm_file, filename, (index-filename)*sizeof(WCHAR));
chm_file[index-filename] = 0;
filename = chm_file;
}
else
{
if (command!=HH_DISPLAY_SEARCH) /* FIXME - use HH_FTS_QUERYW structure in data */
index = (const WCHAR*)data;
}
info = CreateHelpViewer(filename);
res = NavigateToChm(info, info->pCHMInfo->szFile, info->WinType.pszFile);
if(!res)
ReleaseHelpViewer(info);
if (info)
{
if (!index)
index = info->WinType.pszFile;
res = NavigateToChm(info, info->pCHMInfo->szFile, index);
if(!res)
ReleaseHelpViewer(info);
}
return NULL; /* FIXME */
}
@ -137,29 +159,71 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD data)
}
/******************************************************************
* HtmlHelpA (hhctrl.ocx.14)
* HtmlHelpA (HHCTRL.OCX.14)
*/
HWND WINAPI HtmlHelpA(HWND caller, LPCSTR filename, UINT command, DWORD data)
HWND WINAPI HtmlHelpA(HWND caller, LPCSTR filename, UINT command, DWORD_PTR data)
{
WCHAR *wfile = NULL;
WCHAR *wfile = NULL, *wdata = NULL;
DWORD len;
HWND result;
if (filename)
{
DWORD len = MultiByteToWideChar( CP_ACP, 0, filename, -1, NULL, 0 );
len = MultiByteToWideChar( CP_ACP, 0, filename, -1, NULL, 0 );
wfile = hhctrl_alloc(len*sizeof(WCHAR));
MultiByteToWideChar( CP_ACP, 0, filename, -1, wfile, len );
}
result = HtmlHelpW( caller, wfile, command, data );
if (data)
{
switch(command)
{
case HH_ALINK_LOOKUP:
case HH_DISPLAY_SEARCH:
case HH_DISPLAY_TEXT_POPUP:
case HH_GET_LAST_ERROR:
case HH_GET_WIN_TYPE:
case HH_KEYWORD_LOOKUP:
case HH_SET_WIN_TYPE:
case HH_SYNC:
FIXME("structures not handled yet\n");
break;
case HH_DISPLAY_INDEX:
case HH_DISPLAY_TOPIC:
case HH_DISPLAY_TOC:
case HH_GET_WIN_HANDLE:
case HH_SAFE_DISPLAY_TOPIC:
len = MultiByteToWideChar( CP_ACP, 0, (const char*)data, -1, NULL, 0 );
wdata = hhctrl_alloc(len*sizeof(WCHAR));
MultiByteToWideChar( CP_ACP, 0, (const char*)data, -1, wdata, len );
break;
case HH_CLOSE_ALL:
case HH_HELP_CONTEXT:
case HH_INITIALIZE:
case HH_PRETRANSLATEMESSAGE:
case HH_TP_HELP_CONTEXTMENU:
case HH_TP_HELP_WM_HELP:
case HH_UNINITIALIZE:
/* either scalar or pointer to scalar - do nothing */
break;
default:
FIXME("Unknown command: %s (%d)\n", command_to_string(command), command);
break;
}
}
result = HtmlHelpW( caller, wfile, command, wdata ? (DWORD_PTR)wdata : data );
hhctrl_free(wfile);
hhctrl_free(wdata);
return result;
}
/******************************************************************
* doWinMain (hhctrl.ocx.13)
* doWinMain (HHCTRL.OCX.13)
*/
int WINAPI doWinMain(HINSTANCE hInstance, LPSTR szCmdLine)
{
@ -180,7 +244,7 @@ int WINAPI doWinMain(HINSTANCE hInstance, LPSTR szCmdLine)
}
/******************************************************************
* DllGetClassObject (hhctrl.ocx.@)
* DllGetClassObject (HHCTRL.OCX.@)
*/
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{

View file

@ -38,7 +38,7 @@
#include "initguid.h"
#endif
#include "itss.h"
#include "wine/itss.h"
#include "wine/unicode.h"
#define WB_GOBACK 0

View file

@ -1,34 +1,32 @@
<module name="hhctrl" type="win32ocx" baseaddress="${BASEADDRESS_HHCTRL}" installbase="system32" installname="hhctrl.ocx" usewrc="false" allowwarnings="true">
<importlibrary definition="hhctrl.ocx.spec.def" />
<include base="hhctrl">.</include>
<include base="ReactOS">include/reactos/wine</include>
<include base="ReactOS" root="intermediate">include/reactos/wine</include>
<define name="__REACTOS__" />
<define name="__WINESRC__" />
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x600</define>
<define name="_WIN32_WINNT">0x501</define>
<define name="WINVER">0x501</define>
<dependency>wineheaders</dependency>
<library>wine</library>
<library>uuid</library>
<library>kernel32</library>
<library>user32</library>
<library>gdi32</library>
<library>shell32</library>
<library>comctl32</library>
<library>advapi32</library>
<library>gdi32</library>
<library>ntdll</library>
<library>ole32</library>
<library>oleaut32</library>
<library>shlwapi</library>
<file>chm.c</file>
<file>content.c</file>
<file>help.c</file>
<file>hhctrl.c</file>
<file>regsvr.c</file>
<file>webbrowser.c</file>
<file>hhctrl.rc</file>
<file>hhctrl.ocx.spec</file>
</module>
<module name="hhctrl" type="win32ocx" baseaddress="${BASEADDRESS_HHCTRL}" installbase="system32" installname="hhctrl.ocx" allowwarnings="true">
<autoregister infsection="OleControlDlls" type="DllRegisterServer" />
<importlibrary definition="hhctrl.ocx.spec.def" />
<include base="hhctrl">.</include>
<include base="ReactOS">include/reactos/wine</include>
<define name="__REACTOS__" />
<define name="__WINESRC__" />
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x600</define>
<define name="_WIN32_WINNT">0x501</define>
<define name="WINVER">0x501</define>
<library>wine</library>
<library>advapi32</library>
<library>comctl32</library>
<library>shell32</library>
<library>shlwapi</library>
<library>ole32</library>
<library>oleaut32</library>
<library>user32</library>
<library>gdi32</library>
<library>kernel32</library>
<library>uuid</library>
<library>ntdll</library>
<file>chm.c</file>
<file>content.c</file>
<file>help.c</file>
<file>hhctrl.c</file>
<file>regsvr.c</file>
<file>webbrowser.c</file>
<file>hhctrl.rc</file>
<file>hhctrl.ocx.spec</file>
</module>