lyx_mirror/src/frontends/qt4/GuiImplementation.C
Abdelrazak Younes d8ae51dbe1 This is the merging of the GUI API cleanup branch that was developed in svn+ssh://svn.lyx.org/lyx/lyx-devel/branches/personal/younes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14152 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-20 08:39:16 +00:00

58 lines
1.0 KiB
C

// -*- C++ -*-
/**
* \file GuiImplementation.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Levon
* \author Abdelrazak Younes
*
* Full author contact details are available in file CREDITS.
*/
#include "GuiImplementation.h"
#include "GuiWorkArea.h"
#include "QtView.h"
using boost::shared_ptr;
namespace lyx {
namespace frontend {
GuiImplementation::GuiImplementation(QtView & owner): owner_(owner), max_id_(0)
{
}
Clipboard& GuiImplementation::clipboard()
{
return clipboard_;
}
int GuiImplementation::newWorkArea(int w, int h)
{
size_t const id = max_id_;
++max_id_;
work_areas_[id].reset(new GuiWorkArea(owner_, w, h));
return id;
}
WorkArea& GuiImplementation::workArea(int id)
{
BOOST_ASSERT(work_areas_.find(id) != work_areas_.end());
guiCursor().connect(work_areas_[id].get());
return *work_areas_[id].get();
}
void GuiImplementation::destroyWorkArea(int id)
{
work_areas_.erase(id);
}
} // namespace frontend
} // namespace lyx