2019-12-21 18:40:17 -05:00
|
|
|
#pragma once
|
|
|
|
|
#ifndef __PL_HOST_SYSTEM_SERVICES_H__
|
|
|
|
|
#define __PL_HOST_SYSTEM_SERVICES_H__
|
|
|
|
|
|
2019-12-11 00:51:42 -05:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
#ifdef CreateMutex
|
|
|
|
|
#error "CreateMutex was macrod"
|
2019-12-21 18:40:17 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
namespace PortabilityLayer
|
2019-12-11 00:51:42 -05:00
|
|
|
{
|
|
|
|
|
class HostMutex;
|
|
|
|
|
class HostThreadEvent;
|
2019-12-21 18:40:17 -05:00
|
|
|
|
|
|
|
|
class HostSystemServices
|
|
|
|
|
{
|
|
|
|
|
public:
|
2019-12-29 21:31:49 -05:00
|
|
|
virtual int64_t GetTime() const = 0;
|
2019-12-26 12:58:58 -05:00
|
|
|
virtual void GetLocalDateTime(unsigned int &year, unsigned int &month, unsigned int &day, unsigned int &hour, unsigned int &minute, unsigned int &second) const = 0;
|
2019-12-21 18:40:17 -05:00
|
|
|
virtual HostMutex *CreateMutex() = 0;
|
2020-09-28 09:58:19 -04:00
|
|
|
virtual HostMutex *CreateRecursiveMutex() = 0;
|
2019-12-21 18:40:17 -05:00
|
|
|
virtual HostThreadEvent *CreateThreadEvent(bool autoReset, bool startSignaled) = 0;
|
2020-10-10 02:42:06 -04:00
|
|
|
virtual uint64_t GetFreeMemoryCosmetic() const = 0; // Returns free memory in bytes, does not have to be accurate
|
2020-01-04 01:19:01 -05:00
|
|
|
virtual void Beep() const = 0;
|
2020-10-11 19:50:03 -04:00
|
|
|
virtual bool IsTouchscreen() const = 0;
|
|
|
|
|
virtual bool IsUsingMouseAsTouch() const = 0;
|
2019-12-21 18:40:17 -05:00
|
|
|
|
|
|
|
|
static void SetInstance(HostSystemServices *instance);
|
|
|
|
|
static HostSystemServices *GetInstance();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
static HostSystemServices *ms_instance;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|