Autosyncing with Wine HEAD

svn path=/trunk/; revision=32840
This commit is contained in:
The Wine Synchronizer 2008-04-04 12:21:42 +00:00
parent a92ed506c9
commit d47984be22
9 changed files with 189 additions and 37 deletions

View file

@ -0,0 +1,58 @@
/*
* HTML Help resources
* Greek Language Support
*
* Copyright 2008 Apostolos Alexiadis
*
* 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
*/
LANGUAGE LANG_GREEK, SUBLANG_DEFAULT
STRINGTABLE
BEGIN
IDS_CONTENTS "&Ðåñéå÷üìåíá"
IDS_INDEX "I&ndex"
IDS_SEARCH "&ÁíáæÞôçóç"
IDS_FAVORITES "Á&ãáðçìÝíá"
END
STRINGTABLE
BEGIN
IDTB_EXPAND "ÅìöÜíéóç"
IDTB_CONTRACT "Áðüêñõøç"
IDTB_STOP "Ôåñìáôéóìüò"
IDTB_REFRESH "ÁíáíÝùóç"
IDTB_BACK "Ðßóù"
IDTB_HOME "Home"
IDTB_SYNC "Sync"
IDTB_PRINT "Åêôýðùóç"
IDTB_OPTIONS "ÅðéëïãÝò"
IDTB_FORWARD "Forward"
IDTB_NOTES "IDTB_NOTES"
IDTB_BROWSE_FWD "IDTB_BROWSE_FWD"
IDTB_BROWSE_BACK "IDT_BROWSE_BACK"
IDTB_CONTENTS "IDTB_CONTENTS"
IDTB_INDEX "IDTB_INDEX"
IDTB_SEARCH "IDTB_SEARCH"
IDTB_HISTORY "IDTB_HISTORY"
IDTB_FAVORITES "IDTB_FAVORITES"
IDTB_JUMP1 "Jump1"
IDTB_JUMP2 "Jump2"
IDTB_CUSTOMIZE "Customize"
IDTB_ZOOM "Zoom"
IDTB_TOC_NEXT "IDTB_TOC_NEXT"
IDTB_TOC_PREV "IDTB_TOC_PREV"
END

View file

@ -0,0 +1,58 @@
/*
* HTML Help resources
* Russia Language Support
*
* Copyright 2008 Vitaliy Margolen
*
* 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
*/
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
STRINGTABLE
BEGIN
IDS_CONTENTS "&Ñîäåðæàíèå"
IDS_INDEX "&Îãëàâëåíèå"
IDS_SEARCH "&Ïîèñê"
IDS_FAVORITES "&Èçáðàííîå"
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 "Ïåðåõîä 1"
IDTB_JUMP2 "Ïåðåõîä 2"
IDTB_CUSTOMIZE "Ïåðñîíàëèçîâàòü"
IDTB_ZOOM "Ìàñøòàá"
IDTB_TOC_NEXT "Ñëåäóþùàÿ ãëàâà"
IDTB_TOC_PREV "Ïðåäûäóùàÿ ãëàâà"
END

View file

