]> git.lyx.org Git - features.git/blob - src/frontends/WorkAreaManager.cpp
0d1d189cf28f9b4e5a24774e248afd95efd73619
[features.git] / src / frontends / WorkAreaManager.cpp
1 // -*- C++ -*-
2 /**
3  * \file WorkAreaManager.cpp
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Abdelrazak Younes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "WorkAreaManager.h"
15
16 #include "Application.h"
17 #include "WorkArea.h"
18
19
20 namespace lyx {
21 namespace frontend {
22
23 void WorkAreaManager::add(WorkArea * wa)
24 {
25         work_areas_.push_back(wa);
26 }
27
28
29 void WorkAreaManager::remove(WorkArea * wa)
30 {
31         work_areas_.remove(wa);
32 }
33
34
35 void WorkAreaManager::redrawAll(bool update_metrics)
36 {
37         for (WorkArea * wa : work_areas_)
38                 wa->scheduleRedraw(update_metrics);
39 }
40
41
42 void WorkAreaManager::closeAll()
43 {
44         while (!work_areas_.empty())
45                 // WorkArea is de-registering itself.
46                 (*work_areas_.begin())->close();
47 }
48
49
50 bool WorkAreaManager::unhide(Buffer * buf) const
51 {
52         if (!work_areas_.empty())
53                 return true;
54         return theApp()->unhide(buf);
55 }
56
57
58 void WorkAreaManager::updateTitles()
59 {
60         for (WorkArea * wa : work_areas_)
61                 wa->updateWindowTitle();
62 }
63
64
65 } // namespace frontend
66 } // namespace lyx
67