Implement UpdateTexture for 2D textures only.
[wine] / programs / winhelp / winhelp.h
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #define MAX_LANGUAGE_NUMBER     255
24 #define MAX_PATHNAME_LEN        1024
25 #define MAX_STRING_LEN          255
26
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
33
34 #ifndef RC_INVOKED
35
36 #include "hlpfile.h"
37 #include "macro.h"
38 #include "winhelp_res.h"
39
40 typedef struct tagHelpLinePart
41 {
42     RECT      rect;
43     enum {hlp_line_part_text, hlp_line_part_bitmap, hlp_line_part_metafile} cookie;
44     union
45     {
46         struct
47         {
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
55         {
56             HBITMAP     hBitmap;
57         } bitmap;
58         struct
59         {
60             HMETAFILE   hMetaFile;
61         } metafile;
62     } u;
63     HLPFILE_LINK*       link;
64
65     struct tagHelpLinePart *next;
66 } WINHELP_LINE_PART;
67
68 typedef struct tagHelpLine
69 {
70     RECT                rect;
71     WINHELP_LINE_PART   first_part;
72     struct tagHelpLine* next;
73 } WINHELP_LINE;
74
75 typedef struct tagHelpButton
76 {
77     HWND                hWnd;
78
79     LPCSTR              lpszID;
80     LPCSTR              lpszName;
81     LPCSTR              lpszMacro;
82
83     WPARAM              wParam;
84
85     RECT                rect;
86
87     struct tagHelpButton*next;
88 } WINHELP_BUTTON;
89
90 typedef struct tagWinHelp
91 {
92     LPCSTR              lpszName;
93
94     WINHELP_BUTTON*     first_button;
95     HLPFILE_PAGE*       page;
96     WINHELP_LINE*       first_line;
97
98     HWND                hMainWnd;
99     HWND                hButtonBoxWnd;
100     HWND                hTextWnd;
101     HWND                hShadowWnd;
102     HWND                hHistoryWnd;
103
104     HFONT*              fonts;
105     UINT                fonts_len;
106
107     HCURSOR             hArrowCur;
108     HCURSOR             hHandCur;
109
110     HLPFILE_WINDOWINFO* info;
111
112     /* FIXME: for now it's a fixed size */
113     HLPFILE_PAGE*       history[40];
114     unsigned            histIndex;
115     HLPFILE_PAGE*       back[40];
116     unsigned            backIndex;
117
118     struct tagWinHelp*  next;
119 } WINHELP_WINDOW;
120
121 typedef struct
122 {
123     UINT                wVersion;
124     HANDLE              hInstance;
125     HWND                hPopupWnd;
126     UINT                wStringTableOffset;
127     BOOL                isBook;
128     WINHELP_WINDOW*     active_win;
129     WINHELP_WINDOW*     win_list;
130 } WINHELP_GLOBALS;
131
132 extern WINHELP_GLOBALS Globals;
133
134 BOOL WINHELP_CreateHelpWindowByHash(HLPFILE*, LONG, HLPFILE_WINDOWINFO*, int);
135 BOOL WINHELP_CreateHelpWindow(HLPFILE_PAGE*, HLPFILE_WINDOWINFO*, int);
136 INT  WINHELP_MessageBoxIDS(UINT, UINT, WORD);
137 INT  WINHELP_MessageBoxIDS_s(UINT, LPCSTR, UINT, WORD);
138 HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile);
139 HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name);
140
141 extern char MAIN_WIN_CLASS_NAME[];
142 extern char BUTTON_BOX_WIN_CLASS_NAME[];
143 extern char TEXT_WIN_CLASS_NAME[];
144 extern char SHADOW_WIN_CLASS_NAME[];
145 extern char HISTORY_WIN_CLASS_NAME[];
146 extern char STRING_BUTTON[];
147 extern char STRING_MENU_Xx[];
148 extern char STRING_DIALOG_TEST[];
149 #endif
150
151 /* Buttons */
152 #define WH_FIRST_BUTTON     500