Wrote back & history support.
[wine/wine-kai.git] / programs / winhelp / winhelp.h
blobcb21d1b611373963955aee336a0692caa300c2ad
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 "hlpfile.h"
37 #include "macro.h"
38 #include "winhelp_res.h"
40 typedef struct tagHelpLinePart
42 RECT rect;
43 enum {hlp_line_part_text, hlp_line_part_image} cookie;
44 union
46 struct
48 LPCSTR lpsText;
49 HFONT hFont;
50 COLORREF color;
51 WORD wTextLen;
52 WORD wUnderline; /* 0 None, 1 simple, 2 double, 3 dotted */
53 } text;
54 struct
56 HBITMAP hBitmap;
57 } image;
58 } u;
59 HLPFILE_LINK link;
61 struct tagHelpLinePart *next;
62 } WINHELP_LINE_PART;
64 typedef struct tagHelpLine
66 RECT rect;
67 WINHELP_LINE_PART first_part;
68 struct tagHelpLine* next;
69 } WINHELP_LINE;
71 typedef struct tagHelpButton
73 HWND hWnd;
75 LPCSTR lpszID;
76 LPCSTR lpszName;
77 LPCSTR lpszMacro;
79 WPARAM wParam;
81 RECT rect;
83 struct tagHelpButton*next;
84 } WINHELP_BUTTON;
86 typedef struct tagWinHelp
88 LPCSTR lpszName;
90 WINHELP_BUTTON* first_button;
91 HLPFILE_PAGE* page;
92 WINHELP_LINE* first_line;
94 HWND hMainWnd;
95 HWND hButtonBoxWnd;
96 HWND hTextWnd;
97 HWND hShadowWnd;
98 HWND hHistoryWnd;
100 HFONT* fonts;
101 UINT fonts_len;
103 HCURSOR hArrowCur;
104 HCURSOR hHandCur;
106 HLPFILE_WINDOWINFO* info;
108 /* FIXME: for now it's a fixed size */
109 HLPFILE_PAGE* history[40];
110 unsigned histIndex;
111 HLPFILE_PAGE* back[40];
112 unsigned backIndex;
114 struct tagWinHelp* next;
115 } WINHELP_WINDOW;
117 typedef struct
119 UINT wVersion;
120 HANDLE hInstance;
121 HWND hPopupWnd;
122 UINT wStringTableOffset;
123 BOOL isBook;
124 WINHELP_WINDOW* active_win;
125 WINHELP_WINDOW* win_list;
126 } WINHELP_GLOBALS;
128 extern WINHELP_GLOBALS Globals;
130 BOOL WINHELP_CreateHelpWindowByHash(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
131 BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE*, HLPFILE_WINDOWINFO*, int);
132 INT WINHELP_MessageBoxIDS(UINT, UINT, WORD);
133 INT WINHELP_MessageBoxIDS_s(UINT, LPCSTR, UINT, WORD);
134 HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile);
135 HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name);
137 extern char MAIN_WIN_CLASS_NAME[];
138 extern char BUTTON_BOX_WIN_CLASS_NAME[];
139 extern char TEXT_WIN_CLASS_NAME[];
140 extern char SHADOW_WIN_CLASS_NAME[];
141 extern char HISTORY_WIN_CLASS_NAME[];
142 extern char STRING_BUTTON[];
143 extern char STRING_MENU_Xx[];
144 extern char STRING_DIALOG_TEST[];
145 #endif
147 /* Buttons */
148 #define WH_FIRST_BUTTON 500