Files
Aerofoil/PortabilityLayer/HostSystemServices.h

38 lines
1.0 KiB
C
Raw Normal View History

2019-12-21 18:40:17 -05:00
#pragma once
#ifndef __PL_HOST_SYSTEM_SERVICES_H__
#define __PL_HOST_SYSTEM_SERVICES_H__
#include <stdint.h>
#ifdef CreateMutex
#error "CreateMutex was macrod"
2019-12-21 18:40:17 -05:00
#endif
namespace PortabilityLayer
{
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;
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