summaryrefslogtreecommitdiff
path: root/Source/Core/UICommon/UICommon.h
blob: 991f584089dfa4fd4d26d5fa1c1b6a8575d41009 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2014 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include <string>

#include "Common/CommonTypes.h"
#include "Common/HookableEvent.h"

struct WindowSystemInfo;

namespace UICommon
{
void Init();
void Shutdown();

// Triggered from the Host-thread on Android before a potential process termination.
[[nodiscard]] Common::EventHook AddFlushUnsavedDataCallback(std::function<void()> callback);
void FlushUnsavedData();

void InitControllers(const WindowSystemInfo& wsi);
void ShutdownControllers();

void InhibitScreenSaver(bool inhibit);

// Calls std::locale::global, selecting a fallback locale if the
// requested locale isn't available
void SetLocale(std::string locale_name);

void CreateDirectories();
void SetUserDirectory(std::string custom_path);

bool TriggerSTMPowerEvent();

// Return a pretty file size string from byte count.
// e.g. 1134278 -> "1.08 MiB"
std::string FormatSize(u64 bytes, int decimals = 2);
}  // namespace UICommon