progman.h 10.1 KB
Newer Older
Alexandre Julliard's avatar
Alexandre Julliard committed
1 2 3 4
/*
 * Program Manager
 *
 * Copyright 1996 Ulrich Schmid
5
 * Copyright 2002 Sylvain Petreolle
6 7 8 9 10 11 12 13 14 15 16 17 18
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
19
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Alexandre Julliard's avatar
Alexandre Julliard committed
20 21 22 23 24
 */

#ifndef PROGMAN_H
#define PROGMAN_H

Alexandre Julliard's avatar
Alexandre Julliard committed
25 26 27 28
#define MAX_STRING_LEN      255
#define MAX_PATHNAME_LEN    1024
#define MAX_LANGUAGE_NUMBER (PM_LAST_LANGUAGE - PM_FIRST_LANGUAGE)

Alexandre Julliard's avatar
Alexandre Julliard committed
29 30 31
#include "windows.h"

/* Fallback icon */
32
#define DEFAULTICON OIC_WINLOGO
Alexandre Julliard's avatar
Alexandre Julliard committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63

/* Icon index in M$ Window's progman.exe  */
#define PROGMAN_ICON_INDEX 0
#define GROUP_ICON_INDEX   6
#define DEFAULT_ICON_INDEX 7

#define DEF_GROUP_WIN_XPOS   100
#define DEF_GROUP_WIN_YPOS   100
#define DEF_GROUP_WIN_WIDTH  300
#define DEF_GROUP_WIN_HEIGHT 200

typedef struct
{
  HLOCAL   hGroup;
  HLOCAL   hPrior;
  HLOCAL   hNext;
  HWND     hWnd;
  /**/              /* Numbers are byte indexes in *.grp */

  /**/                       /* Program entry */
  INT      x, y;               /*  0 -  3 */
  INT      nIconIndex;         /*  4 -  5 */
  HICON    hIcon;
  /* icon flags ??? */         /*  6 -  7 */
  /* iconANDsize */            /*  8 -  9 */
  /* iconXORsize */            /* 10 - 11 */
  /* pointer to IconInfo    */ /* 12 - 13 */
  /* pointer to iconXORbits */ /* 14 - 15 */ /* sometimes iconANDbits ?! */
  /* pointer to iconANDbits */ /* 16 - 17 */ /* sometimes iconXORbits ?! */
  HLOCAL   hName;              /* 18 - 19 */
  HLOCAL   hCmdLine;           /* 20 - 21 */
64
  HLOCAL   hIconFile;          /* 22 - 23 */
Alexandre Julliard's avatar
Alexandre Julliard committed
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
  HLOCAL   hWorkDir;           /* Extension 0x8101 */
  INT      nHotKey;            /* Extension 0x8102 */
  /* Modifier: bit 8... */
  INT      nCmdShow;           /* Extension 0x8103 */

  /**/                         /* IconInfo */
  /* HotSpot x   ??? */        /*  0 -  1 */
  /* HotSpot y   ??? */        /*  2 -  3 */
  /* Width           */        /*  4 -  5 */
  /* Height          */        /*  6 -  7 */
  /* WidthBytes  ??? */        /*  8 -  9 */
  /* Planes          */        /* 10 - 10 */
  /* BitsPerPixel    */        /* 11 - 11 */
} PROGRAM;

