Release 960302
[wine] / programs / progman / progman.h
1 /*
2  * Program Manager
3  *
4  * Copyright 1996 Ulrich Schmid
5  */
6
7 #ifndef PROGMAN_H
8 #define PROGMAN_H
9
10 #ifndef RC_INVOKED
11
12 #include "windows.h"
13
14 /* FIXME should use WinExec from -lwine */
15 #ifdef WINELIB
16 #define WinExec ProgmanWinExec
17 #define WinHelp ProgmanWinHelp
18 HANDLE  ProgmanWinExec(LPSTR,WORD);
19 BOOL    ProgmanWinHelp(HWND,LPSTR,WORD,DWORD);
20 #endif
21
22 #define MAX_PATHNAME_LEN 1024
23
24 /* Fallback icon */
25 #ifdef WINELIB
26 #define DEFAULTICON OIC_WINEICON
27 #else
28 #define DEFAULTICON OIC_LANDSCAPE
29 #endif
30
31 /* Icon index in M$ Window's progman.exe  */
32 #define PROGMAN_ICON_INDEX 0
33 #define GROUP_ICON_INDEX   6
34 #define DEFAULT_ICON_INDEX 7
35
36 #define DEF_GROUP_WIN_XPOS   100
37 #define DEF_GROUP_WIN_YPOS   100
38 #define DEF_GROUP_WIN_WIDTH  300
39 #define DEF_GROUP_WIN_HEIGHT 200
40
41 typedef struct
42 {
43   HLOCAL   hGroup;
44   HLOCAL   hPrior;
45   HLOCAL   hNext;
46   HWND     hWnd;
47   /**/              /* Numbers are byte indexes in *.grp */
48
49   /**/                       /* Program entry */
50   INT      x, y;               /*  0 -  3 */
51   INT      nIconIndex;         /*  4 -  5 */
52   HICON    hIcon;
53   /* icon flags ??? */         /*  6 -  7 */
54   /* iconANDsize */            /*  8 -  9 */
55   /* iconXORsize */            /* 10 - 11 */
56   /* pointer to IconInfo    */ /* 12 - 13 */
57   /* pointer to iconXORbits */ /* 14 - 15 */ /* sometimes iconANDbits ?! */
58   /* pointer to iconANDbits */ /* 16 - 17 */ /* sometimes iconXORbits ?! */
59   HLOCAL   hName;              /* 18 - 19 */
60   HLOCAL   hCmdLine;           /* 20 - 21 */
61   HLOCAL   hIconFile;          /* 22 - 23 */        
62   HLOCAL   hWorkDir;           /* Extension 0x8101 */
63   INT      nHotKey;            /* Extension 0x8102 */
64   /* Modifier: bit 8... */
65   INT      nCmdShow;           /* Extension 0x8103 */
66
67   /**/                         /* IconInfo */
68   /* HotSpot x   ??? */        /*  0 -  1 */
69   /* HotSpot y   ??? */        /*  2 -  3 */
70   /* Width           */        /*  4 -  5 */
71   /* Height          */        /*  6 -  7 */
72   /* WidthBytes  ??? */        /*  8 -  9 */
73   /* Planes          */        /* 10 - 10 */
74   /* BitsPerPixel    */        /* 11 - 11 */
75 } PROGRAM;
76
77 typedef struct
78 {
79   HLOCAL   hPrior;
80   HLOCAL   hNext;
81   HWND     hWnd;
82   HLOCAL   hGrpFile;
83   HLOCAL   hActiveProgram;
84   BOOL     bFileNameModified;
85   BOOL     bOverwriteFileOk;
86   INT      seqnum;
87
88   /**/                         /* Absolute */
89   /* magic `PMCC'  */          /*  0 -  3 */
90   /* checksum      */          /*  4 -  5 */
91   /* Extension ptr */          /*  6 -  7 */
92   INT      nCmdShow;           /*  8 -  9 */
93   INT      x, y;               /* 10 - 13 */
94   INT      width, height;      /* 14 - 17 */
95   INT      iconx, icony;       /* 18 - 21 */
96   HLOCAL   hName;              /* 22 - 23 */
97   /* unknown */                /* 24 - 31 */
98   /* number of programs */     /* 32 - 33 */
99   HLOCAL   hPrograms;          /* 34 ...  */
100
101   /**/                        /* Extensions */
102   /* Extension type */         /*  0 -  1 */           
103   /* Program number */         /*  2 -  3 */
104   /* Size of entry  */         /*  4 -  5 */
105   /* Data           */         /*  6 ...  */
106
107   /* magic `PMCC' */           /* Extension 0x8000 */
108   /* End of Extensions */      /* Extension 0xffff */
109 } GROUP;
110
111 typedef struct
112 {
113   HANDLE  hInstance;
114   HANDLE  hAccel;
115   HWND    hMainWnd;
116   HWND    hMDIWnd;
117   HICON   hMainIcon;
118   HICON   hGroupIcon;
119   HICON   hDefaultIcon;
120   HMENU   hMainMenu;
121   HMENU   hFileMenu;
122   HMENU   hOptionMenu;
123   HMENU   hWindowsMenu;
124   LPCSTR  lpszIniFile;
125   LPCSTR  lpszIcoFile;
126   BOOL    bAutoArrange;
127   BOOL    bSaveSettings;
128   BOOL    bMinOnRun;
129   HLOCAL  hGroups;
130   LPCSTR  lpszLanguage;
131   LPCSTR *StringTable;
132   /* FIXME should use MDI */
133   HLOCAL  hActiveGroup;
134 } GLOBALS;
135
136 extern GLOBALS Globals;
137
138 VOID MAIN_ReplaceString(HLOCAL *handle, LPSTR replacestring);
139 VOID MAIN_NotImplementedError(void);
140 VOID MAIN_FileReadError(LPCSTR lpszPath);
141 VOID MAIN_FileWriteError(LPCSTR lpszPath);
142 VOID MAIN_GrpFileReadError(LPCSTR lpszPath);
143 VOID MAIN_OutOfMemoryError(void);
144 VOID MAIN_WinHelpError(void);
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(LPCSTR lpszFormat, 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_SelectLanguage(LPCSTR lang);
195
196 /* Class names */
197 extern CHAR STRING_MAIN_WIN_CLASS_NAME[];
198 extern CHAR STRING_MDI_WIN_CLASS_NAME[];
199 extern CHAR STRING_GROUP_WIN_CLASS_NAME[];
200 extern CHAR STRING_PROGRAM_WIN_CLASS_NAME[];
201
202 /* Resource names */
203 extern CHAR STRING_ACCEL[];
204 extern CHAR STRING_MAIN_Xx[];
205 extern CHAR STRING_NEW_Xx[];
206 extern CHAR STRING_OPEN_Xx[];
207 extern CHAR STRING_MOVE_Xx[];
208 extern CHAR STRING_COPY_Xx[];
209 extern CHAR STRING_DELETE_Xx[];
210 extern CHAR STRING_GROUP_Xx[];
211 extern CHAR STRING_PROGRAM_Xx[];
212 extern CHAR STRING_SYMBOL_Xx[];
213 extern CHAR STRING_EXECUTE_Xx[];
214
215 /* Strings */
216 #define STRING_PROGRAM_MANAGER            Globals.StringTable[ 0]
217 #define STRING_ERROR                      Globals.StringTable[ 1]
218 #define STRING_INFO                       Globals.StringTable[ 2]
219 #define STRING_DELETE                     Globals.StringTable[ 3]
220 #define STRING_DELETE_GROUP_s             Globals.StringTable[ 4]
221 #define STRING_DELETE_PROGRAM_s           Globals.StringTable[ 5]
222 #define STRING_NOT_IMPLEMENTED            Globals.StringTable[ 6]
223 #define STRING_FILE_READ_ERROR_s          Globals.StringTable[ 7]
224 #define STRING_FILE_WRITE_ERROR_s         Globals.StringTable[ 8]
225 #define STRING_GRPFILE_READ_ERROR_s       Globals.StringTable[ 9]
226 #define STRING_OUT_OF_MEMORY              Globals.StringTable[10]
227 #define STRING_WINHELP_ERROR              Globals.StringTable[11]
228 #define STRING_UNKNOWN_FEATURE_IN_GRPFILE Globals.StringTable[12]
229 #define STRING_FILE_NOT_OVERWRITTEN_s     Globals.StringTable[13]
230 #define STRING_SAVE_GROUP_AS_s            Globals.StringTable[14]
231 #define STRING_NO_HOT_KEY                 Globals.StringTable[15]
232 #define STRING_BROWSE_EXE_FILTER          Globals.StringTable[16]
233 #define STRING_BROWSE_ICO_FILTER          Globals.StringTable[17]
234 #define NUMBER_OF_STRINGS                                     18
235
236 extern LPCSTR StringTableCz[];
237 extern LPCSTR StringTableDa[];
238 extern LPCSTR StringTableDe[];
239 extern LPCSTR StringTableEn[];
240 extern LPCSTR StringTableEs[];
241 extern LPCSTR StringTableFi[];
242 extern LPCSTR StringTableFr[];
243 extern LPCSTR StringTableNo[];
244
245 #if defined(WINELIB) && !defined(HAVE_WINE_CONSTRUCTOR)
246   VOID LIBWINE_Register_accel(void);
247   VOID LIBWINE_Register_Cz(void);
248   VOID LIBWINE_Register_Da(void);
249   VOID LIBWINE_Register_De(void);
250   VOID LIBWINE_Register_Es(void);
251   VOID LIBWINE_Register_En(void);
252   VOID LIBWINE_Register_Fi(void);
253   VOID LIBWINE_Register_Fr(void);
254   VOID LIBWINE_Register_No(void);
255 #endif
256
257 #endif /* !RC_INVOKED */
258
259 /* Menu */
260
261 #define PM_NEW              100
262 #define PM_OPEN             101
263 #define PM_MOVE             102
264 #define PM_COPY             103
265 #define PM_DELETE           104
266 #define PM_ATTRIBUTES       105
267 #define PM_EXECUTE          107
268 #define PM_EXIT             108
269
270 #define PM_AUTO_ARRANGE     200
271 #define PM_MIN_ON_RUN       201
272 #define PM_SAVE_SETTINGS    203
273
274 #define PM_OVERLAP          300
275 #define PM_SIDE_BY_SIDE     301
276 #define PM_ARRANGE          302
277 #define PM_FIRST_CHILD      3030
278
279 #define PM_En               400
280 #define PM_Es               401
281 #define PM_De               402
282 #define PM_No               403
283 #define PM_Fr               404
284 #define PM_Fi               405
285 #define PM_Da               406
286 #define PM_Cz               407
287
288 #define PM_CONTENTS         501
289 #define PM_SEARCH           502
290 #define PM_HELPONHELP       503
291 #define PM_TUTORIAL         504
292
293 #define PM_LICENSE          510
294 #define PM_NO_WARRANTY      511
295 #define PM_ABOUT_WINE       512
296
297 /* Dialog `New' */
298
299 /* RADIOBUTTON: The next two must be in sequence */
300 #define PM_NEW_GROUP        1000
301 #define PM_NEW_PROGRAM      1001
302 #define PM_NEW_GROUP_TXT    1002
303 #define PM_NEW_PROGRAM_TXT  1003
304
305 /* Dialogs `Copy', `Move' */
306
307 #define PM_PROGRAM          1200
308 #define PM_FROM_GROUP       1201
309 #define PM_TO_GROUP         1202
310 #define PM_TO_GROUP_TXT     1203
311
312 /* Dialogs `Group attributes' */
313
314 #define PM_DESCRIPTION      1500
315 #define PM_DESCRIPTION_TXT  1501
316 #define PM_FILE             1502
317 #define PM_FILE_TXT         1503
318
319 /* Dialogs `Program attributes' */
320 #define PM_COMMAND_LINE     1510
321 #define PM_COMMAND_LINE_TXT 1511
322 #define PM_DIRECTORY        1512
323 #define PM_DIRECTORY_TXT    1513
324 #define PM_HOT_KEY          1514
325 #define PM_HOT_KEY_TXT      1515
326 #define PM_ICON             1516
327 #define PM_OTHER_SYMBOL     1517
328
329 /* Dialog `Symbol' */
330
331 #define PM_ICON_FILE        1520
332 #define PM_ICON_FILE_TXT    1521
333 #define PM_SYMBOL_LIST      1522
334 #define PM_SYMBOL_LIST_TXT  1523
335
336 /* Dialog `Execute' */
337
338 #define PM_COMMAND          1600
339 #define PM_SYMBOL           1601
340 #define PM_BROWSE           1602
341 #define PM_HELP             1603
342
343 #endif /* PROGMAN_H */
344
345 /* Local Variables:    */
346 /* c-file-style: "GNU" */
347 /* End:                */