Audacity 3.2.0
|
#include <CommandManager.h>
Public Types | |
using | LeafVisitor = std::function< void(const Registry::SingleItem &, const Registry::Path &)> |
Public Types inherited from Registry::VisitorFunctions< MenuRegistry::Traits > | |
using | NodeTypes = detail::VisitedNodeTypes< MenuRegistry::Traits > |
using | LeafTypes = detail::VisitedLeafTypes< MenuRegistry::Traits > |
Public Member Functions | |
Populator (AudacityProject &project, LeafVisitor leafVisitor, std::function< void()> doSeparator) | |
virtual | ~Populator () |
Public Member Functions inherited from MenuRegistry::Visitor< MenuRegistry::Traits > | |
Visitor (VisitorFunctions< MenuRegistry::Traits > functions, std::function< void()> doSeparator) | |
Public Member Functions inherited from Registry::VisitorFunctions< MenuRegistry::Traits > | |
VisitorFunctions (Visitors &&visitors) | |
Type-erasing constructor. More... | |
void | BeginGroup (const GroupItem< MenuRegistry::Traits > &item, const Path &path) const |
Call-through for a decorating pre-visitor. More... | |
void | Visit (const SingleItem &item, const Path &path) const |
Call-through for a decorating leaf-visitor. More... | |
void | EndGroup (const GroupItem< MenuRegistry::Traits > &item, const Path &path) const |
Call-through for a decorating post-visitor. More... | |
Public Member Functions inherited from MenuRegistry::detail::VisitorBase | |
std::pair< bool, bool > | ShouldBeginGroup (const ItemProperties *pProperties) |
void | AfterBeginGroup (const ItemProperties *pProperties) |
bool | ShouldEndGroup (const ItemProperties *pProperties) |
bool | ShouldDoSeparator () |
Protected Member Functions | |
void | DoBeginGroup (const MenuRegistry::GroupItem< MenuRegistry::Traits > &item) |
void | DoVisit (const Registry::SingleItem &item) |
void | DoEndGroup (const MenuRegistry::GroupItem< MenuRegistry::Traits > &item) |
virtual void | BeginMenu (const TranslatableString &tName) |
virtual void | BeginOccultCommands () |
virtual void | EndMenu () |
virtual void | EndOccultCommands () |
virtual std::unique_ptr< CommandListEntry > | AllocateEntry (const MenuRegistry::Options &options) |
virtual void | VisitEntry (CommandListEntry &entry, const MenuRegistry::Options *options) |
void | DoSeparator () |
const TranslatableStrings & | MenuNames () const |
Stack of names of menus that were begun and not yet ended. More... | |
Protected Attributes | |
AudacityProject & | mProject |
bool | mbSeparatorAllowed { false } |
Private Member Functions | |
void | AddItemList (const CommandID &name, const ComponentInterfaceSymbol items[], size_t nItems, CommandHandlerFinder finder, CommandFunctorPointer callback, CommandFlag flags, bool bIsEffect=false) |
void | AddItem (const CommandID &name, const TranslatableString &label_in, CommandHandlerFinder finder, CommandFunctorPointer callback, CommandFlag flags, const MenuRegistry::Options &options={}) |
CommandListEntry * | NewIdentifier (const CommandID &name, const TranslatableString &label, CommandHandlerFinder finder, CommandFunctorPointer callback, const CommandID &nameSuffix, int index, int count, const MenuRegistry::Options &options) |
void | AddGlobalCommand (const CommandID &name, const TranslatableString &label, CommandHandlerFinder finder, CommandFunctorPointer callback, const MenuRegistry::Options &options={}) |
void | SetMaxList () |
Private Attributes | |
std::vector< NormalizedKeyString > | mMaxListOnly |
TranslatableStrings | mMenuNames |
std::vector< bool > | mFlags |
int | mCurrentID { 17000 } |
bool | bMakingOccultCommands { false } |
Additional Inherited Members | |
Public Attributes inherited from MenuRegistry::detail::VisitorBase | |
std::vector< bool > | firstItem |
std::vector< bool > | needSeparator |
Definition at line 122 of file CommandManager.h.
using CommandManager::Populator::LeafVisitor = std::function< void(const Registry::SingleItem &, const Registry::Path&)> |
Definition at line 125 of file CommandManager.h.
CommandManager::Populator::Populator | ( | AudacityProject & | project, |
LeafVisitor | leafVisitor, | ||
std::function< void()> | doSeparator | ||
) |
Definition at line 85 of file CommandManager.cpp.
References DoBeginGroup().
|
virtualdefault |
|
private |
Definition at line 408 of file CommandManager.cpp.
References AlwaysEnabledFlag, entry, anonymous_namespace{Scrubbing.cpp}::finder, and name.
|
private |
Definition at line 349 of file CommandManager.cpp.
References entry, anonymous_namespace{Scrubbing.cpp}::finder, CommandManager::Get(), MenuRegistry::Options::global, CommandManager::mProject, name, NoFlagsSpecified, CommandManager::SetCommandFlags(), and MenuRegistry::Options::useStrictFlags.
|
private |
Add a list of menu items to the current menu. When the user selects any one of these, the given functor will be called with its position in the list as the index number. When you call Enable on this command name, it will enable or disable all of the items at once.
Definition at line 383 of file CommandManager.cpp.
References entry, anonymous_namespace{Scrubbing.cpp}::finder, Internal, MenuRegistry::Options::IsEffect(), and name.
|
protectedvirtual |
Called by DoVisit Override to make entries that carry extra information. Not called for every visit, because existing items may be reused
result != nullptr
Reimplemented in anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor.
Definition at line 328 of file CommandManager.cpp.
|
protectedvirtual |
Called by DoBeginGroup Default implementation does nothing
Reimplemented in anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor.
Definition at line 296 of file CommandManager.cpp.
|
protectedvirtual |
Called by DoBeginGroup Default implementation does nothing
Reimplemented in anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor.
Definition at line 1195 of file CommandManager.cpp.
|
protected |
Definition at line 249 of file CommandManager.cpp.
References flag, MenuRegistry::IsSection(), and title.
Referenced by Populator().
|
protected |
Definition at line 300 of file CommandManager.cpp.
References flag, and MenuRegistry::IsSection().
|
protected |
Definition at line 424 of file CommandManager.cpp.
|
protected |
Definition at line 274 of file CommandManager.cpp.
|
protectedvirtual |
Called by DoEndGroup Default implementation does nothing
Reimplemented in anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor.
Definition at line 324 of file CommandManager.cpp.
|
protectedvirtual |
Called by DoEndGroup Default implementation does nothing
Reimplemented in anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor.
Definition at line 1199 of file CommandManager.cpp.
|
inlineprotected |
Stack of names of menus that were begun and not yet ended.
Definition at line 175 of file CommandManager.h.
|
private |
Given all of the information for a command, comes up with a NEW unique ID, adds it to a list, and returns the ID. WARNING: Does this conflict with the identifiers set for controls/windows? If it does, a workaround may be to keep controls below wxID_LOWEST and keep menus above wxID_HIGHEST
Definition at line 445 of file CommandManager.cpp.
References AlwaysEnabledFlag, audacity::BasicSettings::BeginGroup(), TranslatableString::Debug(), Identifier::empty(), entry, anonymous_namespace{Scrubbing.cpp}::finder, Identifier::GET(), CommandManager::Get(), gPrefs, audacity::BasicSettings::HasEntry(), CommandManager::CommandListEntry::label, label, CommandManager::mProject, TranslatableString::MSGID(), name, CommandManager::NextIdentifier(), audacity::BasicSettings::Read(), size, TranslatableString::Stripped(), and wxT().
|
private |
Definition at line 218 of file CommandManager.cpp.
References CommandManager::ExcludedList(), gPrefs, mMaxListOnly, audacity::BasicSettings::ReadBool(), and wxT().
|
protectedvirtual |
Called by DoVisit Override to intercept all visits of items; default implementation is noop
options | null if a member of a list of commands |
Reimplemented in anonymous_namespace{MenuCreator.cpp}::MenuItemVisitor.
Definition at line 334 of file CommandManager.cpp.
|
private |
Definition at line 219 of file CommandManager.h.
|
protected |
Definition at line 210 of file CommandManager.h.
|
private |
Definition at line 218 of file CommandManager.h.
|
private |
Definition at line 217 of file CommandManager.h.
|
private |
Definition at line 215 of file CommandManager.h.
Referenced by SetMaxList().
|
private |
Definition at line 216 of file CommandManager.h.
|
protected |
Definition at line 207 of file CommandManager.h.