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) |
void | set_rom (Rom *rom) |
Rom * | rom () const |
![]() | |
Editor ()=default | |
virtual | ~Editor ()=default |
virtual absl::Status | Clear () |
EditorType | type () const |
void | set_context (EditorContext *context) |
bool * | active () |
void | set_active (bool active) |
virtual bool | IsRomLoaded () const |
virtual std::string | GetRomStatus () const |
Private Member Functions | |
void | DrawFileMenu () |
void | DrawEditMenu () |
void | DrawCurrentFolder () |
void | DrawFileTabView () |
void | DrawToolset () |
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_ |
Additional Inherited Members | |
![]() | |
std::string | MakeCardTitle (const std::string &base_title) const |
template<typename T > | |
absl::StatusOr< T > | SafeRomAccess (std::function< T()> accessor, const std::string &operation="") const |
![]() | |
bool | active_ = false |
EditorType | type_ |
EditorContext * | context_ = nullptr |
Text editor for modifying assembly code.
Definition at line 26 of file assembly_editor.h.
|
inlineexplicit |
Definition at line 28 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 387 of file assembly_editor.cc.
References active_files_, files_, TextEditor::GetDarkPalette(), yaze::util::LoadFile(), and open_files_.
Referenced by DrawCurrentFolder(), and DrawFileMenu().
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 175 of file assembly_editor.cc.
References TextEditor::SetLanguageDefinition(), and text_editor_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 179 of file assembly_editor.cc.
References yaze::gui::EditorCardManager::Get().
void yaze::editor::AssemblyEditor::Update | ( | bool & | is_loaded | ) |
Definition at line 191 of file assembly_editor.cc.
References TextEditor::CanUndo(), current_file_, DrawEditMenu(), DrawFileMenu(), TextEditor::GetCursorPosition(), TextEditor::GetLanguageDefinition(), TextEditor::GetTotalLines(), TextEditor::IsOverwrite(), TextEditor::LanguageDefinition::mName, TextEditor::Render(), and text_editor_.
Referenced by yaze::editor::EditorManager::DrawMenuBar().
void yaze::editor::AssemblyEditor::InlineUpdate | ( | ) |
Definition at line 211 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::MusicEditor::Update().
void yaze::editor::AssemblyEditor::UpdateCodeView | ( | ) |
Definition at line 223 of file assembly_editor.cc.
References active_file_id_, active_files_, yaze::gui::EditorCard::Begin(), current_folder_, DrawCurrentFolder(), DrawToolset(), yaze::gui::EditorCard::End(), files_, ICON_MD_DESCRIPTION, ICON_MD_FOLDER, yaze::editor::Editor::MakeCardTitle(), yaze::editor::FolderItem::name, open_files_, yaze::util::FileDialogWrapper::ShowOpenFolderDialog(), and yaze::gui::VerticalSpacing().
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 419 of file assembly_editor.cc.
References TextEditor::Cut(), and text_editor_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 424 of file assembly_editor.cc.
References TextEditor::Copy(), and text_editor_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 429 of file assembly_editor.cc.
References TextEditor::Paste(), and text_editor_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 434 of file assembly_editor.cc.
References text_editor_, and TextEditor::Undo().
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 439 of file assembly_editor.cc.
References TextEditor::Redo(), and text_editor_.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 48 of file assembly_editor.h.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 444 of file assembly_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 274 of file assembly_editor.cc.
References active_file_id_, files_, open_files_, and yaze::util::SaveFile().
Referenced by DrawToolset().
void yaze::editor::AssemblyEditor::OpenFolder | ( | const std::string & | folder_path | ) |
Definition at line 187 of file assembly_editor.cc.
References current_folder_.
Referenced by yaze::editor::EditorManager::OpenProject().
|
inline |
|
inline |
|
private |
Definition at line 348 of file assembly_editor.cc.
References ChangeActiveFile(), and yaze::util::FileDialogWrapper::ShowOpenFileDialog().
Referenced by Update().
|
private |
Definition at line 361 of file assembly_editor.cc.
References TextEditor::Copy(), TextEditor::Cut(), TextEditor::Paste(), TextEditor::Redo(), text_editor_, and TextEditor::Undo().
Referenced by Update().
|
private |
Definition at line 297 of file assembly_editor.cc.
References ChangeActiveFile(), current_folder_, yaze::editor::FolderItem::files, yaze::editor::FolderItem::name, and yaze::editor::FolderItem::subfolders.
Referenced by UpdateCodeView().
|
private |
|
private |
Definition at line 283 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().
Referenced by UpdateCodeView().
|
private |
Definition at line 66 of file assembly_editor.h.
|
private |
Definition at line 67 of file assembly_editor.h.
|
private |
Definition at line 68 of file assembly_editor.h.
Referenced by Save(), and UpdateCodeView().
|
private |
Definition at line 70 of file assembly_editor.h.
Referenced by ChangeActiveFile(), Save(), and UpdateCodeView().
|
private |
Definition at line 71 of file assembly_editor.h.
Referenced by ChangeActiveFile(), Save(), and UpdateCodeView().
|
private |
Definition at line 72 of file assembly_editor.h.
Referenced by ChangeActiveFile(), and UpdateCodeView().
|
private |
Definition at line 74 of file assembly_editor.h.
Referenced by InlineUpdate(), and Update().
|
private |
Definition at line 75 of file assembly_editor.h.
Referenced by DrawCurrentFolder(), DrawToolset(), OpenFolder(), and UpdateCodeView().
|
private |
Definition at line 76 of file assembly_editor.h.
Referenced by AssemblyEditor(), Copy(), Cut(), DrawEditMenu(), Initialize(), InlineUpdate(), Paste(), Redo(), Undo(), and Update().
|
private |
Definition at line 78 of file assembly_editor.h.