Skip to content

Commit

Permalink
* The Shell.. for a long time we dreamed of having a compatible, prop…
Browse files Browse the repository at this point in the history
…erly working rewrite, but it's easier said than done. Over the years this effort has been split into tasks, and this branch was the biggest overall. Now it's time to merge it back to trunk!

* This merge is also a chance to thank every single person involved directly and indirectly in this epic work, among them: Martin Fuchs for ReactOS explorer which we are respectfully retiring now, as it served the project so well over all these years. Thomas Bluemel (Thomas Weidenmueller aka w3seek) for his brave work on the shell, mainly his explorer_new. Andrew Hill for advancing the shell bringup with some impressive work. David Quintana, Giannis Adamopoulos and Huw Campbell for working as a solid team on making this branch a huge success, allowing the shell rewrite dream to finally become a reality. Again, thank you all!
* Merging this branch is not the end.. it's the beginning of some serious bug fixing based hopefully on the Community's continuous feedback.
* Finally, here are *some* of the highlights of this branch (simply put):

[BROWSEUI] Halfplement the address bar. Mostly implement the Favorites menu. Implement handling most hotkeys that should be handled by CShellBrowser. Fix various bugs.

[EXPLORER_NEW] Convert to C++ and use several wtl-like classes to simplify it. Fix several bugs and implement misc missing features.

[FILEBROWSER] A small exe file that opens a new file browser window in its own process. Tested to work in windows. It can be used to test our browseui.dll in windows.

[FONTS] A new marlett font.

[MSGINA] Add a proper shutdown dialog that's used when the user selects shutdown from the start menu (this is how it's done in Windows).

[RSHELL] A temporary module that hosts the implementation of the following classes needed for the shell: CMenuBand, CMenuDeskBar, CMenuSite, CMergedFolder, CStartMenu. These were implemented and tested in windows and for that reason they are still there. Should be moved in shell32 in the future.

[SHELL32] Reorganize files to isolate the ones that are not yet forked from wine. Fix various problems. Simplify the implementation of some shell folders. Implement filling in the file menu in the file browser.

[STOBJECT] A shell extension responsible for misc taskbar notification icons. So far only the sound icon is implemented. Adding this is necessary as the old explorer had the sound icon built in and deprecating it needs a proper solution for these notification icons.

[WIN32K] Fix several bugs that prevented the new start menu (that was implemented and tested in Windows) from functioning properly in ReactOS, mostly due to focus issues. Fix several shell notifications to behave more like in Windows.

* Tonight! We shall feast!
* And tomorrow the US guys shall feast again, on turkey! :p

CORE-7330

svn path=/trunk/; revision=65496
  • Loading branch information
AmineKhaldi committed Nov 26, 2014
2 parents d006975 + 0b09ff9 commit 5c1a810
Show file tree
Hide file tree
Showing 256 changed files with 34,308 additions and 21,747 deletions.
2 changes: 2 additions & 0 deletions reactos/base/shell/CMakeLists.txt
Expand Up @@ -2,3 +2,5 @@
add_subdirectory(cmd)
add_subdirectory(explorer)
add_subdirectory(explorer-new)
add_subdirectory(filebrowser)
add_subdirectory(rshell)
46 changes: 27 additions & 19 deletions reactos/base/shell/explorer-new/CMakeLists.txt
@@ -1,24 +1,32 @@
PROJECT(SHELL)

add_definitions(-DWIN32)
set_cpp(WITH_RUNTIME)

include_directories(${REACTOS_SOURCE_DIR}/lib/atl)

list(APPEND SOURCE
desktop.c
dragdrop.c
explorer.c
settings.c
startmnu.c
startup.c
taskband.c
taskswnd.c
tbsite.c
trayntfy.c
trayprop.c
traywnd.c
desktop.cpp
dragdrop.cpp
explorer.cpp
rshell.cpp
settings.cpp
shellservice.cpp
startctxmnu.cpp
startmnu.cpp
startmnusite.cpp
startup.cpp
taskband.cpp
taskswnd.cpp
tbsite.cpp
trayntfy.cpp
trayprop.cpp
traywnd.cpp
util.cpp
precomp.h)

