ReactOS  0.4.12-dev-102-g4b7f1e0
winhelp.h
Go to the documentation of this file.
1 /*
2  * Help Viewer
3  *
4  * Copyright 1996 Ulrich Schmid
5  * Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
6  * 2002 Eric Pouech
7  *
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.
12  *
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.
17  *
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
21  */
22 
23 #pragma once
24 
25 #define MAX_LANGUAGE_NUMBER 255
26 #define MAX_STRING_LEN 255
27 
28 #define INTERNAL_BORDER_WIDTH 5
29 #define POPUP_YDISTANCE 20
30 #define SHADOW_DX 10
31 #define SHADOW_DY 10
32 #define BUTTON_CX 6
33 #define BUTTON_CY 6
34 
35 #ifndef RC_INVOKED
36 
37 #include <stdarg.h>
38 
39 #include "hlpfile.h"
40 #include "windef.h"
41 #include "winbase.h"
42 #include "macro.h"
43 #include "winhelp_res.h"
44 
45 typedef struct tagHelpButton
46 {
48 
52 
54 
56 
59 
60 typedef struct
61 {
66 
67 typedef struct tagPageSet
68 {
69  /* FIXME: for now it's a fixed size */
70  WINHELP_WNDPAGE set[40];
71  unsigned index;
73 
74 typedef struct tagWinHelp
75 {
76  unsigned ref_count;
79 
82 
84 
87 
89 
90  HBRUSH hBrush;
91 
93 
95  unsigned font_scale; /* 0 = small, 1 = normal, 2 = large */
96 
97  struct tagWinHelp* next;
99 
100 #define DC_NOMSG 0x00000000
101 #define DC_MINMAX 0x00000001
102 #define DC_INITTERM 0x00000002
103 #define DC_JUMP 0x00000004
104 #define DC_ACTIVATE 0x00000008
105 #define DC_CALLBACKS 0x00000010
106 
107 #define DW_NOTUSED 0
108 #define DW_WHATMSG 1
109 #define DW_MINMAX 2
110 #define DW_SIZE 3
111 #define DW_INIT 4
112 #define DW_TERM 5
113 #define DW_STARTJUMP 6
114 #define DW_ENDJUMP 7
115 #define DW_CHGFILE 8
116 #define DW_ACTIVATE 9
117 #define DW_CALLBACKS 10
118 
120 
121 typedef struct tagDll
122 {
124  const char* name;
126  DWORD class;
127  struct tagDll* next;
128 } WINHELP_DLL;
129 
130 typedef struct
131 {
143 
144 extern const struct winhelp_callbacks
145 {
146  WORD (WINAPI *GetFSError)(void);
147  HANDLE (WINAPI *HfsOpenSz)(LPSTR,BYTE);
148  WORD (WINAPI *RcCloseHfs)(HANDLE);
149  HANDLE (WINAPI *HfOpenHfs)(HANDLE,LPSTR,BYTE);
150  HANDLE (WINAPI *RcCloseHf)(HANDLE);
151  LONG (WINAPI *LcbReadHf)(HANDLE,BYTE*,LONG);
152  LONG (WINAPI *LTellHf)(HANDLE);
153  LONG (WINAPI *LSeekHf)(HANDLE,LONG,WORD);
154  BOOL (WINAPI *FEofHf)(HANDLE);
155  LONG (WINAPI *LcbSizeHf)(HANDLE);
156  BOOL (WINAPI *FAccessHfs)(HANDLE,LPSTR,BYTE);
157  WORD (WINAPI *RcLLInfoFromHf)(HANDLE,WORD,LPWORD,LPLONG,LPLONG);
158  WORD (WINAPI *RcLLInfoFromHfs)(HANDLE,LPSTR,WORD,LPWORD,LPLONG,LPLONG);
159  void (WINAPI *ErrorW)(int);
160  void (WINAPI *ErrorSz)(LPSTR);
163 } Callbacks;
164 
165 extern WINHELP_GLOBALS Globals;
166 
169  HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
178 
179 extern const char MAIN_WIN_CLASS_NAME[];
180 extern const char BUTTON_BOX_WIN_CLASS_NAME[];
181 extern const char TEXT_WIN_CLASS_NAME[];
182 extern const char SHADOW_WIN_CLASS_NAME[];
183 extern const char HISTORY_WIN_CLASS_NAME[];
184 extern const char STRING_BUTTON[];
185 extern const char STRING_MENU_Xx[];
186 extern const char STRING_DIALOG_TEST[];
187 #endif
188 
189 /* Buttons */
190 #define WH_FIRST_BUTTON 500
const char STRING_MENU_Xx[]
WINHELP_BUTTON * first_button
Definition: winhelp.h:77
#define LONG_PTR
Definition: treelist.c:79
void WINHELP_LayoutMainWindow(WINHELP_WINDOW *win)
Definition: winhelp.c:434
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
WINHELP_PAGESET history
Definition: winhelp.h:140
HLPFILE_WINDOWINFO * WINHELP_GetWindowInfo(HLPFILE *hlpfile, LPCSTR name)
Definition: winhelp.c:254
const char * name
Definition: winhelp.h:124
struct tagHelpButton WINHELP_BUTTON
#define CALLBACK
Definition: compat.h:27
HANDLE hInstance
Definition: winhelp.h:133
BOOL WINHELP_GetOpenFileName(LPSTR, int)
Definition: winhelp.c:146
HICON HCURSOR
Definition: windef.h:289
WINHELP_DLL * dlls
Definition: winhelp.h:139
char * LPSTR
Definition: xmlstorage.h:182
WINHELP_WINDOW * active_popup
Definition: winhelp.h:136
const char MAIN_WIN_CLASS_NAME[]
Definition: string.c:23
static LRESULT GetInfo(const CodecInfo *pi, ICINFO *icinfo, DWORD dwSize)
Definition: msrle32.c:1168
WINHELP_WINDOW * WINHELP_GrabWindow(WINHELP_WINDOW *)
Definition: winhelp.c:513
UINT_PTR WPARAM
Definition: windef.h:207
HFONT hButtonFont
Definition: winhelp.h:141
unsigned ref_count
Definition: winhelp.h:76
long LONG
Definition: pedump.c:60
BOOL WINHELP_ReleaseWindow(WINHELP_WINDOW *)
Definition: winhelp.c:524
#define API
Definition: atlimage.h:858
WINHELP_WINDOW * win_list
Definition: winhelp.h:137
static const WCHAR ErrorW[]
Definition: global.c:37
unsigned index
Definition: winhelp.h:71
const char * LPCSTR
Definition: xmlstorage.h:183
HANDLE hLib
Definition: winhelp.h:123
const char SHADOW_WIN_CLASS_NAME[]
UINT fonts_len
Definition: winhelp.h:86
unsigned int BOOL
Definition: ntddk_ex.h:94
struct tagHelpButton * next
Definition: winhelp.h:57
struct tagDll WINHELP_DLL
const struct winhelp_callbacks Callbacks
BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE *, int, BOOL)
Definition: winhelp.c:698
LONG(CALLBACK * WINHELP_LDLLHandler)(WORD, LONG_PTR, LONG_PTR)
Definition: winhelp.h:119
unsigned int UINT
Definition: ndis.h:50
RECT rect
Definition: winhelp.h:55
unsigned short WORD
Definition: ntddk_ex.h:93
PVOID HANDLE
Definition: typedefs.h:71
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LONG
Definition: msvc.h:36
unsigned char BYTE
Definition: mem.h:68
LPCSTR lpszMacro
Definition: winhelp.h:51
void WINHELP_DeleteBackSet(WINHELP_WINDOW *)
Definition: winhelp.c:481
BOOL WINHELP_OpenHelpWindow(HLPFILE_PAGE *(*)(HLPFILE *, LONG, ULONG *), HLPFILE *, LONG, HLPFILE_WINDOWINFO *, int)
HFONT * fonts
Definition: winhelp.h:85
LPCSTR lpszID
Definition: winhelp.h:49
const char STRING_BUTTON[]
Definition: string.c:26
#define WINAPI
Definition: msvc.h:20
WNDPROC origRicheditWndProc
Definition: winhelp.h:83
HLPFILE_PAGE * page
Definition: winhelp.h:62
HWND hWnd
Definition: winhelp.h:47
uint16_t * LPWORD
Definition: typedefs.h:54
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2859
HWND hHistoryWnd
Definition: winhelp.h:81
int32_t * LPLONG
Definition: typedefs.h:56
HCURSOR hHandCur
Definition: winhelp.h:88
static real win[4][36]
HWND hMainWnd
Definition: winhelp.h:80
ULONG relative
Definition: winhelp.h:64
WINHELP_LDLLHandler handler
Definition: winhelp.h:125
const char HISTORY_WIN_CLASS_NAME[]
Definition: string.c:25
HLPFILE_WINDOWINFO * wininfo
Definition: winhelp.h:63
struct tagWinHelp WINHELP_WINDOW
HBRUSH hBrush
Definition: winhelp.h:90
WINHELP_WINDOW * active_win
Definition: winhelp.h:135
LPCSTR lpszName
Definition: winhelp.h:50
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
const char BUTTON_BOX_WIN_CLASS_NAME[]
Definition: string.c:24
Definition: name.c:36
WINHELP_GLOBALS Globals
Definition: clipbrd.c:13
struct tagPageSet WINHELP_PAGESET
WNDPROC button_proc
Definition: winhelp.h:138
WINHELP_PAGESET back
Definition: winhelp.h:94
BOOL WINHELP_CreateIndexWindow(BOOL)
Definition: winhelp.c:1542
unsigned int ULONG
Definition: retypes.h:1
HLPFILE * WINHELP_LookupHelpFile(LPCSTR lpszFile)
Definition: winhelp.c:212
WPARAM wParam
Definition: winhelp.h:53
#define ULONG_PTR
Definition: config.h:101
HLPFILE_WINDOWINFO * info
Definition: winhelp.h:92
const char TEXT_WIN_CLASS_NAME[]
HLPFILE_PAGE * page
Definition: winhelp.h:78
const char STRING_DIALOG_TEST[]
Definition: string.c:29
struct tagDll * next
Definition: winhelp.h:127
#define BOOL
Definition: msvc.h:23
unsigned font_scale
Definition: winhelp.h:95
struct tagWinHelp * next
Definition: winhelp.h:97
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:29