#include <config.h>
+#include "WorkAreaManager.h"
+
+#include "Application.h"
#include "WorkArea.h"
-#include "WorkAreaManager.h"
namespace lyx {
namespace frontend {
work_areas_.push_back(wa);
}
-void WorkAreaManager::redrawAll()
+
+void WorkAreaManager::remove(WorkArea * wa)
{
- for (size_t i = 0; i != work_areas_.size(); ++i)
- work_areas_[i]->redraw();
+ work_areas_.remove(wa);
}
+
+void WorkAreaManager::redrawAll(bool update_metrics)
+{
+ for (WorkArea * wa : work_areas_)
+ wa->scheduleRedraw(update_metrics);
+}
+
+
void WorkAreaManager::closeAll()
{
- for (size_t i = 0; i != work_areas_.size(); ++i)
- work_areas_[i]->close();
+ while (!work_areas_.empty())
+ // WorkArea is de-registering itself.
+ (*work_areas_.begin())->close();
}
+
+bool WorkAreaManager::unhide(Buffer * buf)
+{
+ if (!work_areas_.empty())
+ return true;
+ return theApp()->unhide(buf);
+}
+
+
+void WorkAreaManager::updateTitles()
+{
+ for (WorkArea * wa : work_areas_)
+ wa->updateWindowTitle();
+}
+
+
} // namespace frontend
} // namespace lyx