rename InsetBase to Inset

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18089 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2007-04-29 13:39:47 +00:00
parent a166944df6
commit 32871c1284
259 changed files with 1006 additions and 1005 deletions

View File

@ -59,7 +59,7 @@ void Bidi::computeTables(Paragraph const & par,
return;
}
if (par.ownerCode() == InsetBase::ERT_CODE) {
if (par.ownerCode() == Inset::ERT_CODE) {
start_ = -1;
return;
}

View File

@ -242,7 +242,7 @@ LyXText & Buffer::text() const
}
InsetBase & Buffer::inset() const
Inset & Buffer::inset() const
{
return const_cast<InsetText &>(pimpl_->inset);
}
@ -1254,15 +1254,15 @@ void Buffer::fillWithBibKeys(vector<pair<string, docstring> > & keys)
}
for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
if (it->lyxCode() == InsetBase::BIBTEX_CODE) {
if (it->lyxCode() == Inset::BIBTEX_CODE) {
InsetBibtex const & inset =
static_cast<InsetBibtex const &>(*it);
inset.fillWithBibKeys(*this, keys);
} else if (it->lyxCode() == InsetBase::INCLUDE_CODE) {
} else if (it->lyxCode() == Inset::INCLUDE_CODE) {
InsetInclude const & inset =
static_cast<InsetInclude const &>(*it);
inset.fillWithBibKeys(*this, keys);
} else if (it->lyxCode() == InsetBase::BIBITEM_CODE) {
} else if (it->lyxCode() == Inset::BIBITEM_CODE) {
InsetBibitem const & inset =
static_cast<InsetBibitem const &>(*it);
// FIXME UNICODE
@ -1290,14 +1290,14 @@ void Buffer::updateBibfilesCache()
bibfilesCache_.clear();
for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
if (it->lyxCode() == InsetBase::BIBTEX_CODE) {
if (it->lyxCode() == Inset::BIBTEX_CODE) {
InsetBibtex const & inset =
static_cast<InsetBibtex const &>(*it);
vector<FileName> const bibfiles = inset.getFiles(*this);
bibfilesCache_.insert(bibfilesCache_.end(),
bibfiles.begin(),
bibfiles.end());
} else if (it->lyxCode() == InsetBase::INCLUDE_CODE) {
} else if (it->lyxCode() == Inset::INCLUDE_CODE) {
InsetInclude & inset =
static_cast<InsetInclude &>(*it);
inset.updateBibfilesCache(*this);
@ -1604,7 +1604,7 @@ void Buffer::buildMacros()
InsetList::const_iterator end = insets.end();
for ( ; it != end; ++it) {
//lyxerr << "found inset code " << it->inset->lyxCode() << std::endl;
if (it->inset->lyxCode() == InsetBase::MATHMACRO_CODE) {
if (it->inset->lyxCode() == Inset::MATHMACRO_CODE) {
MathMacroTemplate const & mac
= static_cast<MathMacroTemplate const &>(*it->inset);
insertMacro(mac.name(), mac.asMacroData());
@ -1622,14 +1622,14 @@ void Buffer::saveCursor(StableDocIterator cur, StableDocIterator anc)
void Buffer::changeRefsIfUnique(docstring const & from, docstring const & to,
InsetBase::Code code)
Inset::Code code)
{
//FIXME: This does not work for child documents yet.
BOOST_ASSERT(code == InsetBase::CITE_CODE || code == InsetBase::REF_CODE);
BOOST_ASSERT(code == Inset::CITE_CODE || code == Inset::REF_CODE);
// Check if the label 'from' appears more than once
vector<docstring> labels;
if (code == InsetBase::CITE_CODE) {
if (code == Inset::CITE_CODE) {
vector<pair<string, docstring> > keys;
fillWithBibKeys(keys);
vector<pair<string, docstring> >::const_iterator bit = keys.begin();

View File

@ -38,7 +38,7 @@ namespace lyx {
class BufferParams;
class ErrorItem;
class FuncRequest;
class InsetBase;
class Inset;
class InsetText;
class LyXFont;
class Lexer;
@ -352,7 +352,7 @@ public:
LyXText & text() const;
/// Our top InsetText!
InsetBase & inset() const;
Inset & inset() const;
//
// Macro handling
@ -374,7 +374,7 @@ public:
StableDocIterator getAnchor() const { return anchor_; }
///
void changeRefsIfUnique(docstring const & from, docstring const & to,
InsetBase::Code code);
Inset::Code code);
/// get source code (latex/docbook) for some paragraphs, or all paragraphs
/// including preamble
void getSourceCode(odocstream & os, pit_type par_begin, pit_type par_end, bool full_source);

View File

@ -107,7 +107,7 @@ namespace {
/// Return an inset of this class if it exists at the current cursor position
template <class T>
T * getInsetByCode(Cursor & cur, InsetBase::Code code)
T * getInsetByCode(Cursor & cur, Inset::Code code)
{
T * inset = 0;
DocIterator it = cur;
@ -588,7 +588,7 @@ boost::tuple<pit_type, pos_type, int> BufferView::moveToPosition(pit_type bottom
// crash lyx when the cursor can not be set to these insets.
size_t const n = dit.depth();
for (size_t i = 0; i < n; ++i)
if (dit[i].inset().editable() != InsetBase::HIGHLY_EDITABLE) {
if (dit[i].inset().editable() != Inset::HIGHLY_EDITABLE) {
dit.resize(i);
break;
}
@ -696,7 +696,7 @@ FuncStatus BufferView::getStatus(FuncRequest const & cmd)
case LFUN_LABEL_GOTO: {
flag.enabled(!cmd.argument().empty()
|| getInsetByCode<InsetRef>(cursor_, InsetBase::REF_CODE));
|| getInsetByCode<InsetRef>(cursor_, Inset::REF_CODE));
break;
}
@ -806,7 +806,7 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
if (label.empty()) {
InsetRef * inset =
getInsetByCode<InsetRef>(cursor_,
InsetBase::REF_CODE);
Inset::REF_CODE);
if (inset) {
label = inset->getParam("reference");
// persistent=false: use temp_bookmark
@ -872,13 +872,13 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
break;
case LFUN_NOTE_NEXT:
bv_funcs::gotoInset(this, InsetBase::NOTE_CODE, false);
bv_funcs::gotoInset(this, Inset::NOTE_CODE, false);
break;
case LFUN_REFERENCE_NEXT: {
vector<InsetBase_code> tmp;
tmp.push_back(InsetBase::LABEL_CODE);
tmp.push_back(InsetBase::REF_CODE);
vector<Inset_code> tmp;
tmp.push_back(Inset::LABEL_CODE);
tmp.push_back(Inset::REF_CODE);
bv_funcs::gotoInset(this, tmp, true);
break;
}
@ -958,9 +958,9 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
case LFUN_BIBTEX_DATABASE_ADD: {
Cursor tmpcur = cursor_;
bv_funcs::findInset(tmpcur, InsetBase::BIBTEX_CODE, false);
bv_funcs::findInset(tmpcur, Inset::BIBTEX_CODE, false);
InsetBibtex * inset = getInsetByCode<InsetBibtex>(tmpcur,
InsetBase::BIBTEX_CODE);
Inset::BIBTEX_CODE);
if (inset) {
if (inset->addDatabase(to_utf8(cmd.argument())))
buffer_->updateBibfilesCache();
@ -970,9 +970,9 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
case LFUN_BIBTEX_DATABASE_DEL: {
Cursor tmpcur = cursor_;
bv_funcs::findInset(tmpcur, InsetBase::BIBTEX_CODE, false);
bv_funcs::findInset(tmpcur, Inset::BIBTEX_CODE, false);
InsetBibtex * inset = getInsetByCode<InsetBibtex>(tmpcur,
InsetBase::BIBTEX_CODE);
Inset::BIBTEX_CODE);
if (inset) {
if (inset->delDatabase(to_utf8(cmd.argument())))
buffer_->updateBibfilesCache();
@ -1020,7 +1020,7 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd)
FuncRequest tmpcmd = FuncRequest(LFUN_INSET_TOGGLE, cmd.origin);
// if there is an inset at cursor, see whether it
// wants to toggle.
InsetBase * inset = cur.nextInset();
Inset * inset = cur.nextInset();
if (inset && inset->isActive()) {
Cursor tmpcur = cur;
tmpcur.pushLeft(*inset);
@ -1102,7 +1102,7 @@ void BufferView::workAreaResize(int width, int height)
}
InsetBase const * BufferView::getCoveringInset(LyXText const & text, int x, int y)
Inset const * BufferView::getCoveringInset(LyXText const & text, int x, int y)
{
pit_type pit = text.getPitNearY(*this, y);
BOOST_ASSERT(pit != -1);
@ -1117,7 +1117,7 @@ InsetBase const * BufferView::getCoveringInset(LyXText const & text, int x, int
InsetList::const_iterator iit = par.insetlist.begin();
InsetList::const_iterator iend = par.insetlist.end();
for (; iit != iend; ++iit) {
InsetBase * const inset = iit->inset;
Inset * const inset = iit->inset;
if (inset->covers(*this, x, y)) {
if (!inset->descendable())
// No need to go further down if the inset is not
@ -1130,7 +1130,7 @@ InsetBase const * BufferView::getCoveringInset(LyXText const & text, int x, int
LyXText const * inner_text = inset->getText(i);
if (inner_text) {
// Try deeper.
InsetBase const * inset_deeper =
Inset const * inset_deeper =
getCoveringInset(*inner_text, x, y);
if (inset_deeper)
return inset_deeper;
@ -1175,7 +1175,7 @@ bool BufferView::workAreaDispatch(FuncRequest const & cmd0)
if (cmd.action == LFUN_MOUSE_MOTION && cmd.button() == mouse_button::none) {
// Get inset under mouse, if there is one.
InsetBase const * covering_inset =
Inset const * covering_inset =
getCoveringInset(buffer_->text(), cmd.x, cmd.y);
if (covering_inset == last_inset_)
// Same inset, no need to do anything...
@ -1183,7 +1183,7 @@ bool BufferView::workAreaDispatch(FuncRequest const & cmd0)
bool need_redraw = false;
// const_cast because of setMouseHover().
InsetBase * inset = const_cast<InsetBase *>(covering_inset);
Inset * inset = const_cast<Inset *>(covering_inset);
if (last_inset_)
// Remove the hint on the last hovered inset (if any).
need_redraw |= last_inset_->setMouseHover(false);
@ -1226,7 +1226,7 @@ bool BufferView::workAreaDispatch(FuncRequest const & cmd0)
}
// Build temporary cursor.
InsetBase * inset = buffer_->text().editXY(cur, cmd.x, cmd.y);
Inset * inset = buffer_->text().editXY(cur, cmd.x, cmd.y);
// Put anchor at the same position.
cur.resetAnchor();

View File

@ -238,7 +238,7 @@ public:
/// This signal is emitted when some inset dialogs needs to be shown.
boost::signal<void(std::string name, std::string data,
InsetBase * inset)> showInsetDialog;
Inset * inset)> showInsetDialog;
/// This signal is emitted when some dialogs needs to be updated.
boost::signal<void(std::string name,
@ -253,7 +253,7 @@ private:
/// Search recursively for the the innermost inset that covers (x, y) position.
/// \retval 0 if no inset is found.
InsetBase const * getCoveringInset(
Inset const * getCoveringInset(
LyXText const & text, //< The LyXText where we start searching.
int x, //< x-coordinate on screen
int y //< y-coordinate on screen
@ -297,7 +297,7 @@ private:
boost::scoped_ptr<Intl> const intl_;
/// last visited inset (kept to send setMouseHover(false) )
InsetBase * last_inset_;
Inset * last_inset_;
/// A map from a LyXText to the associated text metrics
typedef std::map<LyXText const *, TextMetrics> TextMetricsCache;

View File

@ -14,7 +14,7 @@
#include "LyXText.h"
#include "insets/InsetBase.h"
#include "insets/Inset.h"
#include <boost/assert.hpp>
@ -62,27 +62,28 @@ Point CoordCache::get(LyXText const * text, pit_type pit) const
void CoordCache::dump() const
{
lyxerr << "ParPosCache contains:" << std::endl;
for (ParPosCache::const_iterator i = getParPos().begin(); i != getParPos().end(); ++i) {
LyXText const * lt = (*i).first;
InnerParPosCache const & cache = (*i).second;
for (ParPosCache::const_iterator it = getParPos().begin(); it != getParPos().end(); ++it) {
LyXText const * lt = it->first;
InnerParPosCache const & cache = it->second;
lyxerr << "LyXText:" << lt << std::endl;
for (InnerParPosCache::const_iterator j = cache.begin(); j != cache.end(); ++j) {
pit_type pit = (*j).first;
for (InnerParPosCache::const_iterator jt = cache.begin(); jt != cache.end(); ++jt) {
pit_type pit = jt->first;
Paragraph const & par = lt->getPar(pit);
Point p = (*j).second;
Point p = jt->second;
lyxerr << "Paragraph " << pit << ": \"";
for (int k = 0; k < std::min(static_cast<lyx::pos_type>(10), par.size()); ++k) {
lyxerr << to_utf8(docstring(1,par.getChar(k)));
}
int const n = std::min(static_cast<lyx::pos_type>(10), par.size());
for (int k = 0; k < n; ++k)
lyxerr << to_utf8(docstring(1, par.getChar(k)));
lyxerr << "\" has point " << p.x_ << "," << p.y_ << std::endl;
}
}
lyxerr << "InsetCache contains:" << std::endl;
for (CoordCacheBase<InsetBase>::cache_type::const_iterator i = getInsets().getData().begin(); i != getInsets().getData().end(); ++i) {
InsetBase const * inset = (*i).first;
Point p = (*i).second;
lyxerr << "Inset " << inset << "(" << to_utf8(inset->getInsetName()) << ") has point " << p.x_ << "," << p.y_ << std::endl;
for (CoordCacheBase<Inset>::cache_type::const_iterator it = getInsets().getData().begin(); it != getInsets().getData().end(); ++it) {
Inset const * inset = it->first;
Point const p = it->second;
lyxerr << "Inset " << inset << "(" << to_utf8(inset->insetName())
<< ") has point " << p.x_ << "," << p.y_ << std::endl;
}
}

View File

@ -20,7 +20,7 @@
namespace lyx {
class InsetBase;
class Inset;
class LyXText;
class MathData;
class Paragraph;
@ -126,8 +126,8 @@ public:
CoordCacheBase<MathData> & arrays() { return arrays_; }
CoordCacheBase<MathData> const & getArrays() const { return arrays_; }
/// A map from insets to positions on the screen
CoordCacheBase<InsetBase> & insets() { return insets_; }
CoordCacheBase<InsetBase> const & getInsets() const { return insets_; }
CoordCacheBase<Inset> & insets() { return insets_; }
CoordCacheBase<Inset> const & getInsets() const { return insets_; }
/// A map from (LyXText, paragraph) pair to screen positions
ParPosCache & parPos() { return pars_; }
ParPosCache const & getParPos() const { return pars_; }
@ -147,7 +147,7 @@ private:
/// MathDatas
CoordCacheBase<MathData> arrays_;
// All insets
CoordCacheBase<InsetBase> insets_;
CoordCacheBase<Inset> insets_;
/// Paragraph grouped by owning text
ParPosCache pars_;
/// Used with boundary == 0

View File

@ -93,10 +93,10 @@ namespace {
for (size_t i = 0;; ++i) {
int xo;
int yo;
InsetBase const * inset = &it.inset();
std::map<InsetBase const *, Point> const & data =
Inset const * inset = &it.inset();
std::map<Inset const *, Point> const & data =
c.bv().coordCache().getInsets().getData();
std::map<InsetBase const *, Point>::const_iterator I = data.find(inset);
std::map<Inset const *, Point>::const_iterator I = data.find(inset);
// FIXME: in the case where the inset is not in the cache, this
// means that no part of it is visible on screen. In this case
@ -134,7 +134,7 @@ namespace {
int x, int y, int xlow, int xhigh, int ylow, int yhigh)
{
BOOST_ASSERT(!cursor.empty());
InsetBase & inset = cursor[0].inset();
Inset & inset = cursor[0].inset();
BufferView & bv = cursor.bv();
CoordCache::InnerParPosCache const & cache =
@ -203,7 +203,7 @@ namespace {
// << " xlow: " << xlow << " xhigh: " << xhigh
// << " ylow: " << ylow << " yhigh: " << yhigh
// << endl;
InsetBase & inset = bv.buffer()->inset();
Inset & inset = bv.buffer()->inset();
DocIterator it = doc_iterator_begin(inset);
it.pit() = from;
DocIterator et = doc_iterator_end(inset);
@ -256,7 +256,7 @@ Cursor::Cursor(BufferView & bv)
{}
void Cursor::reset(InsetBase & inset)
void Cursor::reset(Inset & inset)
{
clear();
push_back(CursorSlice(inset));
@ -341,13 +341,13 @@ void Cursor::pop()
}
void Cursor::push(InsetBase & p)
void Cursor::push(Inset & p)
{
push_back(CursorSlice(p));
}
void Cursor::pushLeft(InsetBase & p)
void Cursor::pushLeft(Inset & p)
{
BOOST_ASSERT(!empty());
//lyxerr << "Entering inset " << t << " left" << endl;
@ -387,10 +387,10 @@ int Cursor::currentMode()
BOOST_ASSERT(!empty());
for (int i = depth() - 1; i >= 0; --i) {
int res = operator[](i).inset().currentMode();
if (res != InsetBase::UNDECIDED_MODE)
if (res != Inset::UNDECIDED_MODE)
return res;
}
return InsetBase::TEXT_MODE;
return Inset::TEXT_MODE;
}
@ -541,7 +541,7 @@ void Cursor::info(odocstream & os) const
os << " ";
}
if (pos() != 0) {
InsetBase const * inset = prevInset();
Inset const * inset = prevInset();
// prevInset() can return 0 in certain case.
if (inset)
prevInset()->infoize2(os);
@ -608,7 +608,7 @@ namespace lyx {
//#define FILEDEBUG 1
bool Cursor::isInside(InsetBase const * p)
bool Cursor::isInside(Inset const * p)
{
for (size_t i = 0; i != depth(); ++i)
if (&operator[](i).inset() == p)
@ -617,7 +617,7 @@ bool Cursor::isInside(InsetBase const * p)
}
void Cursor::leaveInset(InsetBase const & inset)
void Cursor::leaveInset(Inset const & inset)
{
for (size_t i = 0; i != depth(); ++i) {
if (&operator[](i).inset() == &inset) {
@ -712,7 +712,7 @@ void Cursor::insert(MathAtom const & t)
}
void Cursor::insert(InsetBase * inset)
void Cursor::insert(Inset * inset)
{
if (inMathed())
insert(MathAtom(inset));

View File

@ -47,9 +47,9 @@ public:
/// get the resut of the last dispatch
DispatchResult result() const;
/// add a new cursor slice
void push(InsetBase & inset);
void push(Inset & inset);
/// add a new cursor slice, place cursor on left end
void pushLeft(InsetBase & inset);
void pushLeft(Inset & inset);
/// pop one level off the cursor
void pop();
/// pop one slice off the cursor stack and go left
@ -57,7 +57,7 @@ public:
/// pop one slice off the cursor stack and go right
bool popRight();
/// make sure we are outside of given inset
void leaveInset(InsetBase const & inset);
void leaveInset(Inset const & inset);
/// sets cursor part
void setCursor(DocIterator const & it);
@ -115,7 +115,7 @@ public:
bool posRight();
/// insert an inset
void insert(InsetBase *);
void insert(Inset *);
/// insert a single char
void insert(char_type c);
/// insert a string
@ -146,7 +146,7 @@ public:
int currentMode();
/// reset cursor bottom to the beginning of the given inset
// (sort of 'chroot' environment...)
void reset(InsetBase &);
void reset(Inset &);
/// for spellchecking
void replaceWord(std::string const & replacestring);
/**
@ -272,7 +272,7 @@ public:
// selection in given cell of atom
void handleNest(MathAtom const & at, int cell = 0);
///
bool isInside(InsetBase const *);
bool isInside(Inset const *);
/// make sure cursor position is valid
void normalize();

View File

@ -34,7 +34,7 @@ CursorSlice::CursorSlice()
{}
CursorSlice::CursorSlice(InsetBase & p)
CursorSlice::CursorSlice(Inset & p)
: inset_(&p), idx_(0), pit_(0), pos_(0)
{
BOOST_ASSERT(inset_);

View File

@ -17,8 +17,8 @@
#ifndef CURSORSLICE_H
#define CURSORSLICE_H
#include "insets/InsetBase.h"
#include "support/types.h"
#include "insets/Inset.h"
#include <cstddef>
#include <iosfwd>
@ -26,7 +26,7 @@
namespace lyx {
class InsetBase;
class Inset;
class MathData;
class LyXText;
class Paragraph;
@ -50,10 +50,10 @@ public:
///
CursorSlice();
///
explicit CursorSlice(InsetBase &);
explicit CursorSlice(Inset &);
/// the current inset
InsetBase & inset() const { return *inset_; }
Inset & inset() const { return *inset_; }
/// return the cell this cursor is in
idx_type idx() const { return idx_; }
/// return the cell this cursor is in
@ -115,7 +115,7 @@ public:
friend std::ostream & operator<<(std::ostream &, CursorSlice const &);
public:
/// pointer to 'owning' inset. This is some kind of cache.
InsetBase * inset_;
Inset * inset_;
private:
/*!
* Cell index of a position in this inset.

View File

@ -83,10 +83,10 @@ bool dirty_tabular_stack_ = false;
void region(CursorSlice const & i1, CursorSlice const & i2,
InsetBase::row_type & r1, InsetBase::row_type & r2,
InsetBase::col_type & c1, InsetBase::col_type & c2)
Inset::row_type & r1, Inset::row_type & r2,
Inset::col_type & c1, Inset::col_type & c2)
{
InsetBase & p = i1.inset();
Inset & p = i1.inset();
c1 = p.col(i1.idx());
c2 = p.col(i2.idx());
if (c1 > c2)
@ -128,7 +128,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
// Convert newline to paragraph break in ERT inset.
// This should not be here!
if (pars[pit].inInset() &&
pars[pit].inInset()->lyxCode() == InsetBase::ERT_CODE) {
pars[pit].inInset()->lyxCode() == Inset::ERT_CODE) {
for (ParagraphList::size_type i = 0; i < insertion.size(); ++i) {
for (pos_type j = 0; j < insertion[i].size(); ++j) {
if (insertion[i].isNewline(j)) {
@ -220,7 +220,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
for (; lit != eit; ++lit) {
switch (lit->inset->lyxCode()) {
case InsetBase::TABULAR_CODE: {
case Inset::TABULAR_CODE: {
InsetTabular * it = static_cast<InsetTabular*>(lit->inset);
it->buffer(&buffer);
break;
@ -374,7 +374,7 @@ void copySelectionHelper(Buffer const & buf, ParagraphList & pars,
// ERT paragraphs have the Language latex_language.
// This is invalid outside of ERT, so we need to change it
// to the buffer language.
if (it->ownerCode() == InsetBase::ERT_CODE) {
if (it->ownerCode() == Inset::ERT_CODE) {
it->changeLanguage(buf.params(), latex_language,
buf.getLanguage());
}
@ -446,7 +446,7 @@ void switchBetweenClasses(textclass_type c1, textclass_type c2,
// character styles
InsetIterator const i_end = inset_iterator_end(in);
for (InsetIterator it = inset_iterator_begin(in); it != i_end; ++it) {
if (it->lyxCode() == InsetBase::CHARSTYLE_CODE) {
if (it->lyxCode() == Inset::CHARSTYLE_CODE) {
InsetCharStyle & inset =
static_cast<InsetCharStyle &>(*it);
string const name = inset.params().type;
@ -835,11 +835,11 @@ void eraseSelection(Cursor & cur)
cur.pos() = cur.lastpos();
} else {
InsetMath * p = i1.asInsetMath();
InsetBase::row_type r1, r2;
InsetBase::col_type c1, c2;
Inset::row_type r1, r2;
Inset::col_type c1, c2;
region(i1, i2, r1, r2, c1, c2);
for (InsetBase::row_type row = r1; row <= r2; ++row)
for (InsetBase::col_type col = c1; col <= c2; ++col)
for (Inset::row_type row = r1; row <= r2; ++row)
for (Inset::col_type col = c1; col <= c2; ++col)
p->cell(p->index(row, col)).clear();
// We've deleted the whole cell. Only pos 0 is valid.
cur.pos() = 0;
@ -898,16 +898,16 @@ docstring grabSelection(Cursor const & cur)
}
}
InsetBase::row_type r1, r2;
InsetBase::col_type c1, c2;
Inset::row_type r1, r2;
Inset::col_type c1, c2;
region(i1, i2, r1, r2, c1, c2);
docstring data;
if (i1.inset().asInsetMath()) {
for (InsetBase::row_type row = r1; row <= r2; ++row) {
for (Inset::row_type row = r1; row <= r2; ++row) {
if (row > r1)
data += "\\\\";
for (InsetBase::col_type col = c1; col <= c2; ++col) {
for (Inset::col_type col = c1; col <= c2; ++col) {
if (col > c1)
data += '&';
data += asString(i1.asInsetMath()->

View File

@ -38,12 +38,12 @@ DocIterator::DocIterator()
{}
DocIterator::DocIterator(InsetBase & inset)
DocIterator::DocIterator(Inset & inset)
: boundary_(false), inset_(&inset)
{}
DocIterator doc_iterator_begin(InsetBase & inset)
DocIterator doc_iterator_begin(Inset & inset)
{
DocIterator dit(inset);
dit.forwardPos();
@ -51,13 +51,13 @@ DocIterator doc_iterator_begin(InsetBase & inset)
}
DocIterator doc_iterator_end(InsetBase & inset)
DocIterator doc_iterator_end(Inset & inset)
{
return DocIterator(inset);
}
InsetBase * DocIterator::nextInset()
Inset * DocIterator::nextInset()
{
BOOST_ASSERT(!empty());
if (pos() == lastpos())
@ -72,7 +72,7 @@ InsetBase * DocIterator::nextInset()
}
InsetBase * DocIterator::prevInset()
Inset * DocIterator::prevInset()
{
BOOST_ASSERT(!empty());
if (pos() == 0)
@ -89,7 +89,7 @@ InsetBase * DocIterator::prevInset()
}
InsetBase const * DocIterator::prevInset() const
Inset const * DocIterator::prevInset() const
{
BOOST_ASSERT(!empty());
if (pos() == 0)
@ -106,11 +106,11 @@ InsetBase const * DocIterator::prevInset() const
}
InsetBase * DocIterator::realInset() const
Inset * DocIterator::realInset() const
{
BOOST_ASSERT(inTexted());
// if we are in a tabular, we need the cell
if (inset().lyxCode() == InsetBase::TABULAR_CODE) {
if (inset().lyxCode() == Inset::TABULAR_CODE) {
InsetTabular & tabular = static_cast<InsetTabular&>(inset());
return tabular.cell(idx()).get();
}
@ -269,7 +269,7 @@ LyXText const * DocIterator::innerText() const
}
InsetBase * DocIterator::innerInsetOfType(int code) const
Inset * DocIterator::innerInsetOfType(int code) const
{
for (int i = depth() - 1; i >= 0; --i)
if (slices_[i].inset_->lyxCode() == code)
@ -286,12 +286,12 @@ void DocIterator::forwardPos(bool ignorecollapsed)
return;
}
InsetBase * const nextinset = nextInset();
Inset * const nextinset = nextInset();
// jump over collapsables if they are collapsed
// FIXME: the check for asInsetMath() shouldn't be necessary
// but math insets do not return a sensible editable() state yet.
if (ignorecollapsed && nextinset && (!nextinset->asInsetMath()
&& nextinset->editable() != InsetBase::HIGHLY_EDITABLE)) {
&& nextinset->editable() != Inset::HIGHLY_EDITABLE)) {
++top().pos();
return;
}
@ -303,7 +303,7 @@ void DocIterator::forwardPos(bool ignorecollapsed)
pos_type const lastp = lastpos();
// move into an inset to the right if possible
InsetBase * n = 0;
Inset * n = 0;
if (tip.pos() != lastp) {
// this is impossible for pos() == size()
@ -481,7 +481,7 @@ void DocIterator::backwardPos()
}
// move into an inset to the left if possible
InsetBase * n = 0;
Inset * n = 0;
if (inMathed()) {
n = (tip.cell().begin() + tip.pos())->nucleus();
@ -510,7 +510,7 @@ bool DocIterator::hasPart(DocIterator const & it) const
}
void DocIterator::updateInsets(InsetBase * inset)
void DocIterator::updateInsets(Inset * inset)
{
// this function re-creates the cache of inset pointers.
// code taken in part from StableDocIterator::asDocIterator.
@ -548,7 +548,7 @@ StableDocIterator::StableDocIterator(DocIterator const & dit)
}
DocIterator StableDocIterator::asDocIterator(InsetBase * inset) const
DocIterator StableDocIterator::asDocIterator(Inset * inset) const
{
// this function re-creates the cache of inset pointers
//lyxerr << "converting:\n" << *this << endl;

View File

@ -49,7 +49,7 @@ public:
///
DocIterator();
///
explicit DocIterator(InsetBase & inset);
explicit DocIterator(Inset & inset);
/// access slice at position \p i
CursorSlice const & operator[](size_t i) const { return slices_[i]; }
@ -80,7 +80,7 @@ public:
/// how many nested insets do we have?
size_t depth() const { return slices_.size(); }
/// the containing inset
InsetBase & inset() const { return top().inset(); }
Inset & inset() const { return top().inset(); }
/// return the cell of the inset this cursor is in
idx_type idx() const { return top().idx(); }
/// return the cell of the inset this cursor is in
@ -115,11 +115,11 @@ public:
/// return the last column of the top grid
col_type lastcol() const { return ncols() - 1; }
/// the inset just behind the cursor
InsetBase * nextInset();
Inset * nextInset();
/// the inset just in front of the cursor
InsetBase * prevInset();
Inset * prevInset();
/// the inset just in front of the cursor
InsetBase const * prevInset() const;
Inset const * prevInset() const;
///
bool boundary() const { return boundary_; }
///
@ -162,9 +162,9 @@ public:
///
LyXText const * text() const;
/// the containing inset or the cell, respectively
InsetBase * realInset() const;
Inset * realInset() const;
///
InsetBase * innerInsetOfType(int code) const;
Inset * innerInsetOfType(int code) const;
///
LyXText * innerText();
///
@ -218,7 +218,7 @@ public:
///
void pop_back() { slices_.pop_back(); }
/// recompute the inset parts of the cursor from the document data
void updateInsets(InsetBase * inset);
void updateInsets(Inset * inset);
private:
/**
@ -244,12 +244,12 @@ private:
///
std::vector<CursorSlice> slices_;
///
InsetBase * inset_;
Inset * inset_;
};
DocIterator doc_iterator_begin(InsetBase & inset);
DocIterator doc_iterator_end(InsetBase & inset);
DocIterator doc_iterator_begin(Inset & inset);
DocIterator doc_iterator_end(Inset & inset);
inline
@ -277,7 +277,7 @@ public:
/// non-explicit intended
StableDocIterator(const DocIterator & it);
///
DocIterator asDocIterator(InsetBase * start) const;
DocIterator asDocIterator(Inset * start) const;
///
size_t size() const { return data_.size(); }
/// return the position within the paragraph

View File

@ -19,13 +19,13 @@
namespace lyx {
InsetIterator::InsetIterator(InsetBase & inset)
InsetIterator::InsetIterator(Inset & inset)
: DocIterator(inset)
{
}
InsetIterator inset_iterator_begin(InsetBase & inset)
InsetIterator inset_iterator_begin(Inset & inset)
{
InsetIterator it = InsetIterator(inset);
it.forwardInset();
@ -33,7 +33,7 @@ InsetIterator inset_iterator_begin(InsetBase & inset)
}
InsetIterator inset_iterator_end(InsetBase & inset)
InsetIterator inset_iterator_end(Inset & inset)
{
return InsetIterator(inset);
}

View File

@ -22,20 +22,20 @@ class InsetIterator : public DocIterator
{
public:
///
explicit InsetIterator(InsetBase & inset);
explicit InsetIterator(Inset & inset);
///
void operator++() { forwardInset(); }
///
void operator--();
///
InsetBase * operator->() { return nextInset(); }
Inset * operator->() { return nextInset(); }
///
InsetBase & operator*() { return *nextInset(); }
Inset & operator*() { return *nextInset(); }
};
InsetIterator inset_iterator_begin(InsetBase & inset);
InsetIterator inset_iterator_begin(Inset & inset);
InsetIterator inset_iterator_end(InsetBase & inset);
InsetIterator inset_iterator_end(Inset & inset);

View File

@ -71,7 +71,7 @@ InsetList::const_iterator InsetList::insetIterator(pos_type pos) const
}
void InsetList::insert(InsetBase * inset, pos_type pos)
void InsetList::insert(Inset * inset, pos_type pos)
{
List::iterator end = list_.end();
List::iterator it = insetIterator(pos);
@ -95,12 +95,12 @@ void InsetList::erase(pos_type pos)
}
InsetBase * InsetList::release(pos_type pos)
Inset * InsetList::release(pos_type pos)
{
List::iterator end = list_.end();
List::iterator it = insetIterator(pos);
if (it != end && it->pos == pos) {
InsetBase * tmp = it->inset;
Inset * tmp = it->inset;
it->inset = 0;
return tmp;
}
@ -108,7 +108,7 @@ InsetBase * InsetList::release(pos_type pos)
}
InsetBase * InsetList::get(pos_type pos) const
Inset * InsetList::get(pos_type pos) const
{
List::const_iterator end = list_.end();
List::const_iterator it = insetIterator(pos);

View File

@ -19,7 +19,7 @@
namespace lyx {
class InsetBase;
class Inset;
class Buffer;
@ -30,11 +30,11 @@ public:
class InsetTable {
public:
///
InsetTable(pos_type p, InsetBase * i) : pos(p), inset(i) {}
InsetTable(pos_type p, Inset * i) : pos(p), inset(i) {}
///
pos_type pos;
///
InsetBase * inset;
Inset * inset;
};
///
typedef std::vector<InsetTable> List;
@ -60,13 +60,13 @@ public:
///
const_iterator insetIterator(pos_type pos) const;
///
void insert(InsetBase * inset, pos_type pos);
void insert(Inset * inset, pos_type pos);
///
void erase(pos_type pos);
///
InsetBase * release(pos_type);
Inset * release(pos_type);
///
InsetBase * get(pos_type pos) const;
Inset * get(pos_type pos) const;
///
void increasePosAfterPos(pos_type pos);
///

View File

@ -360,7 +360,7 @@ void LyX::setGuiLanguage(std::string const & language)
}
Buffer const * const LyX::updateInset(InsetBase const * inset) const
Buffer const * const LyX::updateInset(Inset const * inset) const
{
if (!inset)
return 0;

View File

@ -25,7 +25,7 @@ class Buffer;
class BufferList;
class Converters;
class ErrorItem;
class InsetBase;
class Inset;
class LyXFunc;
class LyXServer;
class LyXServerSocket;
@ -97,7 +97,7 @@ public:
/** redraw \c inset in all the BufferViews in which it is currently
* visible. If successful return a pointer to the owning Buffer.
*/
Buffer const * const updateInset(InsetBase const *) const;
Buffer const * const updateInset(Inset const *) const;
/// Execute batch commands if available.
void execBatchCommands();

View File

@ -467,7 +467,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
break;
case LFUN_LAYOUT_TABULAR:
enable = cur.innerInsetOfType(InsetBase::TABULAR_CODE);
enable = cur.innerInsetOfType(Inset::TABULAR_CODE);
break;
case LFUN_LAYOUT:
@ -496,27 +496,27 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
enable = false;
if (!cur)
break;
InsetBase::Code code = cur.inset().lyxCode();
Inset::Code code = cur.inset().lyxCode();
switch (code) {
case InsetBase::TABULAR_CODE:
case Inset::TABULAR_CODE:
enable = cmd.argument() == "tabular";
break;
case InsetBase::ERT_CODE:
case Inset::ERT_CODE:
enable = cmd.argument() == "ert";
break;
case InsetBase::FLOAT_CODE:
case Inset::FLOAT_CODE:
enable = cmd.argument() == "float";
break;
case InsetBase::WRAP_CODE:
case Inset::WRAP_CODE:
enable = cmd.argument() == "wrap";
break;
case InsetBase::NOTE_CODE:
case Inset::NOTE_CODE:
enable = cmd.argument() == "note";
break;
case InsetBase::BRANCH_CODE:
case Inset::BRANCH_CODE:
enable = cmd.argument() == "branch";
break;
case InsetBase::BOX_CODE:
case Inset::BOX_CODE:
enable = cmd.argument() == "box";
break;
default:
@ -527,7 +527,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
case LFUN_INSET_APPLY: {
string const name = cmd.getArg(0);
InsetBase * inset = lyx_view_->getDialogs().getOpenInset(name);
Inset * inset = lyx_view_->getDialogs().getOpenInset(name);
if (inset) {
FuncRequest fr(LFUN_INSET_MODIFY, cmd.argument());
FuncStatus fs;
@ -555,7 +555,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
enable = Exporter::isExportable(*buf, "dvi")
&& lyxrc.print_command != "none";
else if (name == "character")
enable = cur.inset().lyxCode() != InsetBase::ERT_CODE;
enable = cur.inset().lyxCode() != Inset::ERT_CODE;
else if (name == "latexlog")
enable = isFileReadable(FileName(buf->getLogName().second));
else if (name == "spellchecker")
@ -570,8 +570,8 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
}
case LFUN_DIALOG_SHOW_NEW_INSET:
enable = cur.inset().lyxCode() != InsetBase::ERT_CODE;
if (cur.inset().lyxCode() == InsetBase::CAPTION_CODE) {
enable = cur.inset().lyxCode() != Inset::ERT_CODE;
if (cur.inset().lyxCode() == Inset::CAPTION_CODE) {
FuncStatus flag;
if (cur.inset().getStatus(cur, cmd, flag))
return flag;
@ -1345,7 +1345,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
BOOST_ASSERT(lyx_view_);
string const & name = argument;
// Can only update a dialog connected to an existing inset
InsetBase * inset = lyx_view_->getDialogs().getOpenInset(name);
Inset * inset = lyx_view_->getDialogs().getOpenInset(name);
if (inset) {
FuncRequest fr(LFUN_INSET_DIALOG_UPDATE, cmd.argument());
inset->dispatch(view()->cursor(), fr);
@ -1535,7 +1535,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
case LFUN_INSET_APPLY: {
BOOST_ASSERT(lyx_view_);
string const name = cmd.getArg(0);
InsetBase * inset = lyx_view_->getDialogs().getOpenInset(name);
Inset * inset = lyx_view_->getDialogs().getOpenInset(name);
if (inset) {
FuncRequest fr(LFUN_INSET_MODIFY, argument);
inset->dispatch(view()->cursor(), fr);
@ -1553,18 +1553,18 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
BOOST_ASSERT(lyx_view_);
string action;
string const name = split(argument, action, ' ');
InsetBase::Code const inset_code =
InsetBase::translate(name);
Inset::Code const inset_code =
Inset::translate(name);
Cursor & cur = view()->cursor();
FuncRequest fr(LFUN_INSET_TOGGLE, action);
InsetBase & inset = lyx_view_->buffer()->inset();
Inset & inset = lyx_view_->buffer()->inset();
InsetIterator it = inset_iterator_begin(inset);
InsetIterator const end = inset_iterator_end(inset);
for (; it != end; ++it) {
if (!it->asInsetMath()
&& (inset_code == InsetBase::NO_CODE
&& (inset_code == Inset::NO_CODE
|| inset_code == it->lyxCode())) {
Cursor tmpcur = cur;
tmpcur.pushLeft(*it);
@ -1638,11 +1638,11 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
Cursor & cur = view()->cursor();
FuncRequest fr(LFUN_INSET_REFRESH);
InsetBase & inset = lyx_view_->buffer()->inset();
Inset & inset = lyx_view_->buffer()->inset();
InsetIterator it = inset_iterator_begin(inset);
InsetIterator const end = inset_iterator_end(inset);
for (; it != end; ++it)
if (it->lyxCode() == InsetBase::CITE_CODE)
if (it->lyxCode() == Inset::CITE_CODE)
it->dispatch(cur, fr);
break;
}

View File

@ -34,7 +34,7 @@ class DocIterator;
class ErrorList;
class FuncRequest;
class FuncStatus;
class InsetBase;
class Inset;
class Color_color;
class Cursor;
class PainterInfo;
@ -102,7 +102,7 @@ public:
void insertChar(Cursor & cur, char_type c);
/// insert an inset at cursor position
/// FIXME: replace Cursor with DocIterator.
void insertInset(Cursor & cur, InsetBase * inset);
void insertInset(Cursor & cur, Inset * inset);
/// draw text (only used for insets)
void draw(PainterInfo & pi, int x, int y) const;
@ -189,7 +189,7 @@ public:
/// FIXME: move to TextMetrics.
/// FIXME: cleanup to use BufferView::getCoveringInset() and
/// setCursorFromCoordinates() instead of checkInsetHit().
InsetBase * editXY(Cursor & cur, int x, int y);
Inset * editXY(Cursor & cur, int x, int y);
/// Move cursor one line up.
/**
@ -284,7 +284,7 @@ public:
/// \warning This method is not recursive! It will return the
/// outermost inset within this LyXText.
/// \sa BufferView::getCoveringInset() to get the innermost inset.
InsetBase * checkInsetHit(BufferView &, int x, int y);
Inset * checkInsetHit(BufferView &, int x, int y);
///
/// FIXME: move to TextMetrics.

View File

@ -15,7 +15,7 @@
#include "Paragraph.h"
#include "LyXText.h"
#include "insets/InsetBase.h"
#include "insets/Inset.h"
namespace lyx {
@ -29,13 +29,13 @@ ParIterator::ParIterator(DocIterator const & cur)
{}
ParIterator par_iterator_begin(InsetBase & inset)
ParIterator par_iterator_begin(Inset & inset)
{
return ParIterator(doc_iterator_begin(inset));
}
ParIterator par_iterator_end(InsetBase & inset)
ParIterator par_iterator_end(Inset & inset)
{
return ParIterator(doc_iterator_end(inset));
}
@ -183,15 +183,15 @@ bool operator!=(ParConstIterator const & iter1, ParConstIterator const & iter2)
#warning const correctness!
#endif
ParConstIterator par_const_iterator_begin(InsetBase const & inset)
ParConstIterator par_const_iterator_begin(Inset const & inset)
{
return ParConstIterator(doc_iterator_begin(const_cast<InsetBase &>(inset)));
return ParConstIterator(doc_iterator_begin(const_cast<Inset &>(inset)));
}
ParConstIterator par_const_iterator_end(InsetBase const & inset)
ParConstIterator par_const_iterator_end(Inset const & inset)
{
return ParConstIterator(doc_iterator_end(const_cast<InsetBase &>(inset)));
return ParConstIterator(doc_iterator_end(const_cast<Inset &>(inset)));
}

View File

@ -21,7 +21,7 @@
namespace lyx {
class InsetBase;
class Inset;
class LyXText;
class ParagraphList;
@ -41,7 +41,7 @@ public:
ParIterator() : DocIterator() {}
///
ParIterator(InsetBase &, pit_type pit);
ParIterator(Inset &, pit_type pit);
///
ParIterator(ParIterator const &);
///
@ -73,9 +73,9 @@ public:
DocIterator makeDocIterator(ParIterator const &, pos_type);
ParIterator par_iterator_begin(InsetBase & inset);
ParIterator par_iterator_begin(Inset & inset);
ParIterator par_iterator_end(InsetBase & inset);
ParIterator par_iterator_end(Inset & inset);
///
@ -116,9 +116,9 @@ bool operator!=(ParConstIterator const & iter1,
ParConstIterator const & iter2);
ParConstIterator par_const_iterator_begin(InsetBase const & inset);
ParConstIterator par_const_iterator_begin(Inset const & inset);
ParConstIterator par_const_iterator_end(InsetBase const & inset);
ParConstIterator par_const_iterator_end(Inset const & inset);

View File

@ -110,13 +110,13 @@ public:
///
void insertChar(pos_type pos, value_type c, Change const & change);
///
void insertInset(pos_type pos, InsetBase * inset, Change const & change);
void insertInset(pos_type pos, Inset * inset, Change const & change);
/// (logically) erase the char at pos; return true if it was actually erased
bool eraseChar(pos_type pos, bool trackChanges);
/// (logically) erase the given range; return the number of chars actually erased
int eraseChars(pos_type start, pos_type end, bool trackChanges);
///
InsetBase * inset_owner;
Inset * inset_owner;
/** A font entry covers a range of positions. Notice that the
entries in the list are inserted in random order.
@ -457,7 +457,7 @@ void Paragraph::Pimpl::insertChar(pos_type pos, value_type c, Change const & cha
}
void Paragraph::Pimpl::insertInset(pos_type pos, InsetBase * inset,
void Paragraph::Pimpl::insertInset(pos_type pos, Inset * inset,
Change const & change)
{
BOOST_ASSERT(inset);
@ -687,14 +687,14 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
// and then split to handle the two modes separately.
switch (c) {
case Paragraph::META_INSET: {
InsetBase * inset = owner_->getInset(i);
Inset * inset = owner_->getInset(i);
// FIXME: remove this check
if (!inset)
break;
// FIXME: move this to InsetNewline::latex
if (inset->lyxCode() == InsetBase::NEWLINE_CODE) {
if (inset->lyxCode() == Inset::NEWLINE_CODE) {
// newlines are handled differently here than
// the default in simpleTeXSpecialChars().
if (!style.newline_allowed) {
@ -740,9 +740,9 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
bool close = false;
odocstream::pos_type const len = os.tellp();
if ((inset->lyxCode() == InsetBase::GRAPHICS_CODE
|| inset->lyxCode() == InsetBase::MATH_CODE
|| inset->lyxCode() == InsetBase::URL_CODE)
if ((inset->lyxCode() == Inset::GRAPHICS_CODE
|| inset->lyxCode() == Inset::MATH_CODE
|| inset->lyxCode() == Inset::URL_CODE)
&& running_font.isRightToLeft()) {
os << "\\L{";
close = true;
@ -1005,7 +1005,7 @@ void Paragraph::Pimpl::validate(LaTeXFeatures & features,
if (icit->inset) {
icit->inset->validate(features);
if (layout.needprotect &&
icit->inset->lyxCode() == InsetBase::FOOT_CODE)
icit->inset->lyxCode() == Inset::FOOT_CODE)
features.require("NeedLyXFootnoteCode");
}
}
@ -1139,7 +1139,7 @@ void Paragraph::write(Buffer const & buf, ostream & os,
switch (c) {
case META_INSET:
{
InsetBase const * inset = getInset(i);
Inset const * inset = getInset(i);
if (inset)
if (inset->directWrite()) {
// international char, let it write
@ -1242,14 +1242,14 @@ void Paragraph::insertChar(pos_type pos, Paragraph::value_type c,
}
void Paragraph::insertInset(pos_type pos, InsetBase * inset,
void Paragraph::insertInset(pos_type pos, Inset * inset,
Change const & change)
{
pimpl_->insertInset(pos, inset, change);
}
void Paragraph::insertInset(pos_type pos, InsetBase * inset,
void Paragraph::insertInset(pos_type pos, Inset * inset,
LyXFont const & font, Change const & change)
{
pimpl_->insertInset(pos, inset, change);
@ -1257,7 +1257,7 @@ void Paragraph::insertInset(pos_type pos, InsetBase * inset,
}
bool Paragraph::insetAllowed(InsetBase_code code)
bool Paragraph::insetAllowed(Inset_code code)
{
return !pimpl_->inset_owner || pimpl_->inset_owner->insetAllowed(code);
}
@ -1688,7 +1688,7 @@ void Paragraph::setBeginOfBody()
// returns -1 if inset not found
int Paragraph::getPositionOfInset(InsetBase const * inset) const
int Paragraph::getPositionOfInset(Inset const * inset) const
{
// Find the entry.
InsetList::const_iterator it = insetlist.begin();
@ -1703,8 +1703,8 @@ int Paragraph::getPositionOfInset(InsetBase const * inset) const
InsetBibitem * Paragraph::bibitem() const
{
if (!insetlist.empty()) {
InsetBase * inset = insetlist.begin()->inset;
if (inset->lyxCode() == InsetBase::BIBITEM_CODE)
Inset * inset = insetlist.begin()->inset;
if (inset->lyxCode() == Inset::BIBITEM_CODE)
return static_cast<InsetBibitem *>(inset);
}
return 0;
@ -1722,9 +1722,9 @@ namespace {
// paragraphs inside floats need different alignment tags to avoid
// unwanted space
bool noTrivlistCentering(InsetBase::Code code)
bool noTrivlistCentering(Inset::Code code)
{
return code == InsetBase::FLOAT_CODE || code == InsetBase::WRAP_CODE;
return code == Inset::FLOAT_CODE || code == Inset::WRAP_CODE;
}
@ -1741,7 +1741,7 @@ string correction(string const & orig)
string const corrected_env(string const & suffix, string const & env,
InsetBase::Code code)
Inset::Code code)
{
string output = suffix + "{";
if (noTrivlistCentering(code))
@ -2169,14 +2169,14 @@ bool Paragraph::emptyTag() const
{
for (pos_type i = 0; i < size(); ++i) {
if (isInset(i)) {
InsetBase const * inset = getInset(i);
InsetBase::Code lyx_code = inset->lyxCode();
if (lyx_code != InsetBase::TOC_CODE &&
lyx_code != InsetBase::INCLUDE_CODE &&
lyx_code != InsetBase::GRAPHICS_CODE &&
lyx_code != InsetBase::ERT_CODE &&
lyx_code != InsetBase::FLOAT_CODE &&
lyx_code != InsetBase::TABULAR_CODE) {
Inset const * inset = getInset(i);
Inset::Code lyx_code = inset->lyxCode();
if (lyx_code != Inset::TOC_CODE &&
lyx_code != Inset::INCLUDE_CODE &&
lyx_code != Inset::GRAPHICS_CODE &&
lyx_code != Inset::ERT_CODE &&
lyx_code != Inset::FLOAT_CODE &&
lyx_code != Inset::TABULAR_CODE) {
return false;
}
} else {
@ -2193,9 +2193,9 @@ string Paragraph::getID(Buffer const & buf, OutputParams const & runparams) cons
{
for (pos_type i = 0; i < size(); ++i) {
if (isInset(i)) {
InsetBase const * inset = getInset(i);
InsetBase::Code lyx_code = inset->lyxCode();
if (lyx_code == InsetBase::LABEL_CODE) {
Inset const * inset = getInset(i);
Inset::Code lyx_code = inset->lyxCode();
if (lyx_code == Inset::LABEL_CODE) {
string const id = static_cast<InsetCommand const *>(inset)->getContents();
return "id='" + to_utf8(sgml::cleanID(buf, runparams, from_utf8(id))) + "'";
}
@ -2211,7 +2211,7 @@ pos_type Paragraph::getFirstWord(Buffer const & buf, odocstream & os, OutputPara
pos_type i;
for (i = 0; i < size(); ++i) {
if (isInset(i)) {
InsetBase const * inset = getInset(i);
Inset const * inset = getInset(i);
inset->docbook(buf, os, runparams);
} else {
value_type c = getChar(i);
@ -2272,7 +2272,7 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf,
}
if (isInset(i)) {
InsetBase const * inset = getInset(i);
Inset const * inset = getInset(i);
inset->docbook(buf, os, runparams);
} else {
value_type c = getChar(i);
@ -2299,7 +2299,7 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf,
bool Paragraph::isNewline(pos_type pos) const
{
return isInset(pos)
&& getInset(pos)->lyxCode() == InsetBase::NEWLINE_CODE;
&& getInset(pos)->lyxCode() == Inset::NEWLINE_CODE;
}
@ -2340,7 +2340,7 @@ bool Paragraph::isRightToLeftPar(BufferParams const & bparams) const
{
return lyxrc.rtl_support
&& getParLanguage(bparams)->rightToLeft()
&& ownerCode() != InsetBase::ERT_CODE;
&& ownerCode() != Inset::ERT_CODE;
}
@ -2402,7 +2402,7 @@ docstring const Paragraph::asString(Buffer const & buffer,
}
void Paragraph::setInsetOwner(InsetBase * inset)
void Paragraph::setInsetOwner(Inset * inset)
{
pimpl_->inset_owner = inset;
}
@ -2469,16 +2469,16 @@ void Paragraph::layout(LyXLayout_ptr const & new_layout)
}
InsetBase * Paragraph::inInset() const
Inset * Paragraph::inInset() const
{
return pimpl_->inset_owner;
}
InsetBase::Code Paragraph::ownerCode() const
Inset::Code Paragraph::ownerCode() const
{
return pimpl_->inset_owner
? pimpl_->inset_owner->lyxCode() : InsetBase::NO_CODE;
? pimpl_->inset_owner->lyxCode() : Inset::NO_CODE;
}
@ -2500,8 +2500,8 @@ bool Paragraph::isFreeSpacing() const
return true;
// for now we just need this, later should we need this in some
// other way we can always add a function to InsetBase too.
return ownerCode() == InsetBase::ERT_CODE;
// other way we can always add a function to Inset too.
return ownerCode() == Inset::ERT_CODE;
}
@ -2509,7 +2509,7 @@ bool Paragraph::allowEmpty() const
{
if (layout()->keepempty)
return true;
return ownerCode() == InsetBase::ERT_CODE;
return ownerCode() == Inset::ERT_CODE;
}
@ -2598,13 +2598,13 @@ bool Paragraph::checkBiblio(bool track_changes)
bool hasbibitem = !insetlist.empty()
// Insist on it being in pos 0
&& getChar(0) == Paragraph::META_INSET
&& insetlist.begin()->inset->lyxCode() == InsetBase::BIBITEM_CODE;
&& insetlist.begin()->inset->lyxCode() == Inset::BIBITEM_CODE;
if (hasbibitem)
return false;
InsetBibitem * inset(new InsetBibitem(InsetCommandParams("bibitem")));
insertInset(0, static_cast<InsetBase *>(inset),
insertInset(0, static_cast<Inset *>(inset),
Change(track_changes ? Change::INSERTED : Change::UNCHANGED));
return true;

View File

@ -22,7 +22,7 @@
#include "lyxlayout_ptr_fwd.h"
#include "RowList_fwd.h"
#include "insets/InsetBase.h" // only for InsetBase::Code
#include "insets/Inset.h" // only for Inset::Code
namespace lyx {
@ -31,10 +31,10 @@ namespace lyx {
class Buffer;
class BufferParams;
class Counters;
class InsetBase;
class Inset;
class InsetBibitem;
class LaTeXFeatures;
class InsetBase_code;
class Inset_code;
class Language;
class LyXFont;
class LyXFont_size;
@ -158,11 +158,11 @@ public:
void makeSameLayout(Paragraph const & par);
///
void setInsetOwner(InsetBase * inset);
void setInsetOwner(Inset * inset);
///
InsetBase * inInset() const;
Inset * inInset() const;
///
InsetBase::Code ownerCode() const;
Inset::Code ownerCode() const;
///
bool forceDefaultParagraphs() const;
@ -303,26 +303,26 @@ public:
void insertChar(pos_type pos, value_type c,
LyXFont const &, Change const & change);
///
void insertInset(pos_type pos, InsetBase * inset,
void insertInset(pos_type pos, Inset * inset,
Change const & change);
///
void insertInset(pos_type pos, InsetBase * inset,
void insertInset(pos_type pos, Inset * inset,
LyXFont const &, Change const & change);
///
bool insetAllowed(InsetBase_code code);
bool insetAllowed(Inset_code code);
///
InsetBase * getInset(pos_type pos) {
Inset * getInset(pos_type pos) {
return insetlist.get(pos);
}
///
InsetBase const * getInset(pos_type pos) const {
Inset const * getInset(pos_type pos) const {
return insetlist.get(pos);
}
///
bool isHfill(pos_type pos) const {
return isInset(pos)
&& getInset(pos)->lyxCode() == InsetBase::HFILL_CODE;
&& getInset(pos)->lyxCode() == Inset::HFILL_CODE;
}
/// hinted by profiler
bool isInset(pos_type pos) const {
@ -339,7 +339,7 @@ public:
bool isLetter(pos_type pos) const;
/// returns -1 if inset not found
int getPositionOfInset(InsetBase const * inset) const;
int getPositionOfInset(Inset const * inset) const;
/// returns true if at least one line break or line separator has been deleted
/// at the beginning of the paragraph (either physically or logically)

View File

@ -201,7 +201,7 @@ bool TextMetrics::redoParagraph(pit_type const pit)
// redo insets
// FIXME: We should always use getFont(), see documentation of
// noFontChange() in InsetBase.h.
// noFontChange() in Inset.h.
LyXFont const bufferfont = buffer.params().getFont();
InsetList::const_iterator ii = par.insetlist.begin();
InsetList::const_iterator iend = par.insetlist.end();
@ -334,7 +334,7 @@ RowMetrics TextMetrics::computeRowMetrics(pit_type const pit,
int const ns = numberOfSeparators(par, row);
bool disp_inset = false;
if (row.endpos() < par.size()) {
InsetBase const * in = par.getInset(row.endpos());
Inset const * in = par.getInset(row.endpos());
if (in)
disp_inset = in->display();
}

View File

@ -135,8 +135,8 @@ void TocBackend::updateItem(ParConstIterator const & par_it)
InsetList::const_iterator it = toc_item->par_it_->insetlist.begin();
InsetList::const_iterator end = toc_item->par_it_->insetlist.end();
for (; it != end; ++it) {
InsetBase & inset = *it->inset;
if (inset.lyxCode() == InsetBase::OPTARG_CODE) {
Inset & inset = *it->inset;
if (inset.lyxCode() == Inset::OPTARG_CODE) {
if (!tocstring.empty())
break;
Paragraph const & par =
@ -179,10 +179,10 @@ void TocBackend::update()
InsetList::const_iterator it = pit->insetlist.begin();
InsetList::const_iterator end = pit->insetlist.end();
for (; it != end; ++it) {
InsetBase & inset = *it->inset;
Inset & inset = *it->inset;
inset.addToToc(tocs_, *buffer_);
switch (inset.lyxCode()) {
case InsetBase::OPTARG_CODE: {
case Inset::OPTARG_CODE: {
if (!tocstring.empty())
break;
Paragraph const & par =

View File

@ -28,7 +28,7 @@
#include "mathed/MathSupport.h"
#include "mathed/MathData.h"
#include "insets/InsetBase.h"
#include "insets/Inset.h"
#include <algorithm>

View File

@ -352,7 +352,7 @@ bool needEnumCounterReset(ParIterator const & it)
}
void setCaptionLabels(InsetBase & inset, string const & type,
void setCaptionLabels(Inset & inset, string const & type,
docstring const label, Counters & counters)
{
LyXText * text = inset.getText(0);
@ -372,10 +372,10 @@ void setCaptionLabels(InsetBase & inset, string const & type,
// Any caption within this float should have the same
// label prefix but different numbers.
for (; it2 != end2; ++it2) {
InsetBase & icap = *it2->inset;
Inset & icap = *it2->inset;
// Look deeper just in case.
setCaptionLabels(icap, type, label, counters);
if (icap.lyxCode() == InsetBase::CAPTION_CODE) {
if (icap.lyxCode() == Inset::CAPTION_CODE) {
// We found a caption!
counters.step(counter);
int number = counters.value(counter);
@ -399,10 +399,10 @@ void setCaptions(Paragraph & par, LyXTextClass const & textclass)
InsetList::iterator it = par.insetlist.begin();
InsetList::iterator end = par.insetlist.end();
for (; it != end; ++it) {
InsetBase & inset = *it->inset;
if (inset.lyxCode() == InsetBase::FLOAT_CODE
|| inset.lyxCode() == InsetBase::WRAP_CODE) {
docstring const & name = inset.getInsetName();
Inset & inset = *it->inset;
if (inset.lyxCode() == Inset::FLOAT_CODE
|| inset.lyxCode() == Inset::WRAP_CODE) {
docstring const & name = inset.insetName();
if (name.empty())
continue;
@ -412,7 +412,7 @@ void setCaptions(Paragraph & par, LyXTextClass const & textclass)
docstring const label = from_utf8(fl.name());
setCaptionLabels(inset, type, label, counters);
}
else if (inset.lyxCode() == InsetBase::TABULAR_CODE
else if (inset.lyxCode() == Inset::TABULAR_CODE
&& static_cast<InsetTabular &>(inset).tabular.isLongTabular()) {
// FIXME: are "table" and "Table" the correct type and label?
setCaptionLabels(inset, "table", from_ascii("Table"), counters);
@ -549,23 +549,23 @@ void setLabel(Buffer const & buf, ParIterator & it, LyXTextClass const & textcla
} else if (layout->labeltype == LABEL_SENSITIVE) {
// Search for the first float or wrap inset in the iterator
size_t i = it.depth();
InsetBase * in = 0;
Inset * in = 0;
while (i > 0) {
--i;
InsetBase::Code const code = it[i].inset().lyxCode();
if (code == InsetBase::FLOAT_CODE ||
code == InsetBase::WRAP_CODE) {
Inset::Code const code = it[i].inset().lyxCode();
if (code == Inset::FLOAT_CODE ||
code == Inset::WRAP_CODE) {
in = &it[i].inset();
break;
}
}
// FIXME Can getInsetName() return an empty name for wide or
// FIXME Can insetName() return an empty name for wide or
// float insets? If not we can put the definition of type
// inside the if (in) clause and use that instead of
// if (!type.empty()).
docstring type;
if (in)
type = in->getInsetName();
type = in->insetName();
if (!type.empty()) {
Floating const & fl = textclass.floats().getType(to_ascii(type));
@ -688,7 +688,7 @@ void updateLabels(Buffer const & buf, bool childonly)
InsetList::const_iterator iit = it->insetlist.begin();
InsetList::const_iterator end = it->insetlist.end();
for (; iit != end; ++iit) {
if (iit->inset->lyxCode() == InsetBase::INCLUDE_CODE)
if (iit->inset->lyxCode() == Inset::INCLUDE_CODE)
static_cast<InsetInclude const *>(iit->inset)
->updateLabels(buf);
}

View File

@ -239,13 +239,13 @@ CurStatus status(BufferView const * bv, DocIterator const & dit)
namespace {
bool findNextInset(DocIterator & dit,
vector<InsetBase_code> const & codes,
vector<Inset_code> const & codes,
string const & contents)
{
DocIterator tmpdit = dit;
while (tmpdit) {
InsetBase const * inset = tmpdit.nextInset();
Inset const * inset = tmpdit.nextInset();
if (inset
&& find(codes.begin(), codes.end(), inset->lyxCode()) != codes.end()
&& (contents.empty() ||
@ -262,7 +262,7 @@ bool findNextInset(DocIterator & dit,
} // namespace anon
bool findInset(DocIterator & dit, vector<InsetBase_code> const & codes,
bool findInset(DocIterator & dit, vector<Inset_code> const & codes,
bool same_content)
{
string contents;
@ -272,7 +272,7 @@ bool findInset(DocIterator & dit, vector<InsetBase_code> const & codes,
return false;
if (same_content) {
InsetBase const * inset = tmpdit.nextInset();
Inset const * inset = tmpdit.nextInset();
if (inset
&& find(codes.begin(), codes.end(), inset->lyxCode()) != codes.end()) {
contents = static_cast<InsetCommand const *>(inset)->getContents();
@ -294,13 +294,13 @@ bool findInset(DocIterator & dit, vector<InsetBase_code> const & codes,
}
void findInset(DocIterator & dit, InsetBase_code code, bool same_content)
void findInset(DocIterator & dit, Inset_code code, bool same_content)
{
findInset(dit, vector<InsetBase_code>(1, code), same_content);
findInset(dit, vector<Inset_code>(1, code), same_content);
}
void gotoInset(BufferView * bv, vector<InsetBase_code> const & codes,
void gotoInset(BufferView * bv, vector<Inset_code> const & codes,
bool same_content)
{
Cursor tmpcur = bv->cursor();
@ -314,9 +314,9 @@ void gotoInset(BufferView * bv, vector<InsetBase_code> const & codes,
}
void gotoInset(BufferView * bv, InsetBase_code code, bool same_content)
void gotoInset(BufferView * bv, Inset_code code, bool same_content)
{
gotoInset(bv, vector<InsetBase_code>(1, code), same_content);
gotoInset(bv, vector<Inset_code>(1, code), same_content);
}

View File

@ -22,7 +22,7 @@ namespace lyx {
class Point;
class BufferView;
class DocIterator;
class InsetBase_code;
class Inset_code;
class LyXFont;
namespace bv_funcs {
@ -53,18 +53,18 @@ CurStatus status(BufferView const * bv, DocIterator const & dit);
Point coordOffset(BufferView const & bv, DocIterator const & dit, bool boundary);
/// Moves cursor to the next inset with one of the given codes.
void gotoInset(BufferView * bv, std::vector<InsetBase_code> const & codes,
void gotoInset(BufferView * bv, std::vector<Inset_code> const & codes,
bool same_content);
/// Moves cursor to the next inset with given code.
void gotoInset(BufferView * bv, InsetBase_code code, bool same_content);
void gotoInset(BufferView * bv, Inset_code code, bool same_content);
/// Looks for next inset with one of the the given code
bool findInset(DocIterator & dit, std::vector<InsetBase_code> const & codes,
bool findInset(DocIterator & dit, std::vector<Inset_code> const & codes,
bool same_content);
/// Looks for next inset with the given code
void findInset(DocIterator & dit, InsetBase_code code, bool same_content);
void findInset(DocIterator & dit, Inset_code code, bool same_content);
} // namespace bv_funcs

View File

@ -80,7 +80,7 @@ using std::endl;
using std::string;
InsetBase * createInset(BufferView * bv, FuncRequest const & cmd)
Inset * createInset(BufferView * bv, FuncRequest const & cmd)
{
BufferParams const & params = bv->buffer()->params();
@ -372,7 +372,7 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd)
}
InsetBase * readInset(Lexer & lex, Buffer const & buf)
Inset * readInset(Lexer & lex, Buffer const & buf)
{
// consistency check
if (lex.getString() != "\\begin_inset") {
@ -380,7 +380,7 @@ InsetBase * readInset(Lexer & lex, Buffer const & buf)
<< endl;
}
auto_ptr<InsetBase> inset;
auto_ptr<Inset> inset;
LyXTextClass tclass = buf.params().getLyXTextClass();
@ -531,7 +531,7 @@ InsetBase * readInset(Lexer & lex, Buffer const & buf)
#ifdef WITH_WARNINGS
#warning hack..
#endif
if (inset->lyxCode() == InsetBase::MATHMACRO_CODE) {
if (inset->lyxCode() == Inset::MATHMACRO_CODE) {
MathMacroTemplate const * tmpl =
static_cast<MathMacroTemplate*>(inset.get());
MacroTable::globalMacros().insert

View File

@ -17,15 +17,15 @@ namespace lyx {
class Buffer;
class BufferView;
class FuncRequest;
class InsetBase;
class Inset;
class Lexer;
/// creates inset according to 'cmd'
InsetBase * createInset(BufferView * bv, FuncRequest const & cmd);
Inset * createInset(BufferView * bv, FuncRequest const & cmd);
/// read inset from a file
InsetBase * readInset(Lexer & lex, Buffer const & buf);
Inset * readInset(Lexer & lex, Buffer const & buf);
} // namespace lyx

View File

@ -51,12 +51,12 @@ private:
namespace {
BugfixSignal<boost::signal<void(string const &, InsetBase*)> > hideSignal;
BugfixSignal<boost::signal<void(string const &, Inset*)> > hideSignal;
}
void Dialogs::hide(string const & name, InsetBase* inset)
void Dialogs::hide(string const & name, Inset* inset)
{
// Don't send the signal if we are quitting, because on MSVC it is
// destructed before the cut stack in CutAndPaste.cpp, and this method
@ -106,7 +106,7 @@ void Dialogs::show(string const & name, string const & data)
}
void Dialogs::show(string const & name, string const & data, InsetBase * inset)
void Dialogs::show(string const & name, string const & data, Inset * inset)
{
if (in_show_) {
return;
@ -145,7 +145,7 @@ void Dialogs::update(string const & name, string const & data)
}
void Dialogs::hideSlot(string const & name, InsetBase * inset)
void Dialogs::hideSlot(string const & name, Inset * inset)
{
std::map<string, DialogPtr>::const_iterator it =
dialogs_.find(name);
@ -172,12 +172,12 @@ void Dialogs::disconnect(string const & name)
}
InsetBase * Dialogs::getOpenInset(string const & name) const
Inset * Dialogs::getOpenInset(string const & name) const
{
if (!isValidName(name))
return 0;
std::map<string, InsetBase *>::const_iterator it =
std::map<string, Inset *>::const_iterator it =
open_insets_.find(name);
return it == open_insets_.end() ? 0 : it->second;
}

View File

@ -20,7 +20,7 @@
namespace lyx {
class InsetBase;
class Inset;
class LyXView;
namespace frontend { class Dialog; }
@ -73,7 +73,7 @@ public:
dialog on 'Apply'; should it be used to create a new inset at
the current cursor position or modify an existing, 'open' inset?
*/
void show(std::string const & name, std::string const & data, InsetBase * inset);
void show(std::string const & name, std::string const & data, Inset * inset);
/** \param name == "citation", "bibtex" etc; an identifier used
to update the contents of a particular dialog with \param data.
@ -87,14 +87,14 @@ public:
/** All Dialogs of the given \param name will be closed if they are
connected to the given \param inset.
*/
static void hide(std::string const & name, InsetBase * inset);
static void hide(std::string const & name, Inset * inset);
///
void disconnect(std::string const & name);
///
InsetBase * getOpenInset(std::string const & name) const;
Inset * getOpenInset(std::string const & name) const;
private:
///
void hideSlot(std::string const & name, InsetBase * inset);
void hideSlot(std::string const & name, Inset * inset);
///
void redraw() const;
///
@ -109,7 +109,7 @@ private:
///
LyXView & lyxview_;
///
std::map<std::string, InsetBase *> open_insets_;
std::map<std::string, Inset *> open_insets_;
///
std::map<std::string, DialogPtr> dialogs_;

View File

@ -290,7 +290,7 @@ void LyXView::showDialogWithData(string const & name, string const & data)
void LyXView::showInsetDialog(string const & name, string const & data,
InsetBase * inset)
Inset * inset)
{
getDialogs().show(name, data, inset);
}
@ -442,7 +442,7 @@ void LyXView::dispatch(FuncRequest const & cmd)
}
Buffer const * const LyXView::updateInset(InsetBase const * inset) const
Buffer const * const LyXView::updateInset(Inset const * inset) const
{
Buffer const * buffer_ptr = 0;
if (inset) {

View File

@ -30,7 +30,7 @@ namespace lyx {
namespace support { class FileName; }
class Buffer;
class InsetBase;
class Inset;
class Menubar;
class BufferView;
@ -186,7 +186,7 @@ public:
/** redraw \c inset in all the BufferViews in which it is currently
* visible. If successful return a pointer to the owning Buffer.
*/
Buffer const * const updateInset(InsetBase const *) const;
Buffer const * const updateInset(Inset const *) const;
/// returns true if this view has the focus.
virtual bool hasFocus() const = 0;
@ -268,7 +268,7 @@ private:
void showDialogWithData(std::string const & name,
std::string const & data);
void showInsetDialog(std::string const & name,
std::string const & data, InsetBase * inset);
std::string const & data, Inset * inset);
void updateDialog(std::string const & name,
std::string const & data);
//@}

View File

@ -38,7 +38,7 @@ bool ControlTabular::initialiseParams(string const & data)
// get the innermost tabular inset;
// assume that it is "ours"
for (int i = cur.depth() - 1; i >= 0; --i)
if (cur[i].inset().lyxCode() == InsetBase::TABULAR_CODE) {
if (cur[i].inset().lyxCode() == Inset::TABULAR_CODE) {
active_cell_ = cur[i].idx();
break;
}

View File

@ -26,7 +26,7 @@
#include "frontends/Application.h" // hexName
#include "insets/InsetBase.h"
#include "insets/Inset.h"
#include "support/filetools.h"
#include "support/Forkedcall.h"
@ -702,12 +702,12 @@ void PreviewLoader::Impl::dumpPreamble(odocstream & os) const
<< "\n";
// Loop over the insets in the buffer and dump all the math-macros.
InsetBase & inset = buffer_.inset();
Inset & inset = buffer_.inset();
InsetIterator it = inset_iterator_begin(inset);
InsetIterator const end = inset_iterator_end(inset);
for (; it != end; ++it)
if (it->lyxCode() == InsetBase::MATHMACRO_CODE)
if (it->lyxCode() == Inset::MATHMACRO_CODE)
it->latex(buffer_, os, runparams);
// All equation labels appear as "(#)" + preview.sty's rendering of

View File

@ -18,7 +18,7 @@
#include "LyXRC.h"
#include "Paragraph.h"
#include "insets/InsetBase.h"
#include "insets/Inset.h"
namespace lyx {
@ -85,7 +85,7 @@ void Previews::generateBufferPreviews(Buffer const & buffer) const
{
PreviewLoader & ploader = loader(buffer);
InsetBase & inset = buffer.inset();
Inset & inset = buffer.inset();
InsetIterator it = inset_iterator_begin(inset);
InsetIterator const end = inset_iterator_end(inset);

View File

@ -1,5 +1,5 @@
/**
* \file InsetBase.cpp
* \file Inset.cpp
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
@ -14,7 +14,7 @@
#include <config.h>
#include "InsetBase.h"
#include "Inset.h"
#include "Buffer.h"
#include "BufferView.h"
@ -44,67 +44,67 @@ namespace lyx {
class InsetName {
public:
InsetName(std::string const & n, InsetBase::Code c)
InsetName(std::string const & n, Inset::Code c)
: name(n), code(c) {}
std::string name;
InsetBase::Code code;
Inset::Code code;
};
typedef std::map<std::string, InsetBase::Code> TranslatorMap;
typedef std::map<std::string, Inset::Code> TranslatorMap;
static TranslatorMap const build_translator()
{
InsetName const insetnames[] = {
InsetName("toc", InsetBase::TOC_CODE),
InsetName("quote", InsetBase::QUOTE_CODE),
InsetName("ref", InsetBase::REF_CODE),
InsetName("url", InsetBase::URL_CODE),
InsetName("htmlurl", InsetBase::HTMLURL_CODE),
InsetName("separator", InsetBase::SEPARATOR_CODE),
InsetName("ending", InsetBase::ENDING_CODE),
InsetName("label", InsetBase::LABEL_CODE),
InsetName("note", InsetBase::NOTE_CODE),
InsetName("accent", InsetBase::ACCENT_CODE),
InsetName("math", InsetBase::MATH_CODE),
InsetName("index", InsetBase::INDEX_CODE),
InsetName("nomenclature", InsetBase::NOMENCL_CODE),
InsetName("include", InsetBase::INCLUDE_CODE),
InsetName("graphics", InsetBase::GRAPHICS_CODE),
InsetName("bibitem", InsetBase::BIBITEM_CODE),
InsetName("bibtex", InsetBase::BIBTEX_CODE),
InsetName("text", InsetBase::TEXT_CODE),
InsetName("ert", InsetBase::ERT_CODE),
InsetName("foot", InsetBase::FOOT_CODE),
InsetName("margin", InsetBase::MARGIN_CODE),
InsetName("float", InsetBase::FLOAT_CODE),
InsetName("wrap", InsetBase::WRAP_CODE),
InsetName("specialchar", InsetBase::SPECIALCHAR_CODE),
InsetName("tabular", InsetBase::TABULAR_CODE),
InsetName("external", InsetBase::EXTERNAL_CODE),
InsetName("caption", InsetBase::CAPTION_CODE),
InsetName("mathmacro", InsetBase::MATHMACRO_CODE),
InsetName("cite", InsetBase::CITE_CODE),
InsetName("float_list", InsetBase::FLOAT_LIST_CODE),
InsetName("index_print", InsetBase::INDEX_PRINT_CODE),
InsetName("nomencl_print", InsetBase::NOMENCL_PRINT_CODE),
InsetName("optarg", InsetBase::OPTARG_CODE),
InsetName("environment", InsetBase::ENVIRONMENT_CODE),
InsetName("hfill", InsetBase::HFILL_CODE),
InsetName("newline", InsetBase::NEWLINE_CODE),
InsetName("line", InsetBase::LINE_CODE),
InsetName("branch", InsetBase::BRANCH_CODE),
InsetName("box", InsetBase::BOX_CODE),
InsetName("charstyle", InsetBase::CHARSTYLE_CODE),
InsetName("vspace", InsetBase::VSPACE_CODE),
InsetName("mathmacroarg", InsetBase::MATHMACROARG_CODE),
InsetName("toc", Inset::TOC_CODE),
InsetName("quote", Inset::QUOTE_CODE),
InsetName("ref", Inset::REF_CODE),
InsetName("url", Inset::URL_CODE),
InsetName("htmlurl", Inset::HTMLURL_CODE),
InsetName("separator", Inset::SEPARATOR_CODE),
InsetName("ending", Inset::ENDING_CODE),
InsetName("label", Inset::LABEL_CODE),
InsetName("note", Inset::NOTE_CODE),
InsetName("accent", Inset::ACCENT_CODE),
InsetName("math", Inset::MATH_CODE),
InsetName("index", Inset::INDEX_CODE),
InsetName("nomenclature", Inset::NOMENCL_CODE),
InsetName("include", Inset::INCLUDE_CODE),
InsetName("graphics", Inset::GRAPHICS_CODE),
InsetName("bibitem", Inset::BIBITEM_CODE),
InsetName("bibtex", Inset::BIBTEX_CODE),
InsetName("text", Inset::TEXT_CODE),
InsetName("ert", Inset::ERT_CODE),
InsetName("foot", Inset::FOOT_CODE),
InsetName("margin", Inset::MARGIN_CODE),
InsetName("float", Inset::FLOAT_CODE),
InsetName("wrap", Inset::WRAP_CODE),
InsetName("specialchar", Inset::SPECIALCHAR_CODE),
InsetName("tabular", Inset::TABULAR_CODE),
InsetName("external", Inset::EXTERNAL_CODE),
InsetName("caption", Inset::CAPTION_CODE),
InsetName("mathmacro", Inset::MATHMACRO_CODE),
InsetName("cite", Inset::CITE_CODE),
InsetName("float_list", Inset::FLOAT_LIST_CODE),
InsetName("index_print", Inset::INDEX_PRINT_CODE),
InsetName("nomencl_print", Inset::NOMENCL_PRINT_CODE),
InsetName("optarg", Inset::OPTARG_CODE),
InsetName("environment", Inset::ENVIRONMENT_CODE),
InsetName("hfill", Inset::HFILL_CODE),
InsetName("newline", Inset::NEWLINE_CODE),
InsetName("line", Inset::LINE_CODE),
InsetName("branch", Inset::BRANCH_CODE),
InsetName("box", Inset::BOX_CODE),
InsetName("charstyle", Inset::CHARSTYLE_CODE),
InsetName("vspace", Inset::VSPACE_CODE),
InsetName("mathmacroarg", Inset::MATHMACROARG_CODE),
};
std::size_t const insetnames_size =
sizeof(insetnames) / sizeof(insetnames[0]);
std::map<std::string, InsetBase::Code> data;
std::map<std::string, Inset::Code> data;
for (std::size_t i = 0; i != insetnames_size; ++i) {
InsetName const & var = insetnames[i];
data[var.name] = var.code;
@ -115,31 +115,31 @@ static TranslatorMap const build_translator()
/// pretty arbitrary dimensions
InsetBase::InsetBase()
Inset::Inset()
: dim_(10, 10, 10), background_color_(Color::background)
{}
InsetBase::InsetBase(InsetBase const & inset)
Inset::Inset(Inset const & inset)
: dim_(inset.dim_), background_color_(inset.background_color_)
{}
std::auto_ptr<InsetBase> InsetBase::clone() const
std::auto_ptr<Inset> Inset::clone() const
{
std::auto_ptr<InsetBase> b = doClone();
std::auto_ptr<Inset> b = doClone();
BOOST_ASSERT(typeid(*b) == typeid(*this));
return b;
}
docstring InsetBase::getInsetName() const
docstring Inset::insetName() const
{
return from_ascii("unknown");
}
InsetBase::Code InsetBase::translate(std::string const & name)
Inset::Code Inset::translate(std::string const & name)
{
static TranslatorMap const translator = build_translator();
@ -148,7 +148,7 @@ InsetBase::Code InsetBase::translate(std::string const & name)
}
void InsetBase::dispatch(Cursor & cur, FuncRequest & cmd)
void Inset::dispatch(Cursor & cur, FuncRequest & cmd)
{
cur.updateFlags(Update::Force | Update::FitCursor);
cur.dispatched();
@ -156,14 +156,14 @@ void InsetBase::dispatch(Cursor & cur, FuncRequest & cmd)
}
void InsetBase::doDispatch(Cursor & cur, FuncRequest &)
void Inset::doDispatch(Cursor & cur, FuncRequest &)
{
cur.noUpdate();
cur.undispatched();
}
bool InsetBase::getStatus(Cursor &, FuncRequest const & cmd,
bool Inset::getStatus(Cursor &, FuncRequest const & cmd,
FuncStatus & flag) const
{
// LFUN_INSET_APPLY is sent from the dialogs when the data should
@ -195,14 +195,14 @@ bool InsetBase::getStatus(Cursor &, FuncRequest const & cmd,
}
void InsetBase::edit(Cursor &, bool)
void Inset::edit(Cursor &, bool)
{
LYXERR(Debug::INSETS) << BOOST_CURRENT_FUNCTION
<< ": edit left/right" << std::endl;
}
InsetBase * InsetBase::editXY(Cursor &, int x, int y)
Inset * Inset::editXY(Cursor &, int x, int y)
{
LYXERR(Debug::INSETS) << BOOST_CURRENT_FUNCTION
<< ": x=" << x << " y= " << y
@ -211,7 +211,7 @@ InsetBase * InsetBase::editXY(Cursor &, int x, int y)
}
InsetBase::idx_type InsetBase::index(row_type row, col_type col) const
Inset::idx_type Inset::index(row_type row, col_type col) const
{
if (row != 0)
lyxerr << BOOST_CURRENT_FUNCTION
@ -223,66 +223,66 @@ InsetBase::idx_type InsetBase::index(row_type row, col_type col) const
}
bool InsetBase::idxBetween(idx_type idx, idx_type from, idx_type to) const
bool Inset::idxBetween(idx_type idx, idx_type from, idx_type to) const
{
return from <= idx && idx <= to;
}
bool InsetBase::idxUpDown(Cursor &, bool) const
bool Inset::idxUpDown(Cursor &, bool) const
{
return false;
}
int InsetBase::docbook(Buffer const &,
int Inset::docbook(Buffer const &,
odocstream &, OutputParams const &) const
{
return 0;
}
bool InsetBase::directWrite() const
bool Inset::directWrite() const
{
return false;
}
InsetBase::EDITABLE InsetBase::editable() const
Inset::EDITABLE Inset::editable() const
{
return NOT_EDITABLE;
}
bool InsetBase::autoDelete() const
bool Inset::autoDelete() const
{
return false;
}
docstring const InsetBase::editMessage() const
docstring const Inset::editMessage() const
{
return _("Opened inset");
}
void InsetBase::cursorPos(BufferView const & /*bv*/, CursorSlice const &,
void Inset::cursorPos(BufferView const & /*bv*/, CursorSlice const &,
bool, int & x, int & y) const
{
lyxerr << "InsetBase::cursorPos called directly" << std::endl;
lyxerr << "Inset::cursorPos called directly" << std::endl;
x = 100;
y = 100;
}
void InsetBase::metricsMarkers(Dimension & dim, int framesize) const
void Inset::metricsMarkers(Dimension & dim, int framesize) const
{
dim.wid += 2 * framesize;
dim.asc += framesize;
}
void InsetBase::metricsMarkers2(Dimension & dim, int framesize) const
void Inset::metricsMarkers2(Dimension & dim, int framesize) const
{
dim.wid += 2 * framesize;
dim.asc += framesize;
@ -290,7 +290,7 @@ void InsetBase::metricsMarkers2(Dimension & dim, int framesize) const
}
void InsetBase::drawMarkers(PainterInfo & pi, int x, int y) const
void Inset::drawMarkers(PainterInfo & pi, int x, int y) const
{
Color::color pen_color = editing(pi.base.bv)?
Color::mathframe : Color::background;
@ -305,7 +305,7 @@ void InsetBase::drawMarkers(PainterInfo & pi, int x, int y) const
}
void InsetBase::drawMarkers2(PainterInfo & pi, int x, int y) const
void Inset::drawMarkers2(PainterInfo & pi, int x, int y) const
{
Color::color pen_color = editing(pi.base.bv)?
Color::mathframe : Color::background;
@ -321,27 +321,27 @@ void InsetBase::drawMarkers2(PainterInfo & pi, int x, int y) const
}
bool InsetBase::editing(BufferView * bv) const
bool Inset::editing(BufferView * bv) const
{
return bv->cursor().isInside(this);
}
int InsetBase::xo(BufferView const & bv) const
int Inset::xo(BufferView const & bv) const
{
return bv.coordCache().getInsets().x(this);
}
int InsetBase::yo(BufferView const & bv) const
int Inset::yo(BufferView const & bv) const
{
return bv.coordCache().getInsets().y(this);
}
bool InsetBase::covers(BufferView const & bv, int x, int y) const
bool Inset::covers(BufferView const & bv, int x, int y) const
{
//lyxerr << "InsetBase::covers, x: " << x << " y: " << y
//lyxerr << "Inset::covers, x: " << x << " y: " << y
// << " xo: " << xo(bv) << " yo: " << yo()
// << " x1: " << xo(bv) << " x2: " << xo() + width()
// << " y1: " << yo(bv) - ascent() << " y2: " << yo() + descent()
@ -354,43 +354,43 @@ bool InsetBase::covers(BufferView const & bv, int x, int y) const
}
void InsetBase::dump() const
void Inset::dump() const
{
Buffer buf("foo", 1);
write(buf, lyxerr);
}
void InsetBase::setBackgroundColor(Color_color color)
void Inset::setBackgroundColor(Color_color color)
{
background_color_ = color;
}
Color_color InsetBase::backgroundColor() const
Color_color Inset::backgroundColor() const
{
return Color::color(background_color_);
}
void InsetBase::setPosCache(PainterInfo const & pi, int x, int y) const
void Inset::setPosCache(PainterInfo const & pi, int x, int y) const
{
//lyxerr << "InsetBase:: position cache to " << x << " " << y << std::endl;
//lyxerr << "Inset:: position cache to " << x << " " << y << std::endl;
pi.base.bv->coordCache().insets().add(this, x, y);
}
/////////////////////////////////////////
bool isEditableInset(InsetBase const * inset)
bool isEditableInset(Inset const * inset)
{
return inset && inset->editable();
}
bool isHighlyEditableInset(InsetBase const * inset)
bool isHighlyEditableInset(Inset const * inset)
{
return inset && inset->editable() == InsetBase::HIGHLY_EDITABLE;
return inset && inset->editable() == Inset::HIGHLY_EDITABLE;
}

View File

@ -1,6 +1,6 @@
// -*- C++ -*-
/**
* \file InsetBase.h
* \file Inset.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
@ -54,7 +54,7 @@ namespace graphics { class PreviewLoader; }
// everything storing large quantities of insets. Mathed e.g. would
// suffer.
class InsetBase {
class Inset {
public:
///
typedef ptrdiff_t difference_type;
@ -70,9 +70,9 @@ public:
typedef size_t col_type;
/// virtual base class destructor
virtual ~InsetBase() {}
virtual ~Inset() {}
/// replicate ourselves
std::auto_ptr<InsetBase> clone() const;
std::auto_ptr<Inset> clone() const;
/// identification as math inset
virtual InsetMath * asInsetMath() { return 0; }
@ -93,9 +93,9 @@ public:
* - A request that is disabled in getStatus() does not need to
* appear in doDispatch(). It is guaranteed that doDispatch()
* is never called with this request.
* - A few requests are en- or disabled in InsetBase::getStatus().
* - A few requests are en- or disabled in Inset::getStatus().
* These need to be handled in the doDispatch() methods of the
* derived insets, since InsetBase::doDispatch() has not enough
* derived insets, since Inset::doDispatch() has not enough
* information to handle them.
* - LFUN_MOUSE_* need not to be handled in getStatus(), because these
* are dispatched directly
@ -106,7 +106,7 @@ public:
/// cursor enters
virtual void edit(Cursor & cur, bool left);
/// cursor enters
virtual InsetBase * editXY(Cursor & cur, int x, int y);
virtual Inset * editXY(Cursor & cur, int x, int y);
/// compute the size of the object returned in dim
/// \retval true if metrics changed.
@ -249,7 +249,7 @@ public:
/** This is not quite the correct place for this enum. I think
the correct would be to let each subclass of Inset declare
its own enum code. Actually the notion of an InsetBase::Code
its own enum code. Actually the notion of an Inset::Code
should be avoided, but I am not sure how this could be done
in a cleaner way. */
enum Code {
@ -365,7 +365,7 @@ public:
virtual bool hasFixedWidth() const { return false; }
///
virtual docstring getInsetName() const;
virtual docstring insetName() const;
/// used to toggle insets
/// is the inset open?
/// should this inset be handled like a normal charater
@ -464,8 +464,8 @@ public:
enum { TEXT_TO_INSET_OFFSET = 4 };
protected:
InsetBase();
InsetBase(InsetBase const & i);
Inset();
Inset(Inset const & i);
/** The real dispatcher.
* Gets normally called from Cursor::dispatch(). Cursor::dispatch()
* assumes the common case of 'LFUN handled, need update'.
@ -482,7 +482,7 @@ protected:
/// Cached dimensions of the inset.
mutable Dimension dim_;
private:
virtual std::auto_ptr<InsetBase> doClone() const = 0;
virtual std::auto_ptr<Inset> doClone() const = 0;
/** We store the Color::color value as an int to get Color.h out
* of the header file.
*/
@ -494,25 +494,25 @@ private:
* returns true if pointer argument is valid
* and points to an editable inset
*/
bool isEditableInset(InsetBase const * inset);
bool isEditableInset(Inset const * inset);
/**
* returns true if pointer argument is valid
* and points to a highly editable inset
*/
bool isHighlyEditableInset(InsetBase const * inset);
bool isHighlyEditableInset(Inset const * inset);
/** \c InsetBase_code is a wrapper for InsetBase::Code.
/** \c Inset_code is a wrapper for Inset::Code.
* It can be forward-declared and passed as a function argument without
* having to expose InsetBase.h.
* having to expose Inset.h.
*/
class InsetBase_code {
InsetBase::Code val_;
class Inset_code {
Inset::Code val_;
public:
InsetBase_code(InsetBase::Code val) : val_(val) {}
operator InsetBase::Code() const { return val_; }
Inset_code(Inset::Code val) : val_(val) {}
operator Inset::Code() const { return val_; }
};

View File

@ -46,11 +46,11 @@ InsetBibitem::InsetBibitem(InsetCommandParams const & p)
}
auto_ptr<InsetBase> InsetBibitem::doClone() const
auto_ptr<Inset> InsetBibitem::doClone() const
{
auto_ptr<InsetBibitem> b(new InsetBibitem(params()));
b->setCounter(counter);
return auto_ptr<InsetBase>(b);
return auto_ptr<Inset>(b);
}
@ -67,7 +67,7 @@ void InsetBibitem::doDispatch(Cursor & cur, FuncRequest & cmd)
}
if (p["key"] != params()["key"])
cur.bv().buffer()->changeRefsIfUnique(params()["key"],
p["key"], InsetBase::CITE_CODE);
p["key"], Inset::CITE_CODE);
setParams(p);
}

View File

@ -34,7 +34,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetBase::Code lyxCode() const { return InsetBase::BIBITEM_CODE; }
Inset::Code lyxCode() const { return Inset::BIBITEM_CODE; }
///
void setCounter(int);
///
@ -47,7 +47,7 @@ protected:
///
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
///
int counter;

View File

@ -76,9 +76,9 @@ InsetBibtex::InsetBibtex(InsetCommandParams const & p)
{}
std::auto_ptr<InsetBase> InsetBibtex::doClone() const
std::auto_ptr<Inset> InsetBibtex::doClone() const
{
return std::auto_ptr<InsetBase>(new InsetBibtex(*this));
return std::auto_ptr<Inset>(new InsetBibtex(*this));
}

View File

@ -32,7 +32,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetBase::Code lyxCode() const { return InsetBase::BIBTEX_CODE; }
Inset::Code lyxCode() const { return Inset::BIBTEX_CODE; }
///
bool display() const { return true; }
///
@ -51,7 +51,7 @@ public:
protected:
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
};

View File

@ -114,9 +114,9 @@ InsetBox::~InsetBox()
}
auto_ptr<InsetBase> InsetBox::doClone() const
auto_ptr<Inset> InsetBox::doClone() const
{
return auto_ptr<InsetBase>(new InsetBox(*this));
return auto_ptr<Inset>(new InsetBox(*this));
}

View File

@ -64,7 +64,7 @@ public:
///
virtual docstring const editMessage() const;
///
InsetBase::Code lyxCode() const { return InsetBase::BOX_CODE; }
Inset::Code lyxCode() const { return Inset::BOX_CODE; }
///
void write(Buffer const &, std::ostream &) const;
///
@ -110,11 +110,11 @@ protected:
/// Is the width forced to some value?
virtual bool hasFixedWidth() const;
///
virtual docstring getInsetName() const { return from_ascii("Box"); }
virtual docstring insetName() const { return from_ascii("Box"); }
private:
friend class InsetBoxParams;
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
/// used by the constructors
void init();
@ -128,7 +128,7 @@ public:
///
InsetBoxMailer(InsetBox & inset);
///
virtual InsetBase & inset() const { return inset_; }
virtual Inset & inset() const { return inset_; }
///
virtual std::string const & name() const { return name_; }
///

View File

@ -64,9 +64,9 @@ InsetBranch::~InsetBranch()
}
auto_ptr<InsetBase> InsetBranch::doClone() const
auto_ptr<Inset> InsetBranch::doClone() const
{
return auto_ptr<InsetBase>(new InsetBranch(*this));
return auto_ptr<Inset>(new InsetBranch(*this));
}

View File

@ -45,7 +45,7 @@ public:
///
virtual docstring const editMessage() const;
///
InsetBase::Code lyxCode() const { return InsetBase::BRANCH_CODE; }
Inset::Code lyxCode() const { return Inset::BRANCH_CODE; }
///
void write(Buffer const &, std::ostream &) const;
///
@ -85,11 +85,11 @@ protected:
///
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
///
docstring getInsetName() const { return from_ascii("Branch"); }
docstring insetName() const { return from_ascii("Branch"); }
private:
friend class InsetBranchParams;
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
/// used by the constructors
void init();
@ -103,7 +103,7 @@ public:
///
InsetBranchMailer(InsetBranch & inset);
///
virtual InsetBase & inset() const { return inset_; }
virtual Inset & inset() const { return inset_; }
///
virtual std::string const & name() const { return name_; }
///

View File

@ -181,14 +181,14 @@ void InsetCaption::edit(Cursor & cur, bool left)
}
InsetBase * InsetCaption::editXY(Cursor & cur, int x, int y)
Inset * InsetCaption::editXY(Cursor & cur, int x, int y)
{
cur.push(*this);
return InsetText::editXY(cur, x, y);
}
bool InsetCaption::insetAllowed(InsetBase::Code code) const
bool InsetCaption::insetAllowed(Inset::Code code) const
{
switch (code) {
case FLOAT_CODE:
@ -282,9 +282,9 @@ void InsetCaption::computeFullLabel() const
}
auto_ptr<InsetBase> InsetCaption::doClone() const
auto_ptr<Inset> InsetCaption::doClone() const
{
return auto_ptr<InsetBase>(new InsetCaption(*this));
return auto_ptr<Inset>(new InsetCaption(*this));
}

View File

@ -35,7 +35,7 @@ public:
///
virtual bool neverIndent(Buffer const &) const { return true; }
///
virtual InsetBase::Code lyxCode() const;
virtual Inset::Code lyxCode() const;
///
virtual docstring const editMessage() const;
///
@ -52,9 +52,9 @@ public:
///
virtual void edit(Cursor & cur, bool left);
///
virtual InsetBase * editXY(Cursor & cur, int x, int y);
virtual Inset * editXY(Cursor & cur, int x, int y);
///
bool insetAllowed(InsetBase::Code code) const;
bool insetAllowed(Inset::Code code) const;
///
virtual bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
///
@ -85,7 +85,7 @@ private:
///
void computeFullLabel() const;
///
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
///
mutable docstring full_label_;
///
@ -109,7 +109,7 @@ bool InsetCaption::display() const
inline
InsetBase::Code InsetCaption::lyxCode() const
Inset::Code InsetCaption::lyxCode() const
{
return CAPTION_CODE;
}

View File

@ -82,9 +82,9 @@ InsetCharStyle::InsetCharStyle(InsetCharStyle const & in)
}
auto_ptr<InsetBase> InsetCharStyle::doClone() const
auto_ptr<Inset> InsetCharStyle::doClone() const
{
return auto_ptr<InsetBase>(new InsetCharStyle(*this));
return auto_ptr<Inset>(new InsetCharStyle(*this));
}

View File

@ -53,7 +53,7 @@ public:
///
InsetCharStyle(BufferParams const &, CharStyles::iterator);
///
docstring getInsetName() const { return from_ascii("CharStyle"); }
docstring insetName() const { return from_ascii("CharStyle"); }
/// Is this character style defined in the document's textclass?
/// May be wrong after textclass change or paste from another document
bool undefined() const;
@ -64,7 +64,7 @@ public:
///
virtual docstring const editMessage() const;
///
InsetBase::Code lyxCode() const { return InsetBase::CHARSTYLE_CODE; }
Inset::Code lyxCode() const { return Inset::CHARSTYLE_CODE; }
///
void write(Buffer const &, std::ostream &) const;
///
@ -106,7 +106,7 @@ protected:
private:
friend class InsetCharStyleParams;
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
/// used by the constructors
void init();

View File

@ -33,7 +33,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetBase::Code lyxCode() const { return InsetBase::CITE_CODE; }
Inset::Code lyxCode() const { return Inset::CITE_CODE; }
///
int latex(Buffer const &, odocstream &,
OutputParams const &) const;
@ -52,9 +52,9 @@ public:
void replaceContents(std::string const & from, std::string const & to);
private:
virtual std::auto_ptr<InsetBase> doClone() const
virtual std::auto_ptr<Inset> doClone() const
{
return std::auto_ptr<InsetBase>(new InsetCitation(params()));
return std::auto_ptr<Inset>(new InsetCitation(params()));
}
/// This function does the donkey work of creating the pretty label

View File

@ -257,7 +257,7 @@ void InsetCollapsable::cursorPos(BufferView const & bv,
}
InsetBase::EDITABLE InsetCollapsable::editable() const
Inset::EDITABLE InsetCollapsable::editable() const
{
return status() != Collapsed ? HIGHLY_EDITABLE : IS_EDITABLE;
}
@ -304,7 +304,7 @@ void InsetCollapsable::edit(Cursor & cur, bool left)
}
InsetBase * InsetCollapsable::editXY(Cursor & cur, int x, int y)
Inset * InsetCollapsable::editXY(Cursor & cur, int x, int y)
{
//lyxerr << "InsetCollapsable: edit xy" << endl;
if (status() == Collapsed || (button_dim.contains(x, y) && status() != Inlined))

View File

@ -14,7 +14,7 @@
#ifndef INSETCOLLAPSABLE_H
#define INSETCOLLAPSABLE_H
#include "InsetBase.h"
#include "Inset.h"
#include "InsetText.h"
#include "Box.h"
@ -44,7 +44,7 @@ public:
///
InsetCollapsable(InsetCollapsable const & rhs);
///
docstring getInsetName() const { return from_ascii("Collapsable"); }
docstring insetName() const { return from_ascii("Collapsable"); }
///
void read(Buffer const &, Lexer &);
///
@ -97,7 +97,7 @@ protected:
///
void edit(Cursor & cur, bool left);
///
InsetBase * editXY(Cursor & cur, int x, int y);
Inset * editXY(Cursor & cur, int x, int y);
///
void setInlined() { status_ = Inlined; }
///
@ -128,7 +128,7 @@ private:
};
// A helper function that pushes the cursor out of the inset.
void leaveInset(Cursor & cur, InsetBase const & in);
void leaveInset(Cursor & cur, Inset const & in);
} // namespace lyx

View File

@ -138,7 +138,7 @@ void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd)
}
default:
InsetBase::doDispatch(cur, cmd);
Inset::doDispatch(cur, cmd);
break;
}
@ -160,7 +160,7 @@ bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd,
status.enabled(true);
return true;
default:
return InsetBase::getStatus(cur, cmd, status);
return Inset::getStatus(cur, cmd, status);
}
}

View File

@ -13,7 +13,7 @@
#ifndef INSET_LATEXCOMMAND_H
#define INSET_LATEXCOMMAND_H
#include "InsetBase.h"
#include "Inset.h"
#include "InsetCommandParams.h"
#include "RenderButton.h"
#include "MailInset.h"
@ -31,7 +31,7 @@ namespace lyx {
*/
///
class InsetCommand : public InsetBase {
class InsetCommand : public Inset {
public:
///
InsetCommand(InsetCommandParams const &, std::string const & mailer_name);
@ -54,7 +54,7 @@ public:
///
int docbook(Buffer const &, odocstream &, OutputParams const & runparams) const;
///
InsetBase::Code lyxCode() const { return InsetBase::NO_CODE; }
Inset::Code lyxCode() const { return Inset::NO_CODE; }
///
InsetCommandParams const & params() const { return p_; }
@ -125,7 +125,7 @@ public:
///
InsetCommandMailer(std::string const & name, InsetCommand & inset);
///
virtual InsetBase & inset() const { return inset_; }
virtual Inset & inset() const { return inset_; }
///
virtual std::string const & name() const { return name_; }
///

View File

@ -77,9 +77,9 @@ InsetERT::InsetERT(InsetERT const & in)
}
auto_ptr<InsetBase> InsetERT::doClone() const
auto_ptr<Inset> InsetERT::doClone() const
{
return auto_ptr<InsetBase>(new InsetERT(*this));
return auto_ptr<Inset>(new InsetERT(*this));
}
@ -388,7 +388,7 @@ void InsetERT::setButtonLabel()
}
bool InsetERT::insetAllowed(InsetBase::Code /* code */) const
bool InsetERT::insetAllowed(Inset::Code /* code */) const
{
return false;
}

View File

@ -42,9 +42,9 @@ public:
///
~InsetERT();
///
InsetBase::Code lyxCode() const { return InsetBase::ERT_CODE; }
Inset::Code lyxCode() const { return Inset::ERT_CODE; }
///
docstring getInsetName() const { return from_ascii("ERT"); }
docstring insetName() const { return from_ascii("ERT"); }
///
void write(Buffer const & buf, std::ostream & os) const;
///
@ -52,7 +52,7 @@ public:
///
virtual docstring const editMessage() const;
///
bool insetAllowed(InsetBase::Code code) const;
bool insetAllowed(Inset::Code code) const;
///
int latex(Buffer const &, odocstream &,
OutputParams const &) const;
@ -83,7 +83,7 @@ protected:
///
bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
private:
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
///
void init();
///
@ -98,7 +98,7 @@ public:
///
InsetERTMailer(InsetERT & inset);
///
virtual InsetBase & inset() const { return inset_; }
virtual Inset & inset() const { return inset_; }
///
virtual std::string const & name() const { return name_; }
///

View File

@ -41,15 +41,15 @@ InsetEnvironment::InsetEnvironment(InsetEnvironment const & in)
{}
auto_ptr<InsetBase> InsetEnvironment::doClone() const
auto_ptr<Inset> InsetEnvironment::doClone() const
{
return auto_ptr<InsetBase>(new InsetEnvironment(*this));
return auto_ptr<Inset>(new InsetEnvironment(*this));
}
void InsetEnvironment::write(Buffer const & buf, ostream & os) const
{
os << "Environment " << to_utf8(getInsetName()) << "\n";
os << "Environment " << to_utf8(insetName()) << "\n";
InsetText::write(buf, os);
}
@ -62,7 +62,7 @@ void InsetEnvironment::read(Buffer const & buf, Lexer & lex)
docstring const InsetEnvironment::editMessage() const
{
return _("Opened Environment Inset: ") + getInsetName();
return _("Opened Environment Inset: ") + insetName();
}
@ -83,7 +83,7 @@ int InsetEnvironment::latex(Buffer const & buf, odocstream & os,
int InsetEnvironment::plaintext(Buffer const & buf, odocstream & os,
OutputParams const & runparams) const
{
os << '[' << to_utf8(getInsetName()) << ":\n";
os << '[' << to_utf8(insetName()) << ":\n";
InsetText::plaintext(buf, os, runparams);
os << "\n]";

View File

@ -23,13 +23,13 @@ public:
///
InsetEnvironment(BufferParams const &, std::string const & name);
///
docstring getInsetName() const { return name_; }
docstring insetName() const { return name_; }
///
void write(Buffer const & buf, std::ostream & os) const;
///
void read(Buffer const & buf, Lexer & lex);
///
InsetBase::Code lyxCode() const { return InsetBase::ENVIRONMENT_CODE; }
Inset::Code lyxCode() const { return Inset::ENVIRONMENT_CODE; }
///
int latex(Buffer const &, odocstream &,
OutputParams const &) const;
@ -39,7 +39,7 @@ public:
///
virtual docstring const editMessage() const;
///
InsetBase::EDITABLE editable() const { return HIGHLY_EDITABLE; }
Inset::EDITABLE editable() const { return HIGHLY_EDITABLE; }
///
LyXLayout_ptr const & layout() const;
/** returns true if, when outputing LaTeX, font changes should
@ -49,7 +49,7 @@ public:
protected:
InsetEnvironment(InsetEnvironment const &);
private:
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
/// the layout
LyXLayout_ptr layout_;
///

View File

@ -400,16 +400,16 @@ InsetExternal::InsetExternal()
InsetExternal::InsetExternal(InsetExternal const & other)
: InsetBase(other),
: Inset(other),
boost::signals::trackable(),
params_(other.params_),
renderer_(other.renderer_->clone(this))
{}
auto_ptr<InsetBase> InsetExternal::doClone() const
auto_ptr<Inset> InsetExternal::doClone() const
{
return auto_ptr<InsetBase>(new InsetExternal(*this));
return auto_ptr<Inset>(new InsetExternal(*this));
}
@ -454,7 +454,7 @@ void InsetExternal::doDispatch(Cursor & cur, FuncRequest & cmd)
break;
default:
InsetBase::doDispatch(cur, cmd);
Inset::doDispatch(cur, cmd);
}
}
@ -471,7 +471,7 @@ bool InsetExternal::getStatus(Cursor & cur, FuncRequest const & cmd,
return true;
default:
return InsetBase::getStatus(cur, cmd, flag);
return Inset::getStatus(cur, cmd, flag);
}
}

View File

@ -12,7 +12,7 @@
#ifndef INSET_EXTERNAL_H
#define INSET_EXTERNAL_H
#include "InsetBase.h"
#include "Inset.h"
#include "ExternalTransforms.h"
#include "support/FileName.h"
@ -104,14 +104,14 @@ private:
class RenderBase;
///
class InsetExternal : public InsetBase, public boost::signals::trackable
class InsetExternal : public Inset, public boost::signals::trackable
{
public:
InsetExternal();
///
virtual ~InsetExternal();
///
virtual InsetBase::Code lyxCode() const { return EXTERNAL_CODE; }
virtual Inset::Code lyxCode() const { return EXTERNAL_CODE; }
///
virtual EDITABLE editable() const { return IS_EDITABLE; }
@ -153,7 +153,7 @@ protected:
///
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
/** This method is connected to the graphics loader, so we are
* informed when the image has been loaded.
@ -177,7 +177,7 @@ public:
///
InsetExternalMailer(InsetExternal & inset);
///
virtual InsetBase & inset() const { return inset_; }
virtual Inset & inset() const { return inset_; }
///
virtual std::string const & name() const { return name_; }
///

View File

@ -266,9 +266,9 @@ void InsetFloat::validate(LaTeXFeatures & features) const
}
auto_ptr<InsetBase> InsetFloat::doClone() const
auto_ptr<Inset> InsetFloat::doClone() const
{
return auto_ptr<InsetBase>(new InsetFloat(*this));
return auto_ptr<Inset>(new InsetFloat(*this));
}
@ -350,11 +350,11 @@ int InsetFloat::docbook(Buffer const & buf, odocstream & os,
}
bool InsetFloat::insetAllowed(InsetBase::Code code) const
bool InsetFloat::insetAllowed(Inset::Code code) const
{
return code != InsetBase::FLOAT_CODE
&& code != InsetBase::FOOT_CODE
&& code != InsetBase::MARGIN_CODE;
return code != Inset::FLOAT_CODE
&& code != Inset::FOOT_CODE
&& code != Inset::MARGIN_CODE;
}

View File

@ -49,7 +49,7 @@ public:
///
~InsetFloat();
///
docstring getInsetName() const { return name_; }
docstring insetName() const { return name_; }
///
void write(Buffer const & buf, std::ostream & os) const;
///
@ -57,7 +57,7 @@ public:
///
void validate(LaTeXFeatures & features) const;
///
InsetBase::Code lyxCode() const { return InsetBase::FLOAT_CODE; }
Inset::Code lyxCode() const { return Inset::FLOAT_CODE; }
///
virtual bool wide() const { return false; }
///
@ -72,7 +72,7 @@ public:
///
virtual docstring const editMessage() const;
///
bool insetAllowed(InsetBase::Code) const;
bool insetAllowed(Inset::Code) const;
/** returns true if, when outputing LaTeX, font changes should
be closed before generating this inset. This is needed for
insets that may contain several paragraphs */
@ -93,7 +93,7 @@ protected:
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
///
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
///
InsetFloatParams params_;
///
@ -106,7 +106,7 @@ public:
///
InsetFloatMailer(InsetFloat & inset);
///
virtual InsetBase & inset() const { return inset_; }
virtual Inset & inset() const { return inset_; }
///
virtual std::string const & name() const { return name_; }
///

View File

@ -60,9 +60,9 @@ docstring const InsetFloatList::getScreenLabel(Buffer const & buf) const
}
InsetBase::Code InsetFloatList::lyxCode() const
Inset::Code InsetFloatList::lyxCode() const
{
return InsetBase::FLOAT_LIST_CODE;
return Inset::FLOAT_LIST_CODE;
}

View File

@ -31,7 +31,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetBase::Code lyxCode() const;
Inset::Code lyxCode() const;
///
bool display() const { return true; }
///
@ -50,9 +50,9 @@ public:
///
void validate(LaTeXFeatures & features) const;
private:
virtual std::auto_ptr<InsetBase> doClone() const
virtual std::auto_ptr<Inset> doClone() const
{
return std::auto_ptr<InsetBase>(new InsetFloatList(to_ascii(getParam("type"))));
return std::auto_ptr<Inset>(new InsetFloatList(to_ascii(getParam("type"))));
}
};

View File

@ -45,9 +45,9 @@ InsetFoot::InsetFoot(InsetFoot const & in)
}
auto_ptr<InsetBase> InsetFoot::doClone() const
auto_ptr<Inset> InsetFoot::doClone() const
{
return auto_ptr<InsetBase>(new InsetFoot(*this));
return auto_ptr<Inset>(new InsetFoot(*this));
}

View File

@ -26,9 +26,9 @@ public:
///
InsetFoot(BufferParams const &);
///
InsetBase::Code lyxCode() const { return InsetBase::FOOT_CODE; }
Inset::Code lyxCode() const { return Inset::FOOT_CODE; }
///
docstring getInsetName() const { return from_ascii("Foot"); }
docstring insetName() const { return from_ascii("Foot"); }
///
int latex(Buffer const &, odocstream &,
OutputParams const &) const;
@ -43,7 +43,7 @@ public:
protected:
InsetFoot(InsetFoot const &);
private:
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
};

View File

@ -67,15 +67,15 @@ void InsetFootlike::draw(PainterInfo & pi, int x, int y) const
void InsetFootlike::write(Buffer const & buf, std::ostream & os) const
{
os << to_utf8(getInsetName()) << "\n";
os << to_utf8(insetName()) << "\n";
InsetCollapsable::write(buf, os);
}
bool InsetFootlike::insetAllowed(InsetBase::Code code) const
bool InsetFootlike::insetAllowed(Inset::Code code) const
{
if (code == InsetBase::FOOT_CODE || code == InsetBase::MARGIN_CODE
|| code == InsetBase::FLOAT_CODE)
if (code == Inset::FOOT_CODE || code == Inset::MARGIN_CODE
|| code == Inset::FLOAT_CODE)
return false;
return InsetCollapsable::insetAllowed(code);
}

View File

@ -33,7 +33,7 @@ public:
///
void write(Buffer const & buf, std::ostream & os) const;
///
bool insetAllowed(InsetBase::Code) const;
bool insetAllowed(Inset::Code) const;
/** returns true if, when outputing LaTeX, font changes should
be closed before generating this inset. This is needed for
insets that may contain several paragraphs */

View File

@ -153,7 +153,7 @@ InsetGraphics::InsetGraphics()
InsetGraphics::InsetGraphics(InsetGraphics const & ig)
: InsetBase(ig),
: Inset(ig),
boost::signals::trackable(),
graphic_label(sgml::uniqueID(from_ascii("graph"))),
graphic_(new RenderGraphic(*ig.graphic_, this))
@ -162,9 +162,9 @@ InsetGraphics::InsetGraphics(InsetGraphics const & ig)
}
auto_ptr<InsetBase> InsetGraphics::doClone() const
auto_ptr<Inset> InsetGraphics::doClone() const
{
return auto_ptr<InsetBase>(new InsetGraphics(*this));
return auto_ptr<Inset>(new InsetGraphics(*this));
}
@ -205,7 +205,7 @@ void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
break;
default:
InsetBase::doDispatch(cur, cmd);
Inset::doDispatch(cur, cmd);
break;
}
}
@ -222,7 +222,7 @@ bool InsetGraphics::getStatus(Cursor & cur, FuncRequest const & cmd,
return true;
default:
return InsetBase::getStatus(cur, cmd, flag);
return Inset::getStatus(cur, cmd, flag);
}
}
@ -249,7 +249,7 @@ void InsetGraphics::draw(PainterInfo & pi, int x, int y) const
}
InsetBase::EDITABLE InsetGraphics::editable() const
Inset::EDITABLE InsetGraphics::editable() const
{
return IS_EDITABLE;
}

View File

@ -13,7 +13,7 @@
#ifndef INSET_GRAPHICS_H
#define INSET_GRAPHICS_H
#include "InsetBase.h"
#include "Inset.h"
#include "InsetGraphicsParams.h"
#include "MailInset.h"
@ -28,7 +28,7 @@ class RenderGraphic;
class LaTeXFeatures;
///
class InsetGraphics : public InsetBase, public boost::signals::trackable {
class InsetGraphics : public Inset, public boost::signals::trackable {
public:
///
InsetGraphics();
@ -62,7 +62,7 @@ public:
void validate(LaTeXFeatures & features) const;
/// returns LyX code associated with the inset. Used for TOC, ...)
InsetBase::Code lyxCode() const { return InsetBase::GRAPHICS_CODE; }
Inset::Code lyxCode() const { return Inset::GRAPHICS_CODE; }
/** Set the inset parameters, used by the GUIndependent dialog.
Return true of new params are different from what was so far.
@ -86,7 +86,7 @@ protected:
private:
friend class InsetGraphicsMailer;
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
/// Read the inset native format
void readInsetGraphics(Lexer & lex, std::string const & bufpath);
@ -118,7 +118,7 @@ public:
///
InsetGraphicsMailer(InsetGraphics & inset);
///
virtual InsetBase & inset() const { return inset_; }
virtual Inset & inset() const { return inset_; }
///
virtual std::string const & name() const { return name_; }
///

View File

@ -26,9 +26,9 @@ InsetHFill::InsetHFill()
{}
std::auto_ptr<InsetBase> InsetHFill::doClone() const
std::auto_ptr<Inset> InsetHFill::doClone() const
{
return std::auto_ptr<InsetBase>(new InsetHFill);
return std::auto_ptr<Inset>(new InsetHFill);
}

View File

@ -27,7 +27,7 @@ public:
///
docstring const getScreenLabel(Buffer const &) const;
///
InsetBase::Code lyxCode() const { return InsetBase::HFILL_CODE; }
Inset::Code lyxCode() const { return Inset::HFILL_CODE; }
///
int plaintext(Buffer const &, odocstream &,
OutputParams const &) const;
@ -42,7 +42,7 @@ public:
// a line separator)?
bool isSpace() const;
private:
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
};

View File

@ -104,7 +104,7 @@ InsetInclude::InsetInclude(InsetCommandParams const & p)
InsetInclude::InsetInclude(InsetInclude const & other)
: InsetBase(other),
: Inset(other),
params_(other.params_),
include_label(other.include_label),
preview_(new RenderMonitoredPreview(this)),
@ -144,7 +144,7 @@ void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd)
break;
default:
InsetBase::doDispatch(cur, cmd);
Inset::doDispatch(cur, cmd);
break;
}
}
@ -161,7 +161,7 @@ bool InsetInclude::getStatus(Cursor & cur, FuncRequest const & cmd,
return true;
default:
return InsetBase::getStatus(cur, cmd, flag);
return Inset::getStatus(cur, cmd, flag);
}
}
@ -243,9 +243,9 @@ void InsetInclude::set(InsetCommandParams const & p, Buffer const & buffer)
}
auto_ptr<InsetBase> InsetInclude::doClone() const
auto_ptr<Inset> InsetInclude::doClone() const
{
return auto_ptr<InsetBase>(new InsetInclude(*this));
return auto_ptr<Inset>(new InsetInclude(*this));
}

View File

@ -12,7 +12,7 @@
#ifndef INSET_INCLUDE_H
#define INSET_INCLUDE_H
#include "InsetBase.h"
#include "Inset.h"
#include "InsetCommandParams.h"
#include "RenderButton.h"
#include "MailInset.h"
@ -30,7 +30,7 @@ class RenderMonitoredPreview;
/// for including tex/lyx files
class InsetInclude : public InsetBase {
class InsetInclude : public Inset {
public:
///
InsetInclude(InsetCommandParams const &);
@ -47,7 +47,7 @@ public:
InsetCommandParams const & params() const;
///
InsetBase::Code lyxCode() const { return InsetBase::INCLUDE_CODE; }
Inset::Code lyxCode() const { return Inset::INCLUDE_CODE; }
/** Fills \c list
* \param buffer the Buffer containing this inset.
* \param list the list of labels in the child buffer.
@ -104,7 +104,7 @@ protected:
///
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
/** Slot receiving a signal that the external file has changed
* and the preview should be regenerated.
@ -141,7 +141,7 @@ public:
///
InsetIncludeMailer(InsetInclude & inset);
///
virtual InsetBase & inset() const { return inset_; }
virtual Inset & inset() const { return inset_; }
///
virtual std::string const & name() const { return name_; }
///

View File

@ -53,9 +53,9 @@ int InsetIndex::docbook(Buffer const &, odocstream & os,
}
InsetBase::Code InsetIndex::lyxCode() const
Inset::Code InsetIndex::lyxCode() const
{
return InsetBase::INDEX_CODE;
return Inset::INDEX_CODE;
}
@ -82,9 +82,9 @@ void InsetPrintIndex::validate(LaTeXFeatures & features) const
}
InsetBase::Code InsetPrintIndex::lyxCode() const
Inset::Code InsetPrintIndex::lyxCode() const
{
return InsetBase::INDEX_PRINT_CODE;
return Inset::INDEX_PRINT_CODE;
}

View File

@ -31,13 +31,13 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetBase::Code lyxCode() const;
Inset::Code lyxCode() const;
///
int docbook(Buffer const &, odocstream &,
OutputParams const &) const;
private:
virtual std::auto_ptr<InsetBase> doClone() const {
return std::auto_ptr<InsetBase>(new InsetIndex(params()));
virtual std::auto_ptr<Inset> doClone() const {
return std::auto_ptr<Inset>(new InsetIndex(params()));
}
};
@ -51,14 +51,14 @@ public:
///
EDITABLE editable() const { return NOT_EDITABLE; }
///
InsetBase::Code lyxCode() const;
Inset::Code lyxCode() const;
///
bool display() const { return true; }
///
docstring const getScreenLabel(Buffer const &) const;
private:
virtual std::auto_ptr<InsetBase> doClone() const {
return std::auto_ptr<InsetBase>(new InsetPrintIndex(params()));
virtual std::auto_ptr<Inset> doClone() const {
return std::auto_ptr<Inset>(new InsetPrintIndex(params()));
}
};

View File

@ -41,9 +41,9 @@ InsetLabel::InsetLabel(InsetCommandParams const & p)
{}
std::auto_ptr<InsetBase> InsetLabel::doClone() const
std::auto_ptr<Inset> InsetLabel::doClone() const
{
return std::auto_ptr<InsetBase>(new InsetLabel(params()));
return std::auto_ptr<Inset>(new InsetLabel(params()));
}
@ -73,7 +73,7 @@ void InsetLabel::doDispatch(Cursor & cur, FuncRequest & cmd)
}
if (p["name"] != params()["name"])
cur.bv().buffer()->changeRefsIfUnique(params()["name"],
p["name"], InsetBase::REF_CODE);
p["name"], Inset::REF_CODE);
setParams(p);
break;
}

View File

@ -26,7 +26,7 @@ public:
///
EDITABLE editable() const { return IS_EDITABLE; }
///
InsetBase::Code lyxCode() const { return InsetBase::LABEL_CODE; }
Inset::Code lyxCode() const { return Inset::LABEL_CODE; }
/// Appends \c list with this label
void getLabelList(Buffer const &, std::vector<docstring> & list) const;
///
@ -38,7 +38,7 @@ public:
protected:
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
};

View File

@ -13,17 +13,17 @@
#define INSET_LINE_H
#include "InsetBase.h"
#include "Inset.h"
namespace lyx {
class InsetLine : public InsetBase {
class InsetLine : public Inset {
public:
InsetLine() {}
InsetBase::Code lyxCode() const { return InsetBase::LINE_CODE; }
Inset::Code lyxCode() const { return Inset::LINE_CODE; }
bool metrics(MetricsInfo &, Dimension &) const;
@ -48,9 +48,9 @@ public:
///
void validate(LaTeXFeatures & features) const;
private:
virtual std::auto_ptr<InsetBase> doClone() const
virtual std::auto_ptr<Inset> doClone() const
{
return std::auto_ptr<InsetBase>(new InsetLine);
return std::auto_ptr<Inset>(new InsetLine);
}
};

View File

@ -41,9 +41,9 @@ InsetMarginal::InsetMarginal(InsetMarginal const & in)
}
auto_ptr<InsetBase> InsetMarginal::doClone() const
auto_ptr<Inset> InsetMarginal::doClone() const
{
return auto_ptr<InsetBase>(new InsetMarginal(*this));
return auto_ptr<Inset>(new InsetMarginal(*this));
}

View File

@ -27,7 +27,7 @@ public:
///
InsetMarginal(BufferParams const &);
///
InsetBase::Code lyxCode() const { return InsetBase::MARGIN_CODE; }
Inset::Code lyxCode() const { return Inset::MARGIN_CODE; }
///
int latex(Buffer const &, odocstream &,
OutputParams const &) const;
@ -42,7 +42,7 @@ public:
protected:
InsetMarginal(InsetMarginal const &);
private:
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
};

View File

@ -13,17 +13,17 @@
#define INSET_NEWLINE_H
#include "InsetBase.h"
#include "Inset.h"
namespace lyx {
class InsetNewline : public InsetBase {
class InsetNewline : public Inset {
public:
InsetNewline() {}
InsetBase::Code lyxCode() const { return InsetBase::NEWLINE_CODE; }
Inset::Code lyxCode() const { return Inset::NEWLINE_CODE; }
bool metrics(MetricsInfo &, Dimension &) const;
@ -44,9 +44,9 @@ public:
// a line separator)?
bool isSpace() const;
private:
virtual std::auto_ptr<InsetBase> doClone() const
virtual std::auto_ptr<Inset> doClone() const
{
return std::auto_ptr<InsetBase>(new InsetNewline);
return std::auto_ptr<Inset>(new InsetNewline);
}
};

View File

@ -70,9 +70,9 @@ void InsetNomencl::validate(LaTeXFeatures & features) const
}
InsetBase::Code InsetNomencl::lyxCode() const
Inset::Code InsetNomencl::lyxCode() const
{
return InsetBase::NOMENCL_CODE;
return Inset::NOMENCL_CODE;
}
@ -93,10 +93,10 @@ int InsetPrintNomencl::docbook(Buffer const & buf, odocstream & os,
os << "<glossary>\n";
int newlines = 2;
for (InsetIterator it = inset_iterator_begin(buf.inset()); it;) {
if (it->lyxCode() == InsetBase::NOMENCL_CODE) {
if (it->lyxCode() == Inset::NOMENCL_CODE) {
newlines += static_cast<InsetNomencl const &>(*it).docbookGlossary(os);
++it;
} else if(it->lyxCode() == InsetBase::NOTE_CODE &&
} else if(it->lyxCode() == Inset::NOTE_CODE &&
static_cast<InsetNote const &>(*it).params().type == InsetNoteParams::Note) {
// Don't output anything nested in note insets
size_t const depth = it.depth();
@ -118,9 +118,9 @@ void InsetPrintNomencl::validate(LaTeXFeatures & features) const
}
InsetBase::Code InsetPrintNomencl::lyxCode() const
Inset::Code InsetPrintNomencl::lyxCode() const
{
return InsetBase::NOMENCL_PRINT_CODE;
return Inset::NOMENCL_PRINT_CODE;
}

View File

@ -34,15 +34,15 @@ public:
/// Updates needed features for this inset.
void validate(LaTeXFeatures & features) const;
///
InsetBase::Code lyxCode() const;
Inset::Code lyxCode() const;
///
int docbook(Buffer const &, odocstream &,
OutputParams const &) const;
///
int docbookGlossary(odocstream &) const;
private:
virtual std::auto_ptr<InsetBase> doClone() const {
return std::auto_ptr<InsetBase>(new InsetNomencl(params()));
virtual std::auto_ptr<Inset> doClone() const {
return std::auto_ptr<Inset>(new InsetNomencl(params()));
}
/// unique id for this glossary entry for docbook export
docstring glossary_entry_id;
@ -65,14 +65,14 @@ public:
int docbook(Buffer const &, odocstream &,
OutputParams const &) const;
///
InsetBase::Code lyxCode() const;
Inset::Code lyxCode() const;
///
bool display() const { return true; }
///
docstring const getScreenLabel(Buffer const &) const;
private:
virtual std::auto_ptr<InsetBase> doClone() const {
return std::auto_ptr<InsetBase>(new InsetPrintNomencl(params()));
virtual std::auto_ptr<Inset> doClone() const {
return std::auto_ptr<Inset>(new InsetPrintNomencl(params()));
}
};

View File

@ -137,9 +137,9 @@ InsetNote::~InsetNote()
}
auto_ptr<InsetBase> InsetNote::doClone() const
auto_ptr<Inset> InsetNote::doClone() const
{
return auto_ptr<InsetBase>(new InsetNote(*this));
return auto_ptr<Inset>(new InsetNote(*this));
}

View File

@ -50,9 +50,9 @@ public:
///
virtual docstring const editMessage() const;
///
InsetBase::Code lyxCode() const { return InsetBase::NOTE_CODE; }
Inset::Code lyxCode() const { return Inset::NOTE_CODE; }
///
docstring getInsetName() const { return from_ascii("Note"); }
docstring insetName() const { return from_ascii("Note"); }
///
void write(Buffer const &, std::ostream &) const;
///
@ -80,7 +80,7 @@ protected:
private:
friend class InsetNoteParams;
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
/// used by the constructors
void init();
@ -94,7 +94,7 @@ public:
///
InsetNoteMailer(InsetNote & inset);
///
virtual InsetBase & inset() const { return inset_; }
virtual Inset & inset() const { return inset_; }
///
virtual std::string const & name() const { return name_; }
///

View File

@ -48,9 +48,9 @@ InsetOptArg::InsetOptArg(InsetOptArg const & in)
}
auto_ptr<InsetBase> InsetOptArg::doClone() const
auto_ptr<Inset> InsetOptArg::doClone() const
{
return auto_ptr<InsetBase>(new InsetOptArg(*this));
return auto_ptr<Inset>(new InsetOptArg(*this));
}

View File

@ -28,7 +28,7 @@ public:
InsetOptArg(BufferParams const &);
/// code of the inset
InsetBase::Code lyxCode() const { return InsetBase::OPTARG_CODE; }
Inset::Code lyxCode() const { return Inset::OPTARG_CODE; }
/// return an message upon editing
virtual docstring const editMessage() const;
///
@ -55,7 +55,7 @@ public:
protected:
InsetOptArg(InsetOptArg const &);
private:
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
};

View File

@ -13,17 +13,17 @@
#define INSET_PAGEBREAK_H
#include "InsetBase.h"
#include "Inset.h"
#include "gettext.h"
namespace lyx {
class InsetPagebreak : public InsetBase {
class InsetPagebreak : public Inset {
public:
InsetPagebreak() {}
InsetBase::Code lyxCode() const { return InsetBase::PAGEBREAK_CODE; }
Inset::Code lyxCode() const { return Inset::PAGEBREAK_CODE; }
bool metrics(MetricsInfo &, Dimension &) const;
@ -51,9 +51,9 @@ public:
virtual std::string getCmdName() const { return "\\newpage"; }
private:
virtual std::auto_ptr<InsetBase> doClone() const
virtual std::auto_ptr<Inset> doClone() const
{
return std::auto_ptr<InsetBase>(new InsetPagebreak);
return std::auto_ptr<Inset>(new InsetPagebreak);
}
};
@ -67,9 +67,9 @@ public:
std::string getCmdName() const { return "\\clearpage"; }
private:
virtual std::auto_ptr<InsetBase> doClone() const
virtual std::auto_ptr<Inset> doClone() const
{
return std::auto_ptr<InsetBase>(new InsetClearPage);
return std::auto_ptr<Inset>(new InsetClearPage);
}
};
@ -83,9 +83,9 @@ public:
std::string getCmdName() const { return "\\cleardoublepage"; }
private:
virtual std::auto_ptr<InsetBase> doClone() const
virtual std::auto_ptr<Inset> doClone() const
{
return std::auto_ptr<InsetBase>(new InsetClearDoublePage);
return std::auto_ptr<Inset>(new InsetClearDoublePage);
}
};

View File

@ -386,15 +386,15 @@ void InsetQuotes::validate(LaTeXFeatures & features) const
}
auto_ptr<InsetBase> InsetQuotes::doClone() const
auto_ptr<Inset> InsetQuotes::doClone() const
{
return auto_ptr<InsetBase>(new InsetQuotes(language_, side_, times_));
return auto_ptr<Inset>(new InsetQuotes(language_, side_, times_));
}
InsetBase::Code InsetQuotes::lyxCode() const
Inset::Code InsetQuotes::lyxCode() const
{
return InsetBase::QUOTE_CODE;
return Inset::QUOTE_CODE;
}

View File

@ -13,7 +13,7 @@
#define INSET_QUOTES_H
#include "InsetBase.h"
#include "Inset.h"
#include "support/types.h"
@ -28,7 +28,7 @@ class LaTeXFeatures;
/** Quotes.
Used for the various quotes. German, English, French, all either
double or single **/
class InsetQuotes : public InsetBase {
class InsetQuotes : public Inset {
public:
///
enum quote_language {
@ -74,7 +74,7 @@ public:
/// Direct access to inner/outer quotation marks
InsetQuotes(char_type c, quote_language l, quote_times t);
///
docstring getInsetName() const { return from_ascii("Quotes"); }
docstring insetName() const { return from_ascii("Quotes"); }
///
bool metrics(MetricsInfo &, Dimension &) const;
///
@ -100,12 +100,12 @@ public:
///
void validate(LaTeXFeatures &) const;
///
InsetBase::Code lyxCode() const;
Inset::Code lyxCode() const;
// should this inset be handled like a normal character
bool isChar() const { return true; }
private:
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
///
quote_language language_;

View File

@ -63,8 +63,8 @@ protected:
///
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
virtual std::auto_ptr<InsetBase> doClone() const {
return std::auto_ptr<InsetBase>(new InsetRef(*this));
virtual std::auto_ptr<Inset> doClone() const {
return std::auto_ptr<Inset>(new InsetRef(*this));
}
///
bool isLatex;

View File

@ -235,9 +235,9 @@ int InsetSpace::textString(Buffer const & buf, odocstream & os,
}
auto_ptr<InsetBase> InsetSpace::doClone() const
auto_ptr<Inset> InsetSpace::doClone() const
{
return auto_ptr<InsetBase>(new InsetSpace(kind_));
return auto_ptr<Inset>(new InsetSpace(kind_));
}

View File

@ -16,7 +16,7 @@
#define INSET_SPACE_H
#include "InsetBase.h"
#include "Inset.h"
namespace lyx {
@ -24,7 +24,7 @@ namespace lyx {
class LaTeXFeatures;
/// Used to insert different kinds of spaces
class InsetSpace : public InsetBase {
class InsetSpace : public Inset {
public:
/// The different kinds of spaces we support
@ -76,7 +76,7 @@ public:
virtual int textString(Buffer const &, odocstream &,
OutputParams const &) const;
///
InsetBase::Code lyxCode() const { return InsetBase::SPACE_CODE; }
Inset::Code lyxCode() const { return Inset::SPACE_CODE; }
/// We don't need \begin_inset and \end_inset
bool directWrite() const { return true; }
@ -88,7 +88,7 @@ public:
// a line separator)?
bool isSpace() const;
private:
virtual std::auto_ptr<InsetBase> doClone() const;
virtual std::auto_ptr<Inset> doClone() const;
/// And which kind is this?
Kind kind_;

Some files were not shown because too many files have changed in this diff Show More