#pragma once

#include <tl/ptr.h>
#include <tl/flag_set.h>
#include <fs/IFilesystem.h>
#include <fs/AbsPath.h>

#include "IUI/ImGui/imgui.h"
#include "Kit/EngineManager.h"

namespace kit
{

namespace icons
{

enum class Placement : uint8_t
{
	HCenter = 1 << 0,
	VCenter = 1 << 1,
	Left = 1 << 2,
	Right = 1 << 3,
	Top = 1 << 4,
	Bottom = 1 << 5,

	Center = HCenter | VCenter,
	TopLeft = Left | Top,
	BottomRight = Right | Bottom
};
using PlacementSet = tl::flag_set<Placement>;

void init(tl::lent_ref<kit::EngineManager> engineManager, tl::lent_ref<fs::IFilesystem> filesystem, fs::AbsPathView folderPath);
void shutdown();

struct Icon
{
	tl::lent_ptr<filament::Texture> texture;
	math::vec2f uv0;
	math::vec2f uv1;
};

struct FontIcon
{
	const char* icon = nullptr;
	explicit operator bool() const
	{
		return icon != nullptr;
	}
};

const Icon& getIcon(const tl::string& name);
const Icon& getIcon(const char* name);

}
}
