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