Don't include CommandManager.h in other headers

This commit is contained in:
Paul Licameli 2018-10-18 08:58:23 -04:00
parent 8f5629a2a6
commit 16ab48079b
16 changed files with 27 additions and 13 deletions

View File

@ -42,6 +42,7 @@ AliasedFile s.
#include <wx/dialog.h>
#include <wx/filename.h>
#include <wx/hashmap.h>
#include <wx/menu.h>
#include <wx/progdlg.h>
#include <wx/choice.h>
#include <wx/clipbrd.h>

View File

@ -19,6 +19,7 @@
#include "Internat.h"
#include "Project.h" // for GetActiveProject
#include "LabelTrack.h"
#include "commands/CommandManager.h"
BEGIN_EVENT_TABLE(HighlightTextCtrl, wxTextCtrl)

View File

@ -68,6 +68,7 @@ menu items.
#include "Dependencies.h"
#include "float_cast.h"
#include "LabelTrack.h"
#include "commands/CommandManager.h"
#ifdef USE_MIDI
#include "import/ImportMIDI.h"
#endif // USE_MIDI
@ -849,7 +850,7 @@ void MenuCreator::CreateMenusAndCommands(AudacityProject &project)
// // to show the Redo's on stack.
// // "UndoHistory" might already be enabled, but add this check for RedoAvailableFlag.
// if (flags & RedoAvailableFlag)
// mCommandManager.Enable(wxT("UndoHistory"), true);
// GetCommandManager()->Enable(wxT("UndoHistory"), true);
// So for now, enable the command regardless of stack. It will just show empty sometimes.
// FOR REDESIGN, clearly there are some limitations with the flags/mask bitmaps.
@ -2641,8 +2642,8 @@ void MenuManager::UpdateMenus(AudacityProject &project, bool checkActive)
#if 0
if (flags & CutCopyAvailableFlag) {
mCommandManager.Enable(wxT("Copy"), true);
mCommandManager.Enable(wxT("Cut"), true);
GetCommandManager()->Enable(wxT("Copy"), true);
GetCommandManager()->Enable(wxT("Cut"), true);
}
#endif

View File

@ -47,6 +47,7 @@
#include "../images/AudacityLogo48x48.xpm"
#endif
#include "commands/CommandManager.h"
// class MixerTrackSlider

View File

