Audacity  3.0.3
CommandFunctors.h
Go to the documentation of this file.
1 //
2 // CommandFunctors.h
3 // Audacity
4 //
5 // Created by Paul Licameli on 4/22/16.
6 //
7 //
8 
9 #ifndef __AUDACITY_COMMAND_FUNCTORS__
10 #define __AUDACITY_COMMAND_FUNCTORS__
11 
12 class AudacityProject;
13 class AudacityApp;
14 class CommandContext;
15 class wxEvtHandler;
16 
17 // Base class for objects, to whose member functions, the CommandManager will
18 // dispatch.
19 //
20 // It, or a subclass of it, must be the first base class of the object, and the
21 // first base class of that base class, etc., for the same reason that
22 // wxEvtHandler must be first (that is, the downcast from a pointer to the base
23 // to a pointer to the object, must be a vacuous operation).
24 //
25 // In fact, then, we just make it an alias of wxEvtHandler, in case you really
26 // need to inherit from wxEvtHandler for other reasons, and otherwise you
27 // couldn't satisfy the requirement for both base classes at once.
28 using CommandHandlerObject = wxEvtHandler;
29 
30 // First of two functions registered with each command: an extractor
31 // of the handler object from the AudacityProject
33  std::function< CommandHandlerObject&(AudacityProject &) >;
34 
35 // Second of two function pointers registered with each command: a pointer
36 // to a member function of the handler object
38  void (CommandHandlerObject::*)(const CommandContext &context );
39 
40 #endif
AudacityApp
AudacityApp is the 'main' class for Audacity.
Definition: AudacityApp.h:36
CommandHandlerFinder
std::function< CommandHandlerObject &(AudacityProject &) > CommandHandlerFinder
Definition: CommandFunctors.h:33
CommandContext
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
Definition: CommandContext.h:34
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
CommandHandlerObject
wxEvtHandler CommandHandlerObject
Definition: CommandFunctors.h:28
CommandFunctorPointer
void(CommandHandlerObject::*)(const CommandContext &context) CommandFunctorPointer
Definition: CommandFunctors.h:38