Updated with progress. Still far to go....
[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 #if _MSC_VER > 1000
34 #pragma once
35 #endif // _MSC_VER > 1000
36
37 #include "resource.h"
38 #include "entries.h"
39
40
41 ////////////////////////////////////////////////////////////////////////////////
42
43 #define MAX_LOADSTRING 100
44 #define BUFFER_LEN 1024
45
46 #define WM_DISPATCH_COMMAND 0xBF80
47
48 ////////////////////////////////////////////////////////////////////////////////
49 // range for drive bar command ids: 0x9000..0x90FF
50 #define ID_DRIVE_FIRST 0x9001
51
52
53 #define _NO_EXTENSIONS
54
55 enum IMAGE {
56 IMG_NONE=-1, IMG_FILE=0, IMG_DOCUMENT, IMG_EXECUTABLE,
57 IMG_FOLDER, IMG_OPEN_FOLDER, IMG_FOLDER_PLUS,IMG_OPEN_PLUS, IMG_OPEN_MINUS,
58 IMG_FOLDER_UP, IMG_FOLDER_CUR
59 };
60
61 #define IMAGE_WIDTH 16
62 #define IMAGE_HEIGHT 13
63 #define SPLIT_WIDTH 3
64
65 #define IDW_STATUSBAR 0x100
66 #define IDW_TOOLBAR 0x101
67 #define IDW_DRIVEBAR 0x102
68 #define IDW_DRIVEBOX 0x103
69
70 #define IDW_FIRST_CHILD 0xC000 //0x200
71
72 #define IDW_TREE_LEFT 3
73 #define IDW_TREE_RIGHT 6
74 #define IDW_HEADER_LEFT 2
75 #define IDW_HEADER_RIGHT 5
76
77 #define IDW_STATUS_WINDOW 7
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
132 TCHAR num_sep;
133 SIZE spaceSize;
134 HIMAGELIST himl;
135
136 TCHAR drives[BUFFER_LEN];
137 BOOL prescan_node; //TODO
138
139 LPCSTR lpszLanguage;
140 UINT wStringTableOffset;
141 enum OPTION_FLAGS Options;
142
143 } WINFILE_GLOBALS;
144
145 extern WINFILE_GLOBALS Globals;
146
147 #define STRINGID(id) (Globals.wStringTableOffset + 0x##id)
148
149 #else
150
151 extern HINSTANCE hInstance;
152 extern HACCEL hAccel;
153 extern HWND hMainWnd;
154 extern HMENU hMenuFrame;
155 extern HMENU hWindowsMenu;
156 extern HMENU hLanguageMenu;
157 extern HMENU hMenuView;
158 extern HMENU hMenuOptions;
159 extern HWND hMDIClient;
160 extern HWND hStatusBar;
161 extern HWND hToolBar;
162 extern HWND hDriveBar;
163 extern HFONT hFont;
164
165 extern TCHAR num_sep;
166 extern SIZE spaceSize;
167 extern HIMAGELIST himl;
168
169 extern TCHAR drives[BUFFER_LEN];
170 extern BOOL prescan_node; //TODO
171
172 extern LPCSTR lpszLanguage;
173 extern UINT wStringTableOffset;
174
175 #define Globals.
176
177 #endif
178
179 extern UINT OemCodePage;
180 extern UINT AnsiCodePage;
181 extern LCID UserDefaultLCID;
182
183 extern HINSTANCE hInst;
184 extern TCHAR szTitle[];
185 extern TCHAR szFrameClass[];
186 extern TCHAR szChildClass[];
187
188
189 void SetupStatusBar(BOOL bResize);
190 void UpdateStatusBar(void);
191
192
193 #ifdef __cplusplus
194 };
195 #endif
196
197 #endif // __MAIN_H__