Move font API to GpCommon

This commit is contained in:
elasota
2020-09-12 14:01:51 -04:00
parent f07137b52d
commit 987a1dea75
43 changed files with 189 additions and 190 deletions

View File

@@ -115,7 +115,7 @@ void GpAppEnvironment::SetInputDrivers(IGpInputDriver *const* inputDrivers, size
m_numInputDrivers = numDrivers;
}
void GpAppEnvironment::SetFontHandler(PortabilityLayer::HostFontHandler *fontHandler)
void GpAppEnvironment::SetFontHandler(IGpFontHandler *fontHandler)
{
m_fontHandler = fontHandler;
}

View File

@@ -9,7 +9,6 @@
namespace PortabilityLayer
{
union HostSuspendCallArgument;
class HostFontHandler;
class HostVOSEventQueue;
}
@@ -17,6 +16,7 @@ struct IGpDisplayDriver;
struct IGpAudioDriver;
struct IGpInputDriver;
struct IGpFiber;
struct IGpFontHandler;
class GpAppEnvironment
{
@@ -33,7 +33,7 @@ public:
void SetDisplayDriver(IGpDisplayDriver *displayDriver);
void SetAudioDriver(IGpAudioDriver *audioDriver);
void SetInputDrivers(IGpInputDriver *const* inputDrivers, size_t numDrivers);
void SetFontHandler(PortabilityLayer::HostFontHandler *fontHandler);
void SetFontHandler(IGpFontHandler *fontHandler);
void SetVOSEventQueue(GpVOSEventQueue *eventQueue);
private:
@@ -59,7 +59,7 @@ private:
IGpDisplayDriver *m_displayDriver;
IGpAudioDriver *m_audioDriver;
IGpInputDriver *const* m_inputDrivers;
PortabilityLayer::HostFontHandler *m_fontHandler;
IGpFontHandler *m_fontHandler;
GpVOSEventQueue *m_vosEventQueue;
IGpFiber *m_applicationFiber;
IGpFiber *m_vosFiber;

View File

@@ -3,7 +3,7 @@
#include <assert.h>
PortabilityLayer::HostFontHandler *GpFontHandlerFactory::CreateFontHandler(const GpFontHandlerProperties &properties)
IGpFontHandler *GpFontHandlerFactory::CreateFontHandler(const GpFontHandlerProperties &properties)
{
assert(properties.m_type < EGpFontHandlerType_Count);

View File

@@ -2,19 +2,16 @@
#include "EGpFontHandlerType.h"
namespace PortabilityLayer
{
class HostFontHandler;
}
struct IGpFontHandler;
struct GpFontHandlerProperties;
class GpFontHandlerFactory
{
public:
typedef PortabilityLayer::HostFontHandler *(*FactoryFunc_t)(const GpFontHandlerProperties &properties);
typedef IGpFontHandler *(*FactoryFunc_t)(const GpFontHandlerProperties &properties);
static PortabilityLayer::HostFontHandler *CreateFontHandler(const GpFontHandlerProperties &properties);
static IGpFontHandler *CreateFontHandler(const GpFontHandlerProperties &properties);
static void RegisterFontHandlerFactory(EGpFontHandlerType type, FactoryFunc_t func);
private:

View File

@@ -12,6 +12,7 @@
#include "GpAppEnvironment.h"
#include "IGpAudioDriver.h"
#include "IGpDisplayDriver.h"
#include "IGpFontHandler.h"
#include "IGpInputDriver.h"
#include <string.h>
@@ -105,7 +106,7 @@ int GpMain::Run()
IGpDisplayDriver *displayDriver = GpDisplayDriverFactory::CreateDisplayDriver(ddProps);
IGpAudioDriver *audioDriver = GpAudioDriverFactory::CreateAudioDriver(adProps);
PortabilityLayer::HostFontHandler *fontHandler = GpFontHandlerFactory::CreateFontHandler(fontProps);
IGpFontHandler *fontHandler = GpFontHandlerFactory::CreateFontHandler(fontProps);
appEnvironment->Init();