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 "GuiClipboard.h"
22 #include "GuiSelection.h"
23 #include "GuiWorkArea.h"
25 #include "BufferView.h"
27 #include <boost/shared_ptr.hpp>
33 typedef QScreen FScreen;
34 typedef QWorkArea FWorkArea;
37 * The Gui class is the interface to all Qt3 components.
39 class GuiImplementation: public lyx::frontend::Gui
46 virtual ~GuiImplementation()
50 lyx::frontend::Clipboard& clipboard()
55 lyx::frontend::Selection& selection()
60 int newView(unsigned int /*w*/, unsigned int /*h*/)
62 view_.reset(new FView(*this));
67 LyXView& view(int /*id*/)
73 void destroyView(int /*id*/)
78 int newWorkArea(unsigned int w, unsigned int h, int /*view_id*/)
80 old_work_area_.reset(new FWorkArea(*view_.get(), w, h));
81 old_screen_.reset(new FScreen(*old_work_area_.get()));
82 work_area_.reset(new GuiWorkArea(old_screen_.get(), old_work_area_.get()));
83 selection_.reset(new GuiSelection(old_work_area_.get()));
85 // FIXME BufferView creation should be independant of WorkArea creation
86 buffer_views_[0].reset(new BufferView(view_.get()));
87 work_area_->setBufferView(buffer_views_[0].get());
88 view_->setWorkArea(work_area_.get());
92 lyx::frontend::WorkArea& workArea(int /*id*/)
97 void destroyWorkArea(int /*id*/)
101 old_work_area_.reset();
107 GuiClipboard clipboard_;
109 boost::shared_ptr<GuiSelection> selection_;
111 boost::shared_ptr<GuiWorkArea> work_area_;
113 boost::shared_ptr<FView> view_;
115 boost::shared_ptr<FWorkArea> old_work_area_;
117 boost::shared_ptr<FScreen> old_screen_;
120 } // namespace frontend
123 #endif // GUI_IMPLEMENTATION_H