Duckstation/src/frontend-common/fullscreen_ui.h

65 lines
1.7 KiB
C
Raw Normal View History

2021-01-30 11:37:49 +00:00
#pragma once
#include "common/progress_callback.h"
2021-01-30 11:37:49 +00:00
#include "common/types.h"
#include <memory>
#include <string>
2021-01-30 11:37:49 +00:00
class HostDisplayTexture;
2021-01-30 11:37:49 +00:00
namespace FullscreenUI {
bool Initialize();
bool IsInitialized();
2021-01-30 11:37:49 +00:00
bool HasActiveWindow();
void OnSystemStarted();
void OnSystemPaused();
void OnSystemResumed();
void OnSystemDestroyed();
void OnRunningGameChanged();
void OpenPauseMenu();
bool OpenAchievementsWindow();
bool OpenLeaderboardsWindow();
2021-01-30 11:37:49 +00:00
void Shutdown();
void Render();
2022-09-09 10:32:21 +00:00
void InvalidateCoverCache();
// Returns true if the message has been dismissed.
bool DrawErrorWindow(const char* message);
bool DrawConfirmWindow(const char* message, bool* result);
class ProgressCallback final : public BaseProgressCallback
{
public:
ProgressCallback(std::string name);
~ProgressCallback() override;
2022-09-17 05:51:05 +00:00
ALWAYS_INLINE const std::string& GetName() const { return m_name; }
void PushState() override;
void PopState() override;
void SetCancellable(bool cancellable) override;
void SetTitle(const char* title) override;
void SetStatusText(const char* text) override;
void SetProgressRange(u32 range) override;
void SetProgressValue(u32 value) override;
2021-01-30 11:37:49 +00:00
void DisplayError(const char* message) override;
void DisplayWarning(const char* message) override;
void DisplayInformation(const char* message) override;
void DisplayDebugMessage(const char* message) override;
2021-01-30 11:37:49 +00:00
void ModalError(const char* message) override;
bool ModalConfirmation(const char* message) override;
void ModalInformation(const char* message) override;
2021-01-30 11:37:49 +00:00
void SetCancelled();
2021-01-30 11:37:49 +00:00
private:
void Redraw(bool force);
std::string m_name;
int m_last_progress_percent = -1;
};
2021-01-30 11:37:49 +00:00
} // namespace FullscreenUI