lyx_mirror/src/insets/inset.C
André Pönitz b0cffd9fc0 The deed is done.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8064 a592a061-630c-0410-9148-cb99ea01b6c8
2003-11-10 09:06:48 +00:00

154 lines
2.3 KiB
C

/**
* \file inset.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Alejandro Aguilar Sierra
* \author Jürgen Vigna
* \author Lars Gullik Bjønnes
* \author Matthias Ettrich
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "inset.h"
#include "updatableinset.h"
#include "BufferView.h"
#include "gettext.h"
#include "LColor.h"
using std::string;
InsetOld::InsetOld()
: InsetBase(),
top_x(0), top_baseline(0), scx(0), owner_(0),
background_color_(LColor::inherit)
{}
InsetOld::InsetOld(InsetOld const & in)
: InsetBase(),
top_x(0), top_baseline(0), scx(0), owner_(0),
name_(in.name_), background_color_(in.background_color_)
{}
bool InsetOld::directWrite() const
{
return false;
}
InsetOld::EDITABLE InsetOld::editable() const
{
return NOT_EDITABLE;
}
bool InsetOld::autoDelete() const
{
return false;
}
#if 0
LyXFont const InsetOld::convertFont(LyXFont const & font) const
{
#if 1
return font;
#else
return LyXFont(font);
#endif
}
#endif
string const InsetOld::editMessage() const
{
return _("Opened inset");
}
void InsetOld::setBackgroundColor(LColor_color color)
{
background_color_ = color;
}
LColor_color InsetOld::backgroundColor() const
{
if (background_color_ == LColor::inherit) {
if (owner())
return owner()->backgroundColor();
else
return LColor::background;
} else
return LColor::color(background_color_);
}
void InsetOld::setFont(BufferView *, LyXFont const &, bool, bool)
{}
bool InsetOld::forceDefaultParagraphs(InsetOld const * inset) const
{
if (owner())
return owner()->forceDefaultParagraphs(inset);
return false;
}
int InsetOld::latexTextWidth(BufferView * bv) const
{
if (owner())
return (owner()->latexTextWidth(bv));
return bv->workWidth();
}
int InsetOld::ascent() const
{
return dim_.asc;
}
int InsetOld::descent() const
{
return dim_.des;
}
int InsetOld::width() const
{
return dim_.wid;
}
bool InsetOld::insetAllowed(InsetOld * in) const
{
return insetAllowed(in->lyxCode());
}
bool InsetOld::checkInsertChar(LyXFont &)
{
return false;
}
bool isEditableInset(InsetOld const * i)
{
return i && i->editable();
}
bool isHighlyEditableInset(InsetOld const * i)
{
return i && i->editable() == InsetOld::HIGHLY_EDITABLE;
}