[BROWSEUI] -Move the following classes to a new static lib called shellbars: CBandSite, CBandSiteMenu, CBaseBar, CSHEnumClassesOfCategories.

- This will be linked to rshell in order to implement support for additional toolbars in the taskbar as well as floating toolbars.
- In the future more classes will be added in this static lib including: CISFBand (which implements a dockable toolbar that shows the contents of a shell folder), CQuickLinks (a special CISFBand), CDeskBarApp (a special CBaseBar that implements the floating host for toolbars) and perhaps more.

svn path=/trunk/; revision=74292
This commit is contained in:
Giannis Adamopoulos 2017-04-09 13:51:39 +00:00
parent 35eb4001b2
commit 026c7235f9
12 changed files with 185 additions and 118 deletions

View file

@ -1,5 +1,7 @@
PROJECT(SHELL)
add_subdirectory(shellbars)
set_cpp(WITH_RUNTIME)
include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
@ -11,9 +13,6 @@ list(APPEND SOURCE
addressband.cpp
addresseditbox.cpp
bandproxy.cpp
bandsite.cpp
bandsitemenu.cpp
basebar.cpp
basebarsite.cpp
brandband.cpp
browseui.cpp
@ -31,7 +30,6 @@ list(APPEND SOURCE
travellog.cpp
utility.cpp
CProgressDialog.cpp
comcat.cpp
precomp.h)
add_library(browseui SHARED
@ -41,7 +39,7 @@ add_library(browseui SHARED
${CMAKE_CURRENT_BINARY_DIR}/browseui.def)
set_module_type(browseui win32dll UNICODE)
target_link_libraries(browseui atlnew uuid wine)
target_link_libraries(browseui shellbars atlnew uuid wine)
add_importlibs(browseui shlwapi shell32 comctl32 gdi32 ole32 oleaut32 user32 advapi32 msvcrt kernel32 ntdll)
add_pch(browseui precomp.h SOURCE)
add_cd_file(TARGET browseui DESTINATION reactos/system32 FOR all)

View file

@ -20,6 +20,106 @@
#include "precomp.h"
HRESULT CAddressBand_CreateInstance(REFIID riid, void **ppv)
{
#if USE_CUSTOM_ADDRESSBAND
return ShellObjectCreator<CAddressBand>(riid, ppv);
#else
return CoCreateInstance(CLSID_SH_AddressBand, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IUnknown, toolsBar));
#endif
}
HRESULT CAddressEditBox_CreateInstance(REFIID riid, void **ppv)
{
#if USE_CUSTOM_ADDRESSEDITBOX
return ShellObjectCreator<CAddressEditBox>(riid, ppv);
#else
return CoCreateInstance(CLSID_AddressEditBox, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(riid, &ppv));
#endif
}
HRESULT CBandProxy_CreateInstance(REFIID riid, void **ppv)
{
#if USE_CUSTOM_BANDPROXY
return ShellObjectCreator<CBandProxy>(riid, ppv);
#else
return CoCreateInstance(CLSID_BandProxy, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(riid, &ppv));
#endif
}
HRESULT CBrandBand_CreateInstance(REFIID riid, void **ppv)
{
#if USE_CUSTOM_BRANDBAND
return ShellObjectCreator<CBrandBand>(riid, ppv);
#else
return CoCreateInstance(CLSID_BrandBand, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
#endif
}
HRESULT CExplorerBand_CreateInstance(REFIID riid, LPVOID *ppv)
{
#if USE_CUSTOM_EXPLORERBAND
return ShellObjectCreator<CExplorerBand>(riid, ppv);
#else
return CoCreateInstance(CLSID_ExplorerBand, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
#endif
}
HRESULT CInternetToolbar_CreateInstance(REFIID riid, void **ppv)
{
#if USE_CUSTOM_INTERNETTOOLBAR
return ShellObjectCreator<CInternetToolbar>(riid, ppv);
#else
return CoCreateInstance(CLSID_InternetToolbar, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
#endif
}
typedef HRESULT(WINAPI * PMENUBAND_CONSTRUCTOR)(REFIID riid, void **ppv);
typedef HRESULT(WINAPI * PMERGEDFOLDER_CONSTRUCTOR)(REFIID riid, void **ppv);
HRESULT CMergedFolder_CreateInstance(REFIID riid, void **ppv)
{
#if USE_CUSTOM_MERGEDFOLDER
HMODULE hRShell = GetModuleHandle(L"rshell.dll");
if (!hRShell)
hRShell = LoadLibrary(L"rshell.dll");
if (hRShell)
{
PMERGEDFOLDER_CONSTRUCTOR pCMergedFolder_Constructor = (PMERGEDFOLDER_CONSTRUCTOR)
GetProcAddress(hRShell, "CMergedFolder_Constructor");
if (pCMergedFolder_Constructor)
{
return pCMergedFolder_Constructor(riid, ppv);
}
}
#endif
return CoCreateInstance(CLSID_MergedFolder, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
}
HRESULT CMenuBand_CreateInstance(REFIID iid, LPVOID *ppv)
{
#if USE_CUSTOM_MENUBAND
HMODULE hRShell = GetModuleHandleW(L"rshell.dll");
if (!hRShell)
hRShell = LoadLibraryW(L"rshell.dll");
if (hRShell)
{
PMENUBAND_CONSTRUCTOR func = (PMENUBAND_CONSTRUCTOR) GetProcAddress(hRShell, "CMenuBand_Constructor");
if (func)
{
return func(iid , ppv);
}
}
#endif
return CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER, iid, ppv);
}
class CBrowseUIModule : public CComModule
{
public:

View file

@ -9,115 +9,16 @@
#define USE_CUSTOM_EXPLORERBAND 1
#define USE_CUSTOM_INTERNETTOOLBAR 1
/* Constructors for the classes that are not exported */
HRESULT CAddressBand_CreateInstance(REFIID riid, void **ppv);
HRESULT CAddressEditBox_CreateInstance(REFIID riid, void **ppv);
HRESULT CBandProxy_CreateInstance(REFIID riid, void **ppv);
HRESULT CBrandBand_CreateInstance(REFIID riid, void **ppv);
HRESULT CExplorerBand_CreateInstance(REFIID riid, LPVOID *ppv);
HRESULT CInternetToolbar_CreateInstance(REFIID riid, void **ppv);
HRESULT CMergedFolder_CreateInstance(REFIID riid, void **ppv);
HRESULT CMenuBand_CreateInstance(REFIID iid, LPVOID *ppv);
HRESULT CShellBrowser_CreateInstance(LPITEMIDLIST pidl, DWORD dwFlags, REFIID riid, void **ppv);
HRESULT CTravelLog_CreateInstance(REFIID riid, void **ppv);
HRESULT CBaseBar_CreateInstance(REFIID riid, void **ppv, BOOL vertical);
HRESULT CBaseBarSite_CreateInstance(REFIID riid, void **ppv, BOOL bVertical);
HRESULT CToolsBand_CreateInstance(REFIID riid, void **ppv);
static inline
HRESULT CAddressBand_CreateInstance(REFIID riid, void **ppv)
{
#if USE_CUSTOM_ADDRESSBAND
return ShellObjectCreator<CAddressBand>(riid, ppv);
#else
return CoCreateInstance(CLSID_SH_AddressBand, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IUnknown, toolsBar));
#endif
}
static inline
HRESULT CAddressEditBox_CreateInstance(REFIID riid, void **ppv)
{
#if USE_CUSTOM_ADDRESSEDITBOX
return ShellObjectCreator<CAddressEditBox>(riid, ppv);
#else
return CoCreateInstance(CLSID_AddressEditBox, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(riid, &ppv));
#endif
}
static inline
HRESULT CBandProxy_CreateInstance(REFIID riid, void **ppv)
{
#if USE_CUSTOM_BANDPROXY
return ShellObjectCreator<CBandProxy>(riid, ppv);
#else
return CoCreateInstance(CLSID_BandProxy, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(riid, &ppv));
#endif
}
static inline
HRESULT CBrandBand_CreateInstance(REFIID riid, void **ppv)
{
#if USE_CUSTOM_BRANDBAND
return ShellObjectCreator<CBrandBand>(riid, ppv);
#else
return CoCreateInstance(CLSID_BrandBand, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
#endif
}
static inline
HRESULT WINAPI CExplorerBand_CreateInstance(REFIID riid, LPVOID *ppv)
{
#if USE_CUSTOM_EXPLORERBAND
return ShellObjectCreator<CExplorerBand>(riid, ppv);
#else
return CoCreateInstance(CLSID_ExplorerBand, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
#endif
}
static inline
HRESULT CInternetToolbar_CreateInstance(REFIID riid, void **ppv)
{
#if USE_CUSTOM_INTERNETTOOLBAR
return ShellObjectCreator<CInternetToolbar>(riid, ppv);
#else
return CoCreateInstance(CLSID_InternetToolbar, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
#endif
}
typedef HRESULT(WINAPI * PMENUBAND_CONSTRUCTOR)(REFIID riid, void **ppv);
typedef HRESULT(WINAPI * PMERGEDFOLDER_CONSTRUCTOR)(REFIID riid, void **ppv);
static inline
HRESULT CMergedFolder_CreateInstance(REFIID riid, void **ppv)
{
#if USE_CUSTOM_MERGEDFOLDER
HMODULE hRShell = GetModuleHandle(L"rshell.dll");
if (!hRShell)
hRShell = LoadLibrary(L"rshell.dll");
if (hRShell)
{
PMERGEDFOLDER_CONSTRUCTOR pCMergedFolder_Constructor = (PMERGEDFOLDER_CONSTRUCTOR)
GetProcAddress(hRShell, "CMergedFolder_Constructor");
if (pCMergedFolder_Constructor)
{
return pCMergedFolder_Constructor(riid, ppv);
}
}
#endif
return CoCreateInstance(CLSID_MergedFolder, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
}
static inline
HRESULT CMenuBand_CreateInstance(REFIID iid, LPVOID *ppv)
{
#if USE_CUSTOM_MENUBAND
HMODULE hRShell = GetModuleHandleW(L"rshell.dll");
if (!hRShell)
hRShell = LoadLibraryW(L"rshell.dll");
if (hRShell)
{
PMENUBAND_CONSTRUCTOR func = (PMENUBAND_CONSTRUCTOR) GetProcAddress(hRShell, "CMenuBand_Constructor");
if (func)
{
return func(iid , ppv);
}
}
#endif
return CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER, iid, ppv);
}

View file

@ -40,8 +40,8 @@
#include "addresseditbox.h"
#include "CAutoComplete.h"
#include "bandproxy.h"
#include "bandsite.h"
#include "bandsitemenu.h"
#include "shellbars/CBandSite.h"
#include "shellbars/CBandSiteMenu.h"
#include "brandband.h"
#include "internettoolbar.h"
#include "commonbrowser.h"

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "precomp.h"
#include "shellbars.h"
#ifndef ASSERT
#define ASSERT(cond) \
@ -829,3 +829,8 @@ HRESULT STDMETHODCALLTYPE CBandSiteBase::SaveToStreamBS(IUnknown *, IStream *)
{
return E_NOTIMPL;
}
HRESULT CBandSite_CreateInstance(REFIID riid, void **ppv)
{
return ShellObjectCreator<CBandSite>(riid, ppv);
}

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "precomp.h"
#include "shellbars.h"
CBandSiteMenu::CBandSiteMenu()
{
@ -94,3 +94,8 @@ HRESULT STDMETHODCALLTYPE CBandSiteMenu::HandleMenuMsg2(UINT uMsg, WPARAM wParam
FIXME("CBandSiteMenu::HandleMenuMsg2 is UNIMPLEMENTED(%p, %u, %p, %p, %p)\n", this, uMsg, wParam, lParam, plResult);
return E_NOTIMPL;
}
HRESULT CBandSiteMenu_CreateInstance(REFIID riid, void **ppv)
{
return ShellObjectCreator<CBandSiteMenu>(riid, ppv);
}

View file

@ -22,7 +22,7 @@
This class knows how to contain base bar site in a cabinet window.
*/
#include "precomp.h"
#include "shellbars.h"
/*
Base bar that contains a vertical or horizontal explorer band. It also

View file

@ -0,0 +1,22 @@
PROJECT(SHELL)
set_cpp(WITH_RUNTIME)
add_definitions(-DUNICODE -D_UNICODE)
include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl)
list(APPEND SOURCE
CBandSite.cpp
CBandSiteMenu.cpp
CBaseBar.cpp
CSHEnumClassesOfCategories.cpp)
add_library(shellbars ${SOURCE})
add_dependencies(shellbars xdk)
if(NOT MSVC)
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_target_compile_flags(shellbars "-Wno-unused-but-set-variable")
endif()
endif()

View file

@ -22,7 +22,7 @@
* Wraps the component categories manager enum
*/
#include "precomp.h"
#include "shellbars.h"
#define REGPATH L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Discardable\\PostSetup\\Component Categories"
#define IMPLEMENTING L"Implementing"

View file

@ -0,0 +1,36 @@
#ifndef _SHELLBARS_PCH_
#define _SHELLBARS_PCH_
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#include <windef.h>
#include <winbase.h>
#include <wincon.h>
#include <wingdi.h>
#include <shlobj.h>
#include <shellapi.h>
#include <shlobj_undoc.h>
#include <shlguid_undoc.h>
#include <shdeprecated.h>
#include <tchar.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <undocuser.h>
#include <shlwapi.h>
#include <shlwapi_undoc.h>
#include <undocshell.h>
#include <shellutils.h>
#include <browseui_undoc.h>
#include <wine/debug.h>
#include "../resource.h"
#include "CBandSite.h"
#include "CBandSiteMenu.h"
WINE_DEFAULT_DEBUG_CHANNEL(browseui);
#endif /* _BROWSEUI_PCH_ */