[BROWSEUI] -Move the following classes to a new static lib called shellbars: CBandSit...
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 9 Apr 2017 13:51:39 +0000 (13:51 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Sun, 9 Apr 2017 13:51:39 +0000 (13:51 +0000)
- 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

12 files changed:
reactos/dll/win32/browseui/CMakeLists.txt
reactos/dll/win32/browseui/browseui.cpp
reactos/dll/win32/browseui/browseui.h
reactos/dll/win32/browseui/precomp.h
reactos/dll/win32/browseui/shellbars/CBandSite.cpp [moved from reactos/dll/win32/browseui/bandsite.cpp with 99% similarity]
reactos/dll/win32/browseui/shellbars/CBandSite.h [moved from reactos/dll/win32/browseui/bandsite.h with 100% similarity]
reactos/dll/win32/browseui/shellbars/CBandSiteMenu.cpp [moved from reactos/dll/win32/browseui/bandsitemenu.cpp with 95% similarity]
reactos/dll/win32/browseui/shellbars/CBandSiteMenu.h [moved from reactos/dll/win32/browseui/bandsitemenu.h with 100% similarity]
reactos/dll/win32/browseui/shellbars/CBaseBar.cpp [moved from reactos/dll/win32/browseui/basebar.cpp with 99% similarity]
reactos/dll/win32/browseui/shellbars/CMakeLists.txt [new file with mode: 0644]
reactos/dll/win32/browseui/shellbars/CSHEnumClassesOfCategories.cpp [moved from reactos/dll/win32/browseui/comcat.cpp with 99% similarity]
reactos/dll/win32/browseui/shellbars/shellbars.h [new file with mode: 0644]

index b0cc60b..30ab6a2 100644 (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)
index 0d3070c..d9e05ec 100644 (file)
 
 #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:
index 37faa9a..e1d62de 100644 (file)
 #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);
-}
index 83a5e59..b332351 100644 (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"
similarity index 99%
rename from reactos/dll/win32/browseui/bandsite.cpp
rename to reactos/dll/win32/browseui/shellbars/CBandSite.cpp
index 5e46e71..359a1c4 100644 (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);
+}
@@ -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);
+}
similarity index 99%
rename from reactos/dll/win32/browseui/basebar.cpp
rename to reactos/dll/win32/browseui/shellbars/CBaseBar.cpp
index bd84b4a..44d2ec5 100644 (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
diff --git a/reactos/dll/win32/browseui/shellbars/CMakeLists.txt b/reactos/dll/win32/browseui/shellbars/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3807056
--- /dev/null
@@ -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()
@@ -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"
diff --git a/reactos/dll/win32/browseui/shellbars/shellbars.h b/reactos/dll/win32/browseui/shellbars/shellbars.h
new file mode 100644 (file)
index 0000000..b85d98c
--- /dev/null
@@ -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_ */