]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GuiImplementation.C
make it compile again
[lyx.git] / src / frontends / gtk / GuiImplementation.C
1 // -*- C++ -*-
2 /**
3  * \file gtk/GuiImplementation.h
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 // Too hard to make concept checks work with this file
15 #ifdef _GLIBCXX_CONCEPT_CHECKS
16 #undef _GLIBCXX_CONCEPT_CHECKS
17 #endif
18 #ifdef _GLIBCPP_CONCEPT_CHECKS
19 #undef _GLIBCPP_CONCEPT_CHECKS
20 #endif
21
22 #include "GuiImplementation.h"
23
24 #include "GView.h"
25 #include "BufferView.h"
26
27 // FIXME: defined in X.h, spuriously pulled in by some gui headers
28 #undef CursorShape
29
30 namespace lyx {
31 namespace frontend {
32
33 int GuiImplementation::newView(unsigned int /*w*/, unsigned int /*h*/)
34 {
35         view_.reset(new GView);
36         return 0;
37 }
38
39
40 int GuiImplementation::newWorkArea(unsigned int w, unsigned int h, int /*view_id*/)
41 {
42         old_work_area_.reset(new GWorkArea(*view_.get(), w, h));
43         old_screen_.reset(new GScreen(*old_work_area_.get()));
44         work_area_.reset(new GuiWorkArea(old_screen_.get(), old_work_area_.get()));
45
46         // FIXME BufferView creation should be independant of WorkArea creation
47         buffer_views_[0].reset(new BufferView(view_.get()));
48         work_area_->setBufferView(buffer_views_[0].get());
49         view_->setWorkArea(work_area_.get());
50         return 0;
51 }
52
53
54 void GuiImplementation::destroyWorkArea(int /*id*/)
55 {
56         work_area_.reset();
57         old_work_area_.reset();
58         old_screen_.reset();
59 }
60
61 } // namespace frontend
62 } // namespace lyx