Namespaces | |
| namespace | anonymous_namespace{native_menu_bridge.cc} |
Classes | |
| struct | ActionSpec |
| struct | KeyChord |
| class | NativeMenuHost |
| struct | ResolvedItem |
Enumerations | |
| enum class | MenuAction : int { kAbout = 0 , kSettings , kHide , kHideOthers , kShowAll , kQuit , kOpenRom , kOpenProject , kSave , kSaveAs , kCloseRom , kUndo , kRedo , kCut , kCopy , kPaste , kSelectAll , kToggleSidebar , kToggleFullScreen , kMinimize , kZoom , kBringAllToFront , kKeyboardShortcuts , kCount } |
| enum class | ChordOwner { kNone , kImGui , kNative } |
| enum class | Dispatch { kShortcut , kHost , kTextOrShortcut , kCocoa } |
Functions | |
| const std::vector< ActionSpec > & | ActionSpecs () |
| const ActionSpec * | FindSpec (MenuAction action) |
| KeyChord | ChordFromImGuiKeys (const std::vector< ImGuiKey > &keys) |
| ImGuiKey | ImGuiKeyFromChordKey (char key) |
| ResolvedItem | ResolveItem (const editor::ShortcutManager *shortcuts, MenuAction action) |
| bool | IsNativeOwnedChord (const editor::ShortcutManager *shortcuts, const KeyChord &chord) |
| bool | ShouldMenuPerformKeyEquivalent (const editor::ShortcutManager *shortcuts, const KeyChord &chord) |
| bool | IsActionEnabled (NativeMenuHost &host, MenuAction action) |
| bool | PerformAction (NativeMenuHost &host, MenuAction action) |
| std::string | RecentFileLabel (const std::string &path) |
|
strong |
Definition at line 42 of file native_menu_bridge.h.
|
strong |
| Enumerator | |
|---|---|
| kNone | |
| kImGui | |
| kNative | |
Definition at line 93 of file native_menu_bridge.h.
|
strong |
| Enumerator | |
|---|---|
| kShortcut | |
| kHost | |
| kTextOrShortcut | |
| kCocoa | |
Definition at line 96 of file native_menu_bridge.h.
| const std::vector< ActionSpec > & yaze::platform::native_menu::ActionSpecs | ( | ) |
Definition at line 102 of file native_menu_bridge.cc.
References kAbout, kBringAllToFront, kCloseRom, kCocoa, kCopy, kCut, kHide, kHideOthers, kHost, kKeyboardShortcuts, kMinimize, kOpenProject, kOpenRom, kPaste, kQuit, kRedo, kSave, kSaveAs, kSelectAll, yaze::editor::kSettings, kSettings, kShortcut, kShowAll, kTextOrShortcut, kToggleFullScreen, kToggleSidebar, kUndo, and kZoom.
Referenced by FindSpec(), IsNativeOwnedChord(), and ShouldMenuPerformKeyEquivalent().
| const ActionSpec * yaze::platform::native_menu::FindSpec | ( | MenuAction | action | ) |
Definition at line 173 of file native_menu_bridge.cc.
References ActionSpecs().
Referenced by PerformAction(), and ResolveItem().