@ -117,6 +117,7 @@ scroll information. It also has some status flags.
#include "TrackPanel.h"
#include "WaveTrack.h"
#include "DirManager.h"
#include "commands/CommandManager.h"
#include "effects/Effect.h"
#include "prefs/PrefsDialog.h"
#include "widgets/LinkingHtmlWindow.h"
@ -939,6 +940,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
NumericConverter::BANDWIDTH,
gPrefs->Read(wxT("/BandwidthSelectionFormatName"), wxT("")) ) ),
mUndoManager(std::make_unique<UndoManager>())
, mCommandManager( std::make_unique<CommandManager>() )
{
if (!gPrefs->Read(wxT("/SamplingRate/DefaultProjectSampleRate"), &mRate, AudioIO::GetOptimalSupportedSampleRate())) {
// The default given above can vary with host/devices. So unless there is an entry for
@ -1570,7 +1572,7 @@ void AudacityProject::AS_SetSnapTo(int snap)
mSnapTo = snap;
// LLL: TODO - what should this be changed to???
// mCommandManager.Check(wxT("Snap"), mSnapTo);
// GetCommandManager()->Check(wxT("Snap"), mSnapTo);
gPrefs->Write(wxT("/SnapTo"), mSnapTo);
gPrefs->Flush();
@ -2358,7 +2360,7 @@ void AudacityProject::OnMenu(wxCommandEvent & event)
return;
}
#endif
bool handled = mCommandManager.HandleMenuID(
bool handled = GetCommandManager()->HandleMenuID(
event.GetId(), GetMenuManager(*this).GetUpdateFlags(*this),
NoFlagsSpecified);

View File

@ -28,7 +28,6 @@
#include "ViewInfo.h"
#include "TrackPanelListener.h"
#include "AudioIOListener.h"
#include "commands/CommandManager.h"
#include "effects/EffectManager.h"
#include "xml/XMLTagHandler.h"
#include "toolbars/SelectionBarListener.h"
@ -170,8 +169,6 @@ class WaveTrack;
#include "./commands/CommandFlag.h"
#include "../include/audacity/EffectInterface.h"
#include "./commands/CommandManager.h"
class MenuCommandHandler;
class MenuManager;
@ -347,8 +344,10 @@ public:
// Converts number of minutes to human readable format
wxString GetHoursMinsString(int iMinutes);
CommandManager *GetCommandManager() { return &mCommandManager; }
const CommandManager *GetCommandManager() const { return &mCommandManager; }
CommandManager *GetCommandManager()
{ return mCommandManager.get(); }
const CommandManager *GetCommandManager() const
{ return mCommandManager.get(); }
// Keyboard capture
static bool HasKeyboardCapture(const wxWindow *handler);
@ -653,7 +652,7 @@ private:
// Commands
CommandManager mCommandManager;
std::unique_ptr<CommandManager> mCommandManager;
// Window elements

View File

@ -69,7 +69,6 @@ preferences.
//#include "Project.h"
#include "Shuttle.h"
#include "WrappedType.h"
//#include "commands/CommandManager.h"
//#include "effects/Effect.h"

View File

@ -44,6 +44,7 @@ small calculations of rectangles.
#include "../Prefs.h"
#include "../ShuttleGui.h"
#include "CommandContext.h"
#include "CommandManager.h"
static const IdentInterfaceSymbol

View File

@ -14,6 +14,7 @@
#include "../Experimental.h"
class CommandManager;
class ShuttleGui;
#include <wx/defs.h>
@ -25,7 +26,6 @@ class ShuttleGui;
#include <wx/textctrl.h>
#include <wx/timer.h>
#include "../commands/CommandManager.h"
#include "../widgets/KeyView.h"
#include "PrefsPanel.h"

View File

@ -59,6 +59,7 @@
#include "../Experimental.h"
#include "../commands/CommandContext.h"
#include "../commands/CommandManager.h"
IMPLEMENT_CLASS(EditToolBar, ToolBar);

View File

@ -50,6 +50,7 @@ in which buttons can be placed.
#include "../Project.h"
#include "../Theme.h"
#include "../commands/Keyboard.h"
#include "../commands/CommandManager.h"
#include "../widgets/AButton.h"
#include "../widgets/Grabber.h"
#include "../Prefs.h"

View File

@ -33,6 +33,8 @@ Paul Licameli split from TrackPanel.cpp
#include "../../widgets/Ruler.h"
#include "../../commands/CommandFunctors.h"
#include "../../commands/CommandContext.h"
#include "../../commands/CommandManager.h"
#include <algorithm>

View File

@ -27,6 +27,7 @@ Paul Licameli split from TrackPanel.cpp
#include "../../TrackPanelMouseEvent.h"
#include "../../ViewInfo.h"
#include "../../WaveTrack.h"
#include "../../commands/CommandManager.h"
#include "../../commands/Keyboard.h"
#include "../../ondemand/ODManager.h"
#include "../../prefs/SpectrogramSettings.h"

View File

@ -16,6 +16,7 @@ Paul Licameli split from TrackPanel.cpp
#include "../../RefreshCode.h"
#include "../../Track.h"
#include "../../TrackPanel.h"
#include "../../commands/CommandManager.h"
MinimizeButtonHandle::MinimizeButtonHandle
( const std::shared_ptr<Track> &pTrack, const wxRect &rect )

View File

@ -23,6 +23,7 @@ Paul Licameli split from TrackPanel.cpp
#include <wx/textdlg.h>
#include "../../commands/CommandType.h"
#include "../../commands/Command.h"
#include "../../commands/CommandManager.h"
#include "../../ShuttleGui.h"

View File

@ -16,6 +16,8 @@
#include <wx/string.h>
#include <wx/vlbox.h>
#include "../commands/Keyboard.h"
// Class holding all information about a node. Rather than a real tree
// we store these in an array and simulate a tree.
class KeyNode