typedef struct
{
  HLOCAL   hPrior;
  HLOCAL   hNext;
  HWND     hWnd;
  HLOCAL   hGrpFile;
  HLOCAL   hActiveProgram;
  BOOL     bFileNameModified;
  BOOL     bOverwriteFileOk;
  INT      seqnum;

  /**/                         /* Absolute */
  /* magic `PMCC'  */          /*  0 -  3 */
  /* checksum      */          /*  4 -  5 */
  /* Extension ptr */          /*  6 -  7 */
  INT      nCmdShow;           /*  8 -  9 */
  INT      x, y;               /* 10 - 13 */
  INT      width, height;      /* 14 - 17 */
  INT      iconx, icony;       /* 18 - 21 */
  HLOCAL   hName;              /* 22 - 23 */
  /* unknown */                /* 24 - 31 */
  /* number of programs */     /* 32 - 33 */
  HLOCAL   hPrograms;          /* 34 ...  */

  /**/                        /* Extensions */
105
  /* Extension type */         /*  0 -  1 */
Alexandre Julliard's avatar
Alexandre Julliard committed
106 107 108 109 110 111
  /* Program number */         /*  2 -  3 */
  /* Size of entry  */         /*  4 -  5 */
  /* Data           */         /*  6 ...  */

  /* magic `PMCC' */           /* Extension 0x8000 */
  /* End of Extensions */      /* Extension 0xffff */
112
} PROGGROUP;
Alexandre Julliard's avatar
Alexandre Julliard committed
113 114 115 116 117 118 119 120 121 122 123 124 125 126

typedef struct
{
  HANDLE  hInstance;
  HANDLE  hAccel;
  HWND    hMainWnd;
  HWND    hMDIWnd;
  HICON   hMainIcon;
  HICON   hGroupIcon;
  HICON   hDefaultIcon;
  HMENU   hMainMenu;
  HMENU   hFileMenu;
  HMENU   hOptionMenu;
  HMENU   hWindowsMenu;
Alexandre Julliard's avatar
Alexandre Julliard committed
127
  HMENU   hLanguageMenu;
Alexandre Julliard's avatar
Alexandre Julliard committed
128 129 130 131 132 133 134 135 136 137 138
  LPCSTR  lpszIniFile;
  LPCSTR  lpszIcoFile;
  BOOL    bAutoArrange;
  BOOL    bSaveSettings;
  BOOL    bMinOnRun;
  HLOCAL  hGroups;
  HLOCAL  hActiveGroup;
} GLOBALS;

extern GLOBALS Globals;

Alexandre Julliard's avatar
Alexandre Julliard committed
139 140
INT  MAIN_MessageBoxIDS(UINT ids_text, UINT ids_title, WORD type);
INT  MAIN_MessageBoxIDS_s(UINT ids_text_s, LPCSTR str, UINT ids_title, WORD type);
Alexandre Julliard's avatar
Alexandre Julliard committed
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
VOID MAIN_ReplaceString(HLOCAL *handle, LPSTR replacestring);

HLOCAL GRPFILE_ReadGroupFile(const char* path);
BOOL   GRPFILE_WriteGroupFile(HLOCAL hGroup);

ATOM   GROUP_RegisterGroupWinClass(void);
HLOCAL GROUP_AddGroup(LPCSTR lpszName, LPCSTR lpszGrpFile, INT showcmd,
		      INT x, INT y, INT width, INT heiht,
		      INT iconx, INT icony,
		      BOOL bModifiedFileName, BOOL bOverwriteFileOk,
		      /* FIXME shouldn't be necessary */
		      BOOL bSuppressShowWindow);
VOID   GROUP_NewGroup(void);
VOID   GROUP_ModifyGroup(HLOCAL hGroup);
VOID   GROUP_DeleteGroup(HLOCAL hGroup);
/* FIXME shouldn't be necessary */
VOID   GROUP_ShowGroupWindow(HLOCAL hGroup);
HLOCAL GROUP_FirstGroup(void);
HLOCAL GROUP_NextGroup(HLOCAL hGroup);
HLOCAL GROUP_ActiveGroup(void);
HWND   GROUP_GroupWnd(HLOCAL hGroup);
LPCSTR GROUP_GroupName(HLOCAL hGroup);

ATOM   PROGRAM_RegisterProgramWinClass(void);
HLOCAL PROGRAM_AddProgram(HLOCAL hGroup, HICON hIcon, LPCSTR lpszName,
			  INT x, INT y, LPCSTR lpszCmdLine,
			  LPCSTR lpszIconFile, INT nIconIndex,
			  LPCSTR lpszWorkDir, INT nHotKey, INT nCmdShow);
