flatten Entry/ShellEntry class hierarchy
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/explorer.cpp
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/explorer.h
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/globals.h
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser
.cpp
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser
.h
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp
Deleted:
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc
h.cpp
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc
h.h
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu.
cpp
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu.
h
_____
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/explorer.cpp
--- branches/lean-explorer/reactos/subsys/system/explorer/explorer.cpp
2005-12-31 15:47:15 UTC (rev 20485)
+++ branches/lean-explorer/reactos/subsys/system/explorer/explorer.cpp
2005-12-31 15:54:25 UTC (rev 20486)
@@ -86,35 +86,6 @@
}
-bool FileTypeManager::is_exe_file(LPCTSTR ext)
-{
- static const LPCTSTR s_executable_extensions[] = {
- TEXT("COM"),
- TEXT("EXE"),
- TEXT("BAT"),
- TEXT("CMD"),
- TEXT("CMM"),
- TEXT("BTM"),
- TEXT("AWK"),
- 0
- };
-
- TCHAR ext_buffer[_MAX_EXT];
- const LPCTSTR* p;
- LPCTSTR s;
- LPTSTR d;
-
- for(s=ext+1,d=ext_buffer; (*d=toupper(*s)); s++)
- ++d;
-
- for(p=s_executable_extensions; *p; p++)
- if (!lstrcmp(ext_buffer, *p))
- return true;
-
- return false;
-}
-
-
const FileTypeInfo& FileTypeManager::operator[](String ext)
{
_tcslwr((LPTSTR)ext.c_str());
@@ -149,7 +120,7 @@
return ftype;
}
-LPCTSTR FileTypeManager::set_type(Entry* entry, bool dont_hide_ext)
+LPCTSTR FileTypeManager::set_type(ShellEntry* entry, bool
dont_hide_ext)
{
LPCTSTR ext = _tcsrchr(entry->_data.cFileName, TEXT('.'));
@@ -163,9 +134,6 @@
_tcsncpy(entry->_display_name,
entry->_data.cFileName, len);
entry->_display_name[len] = TEXT('\0');
}
-
- if (is_exe_file(ext))
- entry->_data.dwFileAttributes |=
ATTRIBUTE_EXECUTABLE;
}
return ext;
_____
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp
--- branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp
2005-12-31 15:47:15 UTC (rev 20485)
+++ branches/lean-explorer/reactos/subsys/system/explorer/explorer.dsp
2005-12-31 15:54:25 UTC (rev 20486)
@@ -406,10 +406,6 @@
# End Source File
# Begin Source File
-SOURCE=.\shell\shellfs.h
-# End Source File
-# Begin Source File
-
SOURCE=.\shell\startup.c
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
_____
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/explorer.h
--- branches/lean-explorer/reactos/subsys/system/explorer/explorer.h
2005-12-31 15:47:15 UTC (rev 20485)
+++ branches/lean-explorer/reactos/subsys/system/explorer/explorer.h
2005-12-31 15:54:25 UTC (rev 20486)
@@ -34,7 +34,6 @@
#include "utility/shellclasses.h"
#include "shell/entries.h"
-#include "shell/shellfs.h"
#include "utility/window.h"
_____
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/globals.h
--- branches/lean-explorer/reactos/subsys/system/explorer/globals.h
2005-12-31 15:47:15 UTC (rev 20485)
+++ branches/lean-explorer/reactos/subsys/system/explorer/globals.h
2005-12-31 15:54:25 UTC (rev 20486)
@@ -39,9 +39,7 @@
const FileTypeInfo& operator[](String ext);
- static bool is_exe_file(LPCTSTR ext);
-
- LPCTSTR set_type(struct Entry* entry, bool dont_hide_ext=false);
+ LPCTSTR set_type(struct ShellEntry* entry, bool
dont_hide_ext=false);
};
_____
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp
---
branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp
2005-12-31 15:47:15 UTC (rev 20485)
+++
branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.cpp
2005-12-31 15:54:25 UTC (rev 20486)
@@ -30,7 +30,7 @@
// allocate and initialise a directory entry
-Entry::Entry()
+ShellEntry::ShellEntry()
{
_up = NULL;
_next = NULL;
@@ -42,9 +42,10 @@
_display_name = _data.cFileName;
}
-Entry::Entry(Entry* parent)
- : _up(parent)
+ShellEntry::ShellEntry(LPITEMIDLIST shell_path)
+ : _pidl(shell_path)
{
+ _up = NULL;
_next = NULL;
_down = NULL;
_expanded = false;
@@ -54,10 +55,51 @@
_display_name = _data.cFileName;
}
-Entry::Entry(const Entry& other)
+ShellEntry::ShellEntry(const ShellPath& shell_path)
+ : _pidl(shell_path)
{
+ _up = NULL;
_next = NULL;
_down = NULL;
+ _expanded = false;
+ _scanned = false;
+ _level = 0;
+ _icon_id = ICID_UNKNOWN;
+ _display_name = _data.cFileName;
+}
+
+
+ShellEntry::ShellEntry(ShellDirectory* parent, const ShellPath&
shell_path)
+ : _up(parent),
+ _pidl(shell_path)
+{
+ _next = NULL;
+ _down = NULL;
+ _expanded = false;
+ _scanned = false;
+ _level = 0;
+ _icon_id = ICID_UNKNOWN;
+ _display_name = _data.cFileName;
+}
+
+ShellEntry::ShellEntry(ShellDirectory* parent, LPITEMIDLIST shell_path)
+ : _up(parent),
+ _pidl(shell_path)
+{
+ _next = NULL;
+ _down = NULL;
+ _expanded = false;
+ _scanned = false;
+ _level = 0;
+ _icon_id = ICID_UNKNOWN;
+ _display_name = _data.cFileName;
+}
+
+ShellEntry::ShellEntry(const ShellEntry& other)
+ : _pidl(other._pidl)
+{
+ _next = NULL;
+ _down = NULL;
_up = NULL;
assert(!other._next);
@@ -77,7 +119,7 @@
}
// free a directory entry
-Entry::~Entry()
+ShellEntry::~ShellEntry()
{
if (_icon_id > ICID_NONE)
g_Globals._icon_cache.free_icon(_icon_id);
@@ -88,24 +130,27 @@
// read directory tree and expand to the given location
-Entry* Entry::read_tree(const void* path, SORT_ORDER sortOrder)
+ShellEntry* ShellDirectory::read_tree(const void* path, SORT_ORDER
sortOrder)
{
- CONTEXT("Entry::read_tree()");
+ CONTEXT("ShellEntry::read_tree()");
HCURSOR old_cursor = SetCursor(LoadCursor(0, IDC_WAIT));
- Entry* entry = this;
+ ShellDirectory* entry = this;
for(const void*p=path; p && entry; ) {
+ if (!(entry->_data.dwFileAttributes &
FILE_ATTRIBUTE_DIRECTORY))
+ break;
+
entry->read_directory(sortOrder);
if (entry->_down)
entry->_expanded = true;
- Entry* next_entry = entry->find_entry(p);
+ ShellEntry* next_entry = entry->find_entry(p);
p = entry->get_next_path_component(p);
- entry = next_entry;
+ entry = static_cast<ShellDirectory*>(next_entry);
}
SetCursor(old_cursor);
@@ -114,19 +159,21 @@
}
-void Entry::read_directory(SORT_ORDER sortOrder, int scan_flags)
+void ShellDirectory::read_directory(SORT_ORDER sortOrder, int
scan_flags)
{
- CONTEXT("Entry::read_directory(SORT_ORDER)");
+ CONTEXT("ShellEntry::read_directory(SORT_ORDER)");
// call into subclass
read_directory(scan_flags);
#ifndef ROSSHELL
if (g_Globals._prescan_nodes) { //@todo _prescan_nodes should
not be used for reading the start menu.
- for(Entry*entry=_down; entry; entry=entry->_next)
+ for(ShellEntry*entry=_down; entry; entry=entry->_next)
if (entry->_data.dwFileAttributes &
FILE_ATTRIBUTE_DIRECTORY) {
- entry->read_directory(scan_flags);
- entry->sort_directory(sortOrder);
+ ShellDirectory* dir =
static_cast<ShellDirectory*>(entry);
+
+ dir->read_directory(scan_flags);
+ dir->sort_directory(sortOrder);
}
}
#endif
@@ -170,8 +217,8 @@
static int compareName(const void* arg1, const void* arg2)
{
- const WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data;
- const WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data;
+ const WIN32_FIND_DATA* fd1 = &(*(ShellEntry**)arg1)->_data;
+ const WIN32_FIND_DATA* fd2 = &(*(ShellEntry**)arg2)->_data;
int cmp = compareType(fd1, fd2);
if (cmp)
@@ -182,8 +229,8 @@
static int compareExt(const void* arg1, const void* arg2)
{
- const WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data;
- const WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data;
+ const WIN32_FIND_DATA* fd1 = &(*(ShellEntry**)arg1)->_data;
+ const WIN32_FIND_DATA* fd2 = &(*(ShellEntry**)arg2)->_data;
const TCHAR *name1, *name2, *ext1, *ext2;
int cmp = compareType(fd1, fd2);
@@ -215,8 +262,8 @@
static int compareSize(const void* arg1, const void* arg2)
{
- WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data;
- WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data;
+ WIN32_FIND_DATA* fd1 = &(*(ShellEntry**)arg1)->_data;
+ WIN32_FIND_DATA* fd2 = &(*(ShellEntry**)arg2)->_data;
int cmp = compareType(fd1, fd2);
if (cmp)
@@ -236,8 +283,8 @@
static int compareDate(const void* arg1, const void* arg2)
{
- WIN32_FIND_DATA* fd1 = &(*(Entry**)arg1)->_data;
- WIN32_FIND_DATA* fd2 = &(*(Entry**)arg2)->_data;
+ WIN32_FIND_DATA* fd1 = &(*(ShellEntry**)arg1)->_data;
+ WIN32_FIND_DATA* fd2 = &(*(ShellEntry**)arg2)->_data;
int cmp = compareType(fd1, fd2);
if (cmp)
@@ -256,11 +303,11 @@
};
-void Entry::sort_directory(SORT_ORDER sortOrder)
+void ShellDirectory::sort_directory(SORT_ORDER sortOrder)
{
if (sortOrder != SORT_NONE) {
- Entry* entry = _down;
- Entry** array, **p;
+ ShellEntry* entry = _down;
+ ShellEntry** array, **p;
int len;
len = 0;
@@ -268,7 +315,7 @@
++len;
if (len) {
- array = (Entry**) alloca(len*sizeof(Entry*));
+ array = (ShellEntry**)
alloca(len*sizeof(ShellEntry*));
p = array;
for(entry=_down; entry; entry=entry->_next)
@@ -288,9 +335,9 @@
}
-void Entry::smart_scan(int scan_flags)
+void ShellDirectory::smart_scan(int scan_flags)
{
- CONTEXT("Entry::smart_scan()");
+ CONTEXT("ShellEntry::smart_scan()");
if (!_scanned) {
free_subentries();
@@ -299,7 +346,7 @@
}
-int Entry::extract_icon()
+int ShellEntry::extract_icon()
{
TCHAR path[MAX_PATH];
@@ -367,7 +414,7 @@
return icon_id;
}
-int Entry::safe_extract_icon()
+int ShellEntry::safe_extract_icon()
{
try {
return extract_icon();
@@ -379,82 +426,10 @@
}
-BOOL Entry::launch_entry(HWND hwnd, UINT nCmdShow)
-{
- TCHAR cmd[MAX_PATH];
-
- if (!get_path(cmd))
- return FALSE;
-
- // add path to the recent file list
- SHAddToRecentDocs(SHARD_PATH, cmd);
-
- // start program, open document...
- return launch_file(hwnd, cmd, nCmdShow);
-}
-
-
-HRESULT Entry::GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID* ppvOut)
-{
- TCHAR path[MAX_PATH];
-/*
- if (!get_path(path))
- return E_FAIL;
-
- ShellPath shell_path(path);
-
- IShellFolder* pFolder;
- LPCITEMIDLIST pidl_last = NULL;
-
- static DynamicFct<HRESULT(WINAPI*)(LPCITEMIDLIST, REFIID,
LPVOID*, LPCITEMIDLIST*)> SHBindToParent(TEXT("SHELL32"),
"SHBindToParent");
-
- if (!SHBindToParent)
- return E_NOTIMPL;
-
- HRESULT hr = (*SHBindToParent)(shell_path, IID_IShellFolder,
(LPVOID*)&pFolder, &pidl_last);
- if (FAILED(hr))
- return hr;
-
- ShellFolder shell_folder(pFolder);
-
- shell_folder->Release();
-
- return shell_folder->GetUIObjectOf(hWnd, 1, &pidl_last, riid,
NULL, ppvOut);
-*/
- if (!_up)
- return E_INVALIDARG;
-
- if (!_up->get_path(path))
- return E_FAIL;
-
- ShellPath shell_path(path);
- ShellFolder shell_folder(shell_path);
-
-#ifdef UNICODE
- LPWSTR wname = _data.cFileName;
-#else
- WCHAR wname[MAX_PATH];
- MultiByteToWideChar(CP_ACP, 0, _data.cFileName, -1, wname,
MAX_PATH);
-#endif
-
- LPITEMIDLIST pidl_last = NULL;
- HRESULT hr = shell_folder->ParseDisplayName(hWnd, NULL, wname,
NULL, &pidl_last, NULL);
-
- if (FAILED(hr))
- return hr;
-
- hr = shell_folder->GetUIObjectOf(hWnd, 1,
(LPCITEMIDLIST*)&pidl_last, riid, NULL, ppvOut);
-
- ShellMalloc()->Free((void*)pidl_last);
-
- return hr;
-}
-
-
// recursively free all child entries
-void Entry::free_subentries()
+void ShellEntry::free_subentries()
{
- Entry *entry, *next=_down;
+ ShellEntry *entry, *next=_down;
if (next) {
_down = 0;
_____
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h
---
branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h
2005-12-31 15:47:15 UTC (rev 20485)
+++
branches/lean-explorer/reactos/subsys/system/explorer/shell/entries.h
2005-12-31 15:54:25 UTC (rev 20486)
@@ -1,5 +1,5 @@
/*
- * Copyright 2003, 2004 Martin Fuchs
+ * Copyright 2003, 2004, 2005 Martin Fuchs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -40,28 +40,32 @@
};
#ifndef ATTRIBUTE_SYMBOLIC_LINK
-#define ATTRIBUTE_LONGNAME 0x08000000
-#define ATTRIBUTE_VOLNAME 0x10000000
-#define ATTRIBUTE_ERASED 0x20000000
#define ATTRIBUTE_SYMBOLIC_LINK 0x40000000
#define ATTRIBUTE_EXECUTABLE 0x80000000
#endif
- /// base of all file and directory entries
-struct Entry
+struct ShellDirectory;
+
+
+ /// base of all file entries
+struct ShellEntry
{
+ ShellEntry();
+ ShellEntry(const ShellEntry& other);
+ ShellEntry(ShellDirectory* parent, LPITEMIDLIST shell_path);
+ ShellEntry(ShellDirectory* parent, const ShellPath& shell_path);
+
protected:
- Entry();
- Entry(Entry* parent);
- Entry(const Entry&);
+ ShellEntry(LPITEMIDLIST shell_path);
+ ShellEntry(const ShellPath& shell_path);
public:
- virtual ~Entry();
+ virtual ~ShellEntry();
- Entry* _next;
- Entry* _down;
- Entry* _up;
+ ShellEntry* _next;
+ ShellEntry* _down;
+ ShellDirectory* _up;
bool _expanded;
bool _scanned;
@@ -74,22 +78,19 @@
int /*ICON_ID*/ _icon_id;
+ ShellPath _pidl; // parent relative PIDL
+
void free_subentries();
- void read_directory(SORT_ORDER sortOrder, int scan_flags=0);
- Entry* read_tree(const void* path, SORT_ORDER sortOrder);
- void sort_directory(SORT_ORDER sortOrder);
- void smart_scan(int scan_flags=0);
int extract_icon();
int safe_extract_icon();
- virtual void read_directory(int scan_flags=0) {}
- virtual const void* get_next_path_component(const void*) const
{return NULL;}
- virtual Entry* find_entry(const void*) {return NULL;}
- virtual bool get_path(PTSTR path) const = 0;
- virtual ShellPath create_absolute_pidl() const {return
(LPCITEMIDLIST)NULL;}
- virtual HRESULT GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID*
ppvOut);
- virtual BOOL launch_entry(HWND hwnd, UINT
nCmdShow=SW_SHOWNORMAL);
+ virtual bool get_path(PTSTR path) const;
+ ShellPath create_absolute_pidl() const;
+ BOOL launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL);
+ HRESULT GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID* ppvOut);
+
+ IShellFolder* get_parent_folder() const;
};
@@ -103,12 +104,92 @@
};
+ /// shell folder entry
+struct ShellDirectory : public ShellEntry, public Directory
+{
+ ShellDirectory(ShellFolder& root_folder, const ShellPath&
shell_path, HWND hwnd)
+ : ShellEntry(shell_path),
+ _folder(root_folder, shell_path),
+ _hwnd(hwnd)
+ {
+ CONTEXT("ShellDirectory::ShellDirectory()");
+
+ lstrcpy(_data.cFileName,
root_folder.get_name(shell_path, SHGDN_FORPARSING));
+ _data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
+ _shell_attribs = SFGAO_FOLDER;
+
+ ShellFolder subfolder(root_folder, shell_path);
+ IShellFolder* pFolder = subfolder;
+ pFolder->AddRef();
+ _path = pFolder;
+ }
+
+ explicit ShellDirectory(ShellDirectory* parent, LPITEMIDLIST
shell_path, HWND hwnd)
+ : ShellEntry(parent, shell_path),
+ _folder(parent->_folder, shell_path),
+ _hwnd(hwnd)
+ {
+ /* not neccessary - the caller will fill the info
+ lstrcpy(_data.cFileName, _folder.get_name(shell_path));
+ _data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
+ _shell_attribs = SFGAO_FOLDER; */
+
+ _folder->AddRef();
+ _path = _folder;
+ }
+
+ ShellDirectory(const ShellDirectory& other)
+ : ShellEntry(other),
+ Directory(other),
+ _folder(other._folder),
+ _hwnd(other._hwnd)
+ {
+ IShellFolder* pFolder = (IShellFolder*)_path;
+ pFolder->AddRef();
+ }
+
+ ~ShellDirectory()
+ {
+ IShellFolder* pFolder = (IShellFolder*)_path;
+ _path = NULL;
+ pFolder->Release();
+ }
+
+ ShellEntry* read_tree(const void* path, SORT_ORDER
sortOrder);
+ void read_directory(SORT_ORDER sortOrder, int scan_flags=0);
+ void read_directory(int scan_flags=0);
+ void sort_directory(SORT_ORDER sortOrder);
+ void smart_scan(int scan_flags=0);
+ virtual const void* get_next_path_component(const void*) const;
+ virtual ShellEntry* find_entry(const void* p);
+
+ virtual bool get_path(PTSTR path) const;
+
+ int extract_icons();
+
+ ShellFolder _folder;
+ HWND _hwnd;
+
+protected:
+ void fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs,
WIN32_FIND_DATA*, bool do_access=true);
+};
+
+
+inline IShellFolder* ShellEntry::get_parent_folder() const
+{
+ if (_up)
+ return static_cast<ShellDirectory*>(_up)->_folder;
+ else
+ return GetDesktopFolder();
+}
+
+
/// root entry for file system trees
struct Root {
Root();
~Root();
- Entry* _entry;
+ ShellDirectory* _entry;
TCHAR _path[MAX_PATH];
TCHAR _volname[_MAX_FNAME];
TCHAR _fs[_MAX_DIR];
_____
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser
.cpp
---
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser
.cpp 2005-12-31 15:47:15 UTC (rev 20485)
+++
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser
.cpp 2005-12-31 15:54:25 UTC (rev 20486)
@@ -201,9 +201,9 @@
LPARAM itemData = TreeView_GetItemData(hwndTreeView, hItem);
if (itemData) {
- Entry* entry = (Entry*)itemData;
+ ShellEntry* entry = (ShellEntry*)itemData;
- ShellDirectory* dir =
static_cast<ShellDirectory*>(entry->_up);
+ ShellDirectory* dir = entry->_up;
ShellFolder folder = dir? dir->_folder:
GetDesktopFolder();
LPCITEMIDLIST pidl =
static_cast<ShellEntry*>(entry)->_pidl;
@@ -238,7 +238,7 @@
}
}
-int ShellBrowserChild::get_entry_image(Entry* entry, LPCITEMIDLIST
pidl, int shgfi_flags, ImageMap& cache)
+int ShellBrowserChild::get_entry_image(ShellEntry* entry, LPCITEMIDLIST
pidl, int shgfi_flags, ImageMap& cache)
{
SHFILEINFO sfi;
int idx = -1;
@@ -296,7 +296,7 @@
}
}
-int ShellBrowserChild::InsertSubitems(HTREEITEM hParentItem, Entry*
entry)
+int ShellBrowserChild::InsertSubitems(HTREEITEM hParentItem,
ShellDirectory* dir)
{
CONTEXT("ShellBrowserChild::InsertSubitems()");
@@ -307,15 +307,21 @@
SendMessage(_left_hwnd, WM_SETREDRAW, FALSE, 0);
try {
- entry->smart_scan();
+ dir->smart_scan();
} catch(COMException& e) {
HandleException(e, g_Globals._hMainWnd);
}
+ // remove old children items
+ for(HTREEITEM hchild,hnext=TreeView_GetChild(_left_hwnd,
hParentItem); hchild=hnext; ) {
+ hnext = TreeView_GetNextSibling(_left_hwnd, hchild);
+ TreeView_DeleteItem(_left_hwnd, hchild);
+ }
+
TV_ITEM tvItem;
TV_INSERTSTRUCT tvInsert;
- for(entry=entry->_down; entry; entry=entry->_next) {
+ for(ShellEntry*entry=dir->_down; entry; entry=entry->_next) {
#ifndef _LEFT_FILES
if (entry->_data.dwFileAttributes &
FILE_ATTRIBUTE_DIRECTORY)
#endif
@@ -354,7 +360,7 @@
CONTEXT("ShellBrowserChild::OnTreeItemSelected()");
_last_sel = pnmtv->itemNew.hItem;
- Entry* entry = (Entry*)pnmtv->itemNew.lParam;
+ ShellDirectory* entry = (ShellDirectory*)pnmtv->itemNew.lParam;
jump_to(entry);
}
@@ -583,7 +589,7 @@
UINT firstOffset =
pida->aoffset[1];
LPITEMIDLIST pidl =
(LPITEMIDLIST)((LPBYTE)pida+firstOffset);
- Entry* entry =
parent->find_entry(pidl);
+ ShellEntry* entry =
parent->find_entry(pidl);
if (entry &&
(entry->_data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY))
if
(expand_folder(static_cast<ShellDirectory*>(entry)))
@@ -639,10 +645,10 @@
void ShellBrowserChild::jump_to(LPCITEMIDLIST pidl)
{
- Entry* entry = NULL;
+ ShellDirectory* entry = NULL;
if (!_cur_dir)
- _cur_dir = static_cast<ShellDirectory*>(_root._entry);
+ _cur_dir = _root._entry;
if (_cur_dir) {
static DynamicFct<LPITEMIDLIST(WINAPI*)(LPCITEMIDLIST,
LPCITEMIDLIST)> ILFindChild(TEXT("SHELL32"), 24);
@@ -655,7 +661,7 @@
_cur_dir->smart_scan();
- entry =
_cur_dir->find_entry(child_pidl);
+ entry =
static_cast<ShellDirectory*>(_cur_dir->find_entry(child_pidl));
if (!entry)
break;
@@ -664,7 +670,7 @@
} else {
_cur_dir->smart_scan();
- entry = _cur_dir->find_entry(pidl); // This
is not correct in the common case, but works on the desktop level.
+ entry =
static_cast<ShellDirectory*>(_cur_dir->find_entry(pidl)); // This
is not correct in the common case, but works on the desktop level.
if (entry)
jump_to(entry);
@@ -676,10 +682,10 @@
UpdateFolderView(ShellFolder(pidl));
}
-void ShellBrowserChild::jump_to(Entry* entry)
+void ShellBrowserChild::jump_to(ShellDirectory* entry)
{
IShellFolder* folder;
- ShellDirectory* se = static_cast<ShellDirectory*>(entry);
+ ShellDirectory* se = entry;
if (se->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
folder = static_cast<ShellDirectory*>(se)->_folder;
_____
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser
.h
---
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser
.h 2005-12-31 15:47:15 UTC (rev 20485)
+++
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellbrowser
.h 2005-12-31 15:54:25 UTC (rev 20486)
@@ -102,8 +102,6 @@
return E_NOTIMPL;
}
- const Root& get_root() const {return _root;}
-
protected:
HWND _hwnd;
HWND _left_hwnd;
@@ -128,7 +126,7 @@
LRESULT Init();
void InitializeTree();
- int InsertSubitems(HTREEITEM hParentItem, Entry*
entry);
+ int InsertSubitems(HTREEITEM hParentItem,
ShellDirectory* dir);
bool InitDragDrop();
HRESULT OnDefaultCommand(LPIDA pida);
@@ -152,16 +150,16 @@
void jump_to(LPCTSTR path);
void jump_to(LPCITEMIDLIST pidl);
- void jump_to(Entry* entry);
+ void jump_to(ShellDirectory* entry);
protected:
ShellDirectory* _cur_dir;
CtxMenuInterfaces& _cm_ifs;
- typedef map<Entry*, int> ImageMap;
+ typedef map<ShellEntry*, int> ImageMap;
ImageMap _image_map;
ImageMap _image_map_open;
- int get_entry_image(Entry* entry, LPCITEMIDLIST
pidl, int shgfi_flags, ImageMap& cache);
+ int get_entry_image(ShellEntry* entry, LPCITEMIDLIST
pidl, int shgfi_flags, ImageMap& cache);
void invalidate_cache();
};
_____
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp
---
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp
2005-12-31 15:47:15 UTC (rev 20485)
+++
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.cpp
2005-12-31 15:54:25 UTC (rev 20486)
@@ -195,8 +195,8 @@
int level = _level + 1;
- Entry* first_entry = NULL;
- Entry* last = NULL;
+ ShellEntry* first_entry = NULL;
+ ShellEntry* last = NULL;
/*if (_folder.empty())
return;*/
@@ -251,7 +251,7 @@
fill_w32fdata_shell(pidls[n], attribs, &w32fd,
!(scan_flags&SCAN_DONT_ACCESS)&&!removeable);
try {
- Entry* entry = NULL; // eliminate
useless GCC warning by initializing entry
+ ShellEntry* entry = NULL; //
eliminate useless GCC warning by initializing entry
if (w32fd.dwFileAttributes &
FILE_ATTRIBUTE_DIRECTORY)
entry = new ShellDirectory(this,
pidls[n], _hwnd);
@@ -319,11 +319,11 @@
return pidl;
}
-Entry* ShellDirectory::find_entry(const void* p)
+ShellEntry* ShellDirectory::find_entry(const void* p)
{
LPITEMIDLIST pidl = (LPITEMIDLIST) p;
- for(Entry*entry=_down; entry; entry=entry->_next) {
+ for(ShellEntry*entry=_down; entry; entry=entry->_next) {
ShellEntry* se = static_cast<ShellEntry*>(entry);
if (se->_pidl && se->_pidl->mkid.cb==pidl->mkid.cb &&
!memcmp(se->_pidl, pidl, se->_pidl->mkid.cb))
@@ -337,7 +337,7 @@
{
int cnt = 0;
- for(Entry*entry=_down; entry; entry=entry->_next)
+ for(ShellEntry*entry=_down; entry; entry=entry->_next)
if (entry->_icon_id == ICID_UNKNOWN) {
entry->_icon_id = entry->extract_icon();
_____
Deleted:
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h
---
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h
2005-12-31 15:47:15 UTC (rev 20485)
+++
branches/lean-explorer/reactos/subsys/system/explorer/shell/shellfs.h
2005-12-31 15:54:25 UTC (rev 20486)
@@ -1,123 +0,0 @@
-/*
- * 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
- * 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
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
- */
-
-
- //
- // Explorer clone, lean version
- //
- // shellfs.h
- //
- // Martin Fuchs, 23.07.2003
- //
-
-
- /// shell file/directory entry
-struct ShellEntry : public Entry
-{
- ShellEntry(Entry* parent, LPITEMIDLIST shell_path) :
Entry(parent), _pidl(shell_path) {}
- ShellEntry(Entry* parent, const ShellPath& shell_path) :
Entry(parent), _pidl(shell_path) {}
-
- virtual bool get_path(PTSTR path) const;
- virtual ShellPath create_absolute_pidl() const;
- virtual BOOL launch_entry(HWND hwnd, UINT
nCmdShow=SW_SHOWNORMAL);
- virtual HRESULT GetUIObjectOf(HWND hWnd, REFIID riid, LPVOID*
ppvOut);
-
- IShellFolder* get_parent_folder() const;
-
- ShellPath _pidl; // parent relative PIDL
-
-protected:
- ShellEntry(LPITEMIDLIST shell_path) : _pidl(shell_path) {}
- ShellEntry(const ShellPath& shell_path) : _pidl(shell_path) {}
-};
-
-
- /// shell folder entry
-struct ShellDirectory : public ShellEntry, public Directory
-{
- ShellDirectory(ShellFolder& root_folder, const ShellPath&
shell_path, HWND hwnd)
- : ShellEntry(shell_path),
- _folder(root_folder, shell_path),
- _hwnd(hwnd)
- {
- CONTEXT("ShellDirectory::ShellDirectory()");
-
- lstrcpy(_data.cFileName,
root_folder.get_name(shell_path, SHGDN_FORPARSING));
- _data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
- _shell_attribs = SFGAO_FOLDER;
-
- ShellFolder subfolder(root_folder, shell_path);
- IShellFolder* pFolder = subfolder;
- pFolder->AddRef();
- _path = pFolder;
- }
-
- explicit ShellDirectory(ShellDirectory* parent, LPITEMIDLIST
shell_path, HWND hwnd)
- : ShellEntry(parent, shell_path),
- _folder(parent->_folder, shell_path),
- _hwnd(hwnd)
- {
- /* not neccessary - the caller will fill the info
- lstrcpy(_data.cFileName, _folder.get_name(shell_path));
- _data.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY;
- _shell_attribs = SFGAO_FOLDER; */
-
- _folder->AddRef();
- _path = _folder;
- }
-
- ShellDirectory(const ShellDirectory& other)
- : ShellEntry(other),
- Directory(other),
- _folder(other._folder),
- _hwnd(other._hwnd)
- {
- IShellFolder* pFolder = (IShellFolder*)_path;
- pFolder->AddRef();
- }
-
- ~ShellDirectory()
- {
- IShellFolder* pFolder = (IShellFolder*)_path;
- _path = NULL;
- pFolder->Release();
- }
-
- virtual void read_directory(int scan_flags=0);
- virtual const void* get_next_path_component(const void*) const;
- virtual Entry* find_entry(const void* p);
-
- virtual bool get_path(PTSTR path) const;
-
- int extract_icons();
-
- ShellFolder _folder;
- HWND _hwnd;
-
-protected:
- void fill_w32fdata_shell(LPCITEMIDLIST pidl, SFGAOF attribs,
WIN32_FIND_DATA*, bool do_access=true);
-};
-
-
-inline IShellFolder* ShellEntry::get_parent_folder() const
-{
- if (_up)
- return static_cast<ShellDirectory*>(_up)->_folder;
- else
- return GetDesktopFolder();
-}
_____
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc
h.cpp
---
branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc
h.cpp 2005-12-31 15:47:15 UTC (rev 20485)
+++
branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc
h.cpp 2005-12-31 15:54:25 UTC (rev 20486)
@@ -149,7 +149,7 @@
SendMessage(_hwnd, TB_INSERTBUTTON, INT_MAX, (LPARAM)&sep);
- for(Entry*entry=_dir->_down; entry; entry=entry->_next) {
+ for(ShellEntry*entry=_dir->_down; entry; entry=entry->_next) {
// hide files like "desktop.ini"
if (entry->_data.dwFileAttributes &
FILE_ATTRIBUTE_HIDDEN)
continue;
@@ -168,7 +168,7 @@
SendMessage(GetParent(_hwnd), PM_RESIZE_CHILDREN, 0, 0);
}
-void QuickLaunchBar::AddButton(int id, HBITMAP hbmp, LPCTSTR name,
Entry* entry, int flags)
+void QuickLaunchBar::AddButton(int id, HBITMAP hbmp, LPCTSTR name,
ShellEntry* entry, int flags)
{
TBADDBITMAP ab = {0, (UINT_PTR)hbmp};
int bmp_idx = SendMessage(_hwnd, TB_ADDBITMAP, 1, (LPARAM)&ab);
_____
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc
h.h
---
branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc
h.h 2005-12-31 15:47:15 UTC (rev 20485)
+++
branches/lean-explorer/reactos/subsys/system/explorer/taskbar/quicklaunc
h.h 2005-12-31 15:54:25 UTC (rev 20486)
@@ -47,7 +47,7 @@
HBITMAP _hbmp;
String _title;
- Entry* _entry;
+ ShellEntry* _entry;
};
/// map for managing the task bar buttons
@@ -80,6 +80,6 @@
int _size;
void AddShortcuts();
- void AddButton(int id, HBITMAP hbmp, LPCTSTR name, Entry*
entry, int flags=TBSTATE_ENABLED);
+ void AddButton(int id, HBITMAP hbmp, LPCTSTR name,
ShellEntry* entry, int flags=TBSTATE_ENABLED);
void UpdateDesktopButtons(int desktop_idx);
};
_____
Modified:
branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu.
cpp
---
branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu.
cpp 2005-12-31 15:47:15 UTC (rev 20485)
+++
branches/lean-explorer/reactos/subsys/system/explorer/taskbar/startmenu.
cpp 2005-12-31 15:54:25 UTC (rev 20486)
@@ -254,7 +254,7 @@
*ignore_name = '\0';
[truncated at 1000 lines; 90 more skipped]