Text editor for modifying assembly code. More...
#include <assembly_editor.h>

Public Member Functions | |
| AssemblyEditor (Rom *rom=nullptr) | |
| void | ChangeActiveFile (const std::string_view &filename) |
| void | Initialize () override |
| absl::Status | Load () override |
| void | Update (bool &is_loaded) |
| void | InlineUpdate () |
| void | UpdateCodeView () |
| absl::Status | Cut () override |
| absl::Status | Copy () override |
| absl::Status | Paste () override |
| absl::Status | Undo () override |
| absl::Status | Redo () override |
| absl::Status | Find () override |
| absl::Status | Update () override |
| absl::Status | Save () override |
| void | OpenFolder (const std::string &folder_path) |
| absl::Status | ValidateCurrentFile () |
| absl::Status | ApplyPatchToRom () |
| void | UpdateErrorMarkers (const core::AsarPatchResult &result) |
| void | ClearErrorMarkers () |
| void | SetRom (Rom *rom) |
| Rom * | rom () const |
| bool | is_asar_initialized () const |
| const std::map< std::string, core::AsarSymbol > & | symbols () const |
| core::AsarWrapper * | asar_wrapper () |
Public Member Functions inherited from yaze::editor::Editor | |
| Editor ()=default | |
| virtual | ~Editor ()=default |
| void | SetDependencies (const EditorDependencies &deps) |
| virtual void | SetGameData (zelda3::GameData *game_data) |
| virtual absl::Status | Clear () |
| EditorType | type () const |
| bool * | active () |
| void | set_active (bool active) |
| void | toggle_active () |
| virtual bool | IsRomLoaded () const |
| virtual std::string | GetRomStatus () const |
| Rom * | rom () const |
| zelda3::GameData * | game_data () const |
| EditorContext | context () const |
| bool | HasContext () const |
Private Member Functions | |
| void | DrawCodeEditor () |
| void | DrawFileBrowser () |
| void | DrawSymbolsContent () |
| void | DrawBuildOutput () |
| void | DrawToolbarContent () |
| void | DrawFileMenu () |
| void | DrawEditMenu () |
| void | DrawAssembleMenu () |
| void | DrawCurrentFolder () |
| void | DrawFileTabView () |
| void | DrawToolset () |
| void | DrawSymbolPanel () |
Private Attributes | |
| bool | file_is_loaded_ = false |
| int | current_file_id_ = 0 |
| int | active_file_id_ = -1 |
| std::vector< std::string > | files_ |
| std::vector< TextEditor > | open_files_ |
| ImVector< int > | active_files_ |
| std::string | current_file_ |
| FolderItem | current_folder_ |
| TextEditor | text_editor_ |
| Rom * | rom_ |
| core::AsarWrapper | asar_ |
| bool | asar_initialized_ = false |
| bool | show_symbol_panel_ = false |
| std::map< std::string, core::AsarSymbol > | symbols_ |
| std::vector< std::string > | last_errors_ |
| std::vector< std::string > | last_warnings_ |
Additional Inherited Members | |
Protected Member Functions inherited from yaze::editor::Editor | |
| std::string | MakePanelTitle (const std::string &base_title) const |
| std::string | MakePanelId (const std::string &base_id) const |
| template<typename T > | |
| absl::StatusOr< T > | SafeRomAccess (std::function< T()> accessor, const std::string &operation="") const |
Protected Attributes inherited from yaze::editor::Editor | |
| bool | active_ = false |
| EditorType | type_ |
| EditorDependencies | dependencies_ |
Text editor for modifying assembly code.
Definition at line 29 of file assembly_editor.h.
|
inlineexplicit |
Definition at line 31 of file assembly_editor.h.
References TextEditor::GetDarkPalette(), yaze::editor::kAssembly, TextEditor::SetPalette(), TextEditor::SetShowWhitespaces(), text_editor_, and yaze::editor::Editor::type_.

