Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
16b35e00
Commit
16b35e00
authored
Jan 17, 2011
by
Owen Rudge
Committed by
Alexandre Julliard
Jan 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hhctrl.ocx: Implement Sync button functionality.
parent
deda1b2c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
9 deletions
+70
-9
content.c
dlls/hhctrl.ocx/content.c
+16
-0
help.c
dlls/hhctrl.ocx/help.c
+53
-9
hhctrl.h
dlls/hhctrl.ocx/hhctrl.h
+1
-0
No files found.
dlls/hhctrl.ocx/content.c
View file @
16b35e00
/*
/*
* Copyright 2007 Jacek Caban for CodeWeavers
* Copyright 2007 Jacek Caban for CodeWeavers
* Copyright 2011 Owen Rudge for CodeWeavers
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* modify it under the terms of the GNU Lesser General Public
...
@@ -312,3 +313,18 @@ void ReleaseContent(HHInfo *info)
...
@@ -312,3 +313,18 @@ void ReleaseContent(HHInfo *info)
{
{
free_content_item
(
info
->
content
);
free_content_item
(
info
->
content
);
}
}
void
ActivateContentTopic
(
HWND
hWnd
,
LPCWSTR
filename
,
ContentItem
*
item
)
{
if
(
lstrcmpiW
(
item
->
local
,
filename
)
==
0
)
{
SendMessageW
(
hWnd
,
TVM_SELECTITEM
,
TVGN_CARET
,
(
LPARAM
)
item
->
id
);
return
;
}
if
(
item
->
next
)
ActivateContentTopic
(
hWnd
,
filename
,
item
->
next
);
if
(
item
->
child
)
ActivateContentTopic
(
hWnd
,
filename
,
item
->
child
);
}
dlls/hhctrl.ocx/help.c
View file @
16b35e00
...
@@ -111,21 +111,15 @@ BOOL NavigateToUrl(HHInfo *info, LPCWSTR surl)
...
@@ -111,21 +111,15 @@ BOOL NavigateToUrl(HHInfo *info, LPCWSTR surl)
return
ret
;
return
ret
;
}
}
BOOL
NavigateToChm
(
HHInfo
*
info
,
LPCWSTR
file
,
LPCWSTR
index
)
BOOL
AppendFullPathURL
(
LPCWSTR
file
,
LPWSTR
buf
,
LPCWSTR
index
)
{
{
WCHAR
buf
[
INTERNET_MAX_URL_LENGTH
];
WCHAR
full_path
[
MAX_PATH
];
LPWSTR
ptr
;
static
const
WCHAR
url_format
[]
=
static
const
WCHAR
url_format
[]
=
{
'm'
,
'k'
,
':'
,
'@'
,
'M'
,
'S'
,
'I'
,
'T'
,
'S'
,
't'
,
'o'
,
'r'
,
'e'
,
':'
,
'%'
,
's'
,
':'
,
':'
,
'%'
,
's'
,
'%'
,
's'
,
0
};
{
'm'
,
'k'
,
':'
,
'@'
,
'M'
,
'S'
,
'I'
,
'T'
,
'S'
,
't'
,
'o'
,
'r'
,
'e'
,
':'
,
'%'
,
's'
,
':'
,
':'
,
'%'
,
's'
,
'%'
,
's'
,
0
};
static
const
WCHAR
slash
[]
=
{
'/'
,
0
};
static
const
WCHAR
slash
[]
=
{
'/'
,
0
};
static
const
WCHAR
empty
[]
=
{
0
};
static
const
WCHAR
empty
[]
=
{
0
};
WCHAR
full_path
[
MAX_PATH
];
TRACE
(
"%p %s %s
\n
"
,
info
,
debugstr_w
(
file
),
debugstr_w
(
index
));
TRACE
(
"%s %p %s
\n
"
,
debugstr_w
(
file
),
buf
,
debugstr_w
(
index
));
if
(
!
info
->
web_browser
)
return
FALSE
;
if
(
!
GetFullPathNameW
(
file
,
sizeof
(
full_path
)
/
sizeof
(
full_path
[
0
]),
full_path
,
NULL
))
{
if
(
!
GetFullPathNameW
(
file
,
sizeof
(
full_path
)
/
sizeof
(
full_path
[
0
]),
full_path
,
NULL
))
{
WARN
(
"GetFullPathName failed: %u
\n
"
,
GetLastError
());
WARN
(
"GetFullPathName failed: %u
\n
"
,
GetLastError
());
...
@@ -133,6 +127,18 @@ BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
...
@@ -133,6 +127,18 @@ BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
}
}
wsprintfW
(
buf
,
url_format
,
full_path
,
(
!
index
||
index
[
0
]
==
'/'
)
?
empty
:
slash
,
index
);
wsprintfW
(
buf
,
url_format
,
full_path
,
(
!
index
||
index
[
0
]
==
'/'
)
?
empty
:
slash
,
index
);
return
TRUE
;
}
BOOL
NavigateToChm
(
HHInfo
*
info
,
LPCWSTR
file
,
LPCWSTR
index
)
{
WCHAR
buf
[
INTERNET_MAX_URL_LENGTH
];
LPWSTR
ptr
;
TRACE
(
"%p %s %s
\n
"
,
info
,
debugstr_w
(
file
),
debugstr_w
(
index
));
if
((
!
info
->
web_browser
)
||
!
AppendFullPathURL
(
file
,
buf
,
index
))
return
FALSE
;
/* FIXME: HACK */
/* FIXME: HACK */
if
((
ptr
=
strchrW
(
buf
,
'#'
)))
if
((
ptr
=
strchrW
(
buf
,
'#'
)))
...
@@ -141,6 +147,42 @@ BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
...
@@ -141,6 +147,42 @@ BOOL NavigateToChm(HHInfo *info, LPCWSTR file, LPCWSTR index)
return
SUCCEEDED
(
navigate_url
(
info
,
buf
));
return
SUCCEEDED
(
navigate_url
(
info
,
buf
));
}
}
static
void
DoSync
(
HHInfo
*
info
)
{
WCHAR
buf
[
INTERNET_MAX_URL_LENGTH
];
HRESULT
hres
;
DWORD
len
;
BSTR
url
;
hres
=
IWebBrowser2_get_LocationURL
(
info
->
web_browser
,
&
url
);
if
(
FAILED
(
hres
))
{
WARN
(
"get_LocationURL failed: %08x
\n
"
,
hres
);
return
;
}
/* If we're not currently viewing a page in the active .chm file, abort */
if
((
!
AppendFullPathURL
(
info
->
pszFile
,
buf
,
NULL
))
||
(
len
=
lstrlenW
(
buf
)
>
lstrlenW
(
url
)))
{
SysFreeString
(
url
);
return
;
}
if
(
lstrcmpiW
(
buf
,
url
)
>
0
)
{
static
const
WCHAR
delimW
[]
=
{
':'
,
':'
,
'/'
,
0
};
const
WCHAR
*
index
;
index
=
strstrW
(
url
,
delimW
);
if
(
index
)
ActivateContentTopic
(
info
->
tabs
[
TAB_CONTENTS
].
hwnd
,
index
+
3
,
info
->
content
);
/* skip over ::/ */
}
SysFreeString
(
url
);
}
/* Size Bar */
/* Size Bar */
#define SIZEBAR_WIDTH 4
#define SIZEBAR_WIDTH 4
...
@@ -654,6 +696,8 @@ static void TB_OnClick(HWND hWnd, DWORD dwID)
...
@@ -654,6 +696,8 @@ static void TB_OnClick(HWND hWnd, DWORD dwID)
ExpandContract
(
info
);
ExpandContract
(
info
);
break
;
break
;
case
IDTB_SYNC
:
case
IDTB_SYNC
:
DoSync
(
info
);
break
;
case
IDTB_OPTIONS
:
case
IDTB_OPTIONS
:
case
IDTB_BROWSE_FWD
:
case
IDTB_BROWSE_FWD
:
case
IDTB_BROWSE_BACK
:
case
IDTB_BROWSE_BACK
:
...
...
dlls/hhctrl.ocx/hhctrl.h
View file @
16b35e00
...
@@ -169,6 +169,7 @@ void DoPageAction(HHInfo*,DWORD);
...
@@ -169,6 +169,7 @@ void DoPageAction(HHInfo*,DWORD);
void
InitContent
(
HHInfo
*
);
void
InitContent
(
HHInfo
*
);
void
ReleaseContent
(
HHInfo
*
);
void
ReleaseContent
(
HHInfo
*
);
void
ActivateContentTopic
(
HWND
,
LPCWSTR
,
ContentItem
*
);
void
InitIndex
(
HHInfo
*
);
void
InitIndex
(
HHInfo
*
);
void
ReleaseIndex
(
HHInfo
*
);
void
ReleaseIndex
(
HHInfo
*
);
...
...
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