3 * \file WorkAreaManager.cpp
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Abdelrazak Younes
9 * Full author contact details are available in file CREDITS.
14 #include "WorkAreaManager.h"
16 #include "BufferView.h"
19 #include "Application.h"
26 void WorkAreaManager::add(WorkArea * wa)
28 work_areas_.push_back(wa);
32 void WorkAreaManager::remove(WorkArea * wa)
34 work_areas_.remove(wa);
38 void WorkAreaManager::redrawAll(bool update_metrics)
40 for (WorkArea * wa : work_areas_)
41 wa->scheduleRedraw(update_metrics);
45 void WorkAreaManager::closeAll()
47 while (!work_areas_.empty())
48 // WorkArea is de-registering itself.
49 (*work_areas_.begin())->close();
53 bool WorkAreaManager::unhide(Buffer * buf) const
55 if (!work_areas_.empty())
57 return theApp()->unhide(buf);
61 void WorkAreaManager::updateTitles()
63 for (WorkArea * wa : work_areas_)
64 wa->updateWindowTitle();
68 void WorkAreaManager::scheduleRedraw()
70 for (WorkArea * wa : work_areas_)
71 wa->scheduleRedraw(true);
75 void WorkAreaManager::sanitizeCursors()
77 for (WorkArea * wa : work_areas_) {
78 wa->bufferView().cursor().sanitize();
79 wa->bufferView().resetInlineCompletionPos();
84 } // namespace frontend