Renamed Winelib apps to .exe.so to follow the dll naming convention.
[wine] / programs / progman / progman.h
1 /*
2  * Program Manager
3  *
4  * Copyright 1996 Ulrich Schmid
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef PROGMAN_H
22 #define PROGMAN_H
23
24 #define MAX_STRING_LEN      255
25 #define MAX_PATHNAME_LEN    1024
26 #define MAX_LANGUAGE_NUMBER (PM_LAST_LANGUAGE - PM_FIRST_LANGUAGE)
27
28 #ifndef RC_INVOKED
29
30 #include "windows.h"
31
32 /* Fallback icon */
33 #define DEFAULTICON OIC_WINLOGO
34
35 /* Icon index in M$ Window's progman.exe  */
36 #define PROGMAN_ICON_INDEX 0
37 #define GROUP_ICON_INDEX   6
38 #define DEFAULT_ICON_INDEX 7
39
40 #define DEF_GROUP_WIN_XPOS   100
41 #define DEF_GROUP_WIN_YPOS   100
42 #define DEF_GROUP_WIN_WIDTH  300
43 #define DEF_GROUP_WIN_HEIGHT 200
44
45 typedef struct
46 {
47   HLOCAL   hGroup;
48   HLOCAL   hPrior;
49   HLOCAL   hNext;
50   HWND     hWnd;
51   /**/              /* Numbers are byte indexes in *.grp */
52
53   /**/                       /* Program entry */
54   INT      x, y;               /*  0 -  3 */
55   INT      nIconIndex;         /*  4 -  5 */
56   HICON    hIcon;
57   /* icon flags ??? */         /*  6 -  7 */
58   /* iconANDsize */            /*  8 -  9 */
59   /* iconXORsize */            /* 10 - 11 */
60   /* pointer to IconInfo    */ /* 12 - 13 */
61   /* pointer to iconXORbits */ /* 14 - 15 */ /* sometimes iconANDbits ?! */
62   /* pointer to iconANDbits */ /* 16 - 17 */ /* sometimes iconXORbits ?! */
63   HLOCAL   hName;              /* 18 - 19 */
64   HLOCAL   hCmdLine;           /* 20 - 21 */
65   HLOCAL   hIconFile;          /* 22 - 23 */        
66   HLOCAL   hWorkDir;           /* Extension 0x8101 */
67   INT      nHotKey;            /* Extension 0x8102 */
68   /* Modifier: bit 8... */
69   INT      nCmdShow;           /* Extension 0x8103 */
70
71   /**/                         /* IconInfo */
72   /* HotSpot x   ??? */        /*  0 -  1 */
73   /* HotSpot y   ??? */        /*  2 -  3 */
74   /* Width           */        /*  4 -  5 */
75   /* Height          */        /*  6 -  7 */
76   /* WidthBytes  ??? */        /*  8 -  9 */
77   /* Planes          */        /* 10 - 10 */
78   /* BitsPerPixel    */        /* 11 - 11 */
79 } PROGRAM;
80
81 typedef struct
82 {
83   HLOCAL   hPrior;
84   HLOCAL   hNext;
85   HWND     hWnd;
86   HLOCAL   hGrpFile;
87   HLOCAL   hActiveProgram;
88   BOOL     bFileNameModified;
89   BOOL     bOverwriteFileOk;
90   INT      seqnum;
91
92   /**/                         /* Absolute */
93   /* magic `PMCC'  */          /*  0 -  3 */
94   /* checksum      */          /*  4 -  5 */
95   /* Extension ptr */          /*  6 -  7 */
96   INT      nCmdShow;           /*  8 -  9 */
97   INT      x, y;               /* 10 - 13 */
98   INT      width, height;      /* 14 - 17 */
99   INT      iconx, icony;       /* 18 - 21 */
100   HLOCAL   hName;              /* 22 - 23 */
101   /* unknown */                /* 24 - 31 */
102   /* number of programs */     /* 32 - 33 */
103   HLOCAL   hPrograms;          /* 34 ...  */
104
105   /**/                        /* Extensions */
106   /* Extension type */         /*  0 -  1 */           
107   /* Program number */         /*  2 -  3 */
108   /* Size of entry  */         /*  4 -  5 */
109   /* Data           */         /*  6 ...  */
110
111   /* magic `PMCC' */           /* Extension 0x8000 */
112   /* End of Extensions */      /* Extension 0xffff */
113 } PROGGROUP;
114
115 typedef struct
116 {
117   HANDLE  hInstance;
118   HANDLE  hAccel;
119   HWND    hMainWnd;
120   HWND    hMDIWnd;
121   HICON   hMainIcon;
122   HICON   hGroupIcon;
123   HICON   hDefaultIcon;
124   HMENU   hMainMenu;
125   HMENU   hFileMenu;
126   HMENU   hOptionMenu;
127   HMENU   hWindowsMenu;
128   HMENU   hLanguageMenu;
129   LPCSTR  lpszIniFile;
130   LPCSTR  lpszIcoFile;
131   BOOL    bAutoArrange;
132   BOOL    bSaveSettings;
133   BOOL    bMinOnRun;
134   HLOCAL  hGroups;
135   LPCSTR  lpszLanguage;
136   UINT    wStringTableOffset;
137   HLOCAL  hActiveGroup;
138 } GLOBALS;
139
140 extern GLOBALS Globals;
141
142 INT  MAIN_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type);
143 INT  MAIN_MessageBoxIDS_s(UINT ids_text_s, LPCSTR str, UINT ids_title, WORD type);
144 VOID MAIN_ReplaceString(HLOCAL *handle, LPSTR replacestring);
145
146 HLOCAL GRPFILE_ReadGroupFile(const char* path);
147 BOOL   GRPFILE_WriteGroupFile(HLOCAL hGroup);
148
149 ATOM   GROUP_RegisterGroupWinClass(void);
150 HLOCAL GROUP_AddGroup(LPCSTR lpszName, LPCSTR lpszGrpFile, INT showcmd,
151                       INT x, INT y, INT width, INT heiht,
152                       INT iconx, INT icony,
153                       BOOL bModifiedFileName, BOOL bOverwriteFileOk,
154                       /* FIXME shouldn't be necessary */
155                       BOOL bSuppressShowWindow);
156 VOID   GROUP_NewGroup(void);
157 VOID   GROUP_ModifyGroup(HLOCAL hGroup);
158 VOID   GROUP_DeleteGroup(HLOCAL hGroup);
159 /* FIXME shouldn't be necessary */
160 VOID   GROUP_ShowGroupWindow(HLOCAL hGroup);
161 HLOCAL GROUP_FirstGroup(void);
162 HLOCAL GROUP_NextGroup(HLOCAL hGroup);
163 HLOCAL GROUP_ActiveGroup(void);
164 HWND   GROUP_GroupWnd(HLOCAL hGroup);
165 LPCSTR GROUP_GroupName(HLOCAL hGroup);
166
167 ATOM   PROGRAM_RegisterProgramWinClass(void);
168 HLOCAL PROGRAM_AddProgram(HLOCAL hGroup, HICON hIcon, LPCSTR lpszName,
169                           INT x, INT y, LPCSTR lpszCmdLine,
170                           LPCSTR lpszIconFile, INT nIconIndex,
171                           LPCSTR lpszWorkDir, INT nHotKey, INT nCmdShow);
172 VOID   PROGRAM_NewProgram(HLOCAL hGroup);
173 VOID   PROGRAM_ModifyProgram(HLOCAL hProgram);
174 VOID   PROGRAM_CopyMoveProgram(HLOCAL hProgram, BOOL bMove);
175 VOID   PROGRAM_DeleteProgram(HLOCAL hProgram, BOOL BUpdateGrpFile);
176 HLOCAL PROGRAM_FirstProgram(HLOCAL hGroup);
177 HLOCAL PROGRAM_NextProgram(HLOCAL hProgram);
178 HLOCAL PROGRAM_ActiveProgram(HLOCAL hGroup);
179 LPCSTR PROGRAM_ProgramName(HLOCAL hProgram);
180 VOID   PROGRAM_ExecuteProgram(HLOCAL hLocal);
181
182 INT    DIALOG_New(INT nDefault);
183 HLOCAL DIALOG_CopyMove(LPCSTR lpszProgramName, LPCSTR lpszGroupName, BOOL bMove);
184 BOOL   DIALOG_Delete(UINT ids_format_s, LPCSTR lpszName);
185 BOOL   DIALOG_GroupAttributes(LPSTR lpszTitle, LPSTR lpszPath, INT nSize);
186 BOOL   DIALOG_ProgramAttributes(LPSTR lpszTitle, LPSTR lpszCmdLine,
187                                 LPSTR lpszWorkDir, LPSTR lpszIconFile,
188                                 HICON *lphIcon, INT *nIconIndex,
189                                 INT *lpnHotKey, INT *lpnCmdShow, INT nSize);
190 VOID   DIALOG_Symbol(HICON *lphIcon, LPSTR lpszIconFile,
191                      INT *lpnIconIndex, INT nSize);
192 VOID   DIALOG_Execute(void);
193
194 VOID STRING_SelectLanguageByName(LPCSTR);
195 VOID STRING_SelectLanguageByNumber(UINT);
196
197 /* Class names */
198 extern CHAR STRING_MAIN_WIN_CLASS_NAME[];
199 extern CHAR STRING_MDI_WIN_CLASS_NAME[];
200 extern CHAR STRING_GROUP_WIN_CLASS_NAME[];
201 extern CHAR STRING_PROGRAM_WIN_CLASS_NAME[];
202
203 /* Resource names */
204 extern CHAR STRING_ACCEL[];
205 extern CHAR STRING_MAIN_Xx[];
206 extern CHAR STRING_NEW_Xx[];
207 extern CHAR STRING_OPEN_Xx[];
208 extern CHAR STRING_MOVE_Xx[];
209 extern CHAR STRING_COPY_Xx[];
210 extern CHAR STRING_DELETE_Xx[];
211 extern CHAR STRING_GROUP_Xx[];
212 extern CHAR STRING_PROGRAM_Xx[];
213 extern CHAR STRING_SYMBOL_Xx[];
214 extern CHAR STRING_EXECUTE_Xx[];
215
216 #define STRINGID(id) (0x##id + Globals.wStringTableOffset)
217
218 #else /* RC_INVOKED */
219
220 #define STRINGID(id) id
221
222 #endif
223
224 /* Stringtable index */
225 #define IDS_LANGUAGE_ID                STRINGID(00)
226 #define IDS_LANGUAGE_MENU_ITEM         STRINGID(01)
227 #define IDS_PROGRAM_MANAGER            STRINGID(02)
228 #define IDS_ERROR                      STRINGID(03)
229 #define IDS_WARNING                    STRINGID(04)
230 #define IDS_INFO                       STRINGID(05)
231 #define IDS_DELETE                     STRINGID(06)
232 #define IDS_DELETE_GROUP_s             STRINGID(07)
233 #define IDS_DELETE_PROGRAM_s           STRINGID(08)
234 #define IDS_NOT_IMPLEMENTED            STRINGID(09)
235 #define IDS_FILE_READ_ERROR_s          STRINGID(0a)
236 #define IDS_FILE_WRITE_ERROR_s         STRINGID(0b)
237 #define IDS_GRPFILE_READ_ERROR_s       STRINGID(0c)
238 #define IDS_OUT_OF_MEMORY              STRINGID(0d)
239 #define IDS_WINHELP_ERROR              STRINGID(0e)
240 #define IDS_UNKNOWN_FEATURE_s          STRINGID(0f)
241 #define IDS_FILE_NOT_OVERWRITTEN_s     STRINGID(10)
242 #define IDS_SAVE_GROUP_AS_s            STRINGID(11)
243 #define IDS_NO_HOT_KEY                 STRINGID(12)
244 #define IDS_ALL_FILES                  STRINGID(13)
245 #define IDS_PROGRAMS                   STRINGID(14)
246 #define IDS_LIBRARIES_DLL              STRINGID(15)
247 #define IDS_SYMBOL_FILES               STRINGID(16)
248 #define IDS_SYMBOLS_ICO                STRINGID(17)
249
250 /* Menu */
251
252 #define PM_NEW              100
253 #define PM_OPEN             101
254 #define PM_MOVE             102
255 #define PM_COPY             103
256 #define PM_DELETE           104
257 #define PM_ATTRIBUTES       105
258 #define PM_EXECUTE          107
259 #define PM_EXIT             108
260
261 #define PM_AUTO_ARRANGE     200
262 #define PM_MIN_ON_RUN       201
263 #define PM_SAVE_SETTINGS    203
264
265 #define PM_OVERLAP          300
266 #define PM_SIDE_BY_SIDE     301
267 #define PM_ARRANGE          302
268 #define PM_FIRST_CHILD      3030
269
270 #define PM_FIRST_LANGUAGE   400
271 #define PM_LAST_LANGUAGE    499
272
273 #define PM_CONTENTS         501
274 #define PM_SEARCH           502
275 #define PM_HELPONHELP       503
276 #define PM_TUTORIAL         504
277
278 #define PM_LICENSE          510
279 #define PM_NO_WARRANTY      511
280 #define PM_ABOUT_WINE       512
281
282 /* Dialog `New' */
283
284 /* RADIOBUTTON: The next two must be in sequence */
285 #define PM_NEW_GROUP        1000
286 #define PM_NEW_PROGRAM      1001
287 #define PM_NEW_GROUP_TXT    1002
288 #define PM_NEW_PROGRAM_TXT  1003
289
290 /* Dialogs `Copy', `Move' */
291
292 #define PM_PROGRAM          1200
293 #define PM_FROM_GROUP       1201
294 #define PM_TO_GROUP         1202
295 #define PM_TO_GROUP_TXT     1203
296
297 /* Dialogs `Group attributes' */
298
299 #define PM_DESCRIPTION      1500
300 #define PM_DESCRIPTION_TXT  1501
301 #define PM_FILE             1502
302 #define PM_FILE_TXT         1503
303
304 /* Dialogs `Program attributes' */
305 #define PM_COMMAND_LINE     1510
306 #define PM_COMMAND_LINE_TXT 1511
307 #define PM_DIRECTORY        1512
308 #define PM_DIRECTORY_TXT    1513
309 #define PM_HOT_KEY          1514
310 #define PM_HOT_KEY_TXT      1515
311 #define PM_ICON             1516
312 #define PM_OTHER_SYMBOL     1517
313
314 /* Dialog `Symbol' */
315
316 #define PM_ICON_FILE        1520
317 #define PM_ICON_FILE_TXT    1521
318 #define PM_SYMBOL_LIST      1522
319 #define PM_SYMBOL_LIST_TXT  1523
320
321 /* Dialog `Execute' */
322
323 #define PM_COMMAND          1600
324 #define PM_SYMBOL           1601
325 #define PM_BROWSE           1602
326 #define PM_HELP             1603
327
328 #endif /* PROGMAN_H */
329
330 /* Local Variables:    */
331 /* c-file-style: "GNU" */
332 /* End:                */