2003-02-14 00:41:44 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file lyxrow.C
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-02-14 00:41:44 +00:00
|
|
|
|
* \author unknown
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author John Levon
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2000-06-08 23:16:16 +00:00
|
|
|
|
*
|
2003-02-14 00:41:44 +00:00
|
|
|
|
* Metrics for an on-screen text row.
|
|
|
|
|
*/
|
2000-06-08 23:16:16 +00:00
|
|
|
|
|
2000-06-15 15:54:05 +00:00
|
|
|
|
#include <config.h>
|
|
|
|
|
|
2000-06-08 23:16:16 +00:00
|
|
|
|
#include "lyxrow.h"
|
2003-08-01 14:12:04 +00:00
|
|
|
|
#include "debug.h"
|
2000-06-08 23:16:16 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
2003-02-14 00:41:44 +00:00
|
|
|
|
|
2000-06-08 23:16:16 +00:00
|
|
|
|
|
2004-11-30 01:59:49 +00:00
|
|
|
|
RowMetrics::RowMetrics()
|
|
|
|
|
: separator(0), hfill(0), label_hfill(0), x(0)
|
2004-03-01 12:23:17 +00:00
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
2000-06-08 23:16:16 +00:00
|
|
|
|
Row::Row()
|
2004-11-30 01:59:49 +00:00
|
|
|
|
: pos_(0), end_(0), ascent_(0), descent_(0), width_(0)
|
2000-06-08 23:16:16 +00:00
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
2003-08-22 07:49:57 +00:00
|
|
|
|
Row::Row(pos_type pos)
|
2004-11-30 01:59:49 +00:00
|
|
|
|
: pos_(pos), end_(0), ascent_(0), descent_(0), width_(0)
|
2003-03-29 23:11:20 +00:00
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
2003-02-14 00:41:44 +00:00
|
|
|
|
void Row::pos(pos_type p)
|
2000-06-08 23:16:16 +00:00
|
|
|
|
{
|
|
|
|
|
pos_ = p;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-02-14 00:41:44 +00:00
|
|
|
|
pos_type Row::pos() const
|
2000-06-08 23:16:16 +00:00
|
|
|
|
{
|
|
|
|
|
return pos_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-10-22 16:30:57 +00:00
|
|
|
|
void Row::endpos(pos_type p)
|
2003-08-22 07:49:57 +00:00
|
|
|
|
{
|
|
|
|
|
end_ = p;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-10-22 16:30:57 +00:00
|
|
|
|
pos_type Row::endpos() const
|
2003-08-22 07:49:57 +00:00
|
|
|
|
{
|
|
|
|
|
return end_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-11-30 01:59:49 +00:00
|
|
|
|
void Row::width(int w)
|
2000-06-26 15:10:49 +00:00
|
|
|
|
{
|
|
|
|
|
width_ = w;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-11-30 01:59:49 +00:00
|
|
|
|
int Row::width() const
|
2000-06-26 15:10:49 +00:00
|
|
|
|
{
|
|
|
|
|
return width_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-11-30 01:59:49 +00:00
|
|
|
|
void Row::ascent(int b)
|
2000-06-08 23:16:16 +00:00
|
|
|
|
{
|
2004-11-30 01:59:49 +00:00
|
|
|
|
ascent_ = b;
|
2000-06-08 23:16:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-11-30 01:59:49 +00:00
|
|
|
|
int Row::ascent() const
|
2000-06-08 23:16:16 +00:00
|
|
|
|
{
|
2004-11-30 01:59:49 +00:00
|
|
|
|
return ascent_;
|
2003-02-26 17:04:10 +00:00
|
|
|
|
}
|
2003-08-01 14:12:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Row::dump(const char * s) const
|
|
|
|
|
{
|
2004-11-30 01:59:49 +00:00
|
|
|
|
lyxerr << s << " pos: " << pos_ << " end: " << end_
|
|
|
|
|
<< " width: " << width_
|
|
|
|
|
<< " ascent: " << ascent_
|
|
|
|
|
<< " descent: " << descent_
|
|
|
|
|
<< std::endl;
|
2003-08-01 14:12:04 +00:00
|
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|