Duckstation/src/frontend-common/fullscreen_ui.h

86 lines
1.9 KiB
C
Raw Normal View History

2021-01-30 11:37:49 +00:00
#pragma once
#include "common/types.h"
2021-02-21 06:55:28 +00:00
#include <string>
#include <memory>
2021-01-30 11:37:49 +00:00
class HostDisplayTexture;
2021-01-30 11:37:49 +00:00
class CommonHostInterface;
class SettingsInterface;
struct Settings;
namespace FrontendCommon {
enum class ControllerNavigationButton : u32;
}
namespace FullscreenUI {
enum class MainWindowType
{
None,
Landing,
GameList,
Settings,
QuickMenu,
2021-02-26 14:44:53 +00:00
Achievements,
2021-06-18 21:40:11 +00:00
Leaderboards,
2021-01-30 11:37:49 +00:00
};
enum class SettingsPage
{
InterfaceSettings,
GameListSettings,
ConsoleSettings,
EmulationSettings,
BIOSSettings,
ControllerSettings,
HotkeySettings,
MemoryCardSettings,
DisplaySettings,
EnhancementSettings,
AudioSettings,
2021-02-26 14:44:53 +00:00
AchievementsSetings,
2021-01-30 11:37:49 +00:00
AdvancedSettings,
Count
};
bool Initialize(CommonHostInterface* host_interface);
bool IsInitialized();
2021-01-30 11:37:49 +00:00
bool HasActiveWindow();
void UpdateSettings();
2021-01-30 11:37:49 +00:00
void SystemCreated();
void SystemDestroyed();
void OpenQuickMenu();
void CloseQuickMenu();
#ifdef WITH_CHEEVOS
bool OpenAchievementsWindow();
bool OpenLeaderboardsWindow();
#endif
2021-01-30 11:37:49 +00:00
void Shutdown();
void Render();
bool IsBindingInput();
bool HandleKeyboardBinding(const char* keyName, bool pressed);
2021-01-30 11:37:49 +00:00
std::unique_ptr<HostDisplayTexture> LoadTextureResource(const char* name, bool allow_fallback = true);
2021-02-21 06:55:28 +00:00
// Returns true if the message has been dismissed.
bool DrawErrorWindow(const char* message);
bool DrawConfirmWindow(const char* message, bool* result);
void QueueGameListRefresh();
2021-01-30 11:37:49 +00:00
void EnsureGameListLoaded();
Settings& GetSettingsCopy();
void SaveAndApplySettings();
void SetDebugMenuAllowed(bool allowed);
2021-01-30 11:37:49 +00:00
/// Only ImGuiNavInput_Activate, ImGuiNavInput_Cancel, and DPad should be forwarded.
/// Returns true if the UI consumed the event, and it should not execute the normal handler.
bool SetControllerNavInput(FrontendCommon::ControllerNavigationButton button, bool value);
/// Forwards the controller navigation to ImGui for fullscreen navigation. Call before NewFrame().
void SetImGuiNavInputs();
} // namespace FullscreenUI