56 lines
1.2 KiB
C++
56 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <filesystem>
|
|
#include <string>
|
|
|
|
namespace XCEngine::UI::Editor::Host {
|
|
|
|
enum class EditorHostPngResourceKind : std::uint8_t {
|
|
FolderIcon = 0,
|
|
GameObjectIcon,
|
|
SceneIcon,
|
|
Logo,
|
|
LogoIcon,
|
|
CameraGizmoIcon,
|
|
DirectionalLightGizmoIcon,
|
|
PointLightGizmoIcon,
|
|
SpotLightGizmoIcon,
|
|
PlayButtonIcon,
|
|
PauseButtonIcon,
|
|
StepButtonIcon,
|
|
ViewMoveToolIcon,
|
|
ViewMoveToolActiveIcon,
|
|
MoveToolIcon,
|
|
MoveToolActiveIcon,
|
|
RotateToolIcon,
|
|
RotateToolActiveIcon,
|
|
ScaleToolIcon,
|
|
ScaleToolActiveIcon,
|
|
TransformToolIcon,
|
|
TransformToolActiveIcon,
|
|
};
|
|
|
|
struct EditorHostResourceBytes {
|
|
const std::uint8_t* data = nullptr;
|
|
std::size_t size = 0u;
|
|
|
|
bool IsValid() const {
|
|
return data != nullptr && size > 0u;
|
|
}
|
|
};
|
|
|
|
class EditorHostResourceService {
|
|
public:
|
|
virtual ~EditorHostResourceService() = default;
|
|
|
|
virtual bool TryLoadPngResource(
|
|
EditorHostPngResourceKind kind,
|
|
EditorHostResourceBytes& outBytes,
|
|
std::string& outError) const = 0;
|
|
virtual std::filesystem::path GetExecutableDirectory() const = 0;
|
|
};
|
|
|
|
} // namespace XCEngine::UI::Editor::Host
|