2020-06-21 12:25:28 +00:00
|
|
|
//
|
|
|
|
// Platform.h
|
|
|
|
//
|
|
|
|
// Platform-specific functions.
|
|
|
|
//
|
|
|
|
|
2017-10-31 17:12:50 +00:00
|
|
|
#pragma once
|
|
|
|
#ifndef ES_CORE_PLATFORM_H
|
|
|
|
#define ES_CORE_PLATFORM_H
|
|
|
|
|
2017-11-01 22:21:10 +00:00
|
|
|
#include <string>
|
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
// Why the hell this naming inconsistency exists is well beyond me.
|
2020-08-23 15:04:30 +00:00
|
|
|
#if defined(_WIN64)
|
2020-06-21 12:25:28 +00:00
|
|
|
#define sleep Sleep
|
2012-09-10 18:48:00 +00:00
|
|
|
#endif
|
2013-05-13 19:53:28 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
enum QuitMode {
|
|
|
|
QUIT = 0,
|
|
|
|
REBOOT = 1,
|
|
|
|
POWEROFF = 2
|
2019-08-14 23:50:23 +00:00
|
|
|
};
|
|
|
|
|
2020-07-07 19:25:15 +00:00
|
|
|
// Uses UTF-8 for Unix and does a UTF-16/wstring conversion for Windows.
|
2020-06-21 12:25:28 +00:00
|
|
|
int runSystemCommand(const std::string& cmd_utf8);
|
2020-07-07 19:25:15 +00:00
|
|
|
// Windows specific UTF-16/wstring function. (FOR FUTURE USE)
|
|
|
|
int runSystemCommand(const std::wstring& cmd_utf16);
|
|
|
|
|
|
|
|
int launchEmulatorUnix(const std::string& cmd_utf8);
|
|
|
|
int launchEmulatorWindows(const std::wstring& cmd_utf16);
|
|
|
|
|
2020-07-18 11:21:44 +00:00
|
|
|
unsigned int getTaskbarState();
|
|
|
|
void hideTaskbar();
|
|
|
|
void revertTaskbarState(unsigned int& state);
|
|
|
|
|
2020-07-08 15:01:47 +00:00
|
|
|
// Clean, normal shutdown.
|
2019-08-14 23:50:23 +00:00
|
|
|
int quitES(QuitMode mode = QuitMode::QUIT);
|
2020-07-08 15:01:47 +00:00
|
|
|
// Immediately shut down the application as cleanly as possible.
|
|
|
|
void emergencyShutdown();
|
2019-08-14 23:50:23 +00:00
|
|
|
void processQuitMode();
|
2017-10-31 17:12:50 +00:00
|
|
|
|
|
|
|
#endif // ES_CORE_PLATFORM_H
|