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
3f1b62f2
Commit
3f1b62f2
authored
Apr 22, 2008
by
Eric Pouech
Committed by
Alexandre Julliard
Apr 23, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhelp: Simplify most of the helpers dealing with window creation.
parent
857d0e06
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
66 deletions
+32
-66
hlpfile.c
programs/winhelp/hlpfile.c
+3
-2
macro.c
programs/winhelp/macro.c
+11
-14
winhelp.c
programs/winhelp/winhelp.c
+16
-47
winhelp.h
programs/winhelp/winhelp.h
+2
-3
No files found.
programs/winhelp/hlpfile.c
View file @
3f1b62f2
...
@@ -148,13 +148,14 @@ static int comp_PageByHash(void *p, const void *key,
...
@@ -148,13 +148,14 @@ static int comp_PageByHash(void *p, const void *key,
/***********************************************************************
/***********************************************************************
*
*
* HLPFILE_
HlpFile
PageByHash
* HLPFILE_PageByHash
*/
*/
HLPFILE_PAGE
*
HLPFILE_PageByHash
(
HLPFILE
*
hlpfile
,
LONG
lHash
,
ULONG
*
relative
)
HLPFILE_PAGE
*
HLPFILE_PageByHash
(
HLPFILE
*
hlpfile
,
LONG
lHash
,
ULONG
*
relative
)
{
{
BYTE
*
ptr
;
BYTE
*
ptr
;
if
(
!
hlpfile
)
return
0
;
if
(
!
hlpfile
)
return
NULL
;
if
(
!
lHash
)
return
HLPFILE_Contents
(
hlpfile
,
relative
);
WINE_TRACE
(
"<%s>[%x]
\n
"
,
hlpfile
->
lpszPath
,
lHash
);
WINE_TRACE
(
"<%s>[%x]
\n
"
,
hlpfile
->
lpszPath
,
lHash
);
...
...
programs/winhelp/macro.c
View file @
3f1b62f2
...
@@ -506,10 +506,7 @@ void CALLBACK MACRO_FileOpen(void)
...
@@ -506,10 +506,7 @@ void CALLBACK MACRO_FileOpen(void)
if
(
WINHELP_GetOpenFileName
(
szFile
,
MAX_PATH
))
if
(
WINHELP_GetOpenFileName
(
szFile
,
MAX_PATH
))
{
{
HLPFILE
*
hlpfile
=
WINHELP_LookupHelpFile
(
szFile
);
MACRO_JumpContents
(
szFile
,
"main"
);
WINHELP_CreateHelpWindowByHash
(
hlpfile
,
0
,
WINHELP_GetWindowInfo
(
hlpfile
,
"main"
),
SW_SHOWNORMAL
);
}
}
}
}
...
@@ -628,10 +625,10 @@ void CALLBACK MACRO_JumpContents(LPCSTR lpszPath, LPCSTR lpszWindow)
...
@@ -628,10 +625,10 @@ void CALLBACK MACRO_JumpContents(LPCSTR lpszPath, LPCSTR lpszWindow)
HLPFILE
*
hlpfile
;
HLPFILE
*
hlpfile
;
WINE_TRACE
(
"(
\"
%s
\"
,
\"
%s
\"
)
\n
"
,
lpszPath
,
lpszWindow
);
WINE_TRACE
(
"(
\"
%s
\"
,
\"
%s
\"
)
\n
"
,
lpszPath
,
lpszWindow
);
hlpfile
=
WINHELP_LookupHelpFile
(
lpszPath
);
if
((
hlpfile
=
WINHELP_LookupHelpFile
(
lpszPath
)))
WINHELP_CreateHelpWindowByHash
(
hlpfile
,
0
,
WINHELP_OpenHelpWindow
(
HLPFILE_PageByHash
,
hlpfile
,
0
,
WINHELP_GetWindowInfo
(
hlpfile
,
lpszWindow
),
WINHELP_GetWindowInfo
(
hlpfile
,
lpszWindow
),
SW_NORMAL
);
SW_NORMAL
);
}
}
void
CALLBACK
MACRO_JumpContext
(
LPCSTR
lpszPath
,
LPCSTR
lpszWindow
,
LONG
context
)
void
CALLBACK
MACRO_JumpContext
(
LPCSTR
lpszPath
,
LPCSTR
lpszWindow
,
LONG
context
)
...
@@ -641,9 +638,9 @@ void CALLBACK MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context
...
@@ -641,9 +638,9 @@ void CALLBACK MACRO_JumpContext(LPCSTR lpszPath, LPCSTR lpszWindow, LONG context
WINE_TRACE
(
"(
\"
%s
\"
,
\"
%s
\"
, %d)
\n
"
,
lpszPath
,
lpszWindow
,
context
);
WINE_TRACE
(
"(
\"
%s
\"
,
\"
%s
\"
, %d)
\n
"
,
lpszPath
,
lpszWindow
,
context
);
hlpfile
=
WINHELP_LookupHelpFile
(
lpszPath
);
hlpfile
=
WINHELP_LookupHelpFile
(
lpszPath
);
/* Some madness: what user calls 'context', hlpfile calls 'map' */
/* Some madness: what user calls 'context', hlpfile calls 'map' */
WINHELP_
CreateHelpWindowByMap
(
hlpfile
,
context
,
WINHELP_
OpenHelpWindow
(
HLPFILE_PageByMap
,
hlpfile
,
context
,
WINHELP_GetWindowInfo
(
hlpfile
,
lpszWindow
),
WINHELP_GetWindowInfo
(
hlpfile
,
lpszWindow
),
SW_NORMAL
);
SW_NORMAL
);
}
}
void
CALLBACK
MACRO_JumpHash
(
LPCSTR
lpszPath
,
LPCSTR
lpszWindow
,
LONG
lHash
)
void
CALLBACK
MACRO_JumpHash
(
LPCSTR
lpszPath
,
LPCSTR
lpszWindow
,
LONG
lHash
)
...
@@ -652,9 +649,9 @@ void CALLBACK MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash)
...
@@ -652,9 +649,9 @@ void CALLBACK MACRO_JumpHash(LPCSTR lpszPath, LPCSTR lpszWindow, LONG lHash)
WINE_TRACE
(
"(
\"
%s
\"
,
\"
%s
\"
, %u)
\n
"
,
lpszPath
,
lpszWindow
,
lHash
);
WINE_TRACE
(
"(
\"
%s
\"
,
\"
%s
\"
, %u)
\n
"
,
lpszPath
,
lpszWindow
,
lHash
);
hlpfile
=
WINHELP_LookupHelpFile
(
lpszPath
);
hlpfile
=
WINHELP_LookupHelpFile
(
lpszPath
);
WINHELP_
CreateHelpWindowByHash
(
hlpfile
,
lHash
,
WINHELP_
OpenHelpWindow
(
HLPFILE_PageByHash
,
hlpfile
,
lHash
,
WINHELP_GetWindowInfo
(
hlpfile
,
lpszWindow
),
WINHELP_GetWindowInfo
(
hlpfile
,
lpszWindow
),
SW_NORMAL
);
SW_NORMAL
);
}
}
void
CALLBACK
MACRO_JumpHelpOn
(
void
)
void
CALLBACK
MACRO_JumpHelpOn
(
void
)
...
...
programs/winhelp/winhelp.c
View file @
3f1b62f2
...
@@ -304,8 +304,8 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
...
@@ -304,8 +304,8 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
if
(
!
hlpfile
)
return
0
;
if
(
!
hlpfile
)
return
0
;
}
}
else
hlpfile
=
NULL
;
else
hlpfile
=
NULL
;
WINHELP_
CreateHelpWindowByHash
(
hlpfile
,
lHash
,
WINHELP_
OpenHelpWindow
(
HLPFILE_PageByHash
,
hlpfile
,
lHash
,
WINHELP_GetWindowInfo
(
hlpfile
,
wndname
),
show
);
WINHELP_GetWindowInfo
(
hlpfile
,
wndname
),
show
);
/* Message loop */
/* Message loop */
while
(
GetMessage
(
&
msg
,
0
,
0
,
0
))
while
(
GetMessage
(
&
msg
,
0
,
0
,
0
))
...
@@ -657,49 +657,17 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe
...
@@ -657,49 +657,17 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe
return
TRUE
;
return
TRUE
;
}
}
/***********************************************************************
/******************************************************************
*
* WINHELP_OpenHelpWindow
* WINHELP_CreateHelpWindowByHash
* Main function to search for a page and display it in a window
*/
BOOL
WINHELP_CreateHelpWindowByHash
(
HLPFILE
*
hlpfile
,
LONG
lHash
,
HLPFILE_WINDOWINFO
*
wi
,
int
nCmdShow
)
{
WINHELP_WNDPAGE
wpage
;
wpage
.
page
=
NULL
;
if
(
hlpfile
)
wpage
.
page
=
lHash
?
HLPFILE_PageByHash
(
hlpfile
,
lHash
,
&
wpage
.
relative
)
:
HLPFILE_Contents
(
hlpfile
,
&
wpage
.
relative
);
if
(
wpage
.
page
)
wpage
.
page
->
file
->
wRefCount
++
;
wpage
.
wininfo
=
wi
;
return
WINHELP_CreateHelpWindow
(
&
wpage
,
nCmdShow
,
TRUE
);
}
/***********************************************************************
*
* WINHELP_CreateHelpWindowByMap
*/
BOOL
WINHELP_CreateHelpWindowByMap
(
HLPFILE
*
hlpfile
,
LONG
lMap
,
HLPFILE_WINDOWINFO
*
wi
,
int
nCmdShow
)
{
WINHELP_WNDPAGE
wpage
;
wpage
.
page
=
HLPFILE_PageByMap
(
hlpfile
,
lMap
,
&
wpage
.
relative
);
if
(
wpage
.
page
)
wpage
.
page
->
file
->
wRefCount
++
;
wpage
.
wininfo
=
wi
;
return
WINHELP_CreateHelpWindow
(
&
wpage
,
nCmdShow
,
TRUE
);
}
/***********************************************************************
*
* WINHELP_CreateHelpWindowByOffset
*/
*/
BOOL
WINHELP_CreateHelpWindowByOffset
(
HLPFILE
*
hlpfile
,
LONG
lOffset
,
BOOL
WINHELP_OpenHelpWindow
(
HLPFILE_PAGE
*
(
*
lookup
)(
HLPFILE
*
,
LONG
,
ULONG
*
),
HLPFILE_WINDOWINFO
*
wi
,
int
nCmdShow
)
HLPFILE
*
hlpfile
,
LONG
val
,
HLPFILE_WINDOWINFO
*
wi
,
int
nCmdShow
)
{
{
WINHELP_WNDPAGE
wpage
;
WINHELP_WNDPAGE
wpage
;
wpage
.
page
=
HLPFILE_PageByOffset
(
hlpfile
,
lOffset
,
&
wpage
.
relative
);
wpage
.
page
=
lookup
(
hlpfile
,
val
,
&
wpage
.
relative
);
if
(
wpage
.
page
)
wpage
.
page
->
file
->
wRefCount
++
;
if
(
wpage
.
page
)
wpage
.
page
->
file
->
wRefCount
++
;
wpage
.
wininfo
=
wi
;
wpage
.
wininfo
=
wi
;
return
WINHELP_CreateHelpWindow
(
&
wpage
,
nCmdShow
,
TRUE
);
return
WINHELP_CreateHelpWindow
(
&
wpage
,
nCmdShow
,
TRUE
);
...
@@ -1229,14 +1197,14 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam,
...
@@ -1229,14 +1197,14 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam,
WINE_WARN
(
"link to window %d/%d
\n
"
,
part
->
link
->
window
,
hlpfile
->
numWindows
);
WINE_WARN
(
"link to window %d/%d
\n
"
,
part
->
link
->
window
,
hlpfile
->
numWindows
);
break
;
break
;
}
}
WINHELP_
CreateHelpWindowByHash
(
hlpfile
,
part
->
link
->
lHash
,
wi
,
WINHELP_
OpenHelpWindow
(
HLPFILE_PageByHash
,
hlpfile
,
part
->
link
->
lHash
,
SW_NORMAL
);
wi
,
SW_NORMAL
);
break
;
break
;
case
hlp_link_popup
:
case
hlp_link_popup
:
hlpfile
=
WINHELP_LookupHelpFile
(
part
->
link
->
lpszString
);
hlpfile
=
WINHELP_LookupHelpFile
(
part
->
link
->
lpszString
);
if
(
hlpfile
)
WINHELP_
CreateHelpWindowByHash
(
hlpfile
,
part
->
link
->
lHash
,
if
(
hlpfile
)
WINHELP_
OpenHelpWindow
(
HLPFILE_PageByHash
,
hlpfile
,
part
->
link
->
lHash
,
WINHELP_GetPopupWindowInfo
(
hlpfile
,
hWnd
,
&
mouse
),
WINHELP_GetPopupWindowInfo
(
hlpfile
,
hWnd
,
&
mouse
),
SW_NORMAL
);
SW_NORMAL
);
break
;
break
;
case
hlp_link_macro
:
case
hlp_link_macro
:
MACRO_ExecuteMacro
(
part
->
link
->
lpszString
);
MACRO_ExecuteMacro
(
part
->
link
->
lpszString
);
...
@@ -2074,7 +2042,8 @@ BOOL WINHELP_CreateIndexWindow(void)
...
@@ -2074,7 +2042,8 @@ BOOL WINHELP_CreateIndexWindow(void)
{
{
ret
-=
2
;
ret
-=
2
;
WINE_TRACE
(
"got %d as an offset
\n
"
,
ret
);
WINE_TRACE
(
"got %d as an offset
\n
"
,
ret
);
WINHELP_CreateHelpWindowByOffset
(
hlpfile
,
ret
,
Globals
.
active_win
->
info
,
SW_NORMAL
);
WINHELP_OpenHelpWindow
(
HLPFILE_PageByOffset
,
hlpfile
,
ret
,
Globals
.
active_win
->
info
,
SW_NORMAL
);
}
}
return
TRUE
;
return
TRUE
;
}
}
programs/winhelp/winhelp.h
View file @
3f1b62f2
...
@@ -178,10 +178,9 @@ typedef struct
...
@@ -178,10 +178,9 @@ typedef struct
extern
WINHELP_GLOBALS
Globals
;
extern
WINHELP_GLOBALS
Globals
;
extern
FARPROC
Callbacks
[];
extern
FARPROC
Callbacks
[];
BOOL
WINHELP_CreateHelpWindowByHash
(
HLPFILE
*
,
LONG
,
HLPFILE_WINDOWINFO
*
,
int
);
BOOL
WINHELP_CreateHelpWindowByMap
(
HLPFILE
*
,
LONG
,
HLPFILE_WINDOWINFO
*
,
int
);
BOOL
WINHELP_CreateHelpWindowByOffset
(
HLPFILE
*
,
LONG
,
HLPFILE_WINDOWINFO
*
,
int
);
BOOL
WINHELP_CreateHelpWindow
(
WINHELP_WNDPAGE
*
,
int
,
BOOL
);
BOOL
WINHELP_CreateHelpWindow
(
WINHELP_WNDPAGE
*
,
int
,
BOOL
);
BOOL
WINHELP_OpenHelpWindow
(
HLPFILE_PAGE
*
(
*
)(
HLPFILE
*
,
LONG
,
ULONG
*
),
HLPFILE
*
,
LONG
,
HLPFILE_WINDOWINFO
*
,
int
);
BOOL
WINHELP_GetOpenFileName
(
LPSTR
,
int
);
BOOL
WINHELP_GetOpenFileName
(
LPSTR
,
int
);
BOOL
WINHELP_CreateIndexWindow
(
void
);
BOOL
WINHELP_CreateIndexWindow
(
void
);
void
WINHELP_DeleteBackSet
(
WINHELP_WINDOW
*
);
void
WINHELP_DeleteBackSet
(
WINHELP_WINDOW
*
);
...
...
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