2014-10-04 13:12:15 -06:00
|
|
|
// Copyright 2014 Dolphin Emulator Project
|
2021-07-04 19:22:19 -06:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2014-10-04 13:12:15 -06:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2018-04-14 08:42:54 -06:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
2021-04-27 15:43:04 -06:00
|
|
|
struct WindowSystemInfo;
|
|
|
|
|
2014-10-04 13:12:15 -06:00
|
|
|
namespace UICommon
|
|
|
|
{
|
|
|
|
void Init();
|
|
|
|
void Shutdown();
|
|
|
|
|
2021-04-27 15:43:04 -06:00
|
|
|
void InitControllers(const WindowSystemInfo& wsi);
|
|
|
|
void ShutdownControllers();
|
|
|
|
|
2021-02-02 17:25:06 -07:00
|
|
|
#ifdef HAVE_X11
|
2020-10-18 12:06:11 -06:00
|
|
|
void InhibitScreenSaver(unsigned long win, bool enable);
|
2018-01-01 14:03:50 -07:00
|
|
|
#else
|
2020-10-18 12:06:11 -06:00
|
|
|
void InhibitScreenSaver(bool enable);
|
2018-01-01 14:03:50 -07:00
|
|
|
#endif
|
|
|
|
|
2017-07-21 04:46:12 -06:00
|
|
|
// Calls std::locale::global, selecting a fallback locale if the
|
|
|
|
// requested locale isn't available
|
|
|
|
void SetLocale(std::string locale_name);
|
|
|
|
|
2014-10-04 13:12:15 -06:00
|
|
|
void CreateDirectories();
|
2021-11-21 19:44:33 -07:00
|
|
|
void SetUserDirectory(std::string custom_path);
|
2014-10-04 13:12:15 -06:00
|
|
|
|
2017-06-24 13:41:53 -06:00
|
|
|
bool TriggerSTMPowerEvent();
|
|
|
|
|
2017-12-31 12:33:36 -07:00
|
|
|
// Return a pretty file size string from byte count.
|
|
|
|
// e.g. 1134278 -> "1.08 MiB"
|
2020-04-10 07:14:03 -06:00
|
|
|
std::string FormatSize(u64 bytes, int decimals = 2);
|
2014-10-04 13:12:15 -06:00
|
|
|
} // namespace UICommon
|