]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/WorkAreaManager.cpp
GuiIdListModel: ignore DecorationRole (icons of available list)
[lyx.git] / src / frontends / WorkAreaManager.cpp
index e846cc1aff2835254c0af0c5d870970e95209e5a..c79f08bef7d018787d059958b652a867e08df2c4 100644 (file)
 
 #include <config.h>
 
+#include "WorkAreaManager.h"
+
+#include "Application.h"
 #include "WorkArea.h"
 
-#include "WorkAreaManager.h"
 
 namespace lyx {
 namespace frontend {
@@ -23,18 +25,43 @@ void WorkAreaManager::add(WorkArea * wa)
        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