| void yaze::editor::AssemblyEditor::ChangeActiveFile | ( | const std::string_view & | filename | ) |
Definition at line 610 of file assembly_editor.cc.
References active_files_, files_, yaze::gui::GetAssemblyLanguageDef(), TextEditor::GetDarkPalette(), yaze::util::LoadFile(), and open_files_.
Referenced by DrawCurrentFolder(), DrawFileMenu(), and DrawToolbarContent().

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 181 of file assembly_editor.cc.
References yaze::editor::Editor::dependencies_, DrawBuildOutput(), DrawCodeEditor(), DrawFileBrowser(), DrawSymbolsContent(), DrawToolbarContent(), yaze::gui::GetAssemblyLanguageDef(), yaze::editor::EditorDependencies::panel_manager, yaze::editor::PanelManager::RegisterEditorPanel(), TextEditor::SetLanguageDefinition(), and text_editor_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 210 of file assembly_editor.cc.
| void yaze::editor::AssemblyEditor::Update | ( | bool & | is_loaded | ) |
Definition at line 463 of file assembly_editor.cc.
References DrawCodeEditor(), and DrawSymbolPanel().

| void yaze::editor::AssemblyEditor::InlineUpdate | ( | ) |
Definition at line 474 of file assembly_editor.cc.
References TextEditor::CanUndo(), current_file_, TextEditor::GetCursorPosition(), TextEditor::GetLanguageDefinition(), TextEditor::GetTotalLines(), TextEditor::IsOverwrite(), TextEditor::LanguageDefinition::mName, TextEditor::Render(), and text_editor_.
Referenced by yaze::editor::MusicAssemblyPanel::Draw().
| void yaze::editor::AssemblyEditor::UpdateCodeView | ( | ) |
Definition at line 486 of file assembly_editor.cc.
References DrawFileBrowser(), and DrawToolbarContent().

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 642 of file assembly_editor.cc.
References TextEditor::Cut(), and text_editor_.

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 647 of file assembly_editor.cc.
References TextEditor::Copy(), and text_editor_.

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 652 of file assembly_editor.cc.
References TextEditor::Paste(), and text_editor_.

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 657 of file assembly_editor.cc.
References text_editor_, and TextEditor::Undo().

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 662 of file assembly_editor.cc.
References TextEditor::Redo(), and text_editor_.

|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 51 of file assembly_editor.h.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 667 of file assembly_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 494 of file assembly_editor.cc.
References active_file_id_, files_, open_files_, and yaze::util::SaveFile().
Referenced by DrawToolbarContent(), and DrawToolset().

| void yaze::editor::AssemblyEditor::OpenFolder | ( | const std::string & | folder_path | ) |
Definition at line 215 of file assembly_editor.cc.
References current_folder_.
Referenced by DrawCurrentFolder(), and DrawFileBrowser().
| absl::Status yaze::editor::AssemblyEditor::ValidateCurrentFile | ( | ) |
Definition at line 675 of file assembly_editor.cc.
References active_file_id_, asar_, asar_initialized_, ClearErrorMarkers(), files_, yaze::core::AsarWrapper::Initialize(), last_errors_, open_files_, and yaze::core::AsarWrapper::ValidateAssembly().
Referenced by DrawAssembleMenu(), DrawBuildOutput(), and DrawToolbarContent().

| absl::Status yaze::editor::AssemblyEditor::ApplyPatchToRom | ( | ) |
Definition at line 729 of file assembly_editor.cc.
References active_file_id_, yaze::core::AsarWrapper::ApplyPatch(), asar_, asar_initialized_, ClearErrorMarkers(), files_, yaze::core::AsarWrapper::GetSymbolTable(), yaze::core::AsarWrapper::Initialize(), yaze::Rom::is_loaded(), last_errors_, last_warnings_, yaze::Rom::LoadFromData(), open_files_, rom_, symbols_, UpdateErrorMarkers(), and yaze::Rom::vector().
Referenced by DrawAssembleMenu(), DrawBuildOutput(), and DrawToolbarContent().
| void yaze::editor::AssemblyEditor::UpdateErrorMarkers | ( | const core::AsarPatchResult & | result | ) |
Definition at line 780 of file assembly_editor.cc.
References active_file_id_, yaze::core::AsarPatchResult::errors, last_errors_, last_warnings_, open_files_, and yaze::core::AsarPatchResult::warnings.
Referenced by ApplyPatchToRom().
| void yaze::editor::AssemblyEditor::ClearErrorMarkers | ( | ) |
Definition at line 815 of file assembly_editor.cc.
References active_file_id_, last_errors_, and open_files_.
Referenced by ApplyPatchToRom(), and ValidateCurrentFile().
|
inline |
|
inline |
|
inline |
Definition at line 69 of file assembly_editor.h.
References asar_initialized_.
|
inline |
Definition at line 70 of file assembly_editor.h.
References symbols_.
|
inline |
Definition at line 73 of file assembly_editor.h.
References asar_.
|
private |
Definition at line 223 of file assembly_editor.cc.
References TextEditor::CanUndo(), current_file_, DrawAssembleMenu(), DrawEditMenu(), DrawFileMenu(), DrawFileTabView(), TextEditor::GetCursorPosition(), TextEditor::GetLanguageDefinition(), TextEditor::GetTotalLines(), TextEditor::IsOverwrite(), TextEditor::LanguageDefinition::mName, TextEditor::Render(), and text_editor_.
Referenced by Initialize(), and Update().
|
private |
Definition at line 248 of file assembly_editor.cc.
References yaze::project::YazeProject::code_folder, current_folder_, yaze::editor::Editor::dependencies_, DrawCurrentFolder(), yaze::project::YazeProject::GetAbsolutePath(), ICON_MD_FOLDER_OPEN, yaze::editor::FolderItem::name, OpenFolder(), yaze::editor::EditorDependencies::project, and yaze::util::FileDialogWrapper::ShowOpenFolderDialog().
Referenced by Initialize(), and UpdateCodeView().

