Audacity  2.2.2
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 #include <wx/string.h>
13 #include <wx/event.h>
14 #include "../MemoryX.h"
15 #include "Command.h"
16 
17 class AudacityProject;
18 class AudacityApp;
19 class wxEvtHandler;
20 
21 // Base class for objects, to whose member functions, the CommandManager will
22 // dispatch.
23 //
24 // It, or a subclass of it, must be the first base class of the object, and the
25 // first base class of that base class, etc., for the same reason that
26 // wxEvtHandler must be first (that is, the downcast from a pointer to the base
27 // to a pointer to the object, must be a vacuous operation).
28 //
29 // In fact, then, we just make it an alias of wxEvtHandler, in case you really
30 // need to inherit from wxEvtHandler for other reasons, and otherwise you
31 // couldn't satisfy the requirement for both base classes at once.
32 using CommandHandlerObject = wxEvtHandler;
33 
34 // First of two function pointers registered with each command: an extractor
35 // of the handler object from the AudacityProject
37 
38 // Second of two function pointers registered with each command: a pointer
39 // to a member function of the handler object
41  void (CommandHandlerObject::*)(const CommandContext &context );
42 
43 #endif
Contains declaration of Command base class.
CommandContext provides addiitonal information to an 'Apply()' command. It provides the project...
void(CommandHandlerObject::*)(const CommandContext &context) CommandFunctorPointer
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
AudacityApp is the 'main' class for Audacity.
Definition: AudacityApp.h:59
CommandHandlerObject &(*)(AudacityProject &) CommandHandlerFinder
wxEvtHandler CommandHandlerObject