yaze 0.2.0
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 "ImGuiColorTextEdit/TextEditor.h"
7#include "app/core/common.h"
9#include "app/gui/style.h"
10
11namespace yaze {
12namespace app {
13namespace editor {
14
19class AssemblyEditor : public Editor {
20 public:
22 text_editor_.SetLanguageDefinition(gui::GetAssemblyLanguageDef());
23 text_editor_.SetPalette(TextEditor::GetDarkPalette());
24 text_editor_.SetShowWhitespaces(false);
26 }
27 void ChangeActiveFile(const std::string_view &filename) {
28 current_file_ = filename;
29 file_is_loaded_ = false;
30 }
31
32 void Update(bool &is_loaded);
33 void InlineUpdate();
34
35 void UpdateCodeView();
36
37 absl::Status Cut() override;
38 absl::Status Copy() override;
39 absl::Status Paste() override;
40
41 absl::Status Undo() override;
42 absl::Status Redo() override;
43 absl::Status Find() override { return absl::UnimplementedError("Find"); }
44
45 absl::Status Update() override;
46
47 void OpenFolder(const std::string &folder_path);
48
49 private:
50 void DrawFileMenu();
51 void DrawEditMenu();
52
53 void SetEditorText();
54
55 void DrawCurrentFolder();
56
57 void DrawFileTabView();
58
59 bool file_is_loaded_ = false;
60
61 std::vector<std::string> files_;
62 std::vector<TextEditor> open_files_;
63 ImVector<int> active_files_;
65
66 std::string current_file_;
68 TextEditor text_editor_;
69};
70
71} // namespace editor
72} // namespace app
73} // namespace yaze
74
75#endif
Text editor for modifying assembly code.
void ChangeActiveFile(const std::string_view &filename)
std::vector< TextEditor > open_files_
void OpenFolder(const std::string &folder_path)
std::vector< std::string > files_
Interface for editor classes.
Definition editor.h:39
TextEditor::LanguageDefinition GetAssemblyLanguageDef()
Definition style.cc:549
Definition common.cc:21