Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
736ef403
Commit
736ef403
authored
Feb 28, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 28, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hhctrl.ocx: Added HH_HELP_CONTEXT implementation.
parent
5d011551
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
97 additions
and
11 deletions
+97
-11
chm.c
dlls/hhctrl.ocx/chm.c
+47
-0
help.c
dlls/hhctrl.ocx/help.c
+22
-7
hhctrl.c
dlls/hhctrl.ocx/hhctrl.c
+26
-4
hhctrl.h
dlls/hhctrl.ocx/hhctrl.h
+2
-0
No files found.
dlls/hhctrl.ocx/chm.c
View file @
736ef403
...
...
@@ -146,6 +146,53 @@ static BOOL ReadChmSystem(CHMInfo *chm)
return
SUCCEEDED
(
hres
);
}
LPWSTR
FindContextAlias
(
CHMInfo
*
chm
,
DWORD
index
)
{
IStream
*
ivb_stream
;
DWORD
size
,
read
,
i
;
DWORD
*
buf
;
LPCSTR
ret
=
NULL
;
HRESULT
hres
;
static
const
WCHAR
wszIVB
[]
=
{
'#'
,
'I'
,
'V'
,
'B'
,
0
};
hres
=
IStorage_OpenStream
(
chm
->
pStorage
,
wszIVB
,
NULL
,
STGM_READ
,
0
,
&
ivb_stream
);
if
(
FAILED
(
hres
))
{
WARN
(
"Could not open #IVB stream: %08x
\n
"
,
hres
);
return
NULL
;
}
hres
=
IStream_Read
(
ivb_stream
,
&
size
,
sizeof
(
size
),
&
read
);
if
(
FAILED
(
hres
))
{
WARN
(
"Read failed: %08x
\n
"
,
hres
);
IStream_Release
(
ivb_stream
);
return
NULL
;
}
buf
=
hhctrl_alloc
(
size
);
hres
=
IStream_Read
(
ivb_stream
,
buf
,
size
,
&
read
);
IStream_Release
(
ivb_stream
);
if
(
FAILED
(
hres
))
{
WARN
(
"Read failed: %08x
\n
"
,
hres
);
hhctrl_free
(
buf
);
return
NULL
;
}
size
/=
2
*
sizeof
(
DWORD
);
for
(
i
=
0
;
i
<
size
;
i
++
)
{
if
(
buf
[
2
*
i
]
==
index
)
{
ret
=
GetChmString
(
chm
,
buf
[
2
*
i
+
1
]);
break
;
}
}
hhctrl_free
(
buf
);
TRACE
(
"returning %s
\n
"
,
debugstr_a
(
ret
));
return
strdupAtoW
(
ret
);
}
/* Loads the HH_WINTYPE data from the CHM file
*
* FIXME: There may be more than one window type in the file, so
...
...
dlls/hhctrl.ocx/help.c
View file @
736ef403
...
...
@@ -57,15 +57,32 @@ static LPWSTR HH_LoadString(DWORD dwID)
return
string
;
}
BOOL
NavigateToUrl
(
HHInfo
*
info
,
LPCWSTR
surl
)
{
VARIANT
url
;
HRESULT
hres
;
V_VT
(
&
url
)
=
VT_BSTR
;
V_BSTR
(
&
url
)
=
SysAllocString
(
surl
);
hres
=
IWebBrowser2_Navigate2
(
info
->
web_browser
,
&
url
,
0
,
0
,
0
,
0
);
VariantClear
(
&
url
);
return
SUCCEEDED
(
hres
);
}
BOOL
NavigateToChm
(
HHInfo
*
info
,
LPCWSTR
file
,
LPCWSTR
index
)
{
WCHAR
buf
[
INTERNET_MAX_URL_LENGTH
];
WCHAR
full_path
[
MAX_PATH
];
VARIANT
url
;
LPWSTR
ptr
;
static
const
WCHAR
url_format
[]
=
{
'm'
,
'k'
,
':'
,
'@'
,
'M'
,
'S'
,
'I'
,
'T'
,
'S'
,
't'
,
'o'
,
'r'
,
'e'
,
':'
,
'%'
,
's'
,
':'
,
':'
,
'/'
,
'%'
,
's'
,
0
};
TRACE
(
"%p %s %s
\n
"
,
info
,
debugstr_w
(
file
),
debugstr_w
(
index
));
if
(
!
info
->
web_browser
)
return
FALSE
;
...
...
@@ -76,13 +93,11 @@ BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
wsprintfW
(
buf
,
url_format
,
full_path
,
index
);
V_VT
(
&
url
)
=
VT_BSTR
;
V_BSTR
(
&
url
)
=
SysAllocString
(
buf
);
IWebBrowser2_Navigate2
(
info
->
web_browser
,
&
url
,
0
,
0
,
0
,
0
);
VariantClear
(
&
url
);
/* FIXME: HACK */
if
((
ptr
=
strchrW
(
buf
,
'#'
)))
*
ptr
=
0
;
return
TRUE
;
return
NavigateToUrl
(
info
,
buf
)
;
}
/* Size Bar */
...
...
dlls/hhctrl.ocx/hhctrl.c
View file @
736ef403
...
...
@@ -2,6 +2,7 @@
* hhctrl implementation
*
* Copyright 2004 Krzysztof Foltman
* Copyright 2007 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -26,7 +27,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
htmlhelp
);
HINSTANCE
hhctrl_hinstance
;
BOOL
hh_process
;
BOOL
hh_process
=
FALSE
;
BOOL
WINAPI
DllMain
(
HINSTANCE
hInstance
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
{
...
...
@@ -84,9 +85,11 @@ static const char *command_to_string(UINT command)
#undef X
}
/******************************************************************
* HtmlHelpW (hhctrl.ocx.15)
*/
HWND
WINAPI
HtmlHelpW
(
HWND
caller
,
LPCWSTR
filename
,
UINT
command
,
DWORD
data
)
{
TRACE
(
"(%p, %s, command=%s, data=%d)
\n
"
,
caller
,
debugstr_w
(
filename
),
command_to_string
(
command
),
data
);
...
...
@@ -95,8 +98,7 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD data)
{
case
HH_DISPLAY_TOPIC
:
case
HH_DISPLAY_TOC
:
case
HH_DISPLAY_SEARCH
:
case
HH_HELP_CONTEXT
:
{
case
HH_DISPLAY_SEARCH
:{
HHInfo
*
info
;
BOOL
res
;
...
...
@@ -110,6 +112,23 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD data)
return
NULL
;
/* FIXME */
}
case
HH_HELP_CONTEXT
:
{
HHInfo
*
info
;
LPWSTR
url
;
info
=
CreateHelpViewer
(
filename
);
if
(
!
info
)
return
NULL
;
url
=
FindContextAlias
(
info
->
pCHMInfo
,
data
);
if
(
!
url
)
return
NULL
;
NavigateToUrl
(
info
,
url
);
hhctrl_free
(
url
);
return
NULL
;
/* FIXME */
}
default:
FIXME
(
"HH case %s not handled.
\n
"
,
command_to_string
(
command
));
}
...
...
@@ -117,6 +136,9 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD data)
return
0
;
}
/******************************************************************
* HtmlHelpA (hhctrl.ocx.14)
*/
HWND
WINAPI
HtmlHelpA
(
HWND
caller
,
LPCSTR
filename
,
UINT
command
,
DWORD
data
)
{
WCHAR
*
wfile
=
NULL
;
...
...
dlls/hhctrl.ocx/hhctrl.h
View file @
736ef403
...
...
@@ -79,9 +79,11 @@ void DoPageAction(HHInfo*,DWORD);
CHMInfo
*
OpenCHM
(
LPCWSTR
szFile
);
BOOL
LoadWinTypeFromCHM
(
CHMInfo
*
pCHMInfo
,
HH_WINTYPEW
*
pHHWinType
);
CHMInfo
*
CloseCHM
(
CHMInfo
*
pCHMInfo
);
LPWSTR
FindContextAlias
(
CHMInfo
*
,
DWORD
);
HHInfo
*
CreateHelpViewer
(
LPCWSTR
);
void
ReleaseHelpViewer
(
HHInfo
*
);
BOOL
NavigateToUrl
(
HHInfo
*
,
LPCWSTR
);
BOOL
NavigateToChm
(
HHInfo
*
,
LPCWSTR
,
LPCWSTR
);
/* memory allocation functions */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment