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.
12 #ifndef GUI_IMPLEMENTATION_H
13 #define GUI_IMPLEMENTATION_H
15 #include "frontends/Gui.h"
19 #include "QWorkArea.h"
21 #include "GuiWorkArea.h"
23 #include "BufferView.h"
25 #include <boost/shared_ptr.hpp>
31 typedef QScreen FScreen;
32 typedef QWorkArea FWorkArea;
35 * The Gui class is the interface to all Qt3 components.
37 class GuiImplementation: public lyx::frontend::Gui
44 virtual ~GuiImplementation()
48 int newView(unsigned int /*w*/, unsigned int /*h*/)
50 view_.reset(new FView);
55 LyXView& view(int /*id*/)
61 void destroyView(int /*id*/)
66 int newWorkArea(unsigned int w, unsigned int h, int /*view_id*/)
68 old_work_area_.reset(new FWorkArea(*view_.get(), w, h));
69 old_screen_.reset(new FScreen(*old_work_area_.get()));
70 work_area_.reset(new GuiWorkArea(old_screen_.get(), old_work_area_.get()));
72 // FIXME BufferView creation should be independant of WorkArea creation
73 buffer_views_[0].reset(new BufferView);
74 work_area_->setBufferView(buffer_views_[0].get());
75 view_->setWorkArea(work_area_.get());
79 lyx::frontend::WorkArea& workArea(int /*id*/)
84 void destroyWorkArea(int /*id*/)
87 old_work_area_.reset();
93 boost::shared_ptr<GuiWorkArea> work_area_;
95 boost::shared_ptr<FView> view_;
97 boost::shared_ptr<FWorkArea> old_work_area_;
99 boost::shared_ptr<FScreen> old_screen_;
102 } // namespace frontend
105 #endif // GUI_IMPLEMENTATION_H