2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file inset.C
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:09:55 +00:00
|
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* \author Alejandro Aguilar Sierra
|
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author Matthias Ettrich
|
2002-03-21 17:09:55 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-09-25 14:26:13 +00:00
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
|
#include "inset.h"
|
2003-09-05 09:01:27 +00:00
|
|
|
|
#include "updatableinset.h"
|
|
|
|
|
|
2000-02-25 12:06:15 +00:00
|
|
|
|
#include "BufferView.h"
|
2003-12-10 09:45:32 +00:00
|
|
|
|
#include "debug.h"
|
2001-04-05 12:26:41 +00:00
|
|
|
|
#include "gettext.h"
|
2003-12-10 09:45:32 +00:00
|
|
|
|
#include "lyxtext.h"
|
2003-09-16 09:44:34 +00:00
|
|
|
|
#include "LColor.h"
|
2004-02-06 13:18:49 +00:00
|
|
|
|
#include "metricsinfo.h"
|
2004-08-14 14:03:42 +00:00
|
|
|
|
#include "coordcache.h"
|
2003-07-25 19:18:43 +00:00
|
|
|
|
|
2003-10-06 15:43:21 +00:00
|
|
|
|
using std::string;
|
|
|
|
|
|
|
|
|
|
|
2003-07-25 21:20:24 +00:00
|
|
|
|
InsetOld::InsetOld()
|
2004-08-14 14:03:42 +00:00
|
|
|
|
: scx(0),
|
2003-12-01 13:35:49 +00:00
|
|
|
|
//background_color_(LColor::inherit)
|
|
|
|
|
background_color_(LColor::background)
|
2001-07-24 15:07:09 +00:00
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
2003-07-25 21:20:24 +00:00
|
|
|
|
InsetOld::InsetOld(InsetOld const & in)
|
2004-08-14 14:03:42 +00:00
|
|
|
|
: InsetBase(in), scx(0), name_(in.name_),
|
2003-12-01 13:35:49 +00:00
|
|
|
|
background_color_(in.background_color_)
|
2003-08-26 16:36:53 +00:00
|
|
|
|
{}
|
2001-07-24 15:07:09 +00:00
|
|
|
|
|
|
|
|
|
|
2003-09-18 11:48:11 +00:00
|
|
|
|
void InsetOld::setBackgroundColor(LColor_color color)
|
2001-07-24 10:13:19 +00:00
|
|
|
|
{
|
|
|
|
|
background_color_ = color;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-09-18 11:48:11 +00:00
|
|
|
|
LColor_color InsetOld::backgroundColor() const
|
2001-07-24 10:13:19 +00:00
|
|
|
|
{
|
2003-12-01 13:35:49 +00:00
|
|
|
|
return LColor::color(background_color_);
|
2001-07-24 10:13:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-03-25 09:16:36 +00:00
|
|
|
|
bool InsetOld::forceDefaultParagraphs(InsetBase const *) const
|
2002-01-08 14:24:49 +00:00
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2003-05-19 17:03:12 +00:00
|
|
|
|
|
2003-07-25 21:20:24 +00:00
|
|
|
|
int InsetOld::ascent() const
|
2003-05-19 17:03:12 +00:00
|
|
|
|
{
|
2003-07-18 07:47:07 +00:00
|
|
|
|
return dim_.asc;
|
2003-05-19 17:03:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-07-25 21:20:24 +00:00
|
|
|
|
int InsetOld::descent() const
|
2003-05-19 17:03:12 +00:00
|
|
|
|
{
|
2003-07-18 07:47:07 +00:00
|
|
|
|
return dim_.des;
|
2003-05-19 17:03:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-07-25 21:20:24 +00:00
|
|
|
|
int InsetOld::width() const
|
2003-05-19 17:03:12 +00:00
|
|
|
|
{
|
2003-07-18 07:47:07 +00:00
|
|
|
|
return dim_.wid;
|
2003-05-19 17:03:12 +00:00
|
|
|
|
}
|
2003-08-07 11:59:09 +00:00
|
|
|
|
|
|
|
|
|
|
2004-03-25 09:16:36 +00:00
|
|
|
|
int InsetOld::scroll(bool) const
|
2003-11-10 18:13:00 +00:00
|
|
|
|
{
|
2004-03-25 09:16:36 +00:00
|
|
|
|
return scx;
|
2003-11-10 18:13:00 +00:00
|
|
|
|
}
|
2004-01-30 11:41:12 +00:00
|
|
|
|
|
|
|
|
|
|
2004-02-06 13:18:49 +00:00
|
|
|
|
void InsetOld::setPosCache(PainterInfo const & pi, int x, int y) const
|
2004-01-30 11:41:12 +00:00
|
|
|
|
{
|
2004-02-03 16:44:57 +00:00
|
|
|
|
//lyxerr << "InsetOld:: position cache to " << x << " " << y << std::endl;
|
2004-08-14 21:56:40 +00:00
|
|
|
|
theCoords.insets_.add(this, x, y);
|
2004-01-30 11:41:12 +00:00
|
|
|
|
}
|