|
private |
Definition at line 276 of file assembly_editor.cc.
References ICON_MD_SEARCH, and symbols_.
Referenced by Initialize().
|
private |
Definition at line 311 of file assembly_editor.cc.
References active_file_id_, ApplyPatchToRom(), yaze::editor::Editor::dependencies_, ICON_MD_BUILD, ICON_MD_CHECK_CIRCLE, ICON_MD_ERROR, ICON_MD_WARNING, yaze::Rom::is_loaded(), yaze::editor::kSuccess, last_errors_, last_warnings_, open_files_, rom_, yaze::editor::ToastManager::Show(), yaze::editor::EditorDependencies::toast_manager, and ValidateCurrentFile().
Referenced by Initialize().

|
private |
Definition at line 363 of file assembly_editor.cc.
References active_file_id_, ApplyPatchToRom(), ChangeActiveFile(), current_folder_, ICON_MD_BUILD, ICON_MD_CHECK_CIRCLE, ICON_MD_FILE_OPEN, ICON_MD_FOLDER_OPEN, ICON_MD_SAVE, yaze::Rom::is_loaded(), open_files_, rom_, Save(), yaze::util::FileDialogWrapper::ShowOpenFileDialog(), yaze::util::FileDialogWrapper::ShowOpenFolderDialog(), and ValidateCurrentFile().
Referenced by Initialize(), and UpdateCodeView().
|
private |
Definition at line 571 of file assembly_editor.cc.
References ChangeActiveFile(), ICON_MD_FILE_OPEN, ICON_MD_SAVE, and yaze::util::FileDialogWrapper::ShowOpenFileDialog().
Referenced by DrawCodeEditor().

|
private |
Definition at line 584 of file assembly_editor.cc.
References TextEditor::Copy(), TextEditor::Cut(), ICON_MD_CONTENT_COPY, ICON_MD_CONTENT_CUT, ICON_MD_CONTENT_PASTE, ICON_MD_REDO, ICON_MD_SEARCH, ICON_MD_UNDO, TextEditor::Paste(), TextEditor::Redo(), text_editor_, and TextEditor::Undo().
Referenced by DrawCodeEditor().
|
private |
Definition at line 826 of file assembly_editor.cc.
References active_file_id_, ApplyPatchToRom(), asar_, yaze::core::VersionManager::CreateSnapshot(), yaze::editor::Editor::dependencies_, yaze::project::YazeProject::GetAbsolutePath(), yaze::core::AsarWrapper::GetSymbolTable(), ICON_MD_BUILD, ICON_MD_CAMERA_ALT, ICON_MD_CHECK_CIRCLE, ICON_MD_FILE_UPLOAD, ICON_MD_LIST, yaze::Rom::is_loaded(), yaze::editor::kError, yaze::editor::kSuccess, yaze::editor::kWarning, last_errors_, last_warnings_, yaze::core::AsarWrapper::LoadSymbolsFromFile(), open_files_, yaze::editor::EditorDependencies::project, rom_, yaze::editor::ToastManager::Show(), show_symbol_panel_, symbols_, yaze::project::YazeProject::symbols_filename, yaze::editor::EditorDependencies::toast_manager, ValidateCurrentFile(), and yaze::editor::EditorDependencies::version_manager.
Referenced by DrawCodeEditor().
|
private |
Definition at line 517 of file assembly_editor.cc.
References ChangeActiveFile(), yaze::project::YazeProject::code_folder, current_folder_, yaze::editor::Editor::dependencies_, yaze::editor::FolderItem::files, yaze::project::YazeProject::GetAbsolutePath(), yaze::editor::FolderItem::name, OpenFolder(), yaze::editor::EditorDependencies::project, and yaze::editor::FolderItem::subfolders.
Referenced by DrawFileBrowser().

