Move font handler and platform-independent shell stuff

This commit is contained in:
elasota
2020-09-12 11:52:19 -04:00
parent 4a78f10975
commit 1d3c84a473
37 changed files with 597 additions and 117 deletions

View File

@@ -0,0 +1,23 @@
#include "GpFontHandlerFactory.h"
#include "GpFontHandlerProperties.h"
#include <assert.h>
PortabilityLayer::HostFontHandler *GpFontHandlerFactory::CreateFontHandler(const GpFontHandlerProperties &properties)
{
assert(properties.m_type < EGpFontHandlerType_Count);
if (ms_registry[properties.m_type])
return ms_registry[properties.m_type](properties);
else
return nullptr;
}
void GpFontHandlerFactory::RegisterFontHandlerFactory(EGpFontHandlerType type, FactoryFunc_t func)
{
assert(type < EGpFontHandlerType_Count);
ms_registry[type] = func;
}
GpFontHandlerFactory::FactoryFunc_t GpFontHandlerFactory::ms_registry[EGpFontHandlerType_Count];