mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-26 15:23:48 +01:00
Registration of toolbar factory functions...
... reduces direct dependencies of ToolManager.cpp. This frees four files from cycles: DeviceToolBar EditToolBar MeterToolBar MixerToolBar Leaving 66 files still in the big s.c.c.
This commit is contained in:
@@ -913,3 +913,25 @@ int ToolBar::GetResizeGrabberWidth()
|
||||
{
|
||||
return RWIDTH;
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
RegisteredToolbarFactory::Functions &GetFunctions()
|
||||
{
|
||||
static RegisteredToolbarFactory::Functions factories( ToolBarCount );
|
||||
return factories;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RegisteredToolbarFactory::RegisteredToolbarFactory(
|
||||
int id, const Function &function)
|
||||
{
|
||||
wxASSERT( id >= 0 && id < ToolBarCount );
|
||||
GetFunctions()[ id ] = function;
|
||||
}
|
||||
|
||||
auto RegisteredToolbarFactory::GetFactories() -> const Functions&
|
||||
{
|
||||
return GetFunctions();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user