oledlg: Update the source text.
[wine/hacks.git] / programs / winhelp / winhelp.h
blob7b10019e0f330b17570a7f06f66c029b75f03df4
1 /*
2 * Help Viewer
4 * Copyright 1996 Ulrich Schmid
5 * Copyright 2002 Sylvain Petreolle <spetreolle@yahoo.fr>
6 * 2002 Eric Pouech
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_PATHNAME_LEN 1024
25 #define MAX_STRING_LEN 255
27 #define INTERNAL_BORDER_WIDTH 5
28 #define POPUP_YDISTANCE 20
29 #define SHADOW_DX 10
30 #define SHADOW_DY 10
31 #define BUTTON_CX 6
32 #define BUTTON_CY 6
34 #ifndef RC_INVOKED
36 #include <stdarg.h>
38 #include "hlpfile.h"
39 #include "windef.h"
40 #include "winbase.h"
41 #include "macro.h"
42 #include "winhelp_res.h"
44 typedef struct tagHelpLinePart
46 RECT rect;
47 enum {hlp_line_part_text, hlp_line_part_bitmap, hlp_line_part_metafile} cookie;
48 union
50 struct
52 LPCSTR lpsText;
53 HFONT hFont;
54 COLORREF color;
55 WORD wTextLen;
56 WORD wUnderline; /* 0 None, 1 simple, 2 double, 3 dotted */
57 } text;
58 struct
60 HBITMAP hBitmap;
61 } bitmap;
62 struct
64 HMETAFILE hMetaFile;
65 INT mm;
66 } metafile;
67 } u;
68 HLPFILE_LINK* link;
70 struct tagHelpLinePart *next;
71 } WINHELP_LINE_PART;
73 typedef struct tagHelpLine
75 RECT rect;
76 WINHELP_LINE_PART first_part;
77 struct tagHelpLine* next;
78 } WINHELP_LINE;
80 typedef struct tagHelpButton
82 HWND hWnd;
84 LPCSTR lpszID;
85 LPCSTR lpszName;
86 LPCSTR lpszMacro;
88 WPARAM wParam;
90 RECT rect;
92 struct tagHelpButton*next;
93 } WINHELP_BUTTON;
95 typedef struct tagWinHelp
97 LPCSTR lpszName;
99 WINHELP_BUTTON* first_button;
100 HLPFILE_PAGE* page;
101 WINHELP_LINE* first_line;
103 HWND hMainWnd;
104 HWND hButtonBoxWnd;
105 HWND hTextWnd;
106 HWND hShadowWnd;
107 HWND hHistoryWnd;
109 HFONT* fonts;
110 UINT fonts_len;
112 HCURSOR hArrowCur;
113 HCURSOR hHandCur;
115 HBRUSH hBrush;
117 HLPFILE_WINDOWINFO* info;
119 /* FIXME: for now it's a fixed size */
120 HLPFILE_PAGE* history[40];
121 unsigned histIndex;
122 HLPFILE_PAGE* back[40];
123 unsigned backIndex;
125 struct tagWinHelp* next;
126 } WINHELP_WINDOW;
128 #define DC_NOMSG 0x00000000
129 #define DC_MINMAX 0x00000001
130 #define DC_INITTERM 0x00000002
131 #define DC_JUMP 0x00000004
132 #define DC_ACTIVATE 0x00000008
133 #define DC_CALLBACKS 0x00000010
135 #define DW_NOTUSED 0
136 #define DW_WHATMSG 1
137 #define DW_MINMAX 2
138 #define DW_SIZE 3
139 #define DW_INIT 4
140 #define DW_TERM 5
141 #define DW_STARTJUMP 6
142 #define DW_ENDJUMP 7
143 #define DW_CHGFILE 8
144 #define DW_ACTIVATE 9
145 #define DW_CALLBACKS 10
147 typedef long (CALLBACK *WINHELP_LDLLHandler)(WORD, LONG, LONG);
149 typedef struct tagDll
151 HANDLE hLib;
152 const char* name;
153 WINHELP_LDLLHandler handler;
154 DWORD class;
155 struct tagDll* next;
156 } WINHELP_DLL;
158 typedef struct
160 UINT wVersion;
161 HANDLE hInstance;
162 HWND hPopupWnd;
163 UINT wStringTableOffset;
164 BOOL isBook;
165 WINHELP_WINDOW* active_win;
166 WINHELP_WINDOW* win_list;
167 WNDPROC button_proc;
168 WINHELP_DLL* dlls;
169 } WINHELP_GLOBALS;
171 extern WINHELP_GLOBALS Globals;
172 extern FARPROC Callbacks[];
174 BOOL WINHELP_CreateHelpWindowByHash(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
175 BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE*, HLPFILE_WINDOWINFO*, int);
176 INT WINHELP_MessageBoxIDS(UINT, UINT, WORD);
177 INT WINHELP_MessageBoxIDS_s(UINT, LPCSTR, UINT, WORD);
178 HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile);
179 HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name);
181 extern const char MAIN_WIN_CLASS_NAME[];
182 extern const char BUTTON_BOX_WIN_CLASS_NAME[];
183 extern const char TEXT_WIN_CLASS_NAME[];
184 extern const char SHADOW_WIN_CLASS_NAME[];
185 extern const char HISTORY_WIN_CLASS_NAME[];
186 extern const char STRING_BUTTON[];
187 extern const char STRING_MENU_Xx[];
188 extern const char STRING_DIALOG_TEST[];
189 #endif
191 /* Buttons */
192 #define WH_FIRST_BUTTON 500