merge ROS Shell without integrated explorer part into trunk
[reactos.git] / reactos / subsys / system / explorer / globals.h
index 914e0ea..e28a9c3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003 Martin Fuchs
+ * Copyright 2003, 2004 Martin Fuchs
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  //
 
 
+#include "utility/xmlstorage.h"
+
+using namespace XMLStorage;
+
+#include "taskbar/favorites.h"
+
+
  /// management of file types
 struct FileTypeInfo {
        String  _classname;
@@ -73,6 +80,7 @@ enum ICON_ID {
        ICID_NETWORK,
        ICID_COMPUTER,
        ICID_LOGOFF,
+       ICID_BOOKMARK,
 
        ICID_DYNAMIC
 };
@@ -87,6 +95,7 @@ struct Icon {
 
        void    draw(HDC hdc, int x, int y, int cx, int cy, COLORREF bk_color, HBRUSH bk_brush) const;
        HBITMAP create_bitmap(COLORREF bk_color, HBRUSH hbrBkgnd, HDC hdc_wnd) const;
+       int             add_to_imagelist(HIMAGELIST himl, HDC hdc_wnd, COLORREF bk_color=GetSysColor(COLOR_WINDOW), HBRUSH bk_brush=GetSysColorBrush(COLOR_WINDOW)) const;
 
        int             get_sysiml_idx() const {return _itype==IT_SYSCACHE? _sys_idx: -1;}
 
@@ -141,6 +150,13 @@ protected:
  /// create a bitmap from an icon
 extern HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd);
 
+ /// add icon with alpha channel to imagelist using the specified background color
+extern int ImageList_AddAlphaIcon(HIMAGELIST himl, HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd);
+
+ /// retrieve icon from window
+extern HICON get_window_icon_small(HWND hwnd);
+extern HICON get_window_icon_big(HWND hwnd, bool allow_from_class=true);
+
 
  /// desktop management
 #ifdef _USE_HDESK
@@ -177,9 +193,13 @@ protected:
 
 #else
 
+typedef pair<HWND, DWORD> MinimizeStruct;
+
 struct Desktop
 {
        set<HWND> _windows;
+       WindowHandle _hwndForeground;
+       list<MinimizeStruct> _minimized;
 };
 typedef Desktop DesktopRef;
 
@@ -191,11 +211,15 @@ typedef Desktop DesktopRef;
 struct Desktops : public vector<DesktopRef>
 {
        Desktops();
+       ~Desktops();
 
        void    init();
        void    SwitchToDesktop(int idx);
+       void    ToggleMinimize();
 
+#ifdef _USE_HDESK
        DesktopRef& get_current_Desktop() {return (*this)[_current_desktop];}
+#endif
 
        int             _current_desktop;
 };
@@ -206,14 +230,23 @@ extern struct ExplorerGlobals
 {
        ExplorerGlobals();
 
-       void            init(HINSTANCE hInstance);
+       void    init(HINSTANCE hInstance);
+
+       void    read_persistent();
+       void    write_persistent();
+
+       XMLPos  get_cfg();
+       XMLPos  get_cfg(const char* path);
 
        HINSTANCE       _hInstance;
-       ATOM            _hframeClass;
        UINT            _cfStrFName;
+
+#ifndef ROSSHELL
+       ATOM            _hframeClass;
        HWND            _hMainWnd;
-       bool            _prescan_nodes;
        bool            _desktop_mode;
+       bool            _prescan_nodes;
+#endif
 
        FILE*           _log;
 
@@ -226,8 +259,16 @@ extern struct ExplorerGlobals
 
        HWND            _hwndDesktopBar;
        HWND            _hwndShellView;
+       HWND            _hwndDesktop;
 
        Desktops        _desktops;
+
+       XMLDoc          _cfg;
+       String          _cfg_dir;
+       String          _cfg_path;
+
+       Favorites       _favorites;
+       String          _favorites_path;
 } g_Globals;