... As when recording starts or stops, or the Tools button has changed, or
scrolling has changed the results of hit-test.
This reduces TrackPanel's intrusions into other code, including ProjectHistory.
Also for AdornedRulerPanel, which shares the base class CellularPanel
... and break its compile dependency on CommandManager.h by letting it install
callbacks.
This also removes Objective-C mixed code from CommmandManager.
This also eliminates four inclusions of Project.h!
Capture handler state is also global, not per project, though the
CommandManager's callbacks still do depend on the active project.
... Unnecessary because transitively included.
But each .cpp file still includes its own .h file near the top to ensure
that it compiles indenendently, even if it is reincluded transitively later.
... Reimplement the ESC key handling in TrackPanel and time ruler on all
operating systems so that it does not rely on the focused window, but instead
uses the application-wide event filter.
This includes reversion of 9491605cfc8a7d60117365884fd494996b5ebbaf
... Cross platform differences in Focus handling are confusing, and we don't
know yet how to abort drags and also put focus back where we want it on Linux.
So don't take focus even temporarily in the time ruler. Sorry, ESC key won't
work.
... Fixed as suggested by David Bailes.
Confirmed on Mac and Windows that the intended ESC key handling to abort drag
in the ruler also now works. (It didn't on Windows in 2.3.0.)
... Do for release as was already done for click and drag: hold a shared
pointer.
This will protect against reentrancy surprises as in this bug, where a
reference to the handle may be removed during one of the handle's own
methods.
... while the project makes note of which window has temporarily given up the
focus; and TrackPanel can detect that, so that the yellow border of the focused
track is still drawn while the panel "lends" the focus.
Why do all this? So that, when the ruler is another CellularPanel, ESC key
will work to abort drags in the ruler, but TrackPanel appearance won't change
during the drags.