VOID   PROGRAM_NewProgram(HLOCAL hGroup);
VOID   PROGRAM_ModifyProgram(HLOCAL hProgram);
VOID   PROGRAM_CopyMoveProgram(HLOCAL hProgram, BOOL bMove);
VOID   PROGRAM_DeleteProgram(HLOCAL hProgram, BOOL BUpdateGrpFile);
HLOCAL PROGRAM_FirstProgram(HLOCAL hGroup);
HLOCAL PROGRAM_NextProgram(HLOCAL hProgram);
HLOCAL PROGRAM_ActiveProgram(HLOCAL hGroup);
LPCSTR PROGRAM_ProgramName(HLOCAL hProgram);
VOID   PROGRAM_ExecuteProgram(HLOCAL hLocal);

INT    DIALOG_New(INT nDefault);
HLOCAL DIALOG_CopyMove(LPCSTR lpszProgramName, LPCSTR lpszGroupName, BOOL bMove);
Alexandre Julliard's avatar
Alexandre Julliard committed
181
BOOL   DIALOG_Delete(UINT ids_format_s, LPCSTR lpszName);
Alexandre Julliard's avatar
Alexandre Julliard committed
182 183 184 185 186 187 188
BOOL   DIALOG_GroupAttributes(LPSTR lpszTitle, LPSTR lpszPath, INT nSize);
BOOL   DIALOG_ProgramAttributes(LPSTR lpszTitle, LPSTR lpszCmdLine,
				LPSTR lpszWorkDir, LPSTR lpszIconFile,
				HICON *lphIcon, INT *nIconIndex,
				INT *lpnHotKey, INT *lpnCmdShow, INT nSize);
VOID   DIALOG_Execute(void);

189
VOID   STRING_LoadMenus(VOID);
Alexandre Julliard's avatar
Alexandre Julliard committed
190 191 192 193 194 195 196 197 198

/* Class names */
extern CHAR STRING_MAIN_WIN_CLASS_NAME[];
extern CHAR STRING_MDI_WIN_CLASS_NAME[];
extern CHAR STRING_GROUP_WIN_CLASS_NAME[];
extern CHAR STRING_PROGRAM_WIN_CLASS_NAME[];

/* Resource names */
extern CHAR STRING_ACCEL[];
199 200 201 202 203 204 205 206 207 208
extern CHAR STRING_MAIN[];
extern CHAR STRING_NEW[];
extern CHAR STRING_OPEN[];
extern CHAR STRING_MOVE[];
extern CHAR STRING_COPY[];
extern CHAR STRING_DELETE[];
extern CHAR STRING_GROUP[];
extern CHAR STRING_PROGRAM[];
extern CHAR STRING_SYMBOL[];
extern CHAR STRING_EXECUTE[];
Alexandre Julliard's avatar
Alexandre Julliard committed
209

Alexandre Julliard's avatar
Alexandre Julliard committed
210
/* Stringtable index */
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
#define IDS_PROGRAM_MANAGER            0x02
#define IDS_ERROR                      0x03
#define IDS_WARNING                    0x04
#define IDS_INFO                       0x05
#define IDS_DELETE                     0x06
#define IDS_DELETE_GROUP_s             0x07
#define IDS_DELETE_PROGRAM_s           0x08
#define IDS_NOT_IMPLEMENTED            0x09
#define IDS_FILE_READ_ERROR_s          0x0a
#define IDS_FILE_WRITE_ERROR_s         0x0b
#define IDS_GRPFILE_READ_ERROR_s       0x0c
#define IDS_OUT_OF_MEMORY              0x0d
#define IDS_WINHELP_ERROR              0x0e
#define IDS_UNKNOWN_FEATURE_s          0x0f
#define IDS_FILE_NOT_OVERWRITTEN_s     0x10
#define IDS_SAVE_GROUP_AS_s            0x11
#define IDS_NO_HOT_KEY                 0x12
#define IDS_ALL_FILES                  0x13
#define IDS_PROGRAMS                   0x14
#define IDS_LIBRARIES_DLL              0x15
#define IDS_SYMBOL_FILES               0x16
#define IDS_SYMBOLS_ICO                0x17
Alexandre Julliard's avatar
Alexandre Julliard committed
233

