]> git.lyx.org Git - lyx.git/blob - src/frontends/WorkAreaManager.cpp
Create new graphics from within LyX choosing a sample file to copy from.
[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(bool update_metrics)
35 {
36         for (WorkArea * wa : work_areas_)
37                 wa->redraw(update_metrics);
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::updateTitles()
50 {
51         for (WorkArea * wa : work_areas_)
52                 wa->updateWindowTitle();
53 }
54
55
56 } // namespace frontend
57 } // namespace lyx
58