فهرست منبع

feat: remove class factor from editor and IClassDesc (#18063)

Signed-off-by: Michael Pollind <[email protected]>
Michael Pollind 1 سال پیش
والد
کامیت
7a46d8a484

+ 23 - 26
Code/Editor/EditorPreferencesDialog.cpp

@@ -20,7 +20,6 @@
 // Editor
 #include "MainWindow.h"
 #include "EditorPreferencesTreeWidgetItem.h"
-#include "PreferencesStdPages.h"
 #include "DisplaySettings.h"
 #include "CryEditDoc.h"
 #include "Controls/ConsoleSCB.h"
@@ -32,6 +31,17 @@
 #include "EditorPreferencesPageViewportDebug.h"
 #include "EditorPreferencesPageAWS.h"
 #include "LyViewPaneNames.h"
+#include "Entity/EditorEntityHelpers.h"
+
+// Editor
+#include "EditorPreferencesPageGeneral.h"
+#include "EditorPreferencesPageFiles.h"
+#include "EditorPreferencesPageViewportGeneral.h"
+#include "EditorPreferencesPageViewportManipulator.h"
+#include "EditorPreferencesPageViewportCamera.h"
+#include "EditorPreferencesPageViewportDebug.h"
+#include "EditorPreferencesPageAWS.h"
+
 
 AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
 #include <ui_EditorPreferencesDialog.h>
@@ -57,8 +67,6 @@ EditorPreferencesDialog::EditorPreferencesDialog(QWidget* pParent)
     if (!bAlreadyRegistered)
     {
         bAlreadyRegistered = true;
-        GetIEditor()->GetClassFactory()->RegisterClass(new CStdPreferencesClassDesc);
-
         if (serializeContext)
         {
             CEditorPreferencesPage_General::Reflect(*serializeContext);
@@ -125,7 +133,7 @@ bool WidgetConsumesKeyPressEvent(QKeyEvent* event)
     {
         return false;
     }
-   
+
     if (QWidget* editWidget = QApplication::focusWidget())
     {
         editWidget->clearFocus();
@@ -309,30 +317,19 @@ void EditorPreferencesDialog::CreateImages()
 
 void EditorPreferencesDialog::CreatePages()
 {
-    std::vector<IClassDesc*> classes;
-    GetIEditor()->GetClassFactory()->GetClassesBySystemID(ESYSTEM_CLASS_PREFERENCE_PAGE, classes);
 
-    for (int i = 0; i < classes.size(); i++)
+    auto addPreferencePage = [&](IPreferencesPage* page) {
+       ui->pageTree->addTopLevelItem(new EditorPreferencesTreeWidgetItem(page, page->GetIcon()));
+    };
+    addPreferencePage(new CEditorPreferencesPage_General());
+    addPreferencePage(new CEditorPreferencesPage_Files());
+    addPreferencePage(new CEditorPreferencesPage_ViewportGeneral());
+    addPreferencePage(new CEditorPreferencesPage_ViewportCamera());
+    addPreferencePage(new CEditorPreferencesPage_ViewportManipulator());
+    addPreferencePage(new CEditorPreferencesPage_ViewportDebug());
+    if (AzToolsFramework::IsComponentWithServiceRegistered(AZ_CRC_CE("AWSCoreEditorService")))
     {
-        auto pUnknown = classes[i];
-
-        IPreferencesPageCreator* pPageCreator = nullptr;
-        if (FAILED(pUnknown->QueryInterface(&pPageCreator)))
-        {
-            continue;
-        }
-
-        int numPages = pPageCreator->GetPagesCount();
-        for (int pindex = 0; pindex < numPages; pindex++)
-        {
-            IPreferencesPage* pPage = pPageCreator->CreateEditorPreferencesPage(pindex);
-            if (!pPage)
-            {
-                continue;
-            }
-
-            ui->pageTree->addTopLevelItem(new EditorPreferencesTreeWidgetItem(pPage, pPage->GetIcon()));
-        }
+        addPreferencePage(new CEditorPreferencesPage_AWS());
     }
 }
 

+ 0 - 13
Code/Editor/IEditor.h

@@ -36,7 +36,6 @@ class CAnimationContext;
 class CTrackViewSequenceManager;
 class CGameEngine;
 class CToolBoxManager;
-class CClassFactory;
 class CMusicManager;
 struct IEditorParticleManager;
 class CEAXPresetManager;
@@ -44,7 +43,6 @@ class CErrorReport;
 class ICommandManager;
 class CEditorCommandManager;
 class CConsoleSynchronization;
-struct IEditorClassFactory;
 class CDialog;
 #if defined(AZ_PLATFORM_WINDOWS)
 class C3DConnexionDriver;
@@ -316,13 +314,6 @@ enum EModifiedModule
     eModifiedAll = -1
 };
 
-//! Class provided by editor for various registration functions.
-struct CRegistrationContext
-{
-    CEditorCommandManager* pCommandManager;
-    CClassFactory* pClassFactory;
-};
-
 //! Interface provided by editor to reach status bar functionality.
 struct IMainStatusBar
 {
@@ -371,8 +362,6 @@ struct IEditor
     virtual void DeleteThis() = 0;
     //! Access to Editor ISystem interface.
     virtual ISystem* GetSystem() = 0;
-    //! Access to class factory.
-    virtual IEditorClassFactory* GetClassFactory() = 0;
     //! Access to commands manager.
     virtual CEditorCommandManager* GetCommandManager() = 0;
     virtual ICommandManager* GetICommandManager() = 0;
@@ -522,9 +511,7 @@ struct IEditor
     virtual const QtViewPane* OpenView(QString sViewClassName, bool reuseOpen = true) = 0;
     virtual QWidget* FindView(QString viewClassName) = 0;
 
-    virtual bool CloseView(const char* sViewClassName) = 0;
     virtual bool SetViewFocus(const char* sViewClassName) = 0;
-    virtual void CloseView(const GUID& classId) = 0; // close ALL panels related to classId, used when unloading plugins.
 
     //! Opens standard color selection dialog.
     //! Initialized with the color specified in color parameter.

+ 0 - 22
Code/Editor/IEditorImpl.cpp

@@ -40,7 +40,6 @@
 
 // Editor
 #include "CryEdit.h"
-#include "Plugin.h"
 #include "PluginManager.h"
 #include "ViewManager.h"
 #include "DisplaySettings.h"
@@ -83,7 +82,6 @@ CEditorImpl::CEditorImpl()
     : m_operationMode(eOperationModeNone)
     , m_pSystem(nullptr)
     , m_pFileUtil(nullptr)
-    , m_pClassFactory(nullptr)
     , m_pCommandManager(nullptr)
     , m_pPluginManager(nullptr)
     , m_pViewManager(nullptr)
@@ -125,7 +123,6 @@ CEditorImpl::CEditorImpl()
     gSettings.Load();
 
     m_pErrorReport = new CErrorReport;
-    m_pClassFactory = CClassFactory::Instance();
     m_pCommandManager = new CEditorCommandManager;
     m_pEditorFileMonitor.reset(new CEditorFileMonitor());
     m_pDisplaySettings = new CDisplaySettings;
@@ -267,7 +264,6 @@ CEditorImpl::~CEditorImpl()
     SAFE_DELETE(m_pDisplaySettings)
     SAFE_DELETE(m_pToolBoxManager)
     SAFE_DELETE(m_pCommandManager)
-    SAFE_DELETE(m_pClassFactory)
     SAFE_DELETE(m_pLasLoadedLevelErrorReport)
 
     SAFE_DELETE(m_pSettingsManager);
@@ -351,10 +347,6 @@ ISystem* CEditorImpl::GetSystem()
     return m_pSystem;
 }
 
-IEditorClassFactory* CEditorImpl::GetClassFactory()
-{
-    return m_pClassFactory;
-}
 
 CCryEditDoc* CEditorImpl::GetDocument() const
 {
@@ -672,20 +664,6 @@ bool CEditorImpl::SetViewFocus(const char* sViewClassName)
     return false;
 }
 
-bool CEditorImpl::CloseView(const char* sViewClassName)
-{
-    return QtViewPaneManager::instance()->ClosePane(sViewClassName);
-}
-
-void CEditorImpl::CloseView(const GUID& classId)
-{
-    IClassDesc* found = GetClassFactory()->FindClass(classId);
-    if (found)
-    {
-        CloseView(found->ClassName().toUtf8().data());
-    }
-}
-
 bool CEditorImpl::SelectColor(QColor& color, QWidget* parent)
 {
     const AZ::Color c = AzQtComponents::fromQColor(color);

+ 0 - 4
Code/Editor/IEditorImpl.h

@@ -71,7 +71,6 @@ public:
 
     void SetGameEngine(CGameEngine* ge);
     void DeleteThis() override { delete this; };
-    IEditorClassFactory* GetClassFactory() override;
     CEditorCommandManager* GetCommandManager() override { return m_pCommandManager; };
     ICommandManager* GetICommandManager() override { return m_pCommandManager; }
     void ExecuteCommand(const char* sCommand, ...) override;
@@ -191,11 +190,9 @@ public:
      */
     QWidget* FindView(QString viewClassName) override;
 
-    bool CloseView(const char* sViewClassName) override;
     bool SetViewFocus(const char* sViewClassName) override;
 
     // close ALL panels related to classId, used when unloading plugins.
-    void CloseView(const GUID& classId) override;
     bool SelectColor(QColor &color, QWidget *parent = 0) override;
     void Update();
     SFileVersion GetFileVersion() override { return m_fileVersion; };
@@ -269,7 +266,6 @@ protected:
     EOperationMode m_operationMode;
     ISystem* m_pSystem;
     IFileUtil* m_pFileUtil;
-    CClassFactory* m_pClassFactory;
     CEditorCommandManager* m_pCommandManager;
     CPluginManager* m_pPluginManager;
     CViewManager*   m_pViewManager;

+ 0 - 156
Code/Editor/Include/IEditorClassFactory.h

@@ -1,156 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-// Description : Class factory support classes
-
-
-#ifndef CRYINCLUDE_EDITOR_INCLUDE_IEDITORCLASSFACTORY_H
-#define CRYINCLUDE_EDITOR_INCLUDE_IEDITORCLASSFACTORY_H
-#pragma once
-
-#include <CryCommon/platform.h>
-#include <vector>
-#include <QtCore/QString>
-#include <AzCore/Math/Guid.h>
-
-#define DEFINE_UUID(l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
-static const GUID uuid() { return { l, w1, w2, { b1, b2,  b3,  b4,  b5,  b6,  b7,  b8 } }; }
-
-#ifdef AZ_PLATFORM_WINDOWS
-#include <Unknwn.h>
-#else
-struct IUnknown
-{
-    virtual ~IUnknown() = default;
-};
-#endif
-
-#define __az_uuidof(T) T::uuid()
-
-#if defined(AZ_PLATFORM_LINUX) || defined(AZ_PLATFORM_MAC)
-
-# ifndef _REFGUID_DEFINED
-# define _REFGUID_DEFINED
-typedef const GUID& REFGUID;
-# endif
-
-# ifndef _REFIID_DEFINED
-# define _REFIID_DEFINED
-typedef const GUID& REFIID;
-# endif
-
-# ifndef IID_DEFINED
-# define IID_DEFINED
-typedef GUID IID;
-# endif
-
-#ifndef HRESULT_VALUES_DEFINED
-#define HRESULT_VALUES_DEFINED
-enum
-{
-    E_OUTOFMEMORY  = 0x8007000E,
-    E_FAIL         = 0x80004005,
-    E_ABORT        = 0x80004004,
-    E_INVALIDARG   = 0x80070057,
-    E_NOINTERFACE  = 0x80004002,
-    E_NOTIMPL      = 0x80004001,
-    E_UNEXPECTED   = 0x8000FFFF
-};
-#endif
-
-#endif  // defined(AZ_PLATFORM_LINUX) || defined(AZ_PLATFORM_MAC)
-
-#include "SandboxAPI.h"
-
-class QObject;
-
-
-//! System class IDs
-enum ESystemClassID
-{
-    ESYSTEM_CLASS_OBJECT = 0x0001,
-    ESYSTEM_CLASS_EDITTOOL = 0x0002,
-    ESYSTEM_CLASS_PREFERENCE_PAGE = 0x0020,
-    ESYSTEM_CLASS_VIEWPANE = 0x0021,
-    //! Source/Asset Control Management Provider
-    ESYSTEM_CLASS_SCM_PROVIDER = 0x0022,
-    ESYSTEM_CLASS_CONSOLE_CONNECTIVITY = 0x0023,
-    ESYSTEM_CLASS_ASSET_DISPLAY = 0x0024,
-    ESYSTEM_CLASS_ASSET_TAGGING = 0x0025,
-    ESYSTEM_CLASS_FRAMEWND_EXTENSION_PANE = 0x0030,
-    ESYSTEM_CLASS_TRACKVIEW_KEYUI = 0x0040,
-    ESYSTEM_CLASS_UITOOLS = 0x0050, // UI Emulator tool
-    ESYSTEM_CLASS_CONTROL = 0x0900,
-    ESYSTEM_CLASS_USER = 0x1000
-};
-
-//! This interface describes a class created by a plugin
-struct IClassDesc
-    : public IUnknown
-{
-    //////////////////////////////////////////////////////////////////////////
-    // IUnknown implementation.
-    //////////////////////////////////////////////////////////////////////////
-    virtual HRESULT STDMETHODCALLTYPE QueryInterface([[maybe_unused]] const IID& riid, [[maybe_unused]] void** ppvObj) { return E_NOINTERFACE; }
-    virtual ULONG STDMETHODCALLTYPE AddRef() { return 0; }
-    virtual ULONG STDMETHODCALLTYPE Release() { return 0; }
-
-    template<class Q>
-    HRESULT STDMETHODCALLTYPE QueryInterface(Q** pp)
-    {
-        return QueryInterface(__az_uuidof(Q), (void**)pp);
-    }
-
-    //////////////////////////////////////////////////////////////////////////
-    // Class description.
-    //////////////////////////////////////////////////////////////////////////
-    //! This method returns an Editor defined GUID describing the class this plugin class is associated with.
-    virtual ESystemClassID SystemClassID() = 0;
-    //! Return the GUID of the class created by plugin.
-    virtual REFGUID ClassID() = 0;
-    //! This method returns the human readable name of the class.
-    virtual QString ClassName() = 0;
-    //! This method returns Category of this class, Category is specifying where this plugin class fits best in
-    //! create panel.
-    virtual QString Category() = 0;
-
-    virtual QString MenuSuggestion() { return QString(); }
-    virtual QString Tooltip() { return QString(); }
-    virtual QString Description() { return QString(); }
-
-    //! This method returns if the plugin should have a menu item for its pane.
-    virtual bool ShowInMenu() const { return true; }
-    //! Qt equivalent of CRuntimeClass::CreateObject(). We might create a full QRuntimeClass, if there's a need for it.
-    virtual QObject* CreateQObject() const { return nullptr; }
-
-    //! For any class that may be conditionally enabled or disabled, this function can be overriden to return true if it is enabled, false otherwise.
-    //! The default is to always return true.
-    virtual bool IsEnabled() const { return true; }
-    //////////////////////////////////////////////////////////////////////////
-};
-
-struct CRYEDIT_API IEditorClassFactory
-{
-public:
-    virtual ~IEditorClassFactory() = default;
-
-    //! Register new class to the factory.
-    virtual void RegisterClass(IClassDesc* pClassDesc) = 0;
-    //! Find class in the factory by class name.
-    virtual IClassDesc* FindClass(const char* pClassName) const = 0;
-    //! Find class in the factory by class id
-    virtual IClassDesc* FindClass(const GUID& rClassID) const = 0;
-    virtual void UnregisterClass(const char* pClassName) = 0;
-    virtual void UnregisterClass(const GUID& rClassID) = 0;
-    //! Get classes that matching specific requirements.
-    virtual void GetClassesBySystemID(ESystemClassID aSystemClassID, std::vector<IClassDesc*>& rOutClasses) = 0;
-    virtual void GetClassesByCategory(const char* pCategory, std::vector<IClassDesc*>& rOutClasses) = 0;
-};
-
-#endif // CRYINCLUDE_EDITOR_INCLUDE_IEDITORCLASSFACTORY_H

+ 1 - 35
Code/Editor/Include/IPreferencesPage.h

@@ -12,9 +12,9 @@
 #ifndef CRYINCLUDE_EDITOR_INCLUDE_IPREFERENCESPAGE_H
 #define CRYINCLUDE_EDITOR_INCLUDE_IPREFERENCESPAGE_H
 #pragma once
-#include "Plugin.h"
 #include <AzCore/RTTI/RTTI.h>
 
+
 //! The interface class for preferences pages.
 struct IPreferencesPage
 {
@@ -37,38 +37,4 @@ struct IPreferencesPage
     //! @param bActive true when page become active, false when page deactivated.
 };
 
-//! Interface used to create new preferences pages.
-//! You can query this interface from any IClassDesc interface with ESYSTEM_CLASS_PREFERENCE_PAGE system class Id.
-struct IPreferencesPageCreator
-{
-    DEFINE_UUID(0xD494113C, 0xBF13, 0x4171, 0x91, 0x71, 0x03, 0x33, 0xDF, 0x10, 0xEA, 0xFC)
-
-    //! Get number of preferences page hosted by this class.
-    virtual int GetPagesCount() = 0;
-    //! Creates a new preferences page by page index.
-    //! @param index must be within 0 <= index < GetPagesCount().
-    virtual IPreferencesPage* CreateEditorPreferencesPage(int index) = 0;
-};
-
-//! A plugin class description for all IPreferencesPage derived classes.
-struct IPreferencesPageClassDesc
-    : public IClassDesc
-{
-    //////////////////////////////////////////////////////////////////////////
-    // IClassDesc implementation.
-    //////////////////////////////////////////////////////////////////////////
-    virtual ESystemClassID SystemClassID() { return ESYSTEM_CLASS_PREFERENCE_PAGE; };
-    //! This method returns the human readable name of the class.
-    virtual QString ClassName() { return "Preferences Page"; };
-    //! This method returns Category of this class,
-    //! Category is specifying where this plugin class fits best in the create panel.
-    virtual QString Category() { return "Preferences"; };
-    //! Show a modal about dialog / message box for the plugin.
-    virtual void ShowAbout() {};
-    virtual bool CanExitNow() { return true; };
-    //! The plugin should write / read its data to the passed stream. The data is saved to or loaded
-    //! from the editor project file. This function is called during the usual save / load process of
-    //! the editor's project file
-    virtual void Serialize([[maybe_unused]] CXmlArchive& ar) {};
-};
 #endif // CRYINCLUDE_EDITOR_INCLUDE_IPREFERENCESPAGE_H

+ 0 - 1
Code/Editor/Lib/Tests/IEditorMock.h

@@ -28,7 +28,6 @@ public:
 
     MOCK_METHOD0(DeleteThis, void());
     MOCK_METHOD0(GetSystem, ISystem*());
-    MOCK_METHOD0(GetClassFactory, IEditorClassFactory* ());
     MOCK_METHOD0(GetCommandManager, CEditorCommandManager*());
     MOCK_METHOD0(GetICommandManager, ICommandManager* ());
     MOCK_METHOD1(ExecuteCommand, void(const QString& sCommand));

+ 0 - 218
Code/Editor/Plugin.cpp

@@ -1,218 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-#include "EditorDefs.h"
-
-#include "Plugin.h"
-
-#include <QMessageBox>
-
-CClassFactory* CClassFactory::s_pInstance = nullptr;
-CAutoRegisterClassHelper* CAutoRegisterClassHelper::s_pFirst = nullptr;
-CAutoRegisterClassHelper* CAutoRegisterClassHelper::s_pLast = nullptr;
-
-CClassFactory::CClassFactory()
-{
-    m_classes.reserve(100);
-    RegisterAutoTypes();
-}
-
-CClassFactory::~CClassFactory()
-{
-    for (int i = 0; i < m_classes.size(); i++)
-    {
-        m_classes[i]->Release();
-    }
-}
-
-void CClassFactory::RegisterAutoTypes()
-{
-    CAutoRegisterClassHelper* pClass = CAutoRegisterClassHelper::s_pFirst;
-
-    while (pClass)
-    {
-        RegisterClass(pClass->m_pClassDesc);
-        pClass = pClass->m_pNext;
-    }
-}
-
-CClassFactory* CClassFactory::Instance()
-{
-    if (!s_pInstance)
-    {
-        s_pInstance = new CClassFactory;
-    }
-
-    return s_pInstance;
-}
-
-void CClassFactory::RegisterClass(IClassDesc* pClassDesc)
-{
-    assert(pClassDesc);
-
-    auto findByGuid = m_guidToClass.find(pClassDesc->ClassID());
-
-    if (findByGuid != m_guidToClass.end())
-    {
-        // you may not re-use UUIDs!
-        // this can happen when someone makes a new plugin or downloads one
-        // where the author copied and pasted code.  This can also happen if two DLLs exist which are actually the same plugin
-        // either way, give info if you can:
-        char errorMessageBuffer[512] = { 0 };
-        AZ::Uuid newUUID(pClassDesc->ClassID());
-        char existingUUIDString[64] = { 0 };
-        newUUID.ToString(existingUUIDString, 64, true, true);
-
-        sprintf_s(errorMessageBuffer, 512,
-            "Error registering class '%s' -  UUID of that class already exists (%s), and belongs to class named '%s.'\n"
-            "You may not have duplicate class identifiers.\n"
-            "Check for duplicate plugins or copy and pasted code for plugins that duplicates UUIDs returned.",
-            pClassDesc->ClassName().toUtf8().data(),
-            existingUUIDString,
-            findByGuid->second->ClassName().toUtf8().data());
-
-        QMessageBox::critical(nullptr,"Invalid class registration - Duplicate UUID",QString::fromLatin1(errorMessageBuffer));
-        return;
-    }
-
-    auto findByName = m_nameToClass.find(pClassDesc->ClassName());
-    if (findByName != m_nameToClass.end())
-    {
-        // you may not re-use names, either!
-        char errorMessageBuffer[512] = { 0 };
-
-        AZ::Uuid newUUID(pClassDesc->ClassID());
-        char newUUIDString[64] = { 0 };
-        newUUID.ToString(newUUIDString, 64, true, true);
-
-        AZ::Uuid existingUUID(findByName->second->ClassID());
-        char existingUUIDString[64] = { 0 };
-        existingUUID.ToString(existingUUIDString, 64, true, true);
-
-        sprintf_s(errorMessageBuffer, 512,
-            "Error registering class '%s' - that name is already taken by a different class.\n"
-            "New class's UUID is %s\n"
-            "Existing class's UUID is %s\n"
-            "You may not have duplicate class names.\n"
-            "Check for duplicate plugins or copy and pasted code for plugins.",
-            pClassDesc->ClassName().toUtf8().constData(),
-            newUUIDString,
-            existingUUIDString);
-
-        QMessageBox::critical(nullptr, "Invalid class registration - Duplicate Class Name", QString::fromLatin1(errorMessageBuffer));
-        return;
-    }
-
-#if defined(DEBUG_CLASS_NAME_REGISTRATION)
-    m_debugClassNames.push_back(pClassDesc->ClassName());
-#endif // DEBUG_CLASS_NAME_REGISTRATION
-
-    m_classes.push_back(pClassDesc);
-    m_guidToClass[pClassDesc->ClassID()] = pClassDesc;
-    m_nameToClass[pClassDesc->ClassName()] = pClassDesc;
-}
-
-IClassDesc* CClassFactory::FindClass(const char* pClassName) const
-{
-    IClassDesc* pClassDesc = stl::find_in_map(m_nameToClass, pClassName, (IClassDesc*)nullptr);
-
-    if (pClassDesc)
-    {
-        return pClassDesc;
-    }
-
-    const char* pSubClassName = strstr(pClassName, "::");
-
-    if (!pSubClassName)
-    {
-        return nullptr;
-    }
-
-    QString name = QString(pClassName).left(static_cast<int>(pSubClassName - pClassName));
-
-    return stl::find_in_map(m_nameToClass, name, (IClassDesc*)nullptr);
-}
-
-IClassDesc* CClassFactory::FindClass(const GUID& rClassID) const
-{
-    IClassDesc* pClassDesc = stl::find_in_map(m_guidToClass, rClassID, (IClassDesc*)nullptr);
-
-    return pClassDesc;
-}
-
-void CClassFactory::UnregisterClass(const char* pClassName)
-{
-    IClassDesc* pClassDesc = FindClass(pClassName);
-
-    if (pClassDesc == nullptr)
-    {
-        return;
-    }
-
-#if defined(DEBUG_CLASS_NAME_REGISTRATION)
-    stl::find_and_erase(m_debugClassNames, pClassDesc->ClassName());
-#endif // DEBUG_CLASS_NAME_REGISTRATION
-
-    stl::find_and_erase(m_classes, pClassDesc);
-    stl::member_find_and_erase(m_guidToClass, pClassDesc->ClassID());
-    stl::member_find_and_erase(m_nameToClass, pClassDesc->ClassName());
-}
-
-void CClassFactory::UnregisterClass(const GUID& rClassID)
-{
-    IClassDesc* pClassDesc = FindClass(rClassID);
-
-    if (!pClassDesc)
-    {
-        return;
-    }
-
-#if defined(DEBUG_CLASS_NAME_REGISTRATION)
-    stl::find_and_erase(m_debugClassNames, pClassDesc->ClassName());
-#endif // DEBUG_CLASS_NAME_REGISTRATION
-
-    stl::find_and_erase(m_classes, pClassDesc);
-    stl::member_find_and_erase(m_guidToClass, pClassDesc->ClassID());
-    stl::member_find_and_erase(m_nameToClass, pClassDesc->ClassName());
-}
-
-bool ClassDescNameCompare(IClassDesc* pArg1, IClassDesc* pArg2)
-{
-    return (QString::compare(pArg1->ClassName(), pArg2->ClassName(), Qt::CaseInsensitive) < 0);
-}
-
-void CClassFactory::GetClassesBySystemID(ESystemClassID aSystemClassID, std::vector<IClassDesc*>& rOutClasses)
-{
-    rOutClasses.clear();
-
-    for (size_t i = 0; i < m_classes.size(); ++i)
-    {
-        if (m_classes[i]->SystemClassID() == aSystemClassID)
-        {
-            rOutClasses.push_back(m_classes[i]);
-        }
-    }
-
-    std::sort(rOutClasses.begin(), rOutClasses.end(), ClassDescNameCompare);
-}
-
-void CClassFactory::GetClassesByCategory(const char* pCategory, std::vector<IClassDesc*>& rOutClasses)
-{
-    rOutClasses.clear();
-
-    for (size_t i = 0; i < m_classes.size(); ++i)
-    {
-        if (!QString::compare(pCategory, m_classes[i]->Category(), Qt::CaseInsensitive))
-        {
-            rOutClasses.push_back(m_classes[i]);
-        }
-    }
-
-    std::sort(rOutClasses.begin(), rOutClasses.end(), ClassDescNameCompare);
-}

+ 0 - 97
Code/Editor/Plugin.h

@@ -1,97 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-#pragma once
-#ifndef CRYINCLUDE_EDITOR_PLUGIN_H
-#define CRYINCLUDE_EDITOR_PLUGIN_H
-#include "Include/IEditorClassFactory.h"
-
-#include "Util/GuidUtil.h"
-#include <map>
-
-//! Class factory is a common repository of all registered plugin classes,
-//! Classes here can found by their class ID or all classes of given system class retrieved
-class CRYEDIT_API CClassFactory
-    : public IEditorClassFactory
-{
-public:
-    CClassFactory();
-    ~CClassFactory();
-
-    //! Access class factory singleton.
-    static CClassFactory* Instance();
-    //! Register a new class to the factory
-    void RegisterClass(IClassDesc* pClassDesc);
-    //! Find class in the factory by class name
-    IClassDesc* FindClass(const char* className) const;
-    //! Find class in the factory by class ID
-    IClassDesc* FindClass(const GUID& rClassID) const;
-    void UnregisterClass(const char* pClassName);
-    void UnregisterClass(const GUID& rClassID);
-    //! Get classes matching specific requirements ordered alphabetically by name.
-    void GetClassesBySystemID(ESystemClassID aSystemClassID, std::vector<IClassDesc*>& rOutClasses);
-    void GetClassesByCategory(const char* pCategory, std::vector<IClassDesc*>& rOutClasses);
-
-private:
-    void RegisterAutoTypes();
-
-    typedef std::map<QString, IClassDesc*> TNameMap;
-    typedef std::map<GUID, IClassDesc*, guid_less_predicate> TGuidMap;
-
-    AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
-    TNameMap m_nameToClass;
-    TGuidMap m_guidToClass;
-    std::vector<IClassDesc*> m_classes;
-    AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
-
-#if defined(DEBUG_CLASS_NAME_REGISTRATION)
-    // This vector will mirror that of CClassFactory::m_classes.
-    // When a class description is destroyed without being unregistered first
-    // (i.e. from within plugins is a common scenario) you will get a crash
-    // in ~CClassFactory as it's Releasing m_classes.
-    // When you hit that crash, take the index and look into this vector at
-    // the class name.  That class did not unregister before it was released.
-    std::vector<string> m_debugClassNames;
-#endif // DEBUG_CLASS_NAME_REGISTRATION
-
-    static CClassFactory* s_pInstance;
-};
-
-//! Auto registration for classes
-class CAutoRegisterClassHelper
-{
-public:
-    CAutoRegisterClassHelper(IClassDesc* pClassDesc)
-    {
-        m_pClassDesc = pClassDesc;
-        m_pNext = 0;
-
-        if (!s_pLast)
-        {
-            s_pFirst = this;
-        }
-        else
-        {
-            s_pLast->m_pNext = this;
-        }
-
-        s_pLast = this;
-    }
-
-    IClassDesc* m_pClassDesc;
-    CAutoRegisterClassHelper* m_pNext;
-    static CAutoRegisterClassHelper* s_pFirst;
-    static CAutoRegisterClassHelper* s_pLast;
-};
-
-// Use this define to automatically register a new class description.
-#define REGISTER_CLASS_DESC(ClassDesc) \
-    CAutoRegisterClassHelper g_AutoRegHelper##ClassDesc(new ClassDesc);
-
-#endif // CRYINCLUDE_EDITOR_PLUGIN_H

+ 0 - 2
Code/Editor/Plugins/ComponentEntityEditorPlugin/ComponentEntityEditorPlugin.cpp

@@ -25,7 +25,6 @@
 #include <AzToolsFramework/API/ToolsApplicationAPI.h>
 
 #include "SandboxIntegration.h"
-#include "Include/IEditorClassFactory.h"
 
 namespace ComponentEntityEditorPluginInternal
 {
@@ -44,7 +43,6 @@ namespace ComponentEntityEditorPluginInternal
 
     void UnregisterSandboxObjects()
     {
-        GetIEditor()->GetClassFactory()->UnregisterClass("ComponentEntity");
     }
 
 

+ 0 - 1
Code/Editor/Plugins/ComponentEntityEditorPlugin/dllmain.cpp

@@ -10,7 +10,6 @@
 
 #include <IEditor.h>
 #include <Include/IPlugin.h>
-#include <Include/IEditorClassFactory.h>
 #include "ComponentEntityEditorPlugin.h"
 
 #if AZ_TRAIT_OS_PLATFORM_APPLE || defined(AZ_PLATFORM_LINUX)

+ 0 - 1
Code/Editor/Plugins/FFMPEGPlugin/main.cpp

@@ -7,7 +7,6 @@
  */
 
 #include "FFMPEGPlugin.h"
-#include "Include/IEditorClassFactory.h"
 
 
 PLUGIN_API IPlugin* CreatePluginInstance(PLUGIN_INIT_PARAM* pInitParam)

+ 0 - 96
Code/Editor/PreferencesStdPages.cpp

@@ -1,96 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-#include "EditorDefs.h"
-
-#include "PreferencesStdPages.h"
-
-#include <AzToolsFramework/Entity/EditorEntityHelpers.h>
-
-// Editor
-#include "EditorPreferencesPageGeneral.h"
-#include "EditorPreferencesPageFiles.h"
-#include "EditorPreferencesPageViewportGeneral.h"
-#include "EditorPreferencesPageViewportManipulator.h"
-#include "EditorPreferencesPageViewportCamera.h"
-#include "EditorPreferencesPageViewportDebug.h"
-#include "EditorPreferencesPageAWS.h"
-
-
-//////////////////////////////////////////////////////////////////////////
-// Implementation of ClassDesc for standard Editor preferences.
-//////////////////////////////////////////////////////////////////////////
-
-CStdPreferencesClassDesc::CStdPreferencesClassDesc()
-    : m_refCount(0)
-{
-    m_pageCreators = {
-        [](){ return new CEditorPreferencesPage_General(); },
-        [](){ return new CEditorPreferencesPage_Files(); },
-        [](){ return new CEditorPreferencesPage_ViewportGeneral(); },
-        [](){ return new CEditorPreferencesPage_ViewportCamera(); },
-        [](){ return new CEditorPreferencesPage_ViewportManipulator(); },
-        [](){ return new CEditorPreferencesPage_ViewportDebug(); }
-    };
-
-    if (AzToolsFramework::IsComponentWithServiceRegistered(AZ_CRC_CE("AWSCoreEditorService")))
-    {
-        m_pageCreators.push_back([]() { return new CEditorPreferencesPage_AWS(); });
-    }
-}
-
-HRESULT CStdPreferencesClassDesc::QueryInterface(const IID& riid, void** ppvObj)
-{
-    if (riid == __az_uuidof(IPreferencesPageCreator))
-    {
-        *ppvObj = (IPreferencesPageCreator*)this;
-        return S_OK;
-    }
-    return E_NOINTERFACE;
-}
-
-//////////////////////////////////////////////////////////////////////////
-ULONG CStdPreferencesClassDesc::AddRef()
-{
-    m_refCount++;
-    return m_refCount;
-};
-
-//////////////////////////////////////////////////////////////////////////
-ULONG CStdPreferencesClassDesc::Release()
-{
-    ULONG refs = --m_refCount;
-    if (m_refCount <= 0)
-    {
-        delete this;
-    }
-    return refs;
-}
-
-//////////////////////////////////////////////////////////////////////////
-REFGUID CStdPreferencesClassDesc::ClassID()
-{
-    // {95FE3251-796C-4e3b-82F0-AD35F7FFA267}
-    static const GUID guid = {
-        0x95fe3251, 0x796c, 0x4e3b, { 0x82, 0xf0, 0xad, 0x35, 0xf7, 0xff, 0xa2, 0x67 }
-    };
-    return guid;
-}
-
-//////////////////////////////////////////////////////////////////////////
-int CStdPreferencesClassDesc::GetPagesCount()
-{
-    return static_cast<int>(m_pageCreators.size());
-}
-
-IPreferencesPage* CStdPreferencesClassDesc::CreateEditorPreferencesPage(int index)
-{
-    return (index >= m_pageCreators.size()) ? nullptr : m_pageCreators[index]();
-}
-

+ 0 - 44
Code/Editor/PreferencesStdPages.h

@@ -1,44 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-#ifndef CRYINCLUDE_EDITOR_PREFERENCESSTDPAGES_H
-#define CRYINCLUDE_EDITOR_PREFERENCESSTDPAGES_H
-#pragma once
-
-#include "Include/IPreferencesPage.h"
-#include <AzCore/std/functional.h>
-#include <AzCore/std/containers/vector.h>
-
-//////////////////////////////////////////////////////////////////////////
-class CStdPreferencesClassDesc
-    : public IPreferencesPageClassDesc
-    , public IPreferencesPageCreator
-{
-    ULONG m_refCount;
-    AZStd::vector< AZStd::function< IPreferencesPage*() > > m_pageCreators;
-public:
-    CStdPreferencesClassDesc();
-    virtual ~CStdPreferencesClassDesc() = default;
-
-    //////////////////////////////////////////////////////////////////////////
-    // IUnkown implementation.
-    HRESULT STDMETHODCALLTYPE QueryInterface(const IID& riid, void** ppvObj) override;
-    ULONG STDMETHODCALLTYPE AddRef() override;
-    ULONG STDMETHODCALLTYPE Release() override;
-    //////////////////////////////////////////////////////////////////////////
-
-    REFGUID ClassID() override;
-
-    //////////////////////////////////////////////////////////////////////////
-    int GetPagesCount() override;
-    IPreferencesPage* CreateEditorPreferencesPage(int index) override;
-};
-
-#endif // CRYINCLUDE_EDITOR_PREFERENCESSTDPAGES_H
-

+ 0 - 1
Code/Editor/TrackView/TrackViewKeyPropertiesDlg.h

@@ -14,7 +14,6 @@
 #if !defined(Q_MOC_RUN)
 #include "TrackViewSequence.h"
 #include "TrackViewNode.h"
-#include "Plugin.h"
 #include "TrackViewDopeSheetBase.h"
 
 #include <QScopedPointer>

+ 0 - 5
Code/Editor/editor_lib_files.cmake

@@ -228,8 +228,6 @@ set(FILES
     res/water.bmp
     res/work_in_progress_icon.ico
     res/MannFileManagerImageList.bmp
-    Plugin.cpp
-    Plugin.h
     PluginManager.cpp
     PluginManager.h
     IEditor.h
@@ -262,7 +260,6 @@ set(FILES
     Include/HitContext.h
     Include/ICommandManager.h
     Include/IDisplayViewport.h
-    Include/IEditorClassFactory.h
     Include/ILogFile.h
     Include/IKeyTimeSet.h
     Include/IPlugin.h
@@ -409,8 +406,6 @@ set(FILES
     Settings.cpp
     SettingsManager.cpp
     SettingsManagerDialog.cpp
-    PreferencesStdPages.h
-    PreferencesStdPages.cpp
     EditorPreferencesPageGeneral.h
     EditorPreferencesPageGeneral.cpp
     EditorPreferencesPageFiles.h

+ 0 - 1
Gems/LyShine/Code/Editor/Animation/UiAnimViewKeyPropertiesDlg.h

@@ -12,7 +12,6 @@
 #if !defined(Q_MOC_RUN)
 #include "UiAnimViewSequence.h"
 #include "UiAnimViewNode.h"
-#include "Plugin.h"
 #include "UiAnimViewDopeSheetBase.h"
 
 #include <QScopedPointer>