yaze 0.2.0
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::app::editor::CommandManager Class Reference

#include <command_manager.h>

Classes

struct  CommandInfo
 
struct  CommandInfoOrPrefix
 

Public Types

using Command = std::function<void()>
 

Public Member Functions

void RegisterPrefix (const std::string &group_name, const char prefix, const std::string &name, const std::string &desc)
 
void RegisterSubcommand (const std::string &group_name, const std::string &shortcut, const char mnemonic, const std::string &name, const std::string &desc, Command command)
 
void RegisterCommand (const std::string &shortcut, Command command, char mnemonic, const std::string &name, const std::string &desc)
 
void ExecuteCommand (const std::string &shortcut)
 
void ShowWhichKey ()
 
void SaveKeybindings (const std::string &filepath)
 
void LoadKeybindings (const std::string &filepath)
 

Private Attributes

std::unordered_map< std::string, CommandInfoOrPrefixcommands_
 

Detailed Description

Definition at line 16 of file command_manager.h.

Member Typedef Documentation

◆ Command

using yaze::app::editor::CommandManager::Command = std::function<void()>

Definition at line 18 of file command_manager.h.

Member Function Documentation

◆ RegisterPrefix()

void yaze::app::editor::CommandManager::RegisterPrefix ( const std::string & group_name,
const char prefix,
const std::string & name,
const std::string & desc )
inline

Definition at line 41 of file command_manager.h.

References commands_.

Referenced by yaze::app::editor::EditorManager::InitializeCommands().

◆ RegisterSubcommand()

void yaze::app::editor::CommandManager::RegisterSubcommand ( const std::string & group_name,
const std::string & shortcut,
const char mnemonic,
const std::string & name,
const std::string & desc,
Command command )
inline

Definition at line 46 of file command_manager.h.

References commands_.

Referenced by yaze::app::editor::EditorManager::InitializeCommands().

◆ RegisterCommand()

void yaze::app::editor::CommandManager::RegisterCommand ( const std::string & shortcut,
Command command,
char mnemonic,
const std::string & name,
const std::string & desc )
inline

Definition at line 54 of file command_manager.h.

References commands_.

◆ ExecuteCommand()

void yaze::app::editor::CommandManager::ExecuteCommand ( const std::string & shortcut)
inline

Definition at line 61 of file command_manager.h.

References commands_.

◆ ShowWhichKey()

void yaze::app::editor::CommandManager::ShowWhichKey ( )

Definition at line 76 of file command_manager.cc.

References commands_.

Referenced by yaze::app::editor::EditorManager::ManageKeyboardShortcuts().

◆ SaveKeybindings()

void yaze::app::editor::CommandManager::SaveKeybindings ( const std::string & filepath)

Definition at line 117 of file command_manager.cc.

References commands_.

◆ LoadKeybindings()

void yaze::app::editor::CommandManager::LoadKeybindings ( const std::string & filepath)

Definition at line 128 of file command_manager.cc.

References commands_.

Member Data Documentation

◆ commands_

std::unordered_map<std::string, CommandInfoOrPrefix> yaze::app::editor::CommandManager::commands_
private

The documentation for this class was generated from the following files: