Q-W2 review follow-ups: anon-namespace TU-private panel helpers, fix stale bank_panel.cpp comments, correct shim-transitivity claim

Wraps ~50 file-local helpers across all eight panel TUs in namespace{} (dissolves the menuAppend default-arg ODR trap); zero behavior change, 60/60 green.
This commit is contained in:
2026-07-29 11:28:48 -04:00
parent 30a4ffd01b
commit 19b12186ac
8 changed files with 64 additions and 6 deletions
+10 -2
View File
@@ -48,6 +48,8 @@ TailSetting currentTail() {
return g_panel.session ? g_panel.session->tail() : TailSetting{};
}
namespace {
// Commits the current tail setting to ext state and marks the active project dirty
// so the change travels inside the .rpp on Ctrl+S. saveToActiveProject() is the only
// path that calls SetProjExtState for the tail key — calling it here closes the gap
@@ -96,7 +98,7 @@ bool handleToolbarClick(int x, int y, const ActionBarRect& bar,
// True iff `tr` has I_FREEMODE==2 (fixed lanes enabled). The SDK value is verified
// in view.cpp (kFreeModeFixedLanes=2); reproduced here as a local constant so
// bank_panel.cpp stays self-contained without pulling in view.cpp's private namespace.
// panel_input.cpp stays self-contained without pulling in view.cpp's private namespace.
constexpr int kFreeModeFixedLanes = 2;
bool isFixedLaneTrack(MediaTrack* tr) {
@@ -104,7 +106,7 @@ bool isFixedLaneTrack(MediaTrack* tr) {
}
// Item GUID + fixed-lane name reads come from the shared item_read seam (item_read.h):
// itemGuid(it) and itemLaneName(tr, it). bank_panel.cpp no longer carries its own copies.
// itemGuid(it) and itemLaneName(tr, it). panel_input.cpp no longer carries its own copies.
// Enumerates the live project's track + item GUIDs. Fills `allGuids` (the full live set,
// baseline input) and, for each item, records whether it sits on a manual lane so a
@@ -319,6 +321,8 @@ bool handlePoolChromeClick(int x, int y, const RECT& region) {
return false;
}
} // namespace
// Applies a left-click at (x, y): route to top toolbar / footer (toggle / Tail / Prune) /
// bottom toolbar / region chrome / grid selection, and arm a potential drag when the click
// lands on a selected cell. L4 order mirrors the three-zone layout top-to-bottom.
@@ -500,6 +504,8 @@ bool handleWheel(int x, int y, int delta) {
return true;
}
namespace {
bool isOurWindow(HWND hwnd) {
for (HWND w = hwnd; w; w = GetParent(w))
if (w == g_panel.hwnd) return true;
@@ -557,6 +563,8 @@ int translateAccel(MSG* msg, accelerator_register_t* /*ctx*/) {
accelerator_register_t g_accel{translateAccel, true, nullptr};
bool g_accelRegistered = false;
} // namespace
void registerAccel() {
if (g_accelRegistered || !g_rec) return;
g_rec->Register("accelerator", &g_accel);