@ -113,11 +113,20 @@ static BOOL ReadChmSystem(CHMInfo *chm)
break;
switch(entry.code) {
case 0x0:
TRACE("TOC is %s\n", debugstr_an(buf, entry.len));
heap_free(chm->defToc);
chm->defToc = strdupnAtoW(buf, entry.len);
break;
case 0x2:
TRACE("Default topic is %s\n", debugstr_an(buf, entry.len));
heap_free(chm->defTopic);
chm->defTopic = strdupnAtoW(buf, entry.len);
break;
case 0x3:
TRACE("Title is %s\n", debugstr_an(buf, entry.len));
heap_free(chm->defTitle);
chm->defTitle = strdupnAtoW(buf, entry.len);
break;
case 0x5:
TRACE("Default window is %s\n", debugstr_an(buf, entry.len));
@ -212,7 +221,26 @@ BOOL LoadWinTypeFromCHM(HHInfo *info)
hr = IStorage_OpenStream(pStorage, windowsW, NULL, STGM_READ, 0, &pStream);
if (FAILED(hr))
return FALSE;
{
/* no defined window types so use (hopefully) sane defaults */
static const WCHAR defaultwinW[] = {'d','e','f','a','u','l','t','w','i','n','\0'};
static const WCHAR null[] = {0};
memset((void*)&(info->WinType), 0, sizeof(info->WinType));
info->WinType.cbStruct=sizeof(info->WinType);
info->WinType.fUniCodeStrings=TRUE;
info->WinType.pszType=strdupW(defaultwinW);
info->WinType.pszToc = strdupW(info->pCHMInfo->defToc);
info->WinType.pszIndex = strdupW(null);
info->WinType.fsValidMembers=0;
info->WinType.fsWinProperties=HHWIN_PROP_TRI_PANE;
info->WinType.pszCaption=strdupW(info->pCHMInfo->defTitle);
info->WinType.dwStyles=WS_POPUP;
info->WinType.dwExStyles=0;
info->WinType.nShowState=SW_SHOW;
info->WinType.pszFile=strdupW(info->pCHMInfo->defTopic);
info->WinType.curNavType=HHWIN_NAVTYPE_TOC;
return TRUE;
}
/* jump past the #WINDOWS header */
liOffset.QuadPart = sizeof(DWORD) * 2;
@ -304,7 +332,7 @@ void SetChmPath(ChmPath *file, LPCWSTR base_file, LPCWSTR path)
IStream *GetChmStream(CHMInfo *info, LPCWSTR parent_chm, ChmPath *chm_file)
{
IStorage *storage;
IStream *stream;
IStream *stream = NULL;
HRESULT hres;
TRACE("%s (%s :: %s)\n", debugstr_w(parent_chm), debugstr_w(chm_file->chm_file),
@ -342,7 +370,7 @@ CHMInfo *OpenCHM(LPCWSTR szFile)
CHMInfo *ret = heap_alloc_zero(sizeof(CHMInfo));
res = GetFullPathNameW(szFile, sizeof(file), file, NULL);
res = GetFullPathNameW(szFile, sizeof(file)/sizeof(file[0]), file, NULL);
ret->szFile = strdupW(file);
hres = CoCreateInstance(&CLSID_ITStorage, NULL, CLSCTX_INPROC_SERVER,
@ -393,6 +421,9 @@ CHMInfo *CloseCHM(CHMInfo *chm)
}
heap_free(chm->strings);
heap_free(chm->defTitle);
heap_free(chm->defTopic);
heap_free(chm->defToc);
heap_free(chm);
return NULL;

View file

@ -51,13 +51,14 @@ static const WCHAR szEmpty[] = {0};
static LPWSTR HH_LoadString(DWORD dwID)
{
LPWSTR string = NULL;
LPCWSTR stringresource;
int iSize;
iSize = LoadStringW(hhctrl_hinstance, dwID, NULL, 0);
iSize += 2; /* some strings (tab text) needs double-null termination */
iSize = LoadStringW(hhctrl_hinstance, dwID, (LPWSTR)&stringresource, 0);
string = heap_alloc(iSize * sizeof(WCHAR));
LoadStringW(hhctrl_hinstance, dwID, string, iSize);
string = heap_alloc((iSize + 2) * sizeof(WCHAR)); /* some strings (tab text) needs double-null termination */
memcpy(string, stringresource, iSize*sizeof(WCHAR));
string[iSize] = 0;
return string;
}
@ -115,7 +116,7 @@ BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
if (!info->web_browser)
return FALSE;
if(!GetFullPathNameW(file, sizeof(full_path), full_path, NULL)) {
if(!GetFullPathNameW(file, sizeof(full_path)/sizeof(full_path[0]), full_path, NULL)) {
WARN("GetFullPathName failed: %u\n", GetLastError());
return FALSE;
}

View file

@ -114,6 +114,7 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat
memcpy(chm_file, filename, (index-filename)*sizeof(WCHAR));
chm_file[index-filename] = 0;
filename = chm_file;
index += 2; /* advance beyond "::" for calling NavigateToChm() later */
}
else
{

View file

@ -74,6 +74,10 @@ typedef struct CHMInfo
IStream *strings_stream;
char **strings;
DWORD strings_size;
WCHAR *defTopic;
WCHAR *defTitle;
WCHAR *defToc;
} CHMInfo;
#define TAB_CONTENTS 0
@ -177,7 +181,7 @@ static inline LPWSTR strdupW(LPCWSTR str)
return ret;
}
static inline LPWSTR strdupAtoW(LPCSTR str)
static inline LPWSTR strdupnAtoW(LPCSTR str, LONG lenA)
{
LPWSTR ret;
DWORD len;
@ -185,13 +189,28 @@ static inline LPWSTR strdupAtoW(LPCSTR str)
if(!str)
return NULL;
len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
if (lenA > 0)
{
/* find length of string */
LPCSTR eos = memchr(str, 0, lenA);
if (eos) lenA = eos - str;
}
len = MultiByteToWideChar(CP_ACP, 0, str, lenA, NULL, 0)+1; /* +1 for null pad */
ret = heap_alloc(len*sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
MultiByteToWideChar(CP_ACP, 0, str, lenA, ret, len);
ret[len-1] = 0;
return ret;
}
static inline LPWSTR strdupAtoW(LPCSTR str)
{
return strdupnAtoW(str, -1);
}
extern HINSTANCE hhctrl_hinstance;
extern BOOL hh_process;

View file

@ -6,11 +6,17 @@
<importlibrary definition="hhctrl.ocx.spec.def" />
<include base="hhctrl">.</include>
<include base="ReactOS">include/reactos/wine</include>
<include base="ReactOS" root="intermediate">include/reactos</include>
<define name="__WINESRC__" />
<define name="WINVER">0x600</define>
<define name="_WIN32_WINNT">0x600</define>
<dependency>wineheaders</dependency>
<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>
<library>wine</library>
<library>advapi32</library>
<library>comctl32</library>
@ -22,13 +28,5 @@
<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>
</group>

View file

@ -1,16 +0,0 @@
Index: hhctrl.ocx.rbuild
===================================================================
--- hhctrl.ocx.rbuild (revision 27782)
+++ hhctrl.ocx.rbuild (working copy)
@@ -5,9 +5,11 @@
<importlibrary definition="hhctrl.ocx.spec.def" />
<include base="hhctrl">.</include>
<include base="ReactOS">include/reactos/wine</include>
+ <include base="ReactOS" root="intermediate">include/reactos</include>
<define name="__WINESRC__" />
<define name="WINVER">0x600</define>
<define name="_WIN32_WINNT">0x600</define>
+ <dependency>wineheaders</dependency>
<library>wine</library>
<library>advapi32</library>
<library>comctl32</library>

View file

@ -31,6 +31,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#include "Cs.rc"
#include "De.rc"
#include "El.rc"
#include "En.rc"
#include "Fr.rc"
#include "Fi.rc"
@ -39,5 +40,6 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#include "Nl.rc"
#include "No.rc"
#include "Pl.rc"
#include "Ru.rc"
#include "Sv.rc"
#include "Tr.rc"