yaze
0.2.2
Link to the Past ROM Editor
Loading...
Searching...
No Matches
popup_manager.h
Go to the documentation of this file.
1
#ifndef YAZE_APP_EDITOR_POPUP_MANAGER_H
2
#define YAZE_APP_EDITOR_POPUP_MANAGER_H
3
4
#include <functional>
5
#include <string>
6
#include <unordered_map>
7
8
#include "absl/status/status.h"
9
10
namespace
yaze
{
11
namespace
editor
{
12
13
// Forward declaration
14
class
EditorManager
;
15
16
struct
PopupParams
{
17
std::string
name
;
18
bool
is_visible
=
false
;
19
std::function<void()>
draw_function
;
20
};
21
22
// ImGui popup manager.
23
class
PopupManager
{
24
public
:
25
PopupManager
(
EditorManager
* editor_manager);
26
27
// Initialize popups
28
void
Initialize
();
29
30
// Draw all popups
31
void
DrawPopups
();
32
33
// Show a specific popup
34
void
Show
(
const
char
* name);
35
36
// Hide a specific popup
37
void
Hide
(
const
char
* name);
38
39
// Check if a popup is visible
40
bool
IsVisible
(
const
char
* name)
const
;
41
42
// Set the status for status popup
43
void
SetStatus
(
const
absl::Status& status);
44
45
// Get the current status
46
absl::Status
GetStatus
()
const
{
return
status_
; }
47
48
private
:
49
// Helper function to begin a centered popup
50
bool
BeginCentered
(
const
char
* name);
51
52
// Draw the about popup
53
void
DrawAboutPopup
();
54
55
// Draw the ROM info popup
56
void
DrawRomInfoPopup
();
57
58
// Draw the status popup
59
void
DrawStatusPopup
();
60
61
// Draw the save as popup
62
void
DrawSaveAsPopup
();
63
64
// Draw the new project popup
65
void
DrawNewProjectPopup
();
66
67
// Draw the supported features popup
68
void
DrawSupportedFeaturesPopup
();
69
70
// Draw the open ROM help popup
71
void
DrawOpenRomHelpPopup
();
72
73
// Draw the manage project popup
74
void
DrawManageProjectPopup
();
75
76
EditorManager
*
editor_manager_
;
77
std::unordered_map<std::string, PopupParams>
popups_
;
78
absl::Status
status_
;
79
bool
show_status_
=
false
;
80
absl::Status
prev_status_
;
81
};
82
83
}
// namespace editor
84
}
// namespace yaze
85
86
#endif
// YAZE_APP_EDITOR_POPUP_MANAGER_H
yaze::editor::EditorManager
The EditorManager controls the main editor window and manages the various editor classes.
Definition
editor_manager.h:44
yaze::editor::PopupManager::SetStatus
void SetStatus(const absl::Status &status)
Definition
popup_manager.cc:67
yaze::editor::PopupManager::GetStatus
absl::Status GetStatus() const
Definition
popup_manager.h:46
yaze::editor::PopupManager::IsVisible
bool IsVisible(const char *name) const
Definition
popup_manager.cc:59
yaze::editor::PopupManager::DrawPopups
void DrawPopups()
Definition
popup_manager.cc:28
yaze::editor::PopupManager::Show
void Show(const char *name)
Definition
popup_manager.cc:44
yaze::editor::PopupManager::Hide
void Hide(const char *name)
Definition
popup_manager.cc:51
yaze::editor::PopupManager::DrawSupportedFeaturesPopup
void DrawSupportedFeaturesPopup()
Definition
popup_manager.cc:185
yaze::editor::PopupManager::Initialize
void Initialize()
Definition
popup_manager.cc:17
yaze::editor::PopupManager::PopupManager
PopupManager(EditorManager *editor_manager)
Definition
popup_manager.cc:14
yaze::editor::PopupManager::popups_
std::unordered_map< std::string, PopupParams > popups_
Definition
popup_manager.h:77
yaze::editor::PopupManager::editor_manager_
EditorManager * editor_manager_
Definition
popup_manager.h:76
yaze::editor::PopupManager::DrawStatusPopup
void DrawStatusPopup()
Definition
popup_manager.cc:85
yaze::editor::PopupManager::DrawSaveAsPopup
void DrawSaveAsPopup()
Definition
popup_manager.cc:131
yaze::editor::PopupManager::prev_status_
absl::Status prev_status_
Definition
popup_manager.h:80
yaze::editor::PopupManager::status_
absl::Status status_
Definition
popup_manager.h:78
yaze::editor::PopupManager::BeginCentered
bool BeginCentered(const char *name)
Definition
popup_manager.cc:75
yaze::editor::PopupManager::show_status_
bool show_status_
Definition
popup_manager.h:79
yaze::editor::PopupManager::DrawRomInfoPopup
void DrawRomInfoPopup()
Definition
popup_manager.cc:119
yaze::editor::PopupManager::DrawAboutPopup
void DrawAboutPopup()
Definition
popup_manager.cc:107
yaze::editor::PopupManager::DrawOpenRomHelpPopup
void DrawOpenRomHelpPopup()
Definition
popup_manager.cc:214
yaze::editor::PopupManager::DrawNewProjectPopup
void DrawNewProjectPopup()
Definition
popup_manager.cc:145
yaze::editor::PopupManager::DrawManageProjectPopup
void DrawManageProjectPopup()
Definition
popup_manager.cc:227
yaze::editor
Editors are the view controllers for the application.
Definition
assembly_editor.cc:13
yaze
Main namespace for the application.
Definition
controller.cc:18
yaze::editor::PopupParams
Definition
popup_manager.h:16
yaze::editor::PopupParams::name
std::string name
Definition
popup_manager.h:17
yaze::editor::PopupParams::draw_function
std::function< void()> draw_function
Definition
popup_manager.h:19
yaze::editor::PopupParams::is_visible
bool is_visible
Definition
popup_manager.h:18
src
app
editor
system
popup_manager.h
Generated by
1.13.2