7996591182
This work has been on hold for a while. Revisiting removal of thumbnail contexts now while debugging related lockups exiting tools from script. Thumbnail contexts are an unused layer of indirection that makes debugging the system more difficult. All systems were only referencing the default context. Signed-off-by: Guthrie Adams <guthadam@amazon.com>
54 lines
2.3 KiB
C++
54 lines
2.3 KiB
C++
/*
|
|
* 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
|
|
|
|
#include <AzCore/Memory/SystemAllocator.h>
|
|
#include <AzCore/Component/Component.h>
|
|
#include <AzToolsFramework/Thumbnails/ThumbnailerBus.h>
|
|
|
|
// ThumbnailerNullComponent is an alternative to ThumbnailerComponent that can be used by tools that don't use Qt.
|
|
// It doesn't do anything (hence "null"), but it allows the system and editor components that rely on the ThumbnailService
|
|
// to start up and function.
|
|
|
|
namespace AzToolsFramework
|
|
{
|
|
namespace Thumbnailer
|
|
{
|
|
class ThumbnailerNullComponent
|
|
: public AZ::Component
|
|
, public AzToolsFramework::Thumbnailer::ThumbnailerRequestBus::Handler
|
|
{
|
|
public:
|
|
AZ_COMPONENT(ThumbnailerNullComponent, "{8009D651-3FAA-9815-B99E-AF174A3B29D4}")
|
|
|
|
ThumbnailerNullComponent();
|
|
virtual ~ThumbnailerNullComponent();
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// AZ::Component
|
|
//////////////////////////////////////////////////////////////////////////
|
|
void Activate() override;
|
|
void Deactivate() override;
|
|
static void Reflect(AZ::ReflectContext* context);
|
|
static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& services);
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// ThumbnailerRequests
|
|
//////////////////////////////////////////////////////////////////////////
|
|
void RegisterThumbnailProvider(AzToolsFramework::Thumbnailer::SharedThumbnailProvider provider) override;
|
|
void UnregisterThumbnailProvider(const char* providerName) override;
|
|
AzToolsFramework::Thumbnailer::SharedThumbnail GetThumbnail(AzToolsFramework::Thumbnailer::SharedThumbnailKey thumbnailKey) override;
|
|
bool IsLoading(AzToolsFramework::Thumbnailer::SharedThumbnailKey thumbnailKey) override;
|
|
QThreadPool* GetThreadPool() override;
|
|
|
|
private:
|
|
AzToolsFramework::Thumbnailer::SharedThumbnail m_nullThumbnail;
|
|
};
|
|
} // Thumbnailer
|
|
} // namespace AzToolsFramework
|