yaze
0.2.2
Link to the Past ROM Editor
Loading...
Searching...
No Matches
assembly_editor.h
Go to the documentation of this file.
1
#ifndef YAZE_APP_EDITOR_ASSEMBLY_EDITOR_H
2
#define YAZE_APP_EDITOR_ASSEMBLY_EDITOR_H
3
4
#include <string>
5
6
#include "
app/editor/editor.h
"
7
#include "
app/gui/modules/text_editor.h
"
8
#include "
app/gui/style.h
"
9
10
namespace
yaze
{
11
namespace
editor
{
12
13
struct
FolderItem
{
14
std::string
name
;
15
std::vector<FolderItem>
subfolders
;
16
std::vector<std::string>
files
;
17
};
18
23
class
AssemblyEditor
:
public
Editor
{
24
public
:
25
AssemblyEditor
() {
26
text_editor_
.SetLanguageDefinition(
gui::GetAssemblyLanguageDef
());
27
text_editor_
.SetPalette(
TextEditor::GetDarkPalette
());
28
text_editor_
.SetShowWhitespaces(
false
);
29
type_
=
EditorType::kAssembly
;
30
}
31
void
ChangeActiveFile
(
const
std::string_view &filename) {
32
current_file_
= filename;
33
file_is_loaded_
=
false
;
34
}
35
36
void
Update
(
bool
&is_loaded);
37
void
InlineUpdate
();
38
39
void
UpdateCodeView
();
40
41
absl::Status
Cut
()
override
;
42
absl::Status
Copy
()
override
;
43
absl::Status
Paste
()
override
;
44
45
absl::Status
Undo
()
override
;
46
absl::Status
Redo
()
override
;
47
absl::Status
Find
()
override
{
return
absl::UnimplementedError(
"Find"
); }
48
49
absl::Status
Update
()
override
;
50
51
void
OpenFolder
(
const
std::string &folder_path);
52
53
private
:
54
void
DrawFileMenu
();
55
void
DrawEditMenu
();
56
57
void
SetEditorText
();
58
59
void
DrawCurrentFolder
();
60
61
void
DrawFileTabView
();
62
63
bool
file_is_loaded_
=
false
;
64
65
std::vector<std::string>
files_
;
66
std::vector<TextEditor>
open_files_
;
67
ImVector<int>
active_files_
;
68
int
current_file_id_
= 0;
69
70
std::string
current_file_
;
71
FolderItem
current_folder_
;
72
TextEditor
text_editor_
;
73
};
74
75
}
// namespace editor
76
}
// namespace yaze
77
78
#endif
TextEditor
Definition
text_editor.h:17
TextEditor::GetDarkPalette
static const Palette & GetDarkPalette()
Definition
text_editor.cc:1809
yaze::editor::AssemblyEditor::current_file_
std::string current_file_
Definition
assembly_editor.h:70
yaze::editor::AssemblyEditor::Find
absl::Status Find() override
Definition
assembly_editor.h:47
yaze::editor::AssemblyEditor::InlineUpdate
void InlineUpdate()
Definition
assembly_editor.cc:125
yaze::editor::AssemblyEditor::current_file_id_
int current_file_id_
Definition
assembly_editor.h:68
yaze::editor::AssemblyEditor::AssemblyEditor
AssemblyEditor()
Definition
assembly_editor.h:25
yaze::editor::AssemblyEditor::UpdateCodeView
void UpdateCodeView()
Definition
assembly_editor.cc:139
yaze::editor::AssemblyEditor::open_files_
std::vector< TextEditor > open_files_
Definition
assembly_editor.h:66
yaze::editor::AssemblyEditor::file_is_loaded_
bool file_is_loaded_
Definition
assembly_editor.h:63
yaze::editor::AssemblyEditor::DrawCurrentFolder
void DrawCurrentFolder()
Definition
assembly_editor.cc:177
yaze::editor::AssemblyEditor::ChangeActiveFile
void ChangeActiveFile(const std::string_view &filename)
Definition
assembly_editor.h:31
yaze::editor::AssemblyEditor::DrawEditMenu
void DrawEditMenu()
Definition
assembly_editor.cc:293
yaze::editor::AssemblyEditor::Copy
absl::Status Copy() override
Definition
assembly_editor.cc:339
yaze::editor::AssemblyEditor::DrawFileMenu
void DrawFileMenu()
Definition
assembly_editor.cc:280
yaze::editor::AssemblyEditor::text_editor_
TextEditor text_editor_
Definition
assembly_editor.h:72
yaze::editor::AssemblyEditor::OpenFolder
void OpenFolder(const std::string &folder_path)
Definition
assembly_editor.cc:100
yaze::editor::AssemblyEditor::Paste
absl::Status Paste() override
Definition
assembly_editor.cc:344
yaze::editor::AssemblyEditor::current_folder_
FolderItem current_folder_
Definition
assembly_editor.h:71
yaze::editor::AssemblyEditor::Update
absl::Status Update() override
Definition
assembly_editor.cc:359
yaze::editor::AssemblyEditor::files_
std::vector< std::string > files_
Definition
assembly_editor.h:65
yaze::editor::AssemblyEditor::Redo
absl::Status Redo() override
Definition
assembly_editor.cc:354
yaze::editor::AssemblyEditor::active_files_
ImVector< int > active_files_
Definition
assembly_editor.h:67
yaze::editor::AssemblyEditor::Undo
absl::Status Undo() override
Definition
assembly_editor.cc:349
yaze::editor::AssemblyEditor::SetEditorText
void SetEditorText()
Definition
assembly_editor.cc:319
yaze::editor::AssemblyEditor::Cut
absl::Status Cut() override
Definition
assembly_editor.cc:334
yaze::editor::AssemblyEditor::DrawFileTabView
void DrawFileTabView()
Definition
assembly_editor.cc:227
yaze::editor::Editor::Editor
Editor()=default
yaze::editor::Editor::type_
EditorType type_
Definition
editor.h:68
editor.h
yaze::editor
Editors are the view controllers for the application.
Definition
assembly_editor.cc:13
yaze::editor::EditorType::kAssembly
@ kAssembly
Definition
editor.h:26
yaze::gui::GetAssemblyLanguageDef
TextEditor::LanguageDefinition GetAssemblyLanguageDef()
Definition
style.cc:277
yaze
Main namespace for the application.
Definition
controller.cc:18
yaze::editor::FolderItem
Definition
assembly_editor.h:13
yaze::editor::FolderItem::subfolders
std::vector< FolderItem > subfolders
Definition
assembly_editor.h:15
yaze::editor::FolderItem::files
std::vector< std::string > files
Definition
assembly_editor.h:16
yaze::editor::FolderItem::name
std::string name
Definition
assembly_editor.h:14
style.h
text_editor.h
src
app
editor
code
assembly_editor.h
Generated by
1.13.2