]> git.lyx.org Git - lyx.git/blob - src/frontends/WorkAreaManager.cpp
lexer cosmetics
[lyx.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 "WorkArea.h"
17
18
19 namespace lyx {
20 namespace frontend {
21
22 void WorkAreaManager::add(WorkArea * wa)
23 {
24         work_areas_.push_back(wa);
25 }
26
27
28 void WorkAreaManager::remove(WorkArea * wa)
29 {
30         work_areas_.remove(wa);
31 }
32
33
34 void WorkAreaManager::redrawAll()
35 {
36         for (iterator it = work_areas_.begin(); it != work_areas_.end(); ++it)
37                 (*it)->redraw();
38 }
39
40
41 void WorkAreaManager::closeAll()
42 {
43         while (!work_areas_.empty())
44                 // WorkArea is de-registering itself.
45                 (*work_areas_.begin())->close();
46 }
47
48
49 void WorkAreaManager::setReadOnly(bool on)
50 {
51         for (iterator it = work_areas_.begin(); it != work_areas_.end(); ++it)
52                 (*it)->setReadOnly(on);
53 }
54
55
56 void WorkAreaManager::updateTitles()
57 {
58         for (iterator it = work_areas_.begin(); it != work_areas_.end(); ++it)
59                 (*it)->updateWindowTitle();
60 }
61
62 } // namespace frontend
63 } // namespace lyx
64