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"
8#include "app/gui/style.h"
9
10namespace yaze {
11namespace editor {
12
13struct FolderItem {
14 std::string name;
15 std::vector<FolderItem> subfolders;
16 std::vector<std::string> files;
17};
18
23class AssemblyEditor : public Editor {
24 public:
26 text_editor_.SetLanguageDefinition(gui::GetAssemblyLanguageDef());
28 text_editor_.SetShowWhitespaces(false);
30 }
31 void ChangeActiveFile(const std::string_view &filename) {
32 current_file_ = filename;
33 file_is_loaded_ = false;
34 }
35
36 void Initialize() override;
37 absl::Status Load() override;
38 void Update(bool &is_loaded);
39 void InlineUpdate();
40
41 void UpdateCodeView();
42
43 absl::Status Cut() override;
44 absl::Status Copy() override;
45 absl::Status Paste() override;
46
47 absl::Status Undo() override;
48 absl::Status Redo() override;
49 absl::Status Find() override { return absl::UnimplementedError("Find"); }
50
51 absl::Status Update() override;
52
53 absl::Status Save() override { return absl::UnimplementedError("Save"); }
54
55 void OpenFolder(const std::string &folder_path);
56
57 private:
58 void DrawFileMenu();
59 void DrawEditMenu();
60 void SetEditorText();
61 void DrawCurrentFolder();
62 void DrawFileTabView();
63
64 bool file_is_loaded_ = false;
66
67 std::vector<std::string> files_;
68 std::vector<TextEditor> open_files_;
69 ImVector<int> active_files_;
70
71 std::string current_file_;
74};
75
76} // namespace editor
77} // namespace yaze
78
79#endif
static const Palette & GetDarkPalette()
absl::Status Find() override
absl::Status Save() override
std::vector< TextEditor > open_files_
absl::Status Load() override
void ChangeActiveFile(const std::string_view &filename)
absl::Status Copy() override
void OpenFolder(const std::string &folder_path)
absl::Status Paste() override
absl::Status Update() override
std::vector< std::string > files_
absl::Status Redo() override
absl::Status Undo() override
absl::Status Cut() override
EditorType type_
Definition editor.h:88
Editors are the view controllers for the application.
TextEditor::LanguageDefinition GetAssemblyLanguageDef()
Definition style.cc:292
Main namespace for the application.
Definition controller.cc:18
std::vector< FolderItem > subfolders
std::vector< std::string > files