Completed Doxygen documentation of all compounds in Explorer
[reactos.git] / reactos / subsys / system / explorer / globals.h
1 /*
2 * Copyright 2003 Martin Fuchs
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19
20 //
21 // Explorer clone
22 //
23 // globals.h
24 //
25 // Martin Fuchs, 23.07.2003
26 //
27
28
29 /// structure containing global variable of Explorer
30 extern struct ExplorerGlobals
31 {
32 ExplorerGlobals();
33
34 HINSTANCE _hInstance;
35 ATOM _hframeClass;
36 UINT _cfStrFName;
37 HWND _hMainWnd;
38 bool _prescan_nodes;
39 bool _desktop_mode;
40
41 FILE* _log;
42
43 #ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003)
44 DWORD(STDAPICALLTYPE* _SHRestricted)(RESTRICTIONS);
45 #endif
46 } g_Globals;
47
48 #define LOG(x) if (g_Globals._log) _ftprintf(g_Globals._log, TEXT("%s\n"), (LPCTSTR)(x));
49
50
51 /// convenient loading of string resources
52 struct ResString : public String
53 {
54 ResString(UINT nid);
55 };
56
57 /// convenient loading of standard (32x32) icon resources
58 struct ResIcon
59 {
60 ResIcon(UINT nid);
61
62 operator HICON() const {return _hIcon;}
63
64 protected:
65 HICON _hIcon;
66 };
67
68 /// convenient loading of small (16x16) icon resources
69 struct SmallIcon
70 {
71 SmallIcon(UINT nid);
72
73 operator HICON() const {return _hIcon;}
74
75 protected:
76 HICON _hIcon;
77 };
78
79 /// convenient loading of icon resources with specified sizes
80 struct ResIconEx
81 {
82 ResIconEx(UINT nid, int w, int h);
83
84 operator HICON() const {return _hIcon;}
85
86 protected:
87 HICON _hIcon;
88 };
89
90 /// set big and small icons out of the resources for a window
91 extern void SetWindowIcon(HWND hwnd, UINT nid);
92
93 /// convenient loading of bitmap resources
94 struct ResBitmap
95 {
96 ResBitmap(UINT nid);
97 ~ResBitmap() {DeleteObject(_hBmp);}
98
99 operator HBITMAP() const {return _hBmp;}
100
101 protected:
102 HBITMAP _hBmp;
103 };