add_executable(explorer_new ${SOURCE} explorer.rc)
target_link_libraries(explorer_new uuid)
set_module_type(explorer_new win32gui UNICODE)
add_importlibs(explorer_new advapi32 gdi32 user32 comctl32 ole32 oleaut32 shell32 shlwapi shdocvw version uxtheme msvcrt kernel32 ntdll)
add_pch(explorer_new precomp.h SOURCE)
add_cd_file(TARGET explorer_new DESTINATION reactos FOR all)
add_executable(explorer ${SOURCE} explorer.rc)
target_link_libraries(explorer uuid atlnew wine)
set_module_type(explorer win32gui UNICODE)
add_importlibs(explorer advapi32 gdi32 user32 comctl32 ole32 oleaut32 shell32 browseui shlwapi shdocvw version uxtheme msvcrt kernel32 ntdll)
add_pch(explorer precomp.h SOURCE)
add_cd_file(TARGET explorer DESTINATION reactos FOR all)
132 changes: 0 additions & 132 deletions reactos/base/shell/explorer-new/desktop.c

This file was deleted.

144 changes: 144 additions & 0 deletions reactos/base/shell/explorer-new/desktop.cpp
@@ -0,0 +1,144 @@
/*
* ReactOS Explorer
*
* Copyright 2006 - 2007 Thomas Weidenmueller <w3seek@reactos.org>
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include "precomp.h"

HANDLE WINAPI _SHCreateDesktop(IShellDesktopTray *ShellDesk);
BOOL WINAPI _SHDesktopMessageLoop(HANDLE hDesktop);

class CDesktopThread
{
HANDLE hEvent;
HANDLE hDesktop;
CComPtr<ITrayWindow> Tray;

DWORD DesktopThreadProc()
{
CComPtr<IShellDesktopTray> pSdt;
HANDLE hDesktop;
HRESULT hRet;

OleInitialize(NULL);

hRet = Tray->QueryInterface(IID_PPV_ARG(IShellDesktopTray, &pSdt));
if (!SUCCEEDED(hRet))
return 1;

hDesktop = _SHCreateDesktop(pSdt);
if (hDesktop == NULL)
return 1;

if (!SetEvent(hEvent))
{
/* Failed to notify that we initialized successfully, kill ourselves
to make the main thread wake up! */
return 1;
}

_SHDesktopMessageLoop(hDesktop);

/* FIXME: Properly rundown the main thread! */
ExitProcess(0);

return 0;
}

static DWORD CALLBACK s_DesktopThreadProc(IN OUT LPVOID lpParameter)
{
return reinterpret_cast<CDesktopThread*>(lpParameter)->DesktopThreadProc();
}

public:
CDesktopThread() :
hEvent(NULL),
hDesktop(NULL),
Tray(NULL)
{
}

HANDLE Initialize(IN OUT ITrayWindow *pTray)
{
HANDLE hThread;
HANDLE Handles[2];

Tray = pTray;

hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
if (!hEvent)
return NULL;

hThread = CreateThread(NULL, 0, s_DesktopThreadProc, (PVOID)this, 0, NULL);
if (!hThread)
{
CloseHandle(hEvent);
return NULL;
}

Handles[0] = hThread;
Handles[1] = hEvent;

for (;;)
{
DWORD WaitResult = MsgWaitForMultipleObjects(_countof(Handles), Handles, FALSE, INFINITE, QS_ALLEVENTS);
if (WaitResult == WAIT_OBJECT_0 + _countof(Handles))
{
TrayProcessMessages(Tray);
}
else if (WaitResult != WAIT_FAILED && WaitResult != WAIT_OBJECT_0)
{
break;
}
}

CloseHandle(hThread);
CloseHandle(hEvent);

return hDesktop;
}

void Destroy()
{
return;
}

} * g_pDesktopWindowInstance;

HANDLE
DesktopCreateWindow(IN OUT ITrayWindow *Tray)
{
if (!g_pDesktopWindowInstance)
{
g_pDesktopWindowInstance = new CDesktopThread();
}

if (!g_pDesktopWindowInstance)
return NULL;

return g_pDesktopWindowInstance->Initialize(Tray);
}

VOID
DesktopDestroyShellWindow(IN HANDLE hDesktop)
{
if (g_pDesktopWindowInstance)
{
g_pDesktopWindowInstance->Destroy();
}
}

0 comments on commit 5c1a810

Please sign in to comment.