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
03587c6f
Commit
03587c6f
authored
Oct 21, 2002
by
Eric Pouech
Committed by
Alexandre Julliard
Oct 21, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved a bit link handling (a few more link types loaded from file
and support for link to a macro).
parent
2468f06f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
59 deletions
+90
-59
hlpfile.c
programs/winhelp/hlpfile.c
+51
-34
hlpfile.h
programs/winhelp/hlpfile.h
+3
-2
winhelp.c
programs/winhelp/winhelp.c
+35
-16
winhelp.h
programs/winhelp/winhelp.h
+1
-7
No files found.
programs/winhelp/hlpfile.c
View file @
03587c6f
...
...
@@ -757,28 +757,31 @@ static BOOL HLPFILE_AddParagraph(HLPFILE *hlpfile, BYTE *buf, BYTE *end, unsigne
strcpy
(
paragraph
->
u
.
text
.
lpszText
,
text
);
}
if
(
attributes
.
link
.
lpsz
Path
)
if
(
attributes
.
link
.
lpsz
String
)
{
/* FIXME: should build a string table for the attributes.link.lpszPath
* they are reallocated for each link
*/
paragraph
->
link
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
HLPFILE_LINK
)
+
strlen
(
attributes
.
link
.
lpsz
Path
)
+
1
);
sizeof
(
HLPFILE_LINK
)
+
strlen
(
attributes
.
link
.
lpsz
String
)
+
1
);
if
(
!
paragraph
->
link
)
return
FALSE
;
paragraph
->
link
->
lpszPath
=
(
char
*
)
paragraph
->
link
+
sizeof
(
HLPFILE_LINK
);
strcpy
((
char
*
)
paragraph
->
link
->
lpszPath
,
attributes
.
link
.
lpszPath
);
paragraph
->
link
->
cookie
=
attributes
.
link
.
cookie
;
paragraph
->
link
->
lpszString
=
(
char
*
)
paragraph
->
link
+
sizeof
(
HLPFILE_LINK
);
strcpy
((
char
*
)
paragraph
->
link
->
lpszString
,
attributes
.
link
.
lpszString
);
paragraph
->
link
->
lHash
=
attributes
.
link
.
lHash
;
paragraph
->
link
->
bClrChange
=
attributes
.
link
.
bClrChange
;
paragraph
->
link
->
bPopup
=
attributes
.
link
.
bPopup
;
WINE_TRACE
(
"Link to %s/%08lx
\n
"
,
paragraph
->
link
->
lpszPath
,
paragraph
->
link
->
lHash
);
WINE_TRACE
(
"Link[%d] to %s/%08lx
\n
"
,
paragraph
->
link
->
cookie
,
paragraph
->
link
->
lpszString
,
paragraph
->
link
->
lHash
);
}
#if 0
memset(&attributes, 0, sizeof(attributes));
#else
attributes
.
hBitmap
=
0
;
attributes
.
link
.
lpszPath
=
NULL
;
attributes
.
link
.
lpszString
=
NULL
;
attributes
.
link
.
bClrChange
=
FALSE
;
attributes
.
link
.
lHash
=
0
;
attributes
.
wVSpace
=
0
;
attributes
.
wHSpace
=
0
;
attributes
.
wIndent
=
0
;
...
...
@@ -880,53 +883,67 @@ static BOOL HLPFILE_AddParagraph(HLPFILE *hlpfile, BYTE *buf, BYTE *end, unsigne
case
0x8B
:
case
0x8C
:
WINE_FIXME
(
"NIY
\n
"
);
WINE_FIXME
(
"NIY
non-break space/hyphen
\n
"
);
format
+=
1
;
break
;
#if 0
case 0x
a
9:
case 0x
A
9:
format += 2;
break;
#endif
case
0xc8
:
case
0xcc
:
WINE_FIXME
(
"macro NIY %s
\n
"
,
format
+
3
);
format
+=
GET_USHORT
(
format
,
1
)
+
3
;
case
0xC8
:
case
0xCC
:
WINE_TRACE
(
"macro => %s
\n
"
,
format
+
3
);
attributes
.
link
.
bClrChange
=
!
(
*
format
&
4
);
attributes
.
link
.
cookie
=
hlp_link_macro
;
attributes
.
link
.
lpszString
=
format
+
3
;
format
+=
3
+
GET_USHORT
(
format
,
1
);
break
;
case
0x
e
0
:
case
0x
e
1
:
case
0x
E
0
:
case
0x
E
1
:
WINE_WARN
(
"jump topic 1 => %u
\n
"
,
GET_UINT
(
format
,
1
));
format
+=
5
;
break
;
case
0xe2
:
case
0xe3
:
attributes
.
link
.
lpszPath
=
hlpfile
->
lpszPath
;
case
0xE2
:
case
0xE3
:
attributes
.
link
.
bClrChange
=
TRUE
;
/* fall thru */
case
0xE6
:
case
0xE7
:
attributes
.
link
.
cookie
=
(
*
format
&
1
)
?
hlp_link_link
:
hlp_link_popup
;
attributes
.
link
.
lpszString
=
hlpfile
->
lpszPath
;
attributes
.
link
.
lHash
=
GET_UINT
(
format
,
1
);
attributes
.
link
.
bPopup
=
!
(
*
format
&
1
);
format
+=
5
;
break
;
case
0xe6
:
case
0xe7
:
WINE_WARN
(
"jump topic 2 => %u
\n
"
,
GET_UINT
(
format
,
1
));
format
+=
5
;
break
;
case
0xEA
:
case
0xEB
:
case
0xEE
:
case
0xEF
:
{
char
*
ptr
=
format
+
8
;
BYTE
type
=
format
[
3
];
case
0xea
:
attributes
.
link
.
lpszPath
=
format
+
8
;
attributes
.
link
.
cookie
=
hlp_link_link
;
attributes
.
link
.
lHash
=
GET_UINT
(
format
,
4
);
attributes
.
link
.
bPopup
=
!
(
*
format
&
1
);
format
+=
3
+
GET_USHORT
(
format
,
1
);
break
;
attributes
.
link
.
bClrChange
=
!
(
*
format
&
1
);
case
0xee
:
case
0xef
:
case
0xeb
:
WINE_WARN
(
"jump to external file
\n
"
);
if
(
type
==
1
)
{
WINE_FIXME
(
"Unsupported wnd number %d for link
\n
"
,
*
ptr
);
ptr
++
;}
if
(
type
==
4
||
type
==
6
)
{
attributes
.
link
.
lpszString
=
ptr
;
ptr
+=
strlen
(
ptr
)
+
1
;
}
else
attributes
.
link
.
lpszString
=
hlpfile
->
lpszPath
;
if
(
type
==
6
)
WINE_FIXME
(
"Unsupported wnd name '%s' for link
\n
"
,
ptr
);
}
format
+=
3
+
GET_USHORT
(
format
,
1
);
break
;
...
...
programs/winhelp/hlpfile.h
View file @
03587c6f
...
...
@@ -23,9 +23,10 @@ struct tagHelpFile;
typedef
struct
{
LPCSTR
lpszPath
;
enum
{
hlp_link_none
,
hlp_link_link
,
hlp_link_popup
,
hlp_link_macro
}
cookie
;
LPCSTR
lpszString
;
LONG
lHash
;
BOOL
bPopup
;
BOOL
bClrChange
;
}
HLPFILE_LINK
;
enum
para_type
{
para_normal_text
,
para_debug_text
,
para_image
};
...
...
programs/winhelp/winhelp.c
View file @
03587c6f
...
...
@@ -701,8 +701,24 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam,
mouse
.
x
=
LOWORD
(
lParam
);
mouse
.
y
=
HIWORD
(
lParam
);
WINHELP_CreateHelpWindowByHash
(
part
->
link
.
lpszPath
,
part
->
link
.
lHash
,
NULL
,
part
->
link
.
bPopup
,
hWnd
,
&
mouse
,
SW_NORMAL
);
switch
(
part
->
link
.
cookie
)
{
case
hlp_link_none
:
break
;
case
hlp_link_link
:
WINHELP_CreateHelpWindowByHash
(
part
->
link
.
lpszString
,
part
->
link
.
lHash
,
NULL
,
FALSE
,
hWnd
,
&
mouse
,
SW_NORMAL
);
break
;
case
hlp_link_popup
:
WINHELP_CreateHelpWindowByHash
(
part
->
link
.
lpszString
,
part
->
link
.
lHash
,
NULL
,
TRUE
,
hWnd
,
&
mouse
,
SW_NORMAL
);
break
;
case
hlp_link_macro
:
MACRO_ExecuteMacro
(
part
->
link
.
lpszString
);
break
;
default:
WINE_FIXME
(
"Unknown link cookie %d
\n
"
,
part
->
link
.
cookie
);
}
}
if
(
hPopupWnd
)
...
...
@@ -773,7 +789,7 @@ static BOOL WINHELP_AppendText(WINHELP_LINE ***linep, WINHELP_LINE_PART ***partp
*
line_ascent
=
ascent
;
line
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WINHELP_LINE
)
+
textlen
+
(
link
?
lstrlen
(
link
->
lpsz
Path
)
+
1
:
0
));
sizeof
(
WINHELP_LINE
)
+
textlen
+
(
link
?
lstrlen
(
link
->
lpsz
String
)
+
1
:
0
));
if
(
!
line
)
return
FALSE
;
line
->
next
=
0
;
...
...
@@ -807,7 +823,7 @@ static BOOL WINHELP_AppendText(WINHELP_LINE ***linep, WINHELP_LINE_PART ***partp
part
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WINHELP_LINE_PART
)
+
textlen
+
(
link
?
lstrlen
(
link
->
lpsz
Path
)
+
1
:
0
));
(
link
?
lstrlen
(
link
->
lpsz
String
)
+
1
:
0
));
if
(
!
part
)
return
FALSE
;
**
partp
=
part
;
ptr
=
(
char
*
)
part
+
sizeof
(
WINHELP_LINE_PART
);
...
...
@@ -836,12 +852,13 @@ static BOOL WINHELP_AppendText(WINHELP_LINE ***linep, WINHELP_LINE_PART ***partp
part
->
rect
.
left
,
part
->
rect
.
top
,
part
->
rect
.
right
,
part
->
rect
.
bottom
);
if
(
link
)
{
strcpy
(
ptr
+
textlen
,
link
->
lpszPath
);
part
->
link
.
lpszPath
=
ptr
+
textlen
;
strcpy
(
ptr
+
textlen
,
link
->
lpszString
);
part
->
link
.
lpszString
=
ptr
+
textlen
;
part
->
link
.
cookie
=
link
->
cookie
;
part
->
link
.
lHash
=
link
->
lHash
;
part
->
link
.
b
Popup
=
link
->
bPopup
;
part
->
link
.
b
ClrChange
=
link
->
bClrChange
;
}
else
part
->
link
.
lpszPath
=
0
;
else
part
->
link
.
cookie
=
hlp_link_none
;
part
->
next
=
0
;
*
partp
=
&
part
->
next
;
...
...
@@ -867,7 +884,7 @@ static BOOL WINHELP_AppendBitmap(WINHELP_LINE ***linep, WINHELP_LINE_PART ***par
if
(
!*
partp
||
pos
==
1
)
/* New line */
{
line
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WINHELP_LINE
)
+
(
link
?
lstrlen
(
link
->
lpsz
Path
)
+
1
:
0
));
sizeof
(
WINHELP_LINE
)
+
(
link
?
lstrlen
(
link
->
lpsz
String
)
+
1
:
0
));
if
(
!
line
)
return
FALSE
;
line
->
next
=
NULL
;
...
...
@@ -890,7 +907,7 @@ static BOOL WINHELP_AppendBitmap(WINHELP_LINE ***linep, WINHELP_LINE_PART ***par
part
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WINHELP_LINE_PART
)
+
(
link
?
lstrlen
(
link
->
lpsz
Path
)
+
1
:
0
));
(
link
?
lstrlen
(
link
->
lpsz
String
)
+
1
:
0
));
if
(
!
part
)
return
FALSE
;
**
partp
=
part
;
ptr
=
(
char
*
)
part
+
sizeof
(
WINHELP_LINE_PART
);
...
...
@@ -912,12 +929,13 @@ static BOOL WINHELP_AppendBitmap(WINHELP_LINE ***linep, WINHELP_LINE_PART ***par
if
(
link
)
{
strcpy
(
ptr
,
link
->
lpszPath
);
part
->
link
.
lpszPath
=
ptr
;
strcpy
(
ptr
,
link
->
lpszString
);
part
->
link
.
lpszString
=
ptr
;
part
->
link
.
cookie
=
link
->
cookie
;
part
->
link
.
lHash
=
link
->
lHash
;
part
->
link
.
b
Popup
=
link
->
bPopup
;
part
->
link
.
b
ClrChange
=
link
->
bClrChange
;
}
else
part
->
link
.
lpszPath
=
0
;
else
part
->
link
.
cookie
=
hlp_link_none
;
part
->
next
=
NULL
;
*
partp
=
&
part
->
next
;
...
...
@@ -996,7 +1014,7 @@ static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize)
if
(
p
->
link
)
{
underline
=
(
p
->
link
->
bP
opup
)
?
3
:
1
;
underline
=
(
p
->
link
->
cookie
==
hlp_link_p
opup
)
?
3
:
1
;
color
=
RGB
(
0
,
0x80
,
0
);
}
if
(
p
->
cookie
==
para_debug_text
)
color
=
RGB
(
0xff
,
0
,
0
);
...
...
@@ -1274,7 +1292,8 @@ WINHELP_LINE_PART* WINHELP_IsOverLink(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
for
(
part
=
&
line
->
first_part
;
part
;
part
=
part
->
next
)
{
if
(
part
->
link
.
lpszPath
&&
if
(
part
->
link
.
cookie
!=
hlp_link_none
&&
part
->
link
.
lpszString
&&
part
->
rect
.
left
<=
mouse
.
x
&&
part
->
rect
.
right
>=
mouse
.
x
&&
part
->
rect
.
top
<=
mouse
.
y
+
scroll_pos
&&
...
...
programs/winhelp/winhelp.h
View file @
03587c6f
...
...
@@ -56,13 +56,7 @@ typedef struct tagHelpLinePart
HBITMAP
hBitmap
;
}
image
;
}
u
;
struct
{
LPCSTR
lpszPath
;
LONG
lHash
;
BOOL
bPopup
;
}
link
;
HLPFILE_LINK
link
;
struct
tagHelpLinePart
*
next
;
}
WINHELP_LINE_PART
;
...
...
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