4 * Copyright 1996 Ulrich Schmid
5 * Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #define MAX_LANGUAGE_NUMBER 255
24 #define MAX_STRING_LEN 255
26 #define INTERNAL_BORDER_WIDTH 5
27 #define POPUP_YDISTANCE 20
41 #include "winhelp_res.h"
43 typedef struct tagHelpButton
55 struct tagHelpButton
*next
;
61 HLPFILE_WINDOWINFO
* wininfo
;
65 typedef struct tagPageSet
67 /* FIXME: for now it's a fixed size */
68 WINHELP_WNDPAGE set
[40];
72 typedef struct tagWinHelp
75 WINHELP_BUTTON
* first_button
;
82 WNDPROC origRicheditWndProc
;
91 HLPFILE_WINDOWINFO
* info
;
94 unsigned font_scale
; /* 0 = small, 1 = normal, 2 = large */
96 struct tagWinHelp
* next
;
99 #define DC_NOMSG 0x00000000
100 #define DC_MINMAX 0x00000001
101 #define DC_INITTERM 0x00000002
102 #define DC_JUMP 0x00000004
103 #define DC_ACTIVATE 0x00000008
104 #define DC_CALLBACKS 0x00000010
112 #define DW_STARTJUMP 6
115 #define DW_ACTIVATE 9
116 #define DW_CALLBACKS 10
118 typedef LONG (CALLBACK
*WINHELP_LDLLHandler
)(WORD
, LONG_PTR
, LONG_PTR
);
120 typedef struct tagDll
124 WINHELP_LDLLHandler handler
;
134 WINHELP_WINDOW
* active_win
;
135 WINHELP_WINDOW
* active_popup
;
136 WINHELP_WINDOW
* win_list
;
139 WINHELP_PAGESET history
;
143 extern const struct winhelp_callbacks
145 WORD (WINAPI
*GetFSError
)(void);
146 HANDLE (WINAPI
*HfsOpenSz
)(LPSTR
,BYTE
);
147 WORD (WINAPI
*RcCloseHfs
)(HANDLE
);
148 HANDLE (WINAPI
*HfOpenHfs
)(HANDLE
,LPSTR
,BYTE
);
149 HANDLE (WINAPI
*RcCloseHf
)(HANDLE
);
150 LONG (WINAPI
*LcbReadHf
)(HANDLE
,BYTE
*,LONG
);
151 LONG (WINAPI
*LTellHf
)(HANDLE
);
152 LONG (WINAPI
*LSeekHf
)(HANDLE
,LONG
,WORD
);
153 BOOL (WINAPI
*FEofHf
)(HANDLE
);
154 LONG (WINAPI
*LcbSizeHf
)(HANDLE
);
155 BOOL (WINAPI
*FAccessHfs
)(HANDLE
,LPSTR
,BYTE
);
156 WORD (WINAPI
*RcLLInfoFromHf
)(HANDLE
,WORD
,LPWORD
,LPLONG
,LPLONG
);
157 WORD (WINAPI
*RcLLInfoFromHfs
)(HANDLE
,LPSTR
,WORD
,LPWORD
,LPLONG
,LPLONG
);
158 void (WINAPI
*ErrorW
)(int);
159 void (WINAPI
*ErrorSz
)(LPSTR
);
160 ULONG_PTR (WINAPI
*GetInfo
)(WORD
,HWND
);
161 LONG (WINAPI
*API
)(LPSTR
,WORD
,DWORD
);
164 extern WINHELP_GLOBALS Globals
;
166 BOOL
WINHELP_CreateHelpWindow(WINHELP_WNDPAGE
*, int, BOOL
);
167 BOOL
WINHELP_OpenHelpWindow(HLPFILE_PAGE
* (*)(HLPFILE
*, LONG
, ULONG
*),
168 HLPFILE
*, LONG
, HLPFILE_WINDOWINFO
*, int);
169 BOOL
WINHELP_GetOpenFileName(LPSTR
, int);
170 BOOL
WINHELP_CreateIndexWindow(BOOL
);
171 void WINHELP_DeleteBackSet(WINHELP_WINDOW
*);
172 HLPFILE
* WINHELP_LookupHelpFile(LPCSTR lpszFile
);
173 HLPFILE_WINDOWINFO
* WINHELP_GetWindowInfo(HLPFILE
* hlpfile
, LPCSTR name
);
174 void WINHELP_LayoutMainWindow(WINHELP_WINDOW
* win
);
175 WINHELP_WINDOW
* WINHELP_GrabWindow(WINHELP_WINDOW
*);
176 BOOL
WINHELP_ReleaseWindow(WINHELP_WINDOW
*);
178 extern const char MAIN_WIN_CLASS_NAME
[];
179 extern const char BUTTON_BOX_WIN_CLASS_NAME
[];
180 extern const char TEXT_WIN_CLASS_NAME
[];
181 extern const char SHADOW_WIN_CLASS_NAME
[];
182 extern const char HISTORY_WIN_CLASS_NAME
[];
183 extern const char STRING_BUTTON
[];
184 extern const char STRING_MENU_Xx
[];
185 extern const char STRING_DIALOG_TEST
[];
189 #define WH_FIRST_BUTTON 500