]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/WorkAreaManager.cpp
Set a maximum value to zoom level
[lyx.git] / src / frontends / WorkAreaManager.cpp
index a8c90309fd7ee804fad56dbc65cb621d625f7dfb..c79f08bef7d018787d059958b652a867e08df2c4 100644 (file)
 
 #include <config.h>
 
-#include "WorkArea.h"
-
 #include "WorkAreaManager.h"
 
-using std::list;
+#include "Application.h"
+#include "WorkArea.h"
+
 
 namespace lyx {
 namespace frontend {
@@ -32,27 +32,36 @@ void WorkAreaManager::remove(WorkArea * wa)
 }
 
 
-void WorkAreaManager::redrawAll()
+void WorkAreaManager::redrawAll(bool update_metrics)
 {
-       for (list<WorkArea *>::iterator it = work_areas_.begin();
-               it != work_areas_.end(); ) {
-               (*it)->redraw();
-               ++it;
-       }
+       for (WorkArea * wa : work_areas_)
+               wa->scheduleRedraw(update_metrics);
 }
 
 
 void WorkAreaManager::closeAll()
 {
-       for (list<WorkArea *>::iterator it = work_areas_.begin();
-               it != work_areas_.end(); ) {
-               (*it)->close();
-               if (work_areas_.empty())
-                       break;
-               ++it;
-       }
+       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