remove empty dir
[reactos.git] / rosapps / winfile / main.h
1 /*
2 * ReactOS winfile
3 *
4 * main.h
5 *
6 * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program 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
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22 /*
23 * Based on Winefile, Copyright 2000 martin Fuchs <martin-fuchs@gmx.net>
24 */
25
26 #ifndef __MAIN_H__
27 #define __MAIN_H__
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33
34 #include "resource.h"
35 #include "entries.h"
36
37
38 ////////////////////////////////////////////////////////////////////////////////
39
40 #define MAX_LOADSTRING 100
41 #define BUFFER_LEN 1024
42
43 #define WM_DISPATCH_COMMAND 0xBF80
44
45 ////////////////////////////////////////////////////////////////////////////////
46 // range for drive bar command ids: 0x9000..0x90FF
47 #define ID_DRIVE_FIRST 0x9001
48
49
50 #define _NO_EXTENSIONS
51
52 enum IMAGE {
53 IMG_NONE=-1, IMG_FILE=0, IMG_DOCUMENT, IMG_EXECUTABLE,
54 IMG_FOLDER, IMG_OPEN_FOLDER, IMG_FOLDER_PLUS,IMG_OPEN_PLUS, IMG_OPEN_MINUS,
55 IMG_FOLDER_UP, IMG_FOLDER_CUR
56 };
57
58 #define IMAGE_WIDTH 16
59 #define IMAGE_HEIGHT 13
60 #define SPLIT_WIDTH 3
61
62 #define IDW_STATUSBAR 0x100
63 #define IDW_TOOLBAR 0x101
64 #define IDW_DRIVEBAR 0x102
65 #define IDW_DRIVEBOX 0x103
66
67 #define IDW_FIRST_CHILD 0xC000 //0x200
68
69 //#define IDW_TREE_LEFT 3
70 //#define IDW_TREE_RIGHT 6
71 //#define IDW_HEADER_LEFT 2
72 //#define IDW_HEADER_RIGHT 5
73
74 #define IDW_STATUS_WINDOW 7
75
76 #define TREE_WINDOW 8
77 #define LIST_WINDOW 9
78
79 ////////////////////////////////////////////////////////////////////////////////
80 void _wsplitpath(const WCHAR* path, WCHAR* drv, WCHAR* dir, WCHAR* name, WCHAR* ext);
81 void _splitpath(const CHAR* path, CHAR* drv, CHAR* dir, CHAR* name, CHAR* ext);
82
83 #ifdef _UNICODE
84 #define _tsplitpath _wsplitpath
85 #else
86 #define _tsplitpath _splitpath
87 #endif
88
89 ////////////////////////////////////////////////////////////////////////////////
90
91 enum OPTION_FLAGS {
92 OPTIONS_OPEN_NEW_WINDOW_ON_CONNECT = 0x01,
93 OPTIONS_MINIMISE_ON_USE = 0x02,
94 OPTIONS_SAVE_ON_EXIT = 0x04,
95 };
96
97 ////////////////////////////////////////////////////////////////////////////////
98
99 enum COLUMN_FLAGS {
100 COL_SIZE = 0x01,
101 COL_DATE = 0x02,
102 COL_TIME = 0x04,
103 COL_ATTRIBUTES = 0x08,
104 COL_DOSNAMES = 0x10,
105 #ifdef _NO_EXTENSIONS
106 COL_ALL = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_DOSNAMES
107 #else
108 COL_INDEX = 0x20,
109 COL_LINKS = 0x40,
110 COL_ALL = COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_DOSNAMES|COL_INDEX|COL_LINKS
111 #endif
112 };
113
114 #define USE_GLOBAL_STRUCT
115 #ifdef USE_GLOBAL_STRUCT
116 typedef struct
117 {
118 HINSTANCE hInstance;
119 HACCEL hAccel;
120 HWND hMainWnd;
121 HMENU hMenuFrame;
122 HMENU hWindowsMenu;
123 HMENU hLanguageMenu;
124 HMENU hMenuView;
125 HMENU hMenuOptions;
126 HWND hMDIClient;
127 HWND hStatusBar;
128 HWND hToolBar;
129 HWND hDriveBar;
130 HFONT hFont;
131 HWND hDriveCombo;
132
133 TCHAR num_sep;
134 SIZE spaceSize;
135 HIMAGELIST himl;
136
137 TCHAR drives[BUFFER_LEN];
138 BOOL prescan_node; //TODO
139
140 LPCSTR lpszLanguage;
141 UINT wStringTableOffset;
142 enum OPTION_FLAGS Options;
143
144 } WINFILE_GLOBALS;
145
146 extern WINFILE_GLOBALS Globals;
147
148 #define STRINGID(id) (Globals.wStringTableOffset + 0x##id)
149
150 #else
151
152 extern HINSTANCE hInstance;
153 extern HACCEL hAccel;
154 extern HWND hMainWnd;
155 extern HMENU hMenuFrame;
156 extern HMENU hWindowsMenu;
157 extern HMENU hLanguageMenu;
158 extern HMENU hMenuView;
159 extern HMENU hMenuOptions;
160 extern HWND hMDIClient;
161 extern HWND hStatusBar;
162 extern HWND hToolBar;
163 extern HWND hDriveBar;
164 extern HFONT hFont;
165
166 extern TCHAR num_sep;
167 extern SIZE spaceSize;
168 extern HIMAGELIST himl;
169
170 extern TCHAR drives[BUFFER_LEN];
171 extern BOOL prescan_node; //TODO
172
173 extern LPCSTR lpszLanguage;
174 extern UINT wStringTableOffset;
175
176 #define Globals.
177
178 #endif
179
180 extern UINT OemCodePage;
181 extern UINT AnsiCodePage;
182 extern LCID UserDefaultLCID;
183
184 extern HINSTANCE hInst;
185 extern TCHAR szTitle[];
186 extern TCHAR szFrameClass[];
187 extern TCHAR szChildClass[];
188
189
190 void SetupStatusBar(BOOL bResize);
191 void UpdateStatusBar(void);
192
193 #if __MINGW32_MAJOR_VERSION == 1
194 typedef struct tagNMITEMACTIVATE{
195 NMHDR hdr;
196 int iItem;
197 int iSubItem;
198 UINT uNewState;
199 UINT uOldState;
200 UINT uChanged;
201 POINT ptAction;
202 LPARAM lParam;
203 UINT uKeyFlags;
204 } NMITEMACTIVATE, FAR *LPNMITEMACTIVATE;
205 #endif
206
207 #ifdef __cplusplus
208 };
209 #endif
210
211 #endif // __MAIN_H__