yaze
0.2.0
Link to the Past ROM Editor
Loading...
Searching...
No Matches
editor.h
Go to the documentation of this file.
1
#ifndef YAZE_APP_CORE_EDITOR_H
2
#define YAZE_APP_CORE_EDITOR_H
3
4
#include <array>
5
6
#include "absl/status/status.h"
7
#include "
app/editor/system/command_manager.h
"
8
#include "
app/editor/system/constant_manager.h
"
9
#include "
app/editor/system/extension_manager.h
"
10
#include "
app/editor/system/history_manager.h
"
11
#include "
app/editor/system/resource_manager.h
"
12
13
namespace
yaze
{
14
namespace
app {
15
20
namespace
editor {
21
22
struct
EditorContext
{
23
static
ConstantManager
constant_manager
;
24
static
CommandManager
command_manager
;
25
static
ExtensionManager
extension_manager
;
26
static
HistoryManager
history_manager
;
27
static
ResourceManager
resource_manager
;
28
};
29
30
enum class
EditorType
{
31
kAssembly
,
32
kDungeon
,
33
kGraphics
,
34
kMusic
,
35
kOverworld
,
36
kPalette
,
37
kScreen
,
38
kSprite
,
39
kMessage
,
40
kSettings
,
41
};
42
43
constexpr
std::array<const char *, 10>
kEditorNames
= {
44
"Assembly"
,
"Dungeon"
,
"Graphics"
,
"Music"
,
"Overworld"
,
45
"Palette"
,
"Screen"
,
"Sprite"
,
"Message"
,
"Settings"
,
46
};
47
54
class
Editor
{
55
public
:
56
Editor
() =
default
;
57
virtual
~Editor
() =
default
;
58
59
virtual
absl::Status
Cut
() = 0;
60
virtual
absl::Status
Copy
() = 0;
61
virtual
absl::Status
Paste
() = 0;
62
63
virtual
absl::Status
Undo
() = 0;
64
virtual
absl::Status
Redo
() = 0;
65
66
virtual
absl::Status
Update
() = 0;
67
68
virtual
absl::Status
Find
() = 0;
69
70
EditorType
type
()
const
{
return
type_
; }
71
72
protected
:
73
EditorType
type_
;
74
EditorContext
context_
;
75
};
76
80
typedef
struct
EditorLayoutParams
{
81
bool
v_split
;
82
bool
h_split
;
83
int
v_split_pos
;
84
int
h_split_pos
;
85
Editor
*
editor
=
nullptr
;
86
EditorLayoutParams
*
left
=
nullptr
;
87
EditorLayoutParams
*
right
=
nullptr
;
88
EditorLayoutParams
*
top
=
nullptr
;
89
EditorLayoutParams
*
bottom
=
nullptr
;
90
91
EditorLayoutParams
() {
92
v_split
=
false
;
93
h_split
=
false
;
94
v_split_pos
= 0;
95
h_split_pos
= 0;
96
}
97
}
EditorLayoutParams
;
98
99
absl::Status
DrawEditor
(
EditorLayoutParams
*params);
100
101
}
// namespace editor
102
}
// namespace app
103
}
// namespace yaze
104
105
#endif
// YAZE_APP_CORE_EDITOR_H
yaze::app::editor::CommandManager
Definition
command_manager.h:16
yaze::app::editor::ConstantManager
Definition
constant_manager.h:13
yaze::app::editor::Editor
Interface for editor classes.
Definition
editor.h:54
yaze::app::editor::Editor::Cut
virtual absl::Status Cut()=0
yaze::app::editor::Editor::Undo
virtual absl::Status Undo()=0
yaze::app::editor::Editor::Editor
Editor()=default
yaze::app::editor::Editor::Update
virtual absl::Status Update()=0
yaze::app::editor::Editor::Find
virtual absl::Status Find()=0
yaze::app::editor::Editor::Redo
virtual absl::Status Redo()=0
yaze::app::editor::Editor::type_
EditorType type_
Definition
editor.h:73
yaze::app::editor::Editor::Copy
virtual absl::Status Copy()=0
yaze::app::editor::Editor::Paste
virtual absl::Status Paste()=0
yaze::app::editor::Editor::~Editor
virtual ~Editor()=default
yaze::app::editor::Editor::type
EditorType type() const
Definition
editor.h:70
yaze::app::editor::Editor::context_
EditorContext context_
Definition
editor.h:74
yaze::app::editor::ExtensionManager
Definition
extension_manager.h:13
yaze::app::editor::HistoryManager
Definition
history_manager.h:13
yaze::app::editor::ResourceManager
Definition
resource_manager.h:11
command_manager.h
constant_manager.h
extension_manager.h
history_manager.h
yaze::app::editor::DrawEditor
absl::Status DrawEditor(EditorLayoutParams *params)
Definition
editor.cc:10
yaze::app::editor::EditorType
EditorType
Definition
editor.h:30
yaze::app::editor::EditorType::kOverworld
@ kOverworld
yaze::app::editor::EditorType::kGraphics
@ kGraphics
yaze::app::editor::EditorType::kDungeon
@ kDungeon
yaze::app::editor::EditorType::kSprite
@ kSprite
yaze::app::editor::EditorType::kMusic
@ kMusic
yaze::app::editor::EditorType::kScreen
@ kScreen
yaze::app::editor::EditorType::kMessage
@ kMessage
yaze::app::editor::EditorType::kAssembly
@ kAssembly
yaze::app::editor::EditorType::kPalette
@ kPalette
yaze::app::editor::EditorType::kSettings
@ kSettings
yaze::app::editor::EditorLayoutParams
struct yaze::app::editor::EditorLayoutParams EditorLayoutParams
Dynamic Editor Layout Parameters.
yaze::app::editor::kEditorNames
constexpr std::array< const char *, 10 > kEditorNames
Definition
editor.h:43
yaze
Definition
common.cc:22
resource_manager.h
yaze::app::editor::EditorContext
Definition
editor.h:22
yaze::app::editor::EditorContext::extension_manager
static ExtensionManager extension_manager
Definition
editor.h:25
yaze::app::editor::EditorContext::resource_manager
static ResourceManager resource_manager
Definition
editor.h:27
yaze::app::editor::EditorContext::history_manager
static HistoryManager history_manager
Definition
editor.h:26
yaze::app::editor::EditorContext::command_manager
static CommandManager command_manager
Definition
editor.h:24
yaze::app::editor::EditorContext::constant_manager
static ConstantManager constant_manager
Definition
editor.h:23
yaze::app::editor::EditorLayoutParams
Dynamic Editor Layout Parameters.
Definition
editor.h:80
yaze::app::editor::EditorLayoutParams::right
EditorLayoutParams * right
Definition
editor.h:87
yaze::app::editor::EditorLayoutParams::EditorLayoutParams
EditorLayoutParams()
Definition
editor.h:91
yaze::app::editor::EditorLayoutParams::v_split
bool v_split
Definition
editor.h:81
yaze::app::editor::EditorLayoutParams::h_split
bool h_split
Definition
editor.h:82
yaze::app::editor::EditorLayoutParams::editor
Editor * editor
Definition
editor.h:85
yaze::app::editor::EditorLayoutParams::h_split_pos
int h_split_pos
Definition
editor.h:84
yaze::app::editor::EditorLayoutParams::left
EditorLayoutParams * left
Definition
editor.h:86
yaze::app::editor::EditorLayoutParams::v_split_pos
int v_split_pos
Definition
editor.h:83
yaze::app::editor::EditorLayoutParams::top
EditorLayoutParams * top
Definition
editor.h:88
yaze::app::editor::EditorLayoutParams::bottom
EditorLayoutParams * bottom
Definition
editor.h:89
src
app
editor
editor.h
Generated by
1.12.0