Audacity 3.2.0
|
class ToolManager More...
#include <ToolManager.h>
Classes | |
struct | TopPanelHook |
Public Member Functions | |
ToolManager (AudacityProject *parent) | |
ToolManager (const ToolManager &)=delete | |
ToolManager & | operator= (const ToolManager &)=delete |
~ToolManager () | |
void | CreateWindows () |
void | LayoutToolBars () |
bool | IsDocked (Identifier type) const |
bool | IsVisible (Identifier type) const |
void | ShowHide (Identifier type) |
void | Expose (Identifier type, bool show) |
ToolBar * | GetToolBar (const Identifier &type) const |
ToolDock * | GetTopDock () |
const ToolDock * | GetTopDock () const |
ToolDock * | GetBotDock () |
const ToolDock * | GetBotDock () const |
void | Reset () |
void | Destroy () |
void | RegenerateTooltips () |
int | FilterEvent (wxEvent &event) override |
bool | RestoreFocus () |
template<typename F > | |
void | ForEach (F &&fun) |
Visit bars, lexicographically by their textual ids. More... | |
size_t | CountBars () const |
Public Member Functions inherited from ClientData::Base | |
virtual | ~Base () |
Static Public Member Functions | |
static ToolManager & | Get (AudacityProject &project) |
static const ToolManager & | Get (const AudacityProject &project) |
static void | OnResetToolBars (const CommandContext &context) |
static void | ModifyToolbarMenus (AudacityProject &project) |
static void | ModifyAllProjectToolbarMenus () |
Private Types | |
using | FramePtr = Destroy_ptr< wxFrame > |
Private Member Functions | |
ToolBar * | Float (ToolBar *t, wxPoint &pos) |
void | OnMenuUpdate (struct MenuUpdateMessage) |
void | OnTimer (wxTimerEvent &event) |
void | OnMouse (wxMouseEvent &event) |
void | OnCaptureLost (wxMouseCaptureLostEvent &event) |
void | UndockBar (wxPoint mp) |
void | OnGrabber (GrabberEvent &event) |
void | HandleEscapeKey () |
void | DoneDragging () |
void | OnIndicatorCreate (wxWindowCreateEvent &event) |
void | OnIndicatorPaint (wxPaintEvent &event) |
void | ReadConfig () |
void | WriteConfig () |
void | Updated () |
Private Attributes | |
Observer::Subscription | mMenuManagerSubscription |
AudacityProject * | mParent |
wxWindowRef | mLastFocus {} |
ToolFrame * | mDragWindow |
ToolDock * | mDragDock |
ToolBar * | mDragBar {} |
wxPoint | mDragOffset |
ToolBarConfiguration::Position | mDragBefore {} |
wxPoint | mLastPos |
wxRect | mBarPos |
FramePtr | mIndicator |
std::unique_ptr< wxRegion > | mLeft |
std::unique_ptr< wxRegion > | mDown |
wxRegion * | mCurrent |
wxTimer | mTimer |
bool | mLastState |
bool | mTransition |
ToolDock * | mTopDock {} |
ToolDock * | mBotDock {} |
std::map< Identifier, ToolBar::Holder > | mBars |
map not unordered_map, for the promise made by ForEach More... | |
wxPoint | mPrevPosition {} |
ToolDock * | mPrevDock {} |
ToolBarConfiguration::Position | mPrevSlot { ToolBarConfiguration::UnspecifiedPosition } |
ToolBarConfiguration | mPrevConfiguration |
bool | mDidDrag {} |
bool | mClicked {} |
class ToolManager
Manages the ToolDocks and handles the dragging, floating, and docking of ToolBars.
Definition at line 51 of file ToolManager.h.
|
private |
Definition at line 151 of file ToolManager.h.
ToolManager::ToolManager | ( | AudacityProject * | parent | ) |
Definition at line 352 of file ToolManager.cpp.
References mBarPos, mDown, mDragBar, mDragDock, mDragWindow, mIndicator, mLastPos, mLeft, mParent, mTransition, OnIndicatorCreate(), OnIndicatorPaint(), and safenew.
|
delete |
ToolManager::~ToolManager | ( | ) |
Definition at line 509 of file ToolManager.cpp.
References Destroy().
|
inline |
Definition at line 109 of file ToolManager.h.
void ToolManager::CreateWindows | ( | ) |
Assign (non-persistent!) sequential ids to the toolbars
Definition at line 420 of file ToolManager.cpp.
References BotDockID, GlobalHook< TopPanelHook, wxWindow *(wxWindow &) >::Call(), factory, ForEach(), CommandManager::Get(), RegisteredToolbarFactory::GetFactories(), GetProjectFrame(), mBars, mBotDock, mMenuManagerSubscription, mParent, mTimer, mTopDock, OnCaptureLost(), OnMenuUpdate(), OnMouse(), ReadConfig(), safenew, ToolBar::SetIndex(), Observer::Publisher< Message, NotifyAll >::Subscribe(), and TopDockID.
Referenced by InitProjectWindow().
void ToolManager::Destroy | ( | ) |
Definition at line 485 of file ToolManager.cpp.
References ToolBarConfiguration::Clear(), ToolDock::GetConfiguration(), mBars, mBotDock, mIndicator, mTopDock, and WriteConfig().
Referenced by ProjectManager::OnCloseWindow(), and ~ToolManager().
|
private |
Definition at line 1487 of file ToolManager.cpp.
References ToolBarConfiguration::Clear(), ToolBar::GetDock(), GetProjectFrame(), mBarPos, mClicked, mDidDrag, mDragBar, mDragDock, mDragWindow, mIndicator, mLastPos, mParent, mPrevConfiguration, mPrevDock, mPrevSlot, mTimer, RestoreFocus(), ToolBar::SetDocked(), and ToolBarConfiguration::UnspecifiedPosition.
Referenced by HandleEscapeKey(), and OnMouse().
void ToolManager::Expose | ( | Identifier | type, |
bool | show | ||
) |
Definition at line 1065 of file ToolManager.cpp.
References ToolBar::Expose(), ToolDock::Expose(), ToolBar::GetDock(), ToolBar::GetSection(), ToolBar::IsDocked(), and mBars.
Referenced by ReadConfig(), Reset(), and ShowHide().
|
override |
Definition at line 690 of file ToolManager.cpp.
References FindProjectFrame(), mLastFocus, and mParent.
|
inline |
Visit bars, lexicographically by their textual ids.
Definition at line 102 of file ToolManager.h.
References details::begin(), and details::end().
Referenced by CreateWindows(), ReadConfig(), RegenerateTooltips(), Reset(), and WriteConfig().
|
static |
Definition at line 339 of file ToolManager.cpp.
Referenced by ControlToolBar::Find(), audacity::cloud::ShareAudioToolbar::Get(), AudioSetupToolBar::Get(), ControlToolBar::Get(), DeviceToolBar::Get(), SelectionBar::Get(), SnappingToolBar::Get(), SpectralSelectionBar::Get(), TimeSignatureToolBar::Get(), TimeToolBar::Get(), ToolsToolBar::Get(), TranscriptionToolBar::Get(), MeterToolBar::Get(), Get(), InitProjectWindow(), ModifyToolbarMenus(), ProjectManager::New(), anonymous_namespace{NavigationMenus.cpp}::NextOrPrevFrame(), ProjectWindow::OnActivate(), ProjectManager::OnCloseWindow(), anonymous_namespace{ExtraMenus.cpp}::OnFullScreen(), OnResetToolBars(), AttachedToolBarMenuItem::OnShowToolBar(), ProjectWindow::OnThemeChange(), and ProjectWindow::UpdateLayout().
|
static |
Definition at line 344 of file ToolManager.cpp.
References Get(), and project.
ToolDock * ToolManager::GetBotDock | ( | ) |
Definition at line 1000 of file ToolManager.cpp.
References mBotDock.
const ToolDock * ToolManager::GetBotDock | ( | ) | const |
Definition at line 1005 of file ToolManager.cpp.
References mBotDock.
ToolBar * ToolManager::GetToolBar | ( | const Identifier & | type | ) | const |
Definition at line 978 of file ToolManager.cpp.
References details::end(), and mBars.
Referenced by IsDocked(), IsVisible(), OnGrabber(), ReadConfig(), and Reset().
ToolDock * ToolManager::GetTopDock | ( | ) |
const ToolDock * ToolManager::GetTopDock | ( | ) | const |
|
private |
Definition at line 1458 of file ToolManager.cpp.
References ToolFrame::ClearBar(), ToolDock::Dock(), DoneDragging(), mDragBar, mDragWindow, mPrevConfiguration, mPrevDock, mPrevPosition, mPrevSlot, ToolDock::RestoreConfiguration(), ToolBar::SetDocked(), and Updated().
Referenced by OnGrabber().
bool ToolManager::IsDocked | ( | Identifier | type | ) | const |
Definition at line 1024 of file ToolManager.cpp.
References GetToolBar().
bool ToolManager::IsVisible | ( | Identifier | type | ) | const |
Definition at line 1034 of file ToolManager.cpp.
References GetToolBar().
Referenced by ShowHide().
void ToolManager::LayoutToolBars | ( | ) |
Definition at line 1083 of file ToolManager.cpp.
References ToolDock::LayoutToolBars(), mBotDock, and mTopDock.
Referenced by InitProjectWindow(), and OnMouse().
|
static |
Definition at line 1532 of file ToolManager.cpp.
References ModifyToolbarMenus(), and project.
Referenced by anonymous_namespace{ViewMenus.cpp}::OnShowRMS(), anonymous_namespace{TrackMenus.cpp}::OnSyncLock(), anonymous_namespace{TransportMenus.cpp}::OnTogglePlayRecording(), anonymous_namespace{TransportMenus.cpp}::OnToggleSoundActivated(), anonymous_namespace{TransportMenus.cpp}::OnToggleSWPlaythrough(), anonymous_namespace{LabelMenus.cpp}::OnToggleTypeToCreateLabel(), and AdornedRulerPanel::TogglePinnedHead().
|
static |
Definition at line 1541 of file ToolManager.cpp.
References CommandManager::Get(), SyncLockState::Get(), Get(), project, Setting< T >::Read(), SyncLockState::SetSyncLock(), SyncLockTracks, and CommandManager::UpdateCheckmarks().
Referenced by ModifyAllProjectToolbarMenus(), anonymous_namespace{ExtraMenus.cpp}::OnFullScreen(), OnMenuUpdate(), OnResetToolBars(), and AttachedToolBarMenuItem::OnShowToolBar().
|
private |
Definition at line 1287 of file ToolManager.cpp.
References mDragWindow, mParent, and OnMouse().
Referenced by CreateWindows().
|
private |
Definition at line 1410 of file ToolManager.cpp.
References GrabberEvent::BarId(), ToolBarConfiguration::Find(), ToolDock::GetConfiguration(), GetProjectFrame(), GetToolBar(), HandleEscapeKey(), ToolBar::IsDocked(), GrabberEvent::IsEscaping(), mClicked, mDragBar, mDragOffset, mDragWindow, mLastState, mParent, mPrevConfiguration, mPrevDock, mPrevPosition, mPrevSlot, mTimer, and ToolDock::WrapConfiguration().
|
private |
Definition at line 1369 of file ToolManager.cpp.
References mCurrent, and mIndicator.
Referenced by ToolManager().
|
private |
Definition at line 1352 of file ToolManager.cpp.
References ThemeBase::Colour(), and theTheme.
Referenced by ToolManager().
|
private |
Definition at line 1304 of file ToolManager.cpp.
References ModifyToolbarMenus(), and mParent.
Referenced by CreateWindows().
|
private |
Definition at line 1100 of file ToolManager.cpp.
References ToolFrame::ClearBar(), ToolDock::Dock(), DoneDragging(), ToolDock::GetConfiguration(), GetProjectFrame(), LayoutToolBars(), mBarPos, mBotDock, mClicked, mCurrent, mDidDrag, mDown, mDragBar, mDragBefore, mDragDock, mDragOffset, mDragWindow, mIndicator, mLastPos, mLeft, mPrevConfiguration, mPrevDock, mTopDock, mTransition, ToolDock::PositionBar(), ToolBarConfiguration::Remove(), ToolDock::RestoreConfiguration(), ToolBar::SetDocked(), toolbarGap, toolbarSingle, UndockBar(), and Updated().
Referenced by CreateWindows(), and OnCaptureLost().
|
static |
Definition at line 566 of file ToolManager.cpp.
References Get(), ModifyToolbarMenus(), CommandContext::project, and project.
Referenced by anonymous_namespace{PluginMenus.cpp}::OnResetConfig(), and anonymous_namespace{ToolbarMenus.cpp}::ToolbarsMenu().
|
private |
Definition at line 1312 of file ToolManager.cpp.
References mDragWindow, mIndicator, mLastState, and mTransition.
|
delete |
|
private |
Definition at line 716 of file ToolManager.cpp.
References audacity::BasicSettings::BeginGroup(), BotDockID, ToolBar::Create(), DefaultConfigTable, ToolBar::DefaultDockID(), ToolDock::Dock(), DockCount, entry, ToolBar::Expose(), Expose(), ForEach(), ToolDock::GetConfiguration(), ToolBar::GetDock(), GetPreferencesVersion(), ToolBar::GetSection(), GetToolBar(), gPrefs, ToolDock::LoadConfig(), mBars, mBotDock, mParent, mTopDock, mTransition, ToolBarConfiguration::PostRead(), audacity::BasicSettings::Read(), ToolBarConfiguration::Read(), Reset(), ToolBar::ResizingDone(), safenew, ToolBar::SetDocked(), ToolBar::SetPositioned(), ToolBar::SetPreferredNeighbors(), ToolBar::SetVisible(), ToolBar::ShownByDefault(), size, TopDockID, and wxT().
Referenced by CreateWindows().
void ToolManager::RegenerateTooltips | ( | ) |
Definition at line 682 of file ToolManager.cpp.
References ForEach().
Referenced by ProjectManager::New().
void ToolManager::Reset | ( | ) |
Definition at line 576 of file ToolManager.cpp.
References DefaultConfigTable, ToolBar::DefaultDockID(), ToolDock::Dock(), ToolBar::EnableDisableButtons(), entry, Expose(), ForEach(), ToolBar::GetDock(), ToolBar::GetIndex(), ToolBar::GetSection(), GetToolBar(), ToolBar::HideAfterReset(), ToolBar::IsDocked(), ToolBar::IsResizable(), mBotDock, mParent, mTopDock, ToolBar::ReCreateButtons(), safenew, ToolBar::SetDocked(), ToolBar::SetToDefaultSize(), ToolBar::ShownByDefault(), ToolBar::TopDockID, ToolDock::Undock(), and Updated().
Referenced by ReadConfig().
bool ToolManager::RestoreFocus | ( | ) |
Definition at line 1520 of file ToolManager.cpp.
References mLastFocus, AButton::TemporarilyAllowFocus(), ASlider::TemporarilyAllowFocus(), and MeterPanelBase::TemporarilyAllowFocus().
Referenced by DoneDragging().
void ToolManager::ShowHide | ( | Identifier | type | ) |
Definition at line 1056 of file ToolManager.cpp.
References Expose(), IsVisible(), mBars, and Updated().
|
private |
Definition at line 1377 of file ToolManager.cpp.
References mDragBar, mDragOffset, mDragWindow, mParent, mTransition, safenew, ToolBar::SetDocked(), ToolBar::SetPositioned(), and Updated().
Referenced by OnMouse().
|
private |
Definition at line 1014 of file ToolManager.cpp.
References GetProjectFrame().
Referenced by HandleEscapeKey(), OnMouse(), Reset(), ShowHide(), and UndockBar().
|
private |
Definition at line 929 of file ToolManager.cpp.
References audacity::BasicSettings::BeginGroup(), BotDockID, ToolBarConfiguration::Contains(), audacity::BasicSettings::Flush(), ForEach(), Identifier::GET(), ToolDock::GetConfiguration(), ToolBar::GetDock(), ToolBar::GetSection(), gPrefs, ToolBar::IsDocked(), ToolBar::IsPositioned(), mBotDock, mTopDock, NoDockID, TopDockID, ToolBarConfiguration::Write(), audacity::BasicSettings::Write(), and wxT().
Referenced by Destroy().
|
private |
Definition at line 149 of file ToolManager.h.
Referenced by DoneDragging(), OnMouse(), and ToolManager().
|
private |
map not unordered_map, for the promise made by ForEach
Definition at line 167 of file ToolManager.h.
Referenced by CreateWindows(), Destroy(), Expose(), GetToolBar(), ReadConfig(), and ShowHide().
|
private |
Definition at line 164 of file ToolManager.h.
Referenced by CreateWindows(), Destroy(), GetBotDock(), LayoutToolBars(), OnMouse(), ReadConfig(), Reset(), and WriteConfig().
|
private |
Definition at line 175 of file ToolManager.h.
Referenced by DoneDragging(), OnGrabber(), and OnMouse().
|
private |
Definition at line 154 of file ToolManager.h.
Referenced by OnIndicatorCreate(), and OnMouse().
|
private |
Definition at line 174 of file ToolManager.h.
Referenced by DoneDragging(), and OnMouse().
|
private |
Definition at line 153 of file ToolManager.h.
Referenced by OnMouse(), and ToolManager().
|
private |
Definition at line 144 of file ToolManager.h.
Referenced by DoneDragging(), HandleEscapeKey(), OnGrabber(), OnMouse(), ToolManager(), and UndockBar().
|
private |
Definition at line 146 of file ToolManager.h.
Referenced by OnMouse().
|
private |
Definition at line 143 of file ToolManager.h.
Referenced by DoneDragging(), OnMouse(), and ToolManager().
|
private |
Definition at line 145 of file ToolManager.h.
Referenced by OnGrabber(), OnMouse(), and UndockBar().
|
private |
Definition at line 142 of file ToolManager.h.
Referenced by DoneDragging(), HandleEscapeKey(), OnCaptureLost(), OnGrabber(), OnMouse(), OnTimer(), ToolManager(), and UndockBar().
|
private |
Definition at line 152 of file ToolManager.h.
Referenced by Destroy(), DoneDragging(), OnIndicatorCreate(), OnMouse(), OnTimer(), and ToolManager().
|
private |
Definition at line 140 of file ToolManager.h.
Referenced by FilterEvent(), and RestoreFocus().
|
private |
Definition at line 148 of file ToolManager.h.
Referenced by DoneDragging(), OnMouse(), and ToolManager().
|
private |
Definition at line 157 of file ToolManager.h.
Referenced by OnGrabber(), and OnTimer().
|
private |
Definition at line 153 of file ToolManager.h.
Referenced by OnMouse(), and ToolManager().
|
private |
Definition at line 138 of file ToolManager.h.
Referenced by CreateWindows().
|
private |
Definition at line 139 of file ToolManager.h.
Referenced by CreateWindows(), DoneDragging(), FilterEvent(), OnCaptureLost(), OnGrabber(), OnMenuUpdate(), ReadConfig(), Reset(), ToolManager(), and UndockBar().
|
private |
Definition at line 173 of file ToolManager.h.
Referenced by DoneDragging(), HandleEscapeKey(), OnGrabber(), and OnMouse().
|
private |
Definition at line 170 of file ToolManager.h.
Referenced by DoneDragging(), HandleEscapeKey(), OnGrabber(), and OnMouse().
|
private |
Definition at line 169 of file ToolManager.h.
Referenced by HandleEscapeKey(), and OnGrabber().
|
private |
Definition at line 171 of file ToolManager.h.
Referenced by DoneDragging(), HandleEscapeKey(), and OnGrabber().
|
private |
Definition at line 156 of file ToolManager.h.
Referenced by CreateWindows(), DoneDragging(), and OnGrabber().
|
private |
Definition at line 163 of file ToolManager.h.
Referenced by CreateWindows(), Destroy(), GetTopDock(), LayoutToolBars(), OnMouse(), ReadConfig(), Reset(), and WriteConfig().
|
private |
Definition at line 160 of file ToolManager.h.
Referenced by OnMouse(), OnTimer(), ReadConfig(), ToolManager(), and UndockBar().