|
private |
Definition at line 411 of file assembly_editor.cc.
References active_file_id_, active_files_, files_, open_files_, and text_editor_.
Referenced by DrawCodeEditor().
|
private |
Definition at line 503 of file assembly_editor.cc.
References yaze::gui::Toolset::AddAction(), yaze::gui::Toolset::Begin(), current_folder_, yaze::gui::Toolset::End(), ICON_MD_FOLDER_OPEN, ICON_MD_SAVE, Save(), and yaze::util::FileDialogWrapper::ShowOpenFolderDialog().
|
private |
Definition at line 926 of file assembly_editor.cc.
References show_symbol_panel_, and symbols_.
Referenced by Update().
|
private |
Definition at line 94 of file assembly_editor.h.
|
private |
Definition at line 95 of file assembly_editor.h.
|
private |
Definition at line 96 of file assembly_editor.h.
Referenced by ApplyPatchToRom(), ClearErrorMarkers(), DrawAssembleMenu(), DrawBuildOutput(), DrawFileTabView(), DrawToolbarContent(), Save(), UpdateErrorMarkers(), and ValidateCurrentFile().
|
private |
Definition at line 98 of file assembly_editor.h.
Referenced by ApplyPatchToRom(), ChangeActiveFile(), DrawFileTabView(), Save(), and ValidateCurrentFile().
|
private |
Definition at line 99 of file assembly_editor.h.
Referenced by ApplyPatchToRom(), ChangeActiveFile(), ClearErrorMarkers(), DrawAssembleMenu(), DrawBuildOutput(), DrawFileTabView(), DrawToolbarContent(), Save(), UpdateErrorMarkers(), and ValidateCurrentFile().
|
private |
Definition at line 100 of file assembly_editor.h.
Referenced by ChangeActiveFile(), and DrawFileTabView().
|
private |
Definition at line 102 of file assembly_editor.h.
Referenced by DrawCodeEditor(), and InlineUpdate().
|
private |
Definition at line 103 of file assembly_editor.h.
Referenced by DrawCurrentFolder(), DrawFileBrowser(), DrawToolbarContent(), DrawToolset(), and OpenFolder().
|
private |
Definition at line 104 of file assembly_editor.h.
Referenced by AssemblyEditor(), Copy(), Cut(), DrawCodeEditor(), DrawEditMenu(), DrawFileTabView(), Initialize(), InlineUpdate(), Paste(), Redo(), and Undo().
|
private |
Definition at line 106 of file assembly_editor.h.
Referenced by ApplyPatchToRom(), DrawAssembleMenu(), DrawBuildOutput(), DrawToolbarContent(), rom(), and SetRom().
|
private |
Definition at line 109 of file assembly_editor.h.
Referenced by ApplyPatchToRom(), asar_wrapper(), DrawAssembleMenu(), and ValidateCurrentFile().
|
private |
Definition at line 110 of file assembly_editor.h.
Referenced by ApplyPatchToRom(), is_asar_initialized(), and ValidateCurrentFile().
|
private |
Definition at line 111 of file assembly_editor.h.
Referenced by DrawAssembleMenu(), and DrawSymbolPanel().
|
private |
Definition at line 112 of file assembly_editor.h.
Referenced by ApplyPatchToRom(), DrawAssembleMenu(), DrawSymbolPanel(), DrawSymbolsContent(), and symbols().
|
private |
Definition at line 113 of file assembly_editor.h.
Referenced by ApplyPatchToRom(), ClearErrorMarkers(), DrawAssembleMenu(), DrawBuildOutput(), UpdateErrorMarkers(), and ValidateCurrentFile().
|
private |
Definition at line 114 of file assembly_editor.h.
Referenced by ApplyPatchToRom(), DrawAssembleMenu(), DrawBuildOutput(), and UpdateErrorMarkers().