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 "GuiWorkArea.h"
24 #include "BufferView.h"
26 #include <boost/shared_ptr.hpp>
32 typedef QScreen FScreen;
33 typedef QWorkArea FWorkArea;
36 * The Gui class is the interface to all Qt3 components.
38 class GuiImplementation: public lyx::frontend::Gui
45 virtual ~GuiImplementation()
49 lyx::frontend::Clipboard& clipboard()
54 int newView(unsigned int /*w*/, unsigned int /*h*/)
56 view_.reset(new FView(*this));
61 LyXView& view(int /*id*/)
67 void destroyView(int /*id*/)
72 int newWorkArea(unsigned int w, unsigned int h, int /*view_id*/)
74 old_work_area_.reset(new FWorkArea(*view_.get(), w, h));
75 old_screen_.reset(new FScreen(*old_work_area_.get()));
76 work_area_.reset(new GuiWorkArea(old_screen_.get(), old_work_area_.get()));
77 clipboard_.reset(new GuiClipboard(old_work_area_.get()));
78 guiCursor().connect(work_area_.get());
80 // FIXME BufferView creation should be independant of WorkArea creation
81 buffer_views_[0].reset(new BufferView(view_.get(), work_area_.get()));
82 work_area_->setBufferView(buffer_views_[0].get());
83 view_->setBufferView(buffer_views_[0].get());
87 lyx::frontend::WorkArea& workArea(int /*id*/)
92 void destroyWorkArea(int /*id*/)
96 old_work_area_.reset();
102 boost::shared_ptr<GuiClipboard> clipboard_;
104 boost::shared_ptr<GuiWorkArea> work_area_;
106 boost::shared_ptr<FView> view_;
108 boost::shared_ptr<FWorkArea> old_work_area_;
110 boost::shared_ptr<FScreen> old_screen_;
113 } // namespace frontend
116 #endif // GUI_IMPLEMENTATION_H