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
|
|
|
|
|
2003-02-14 00:41:44 +00:00
|
|
|
|
using lyx::pos_type;
|
|
|
|
|
|
2000-06-08 23:16:16 +00:00
|
|
|
|
|
|
|
|
|
Row::Row()
|
2003-08-22 07:49:57 +00:00
|
|
|
|
: pos_(0), end_(0), fill_(0), height_(0), width_(0), y_(0),
|
2003-08-22 09:40:56 +00:00
|
|
|
|
ascent_of_text_(0), baseline_(0),
|
|
|
|
|
x_(0), fill_separator_(0), fill_hfill_(0), fill_label_hfill_(0)
|
2000-06-08 23:16:16 +00:00
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
2003-08-22 07:49:57 +00:00
|
|
|
|
Row::Row(pos_type pos)
|
|
|
|
|
: pos_(pos), end_(0), fill_(0), height_(0), width_(0), y_(0),
|
2003-08-22 09:40:56 +00:00
|
|
|
|
ascent_of_text_(0), baseline_(0),
|
|
|
|
|
x_(0), fill_separator_(0), fill_hfill_(0), fill_label_hfill_(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-08-22 07:49:57 +00:00
|
|
|
|
void Row::end(pos_type p)
|
|
|
|
|
{
|
|
|
|
|
end_ = p;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pos_type Row::end() const
|
|
|
|
|
{
|
|
|
|
|
return end_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2000-06-08 23:16:16 +00:00
|
|
|
|
void Row::fill(int f)
|
|
|
|
|
{
|
|
|
|
|
fill_ = f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int Row::fill() const
|
|
|
|
|
{
|
|
|
|
|
return fill_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2000-06-26 15:10:49 +00:00
|
|
|
|
void Row::width(unsigned int w)
|
|
|
|
|
{
|
|
|
|
|
width_ = w;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int Row::width() const
|
|
|
|
|
{
|
|
|
|
|
return width_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-08-26 14:50:16 +00:00
|
|
|
|
void Row::ascent_of_text(unsigned int a)
|
2000-06-08 23:16:16 +00:00
|
|
|
|
{
|
|
|
|
|
ascent_of_text_ = a;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-08-26 14:50:16 +00:00
|
|
|
|
unsigned int Row::ascent_of_text() const
|
2000-06-08 23:16:16 +00:00
|
|
|
|
{
|
|
|
|
|
return ascent_of_text_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
void Row::top_of_text(unsigned int top)
|
|
|
|
|
{
|
|
|
|
|
top_of_text_ = top;
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-04 09:27:27 +00:00
|
|
|
|
|
2003-02-08 19:18:01 +00:00
|
|
|
|
unsigned int Row::top_of_text() const
|
|
|
|
|
{
|
|
|
|
|
return top_of_text_;
|
|
|
|
|
}
|
|
|
|
|
|
2003-03-04 09:27:27 +00:00
|
|
|
|
|
2000-06-08 23:16:16 +00:00
|
|
|
|
void Row::baseline(unsigned int b)
|
|
|
|
|
{
|
|
|
|
|
baseline_ = b;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int Row::baseline() const
|
|
|
|
|
{
|
|
|
|
|
return baseline_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-08-22 09:40:56 +00:00
|
|
|
|
float Row::x() const
|
|
|
|
|
{
|
|
|
|
|
return x_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Row::x(float f)
|
|
|
|
|
{
|
|
|
|
|
x_ = f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float Row::fill_separator() const
|
|
|
|
|
{
|
|
|
|
|
return fill_separator_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Row::fill_separator(float f)
|
|
|
|
|
{
|
|
|
|
|
fill_separator_ = f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float Row::fill_hfill() const
|
|
|
|
|
{
|
|
|
|
|
return fill_hfill_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Row::fill_hfill(float f)
|
|
|
|
|
{
|
|
|
|
|
fill_hfill_ = f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float Row::fill_label_hfill() const
|
|
|
|
|
{
|
|
|
|
|
return fill_label_hfill_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Row::fill_label_hfill(float f)
|
|
|
|
|
{
|
|
|
|
|
fill_label_hfill_ = f;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-02-26 17:04:10 +00:00
|
|
|
|
bool Row::isParStart() const
|
|
|
|
|
{
|
|
|
|
|
return !pos();
|
|
|
|
|
}
|
2003-08-01 14:12:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Row::dump(const char * s) const
|
|
|
|
|
{
|
|
|
|
|
lyxerr << s << " pos: " << pos_ << " width: " << width_
|
|
|
|
|
<< " height: " << height_
|
|
|
|
|
<< " fill: " << fill_
|
|
|
|
|
<< " ascent_of_text: " << ascent_of_text_
|
|
|
|
|
<< " top_of_text: " << top_of_text_
|
2003-08-22 07:49:57 +00:00
|
|
|
|
<< " y: " << y_ << std::endl;
|
2003-08-01 14:12:04 +00:00
|
|
|
|
}
|
|
|
|
|
|