234 235 236 237 238
#define IDS_LICENSE_CAPTION            0x20
#define IDS_LICENSE                    0x21
#define IDS_WARRANTY_CAPTION           0x22
#define IDS_WARRANTY                   0x23

Alexandre Julliard's avatar
Alexandre Julliard committed
239 240
/* Menu */

241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258
#define MAIN_MENU           0x109
#define PM_NEW              0x100
#define PM_OPEN             0x101
#define PM_MOVE             0x102
#define PM_COPY             0x103
#define PM_DELETE           0x104
#define PM_ATTRIBUTES       0x105
#define PM_EXECUTE          0x107
#define PM_EXIT             0x108

#define PM_AUTO_ARRANGE     0x110
#define PM_MIN_ON_RUN       0x111
#define PM_SAVE_SETTINGS    0x113

#define PM_OVERLAP          0x120
#define PM_SIDE_BY_SIDE     0x121
#define PM_ARRANGE          0x122
#define PM_FIRST_CHILD      0x3030
Alexandre Julliard's avatar
Alexandre Julliard committed
259

260 261 262 263
/*
 *#define PM_FIRST_LANGUAGE   0x400
 *#define PM_LAST_LANGUAGE    0x499
 */
Alexandre Julliard's avatar
Alexandre Julliard committed
264

265 266 267 268
#define PM_CONTENTS         0x131
#define PM_SEARCH           0x132
#define PM_HELPONHELP       0x133
#define PM_TUTORIAL         0x134
Alexandre Julliard's avatar
Alexandre Julliard committed
269

270 271 272
#define PM_LICENSE          0x140
#define PM_NO_WARRANTY      0x141
#define PM_ABOUT_WINE       0x142
Alexandre Julliard's avatar
Alexandre Julliard committed
273 274 275 276

/* Dialog `New' */

/* RADIOBUTTON: The next two must be in sequence */
277 278 279 280
#define PM_NEW_GROUP        0x150
#define PM_NEW_PROGRAM      0x151
#define PM_NEW_GROUP_TXT    0x152
#define PM_NEW_PROGRAM_TXT  0x153
Alexandre Julliard's avatar
Alexandre Julliard committed
281 282 283

/* Dialogs `Copy', `Move' */

284 285 286 287
#define PM_PROGRAM          0x160
#define PM_FROM_GROUP       0x161
#define PM_TO_GROUP         0x162
#define PM_TO_GROUP_TXT     0x163
Alexandre Julliard's avatar
Alexandre Julliard committed
288 289 290

/* Dialogs `Group attributes' */

291 292 293 294
#define PM_DESCRIPTION      0x170
#define PM_DESCRIPTION_TXT  0x171
#define PM_FILE             0x172
#define PM_FILE_TXT         0x173
Alexandre Julliard's avatar
Alexandre Julliard committed
295 296

/* Dialogs `Program attributes' */
297 298 299 300 301 302 303 304
#define PM_COMMAND_LINE     0x180
#define PM_COMMAND_LINE_TXT 0x181
#define PM_DIRECTORY        0x182
#define PM_DIRECTORY_TXT    0x183
#define PM_HOT_KEY          0x184
#define PM_HOT_KEY_TXT      0x185
#define PM_ICON             0x186
#define PM_OTHER_SYMBOL     0x187
Alexandre Julliard's avatar
Alexandre Julliard committed
305 306 307

/* Dialog `Symbol' */

308 309 310 311
#define PM_ICON_FILE        0x190
#define PM_ICON_FILE_TXT    0x191
#define PM_SYMBOL_LIST      0x192
#define PM_SYMBOL_LIST_TXT  0x193
Alexandre Julliard's avatar
Alexandre Julliard committed
312 313 314

/* Dialog `Execute' */

315 316 317 318
#define PM_COMMAND          0x1a0
#define PM_SYMBOL           0x1a1
#define PM_BROWSE           0x1a2
#define PM_HELP             0x1a3
Alexandre Julliard's avatar
Alexandre Julliard committed
319 320 321 322 323 324

#endif /* PROGMAN_H */

/* Local Variables:    */
/* c-file-style: "GNU" */
/* End:                */