kernel32: Make __wine_emulate_instruction CDECL and i386 only
[wine/wine64.git] / programs / winhlp32 / winhelp.h
blobf06b0829230477ddffeb78d32fedabed0288dc27
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_STRING_LEN 255
26 #define INTERNAL_BORDER_WIDTH 5
27 #define POPUP_YDISTANCE 20
28 #define SHADOW_DX 10
29 #define SHADOW_DY 10
30 #define BUTTON_CX 6
31 #define BUTTON_CY 6
33 #ifndef RC_INVOKED
35 #include <stdarg.h>
37 #include "hlpfile.h"
38 #include "windef.h"
39 #include "winbase.h"
40 #include "macro.h"
41 #include "winhelp_res.h"
43 typedef struct tagHelpButton
45 HWND hWnd;
47 LPCSTR lpszID;
48 LPCSTR lpszName;
49 LPCSTR lpszMacro;
51 WPARAM wParam;
53 RECT rect;
55 struct tagHelpButton*next;
56 } WINHELP_BUTTON;
58 typedef struct
60 HLPFILE_PAGE* page;
61 HLPFILE_WINDOWINFO* wininfo;
62 ULONG relative;
63 } WINHELP_WNDPAGE;
65 typedef struct tagPageSet
67 /* FIXME: for now it's a fixed size */
68 WINHELP_WNDPAGE set[40];
69 unsigned index;
70 } WINHELP_PAGESET;
72 typedef struct tagWinHelp
74 LPCSTR lpszName;
76 WINHELP_BUTTON* first_button;
77 HLPFILE_PAGE* page;
79 HWND hMainWnd;
80 HWND hShadowWnd;
81 HWND hHistoryWnd;
83 HFONT* fonts;
84 UINT fonts_len;
86 HCURSOR hHandCur;
88 HBRUSH hBrush;
90 HLPFILE_WINDOWINFO* info;
91 HLPFILE_LINK* current_link;
93 WINHELP_PAGESET back;
94 unsigned font_scale; /* 0 = small, 1 = normal, 2 = large */
96 struct tagWinHelp* next;
97 } WINHELP_WINDOW;
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
106 #define DW_NOTUSED 0
107 #define DW_WHATMSG 1
108 #define DW_MINMAX 2
109 #define DW_SIZE 3
110 #define DW_INIT 4
111 #define DW_TERM 5
112 #define DW_STARTJUMP 6
113 #define DW_ENDJUMP 7
114 #define DW_CHGFILE 8
115 #define DW_ACTIVATE 9
116 #define DW_CALLBACKS 10
118 typedef long (CALLBACK *WINHELP_LDLLHandler)(WORD, LONG, LONG);
120 typedef struct tagDll
122 HANDLE hLib;
123 const char* name;
124 WINHELP_LDLLHandler handler;
125 DWORD class;
126 struct tagDll* next;
127 } WINHELP_DLL;
129 typedef struct
131 UINT wVersion;
132 HANDLE hInstance;
133 BOOL isBook;
134 WINHELP_WINDOW* active_win;
135 WINHELP_WINDOW* active_popup;
136 WINHELP_WINDOW* win_list;
137 WNDPROC button_proc;
138 WINHELP_DLL* dlls;
139 WINHELP_PAGESET history;
140 HFONT hButtonFont;
141 } WINHELP_GLOBALS;
143 extern WINHELP_GLOBALS Globals;
144 extern FARPROC Callbacks[];
146 BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE*, int, BOOL);
147 BOOL WINHELP_OpenHelpWindow(HLPFILE_PAGE* (*)(HLPFILE*, LONG, ULONG*),
148 HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
149 BOOL WINHELP_GetOpenFileName(LPSTR, int);
150 BOOL WINHELP_CreateIndexWindow(BOOL);
151 void WINHELP_DeleteBackSet(WINHELP_WINDOW*);
152 INT WINHELP_MessageBoxIDS_s(UINT, LPCSTR, UINT, WORD);
153 HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile);
154 HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name);
155 void WINHELP_LayoutMainWindow(WINHELP_WINDOW* win);
157 extern const char MAIN_WIN_CLASS_NAME[];
158 extern const char BUTTON_BOX_WIN_CLASS_NAME[];
159 extern const char TEXT_WIN_CLASS_NAME[];
160 extern const char SHADOW_WIN_CLASS_NAME[];
161 extern const char HISTORY_WIN_CLASS_NAME[];
162 extern const char STRING_BUTTON[];
163 extern const char STRING_MENU_Xx[];
164 extern const char STRING_DIALOG_TEST[];
165 #endif
167 /* Buttons */
168 #define WH_FIRST_BUTTON 500