mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 21:49:51 +00:00
d8ae51dbe1
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14152 a592a061-630c-0410-9148-cb99ea01b6c8
58 lines
1.0 KiB
C
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
|