| KeyChord yaze::platform::native_menu::ChordFromImGuiKeys | ( | const std::vector< ImGuiKey > & | keys | ) |
Definition at line 182 of file native_menu_bridge.cc.
References yaze::platform::native_menu::KeyChord::command, yaze::platform::native_menu::KeyChord::control, yaze::platform::native_menu::KeyChord::key, yaze::platform::native_menu::KeyChord::option, and yaze::platform::native_menu::KeyChord::shift.
Referenced by yaze::platform::native_menu::anonymous_namespace{native_menu_bridge.cc}::ExactShortcutConflict(), and ResolveItem().
| ImGuiKey yaze::platform::native_menu::ImGuiKeyFromChordKey | ( | char | key | ) |
Definition at line 213 of file native_menu_bridge.cc.
Referenced by PerformAction().
| ResolvedItem yaze::platform::native_menu::ResolveItem | ( | const editor::ShortcutManager * | shortcuts, |
| MenuAction | action ) |
Definition at line 220 of file native_menu_bridge.cc.
References yaze::platform::native_menu::ResolvedItem::chord, ChordFromImGuiKeys(), yaze::platform::native_menu::ActionSpec::default_chord, yaze::platform::native_menu::ActionSpec::dispatch, yaze::platform::native_menu::ResolvedItem::dispatch, yaze::platform::native_menu::ActionSpec::fallback, yaze::editor::ShortcutManager::FindShortcut(), FindSpec(), yaze::platform::native_menu::ActionSpec::imgui_owns_default_chord, yaze::editor::Shortcut::keys, kImGui, kNative, kNone, yaze::platform::native_menu::ResolvedItem::owner, yaze::platform::native_menu::ActionSpec::shortcut_name, and yaze::platform::native_menu::KeyChord::valid().
Referenced by IsNativeOwnedChord(), PerformAction(), and ShouldMenuPerformKeyEquivalent().

| bool yaze::platform::native_menu::IsNativeOwnedChord | ( | const editor::ShortcutManager * | shortcuts, |
| const KeyChord & | chord ) |
Definition at line 259 of file native_menu_bridge.cc.
References ActionSpecs(), yaze::platform::native_menu::ResolvedItem::chord, kNative, yaze::platform::native_menu::ResolvedItem::owner, ResolveItem(), and yaze::platform::native_menu::KeyChord::valid().
Referenced by ShouldMenuPerformKeyEquivalent().

| bool yaze::platform::native_menu::ShouldMenuPerformKeyEquivalent | ( | const editor::ShortcutManager * | shortcuts, |
| const KeyChord & | chord ) |
Definition at line 277 of file native_menu_bridge.cc.
References ActionSpecs(), yaze::platform::native_menu::ResolvedItem::chord, IsNativeOwnedChord(), kImGui, yaze::platform::native_menu::ResolvedItem::owner, ResolveItem(), and yaze::platform::native_menu::KeyChord::valid().

| bool yaze::platform::native_menu::IsActionEnabled | ( | NativeMenuHost & | host, |
| MenuAction | action ) |
Definition at line 298 of file native_menu_bridge.cc.
References yaze::platform::native_menu::NativeMenuHost::CanRedo(), yaze::platform::native_menu::NativeMenuHost::CanUndo(), yaze::platform::native_menu::NativeMenuHost::HasCurrentEditor(), yaze::platform::native_menu::NativeMenuHost::HasLoadedRom(), kCloseRom, kCopy, kCut, kPaste, kRedo, kSave, kSaveAs, kSelectAll, kUndo, and yaze::platform::native_menu::NativeMenuHost::WantsTextInput().
| bool yaze::platform::native_menu::PerformAction | ( | NativeMenuHost & | host, |
| MenuAction | action ) |
Definition at line 319 of file native_menu_bridge.cc.
References yaze::editor::Shortcut::callback, yaze::platform::native_menu::ActionSpec::default_chord, yaze::platform::native_menu::NativeMenuHost::Defer(), yaze::platform::native_menu::ResolvedItem::dispatch, yaze::editor::ShortcutManager::FindShortcut(), FindSpec(), ImGuiKeyFromChordKey(), yaze::platform::native_menu::NativeMenuHost::InjectCommandChord(), kCocoa, yaze::platform::native_menu::KeyChord::key, kHost, kShortcut, kTextOrShortcut, ResolveItem(), yaze::platform::native_menu::NativeMenuHost::RunHostAction(), yaze::platform::native_menu::NativeMenuHost::shortcut_manager(), yaze::platform::native_menu::ActionSpec::shortcut_name, and yaze::platform::native_menu::NativeMenuHost::WantsTextInput().
| std::string yaze::platform::native_menu::RecentFileLabel | ( | const std::string & | path | ) |
Definition at line 369 of file native_menu_bridge.cc.