#include <config.h>
+#include "WorkAreaManager.h"
+
#include "WorkArea.h"
-#include "WorkAreaManager.h"
namespace lyx {
namespace frontend {
-void WorkAreaManager::registerWorkArea(WorkArea * wa)
+void WorkAreaManager::add(WorkArea * wa)
{
work_areas_.push_back(wa);
}
-void WorkAreaManager::changed()
+
+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::closing()
+
+void WorkAreaManager::redrawAll(bool update_metrics)
+{
+ for (iterator it = work_areas_.begin(); it != work_areas_.end(); ++it)
+ (*it)->redraw(update_metrics);
+}
+
+
+void WorkAreaManager::closeAll()
+{
+ while (!work_areas_.empty())
+ // WorkArea is de-registering itself.
+ (*work_areas_.begin())->close();
+}
+
+
+void WorkAreaManager::setReadOnly(bool on)
+{
+ for (iterator it = work_areas_.begin(); it != work_areas_.end(); ++it)
+ (*it)->setReadOnly(on);
+}
+
+
+void WorkAreaManager::updateTitles()
{
- for (size_t i = 0; i != work_areas_.size(); ++i)
- work_areas_[i]->close();
+ for (iterator it = work_areas_.begin(); it != work_areas_.end(); ++it)
+ (*it)->updateWindowTitle();
}
} // namespace frontend