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 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_;
69
70 std::string current_file_;
73};
74
75} // namespace editor
76} // namespace yaze
77
78#endif
static const Palette & GetDarkPalette()
absl::Status Find() override
std::vector< TextEditor > open_files_
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:68
Editors are the view controllers for the application.
TextEditor::LanguageDefinition GetAssemblyLanguageDef()
Definition style.cc:277
Main namespace for the application.
Definition controller.cc:18
std::vector< FolderItem > subfolders
std::vector< std::string > files