remove unused mathed parts

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8915 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2004-08-13 22:24:42 +00:00
parent 57163403d4
commit b119fd180d
12 changed files with 23 additions and 221 deletions

View File

@ -263,7 +263,7 @@ void InsetCollapsable::priv_dispatch(LCursor & cur, FuncRequest & cmd)
else if (status_ == Open && !hitButton(cmd))
InsetText::priv_dispatch(cur, cmd);
else
cur.noUpdate();
cur.noUpdate();
break;
case LFUN_MOUSE_MOTION:

View File

@ -414,16 +414,22 @@ void InsetTabular::priv_dispatch(LCursor & cur, FuncRequest & cmd)
switch (cmd.action) {
case LFUN_MOUSE_PRESS:
lyxerr << "# InsetTabular::MousePress\n" << cur.bv().cursor() << endl;
if (cmd.button() == mouse_button::button1) {
cur.selection() = false;
setPos(cur, cmd.x, cmd.y);
cur.resetAnchor();
bvcur = cur;
break;
}
//if (cmd.button() == mouse_button::button2)
// dispatch(cur, FuncRequest(LFUN_PASTESELECTION, "paragraph"));
// we'll pop up the table dialog on release
if (cmd.button() == mouse_button::button3)
break;
cur.selection() = false;
setPos(cur, cmd.x, cmd.y);
cur.resetAnchor();
bvcur = cur;
//if (cmd.button() == mouse_button::button2)
// dispatch(cur, FuncRequest(LFUN_PASTESELECTION, "paragraph"));
//lyxerr << "# InsetTabular::MousePress\n" << cur.bv().cursor() << endl;
break;
case LFUN_MOUSE_MOTION:
@ -434,11 +440,11 @@ void InsetTabular::priv_dispatch(LCursor & cur, FuncRequest & cmd)
break;
setPos(cur, cmd.x, cmd.y);
bvcur.setCursor(cur, true);
//lyxerr << "# InsetTabular::MouseMotion\n" << bvcur << endl;
lyxerr << "# InsetTabular::MouseMotion\n" << bvcur << endl;
break;
case LFUN_MOUSE_RELEASE:
//lyxerr << "# InsetTabular::MouseRelease\n" << bvcur << endl;
lyxerr << "# InsetTabular::MouseRelease\n" << bvcur << endl;
if (cmd.button() == mouse_button::button3)
InsetTabularMailer(*this).showDialog(&cur.bv());
break;

View File

@ -108,8 +108,6 @@ libmathed_la_SOURCES = \
math_numberinset.h \
math_oversetinset.C \
math_oversetinset.h \
math_parboxinset.C \
math_parboxinset.h \
math_parinset.C \
math_parinset.h \
math_parser.C \

View File

@ -38,12 +38,12 @@ using std::vector;
MathArray::MathArray()
: xo_(0), yo_(0), clean_(false), drawn_(false)
: xo_(0), yo_(0)
{}
MathArray::MathArray(const_iterator from, const_iterator to)
: base_type(from, to), xo_(0), yo_(0), clean_(false), drawn_(false)
: base_type(from, to), xo_(0), yo_(0)
{}
@ -206,8 +206,6 @@ bool MathArray::contains(MathArray const & ar) const
void MathArray::touch() const
{
clean_ = false;
drawn_ = false;
}
@ -237,11 +235,6 @@ bool isInside(DocIterator const & it, MathArray const & ar,
void MathArray::metrics(MetricsInfo & mi) const
{
//if (clean_)
// return;
clean_ = true;
drawn_ = false;
mathed_char_dim(mi.base.font, 'I', dim_);
if (empty())
@ -282,13 +275,10 @@ void MathArray::metrics(MetricsInfo & mi) const
void MathArray::draw(PainterInfo & pi, int x, int y) const
{
//if (drawn_ && x == xo_ && y == yo_)
// return;
//lyxerr << "MathArray::draw: x: " << x << " y: " << y << endl;
xo_ = x;
yo_ = y;
drawn_ = true;
if (empty()) {
pi.pain.rectangle(x, y - ascent(), width(), height(), LColor::mathline);
@ -331,8 +321,6 @@ void MathArray::draw(PainterInfo & pi, int x, int y) const
void MathArray::metricsT(TextMetricsInfo const & mi, Dimension & dim) const
{
//if (clean_)
// return;
dim.clear();
Dimension d;
for (const_iterator it = begin(); it != end(); ++it) {
@ -423,34 +411,6 @@ int MathArray::dist(int x, int y) const
}
bool MathArray::contains(int x, int y) const
{
return xo_ <= x && x <= xo_ + width()
&& yo_ - ascent() <= y && y <= yo_ + descent();
}
void MathArray::center(int & x, int & y) const
{
x = xo_ + width() / 2;
y = yo_ + (descent() - ascent()) / 2;
}
void MathArray::towards(int & x, int & y) const
{
int cx = 0;
int cy = 0;
center(cx, cy);
double r = 1.0;
//int dist = (x - cx) * (x - cx) + (y - cy) * (y - cy);
x = cx + int(r * (x - cx));
y = cy + int(r * (y - cy));
}
void MathArray::setXY(int x, int y) const
{
xo_ = x;

View File

@ -119,8 +119,6 @@ public:
int xm() const { return xo_ + dim_.wid / 2; }
/// access to cached y coordinate of mid point of last drawing
int ym() const { return yo_ + (dim_.des - dim_.asc) / 2; }
///
bool contains(int x, int y) const;
/// write access to coordinate;
void setXY(int x, int y) const;
/// returns x coordinate of given position in the array
@ -147,12 +145,6 @@ public:
Dimension const & dim() const { return dim_; }
/// dimensions of cell
void setDim(Dimension const & d) const { dim_ = d; }
/// bounding box of this cell
void boundingBox(int & xlow, int & xhigh, int & ylow, int & yhigh);
/// gives center coordinates
void center(int & x, int & y) const;
/// adjust (x,y) to point on boundary on a straight line from the center
void towards(int & x, int & y) const;
private:
/// is this an exact match at this position?
@ -164,10 +156,6 @@ private:
mutable int xo_;
/// cached y coordinate of last drawing
mutable int yo_;
/// cached cleaness of cell
mutable bool clean_;
/// cached draw status of cell
mutable bool drawn_;
};
///

View File

@ -36,7 +36,6 @@
#include "math_macrotemplate.h"
#include "math_makeboxinset.h"
#include "math_oversetinset.h"
#include "math_parboxinset.h"
#include "math_parser.h"
#include "math_rootinset.h"
#include "math_sizeinset.h"
@ -255,8 +254,6 @@ MathAtom createMathInset(string const & s)
return MathAtom(new MathDotsInset(l));
// if (inset == "mbox")
// return MathAtom(new MathBoxInset(l->name));
// if (inset == "parbox")
// return MathAtom(new MathParboxInset);
// if (inset == "fbox")
// return MathAtom(new MathFboxInset(l));
if (inset == "style")

View File

@ -1,82 +0,0 @@
/**
* \file math_parboxinset.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author André Pönitz
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "math_parboxinset.h"
#include "math_data.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
#include "debug.h"
using std::string;
using std::auto_ptr;
using std::endl;
MathParboxInset::MathParboxInset()
: lyx_width_(0), tex_width_("0mm"), position_('c')
{
lyxerr << "constructing MathParboxInset" << endl;
}
auto_ptr<InsetBase> MathParboxInset::clone() const
{
return auto_ptr<InsetBase>(new MathParboxInset(*this));
}
void MathParboxInset::setPosition(string const & p)
{
position_ = p.size() > 0 ? p[0] : 'c';
}
void MathParboxInset::setWidth(string const & w)
{
tex_width_ = w;
lyx_width_ = LyXLength(w).inBP();
lyxerr << "setting " << w << " to " << lyx_width_ << " pixel" << endl;
}
void MathParboxInset::metrics(MetricsInfo & mi, Dimension & dim) const
{
FontSetChanger dummy1(mi.base, "textnormal");
WidthChanger dummy2(mi.base, lyx_width_);
MathTextInset::metrics(mi, dim);
metricsMarkers(dim);
dim_ = dim;
}
void MathParboxInset::draw(PainterInfo & pi, int x, int y) const
{
FontSetChanger dummy(pi.base, "textnormal");
MathTextInset::draw(pi, x + 1, y);
drawMarkers(pi, x, y);
}
void MathParboxInset::write(WriteStream & os) const
{
os << "\\parbox";
if (position_ != 'c')
os << '[' << position_ << ']';
os << '{' << tex_width_ << "}{" << cell(0) << '}';
}
void MathParboxInset::infoize(std::ostream & os) const
{
os << "Box: Parbox " << tex_width_;
}

View File

@ -1,51 +0,0 @@
// -*- C++ -*-
/**
* \file math_parboxinset.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author André Pönitz
*
* Full author contact details are available in file CREDITS.
*/
#ifndef MATH_PARBOXINSET_H
#define MATH_PARBOXINSET_H
#include "math_textinset.h"
// implements support for \parbox
class MathParboxInset : public MathTextInset {
public:
///
MathParboxInset();
///
MathParboxInset * asParboxInset() { return this; }
///
virtual std::auto_ptr<InsetBase> clone() const;
///
mode_type currentMode() const { return TEXT_MODE; }
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///
void draw(PainterInfo &, int x, int y) const;
///
void infoize(std::ostream & os) const;
///
void write(WriteStream & os) const;
///
void setWidth(std::string const & width);
///
void setPosition(std::string const & pos);
private:
/// width on screen
int lyx_width_;
/// width for TeX
std::string tex_width_;
/// one of htb
char position_;
};
#endif

View File

@ -50,7 +50,6 @@ following hack as starting point to write some macros:
#include "math_macro.h"
#include "math_macroarg.h"
#include "math_macrotemplate.h"
#include "math_parboxinset.h"
#include "math_parinset.h"
#include "math_rootinset.h"
#include "math_scriptinset.h"
@ -1169,18 +1168,6 @@ void Parser::parse1(MathGridInset & grid, unsigned flags,
return;
}
#if 0
else if (l->inset == "parbox") {
// read optional positioning and width
string pos = parse_verbatim_option();
string width = parse_verbatim_item();
cell->push_back(createMathInset(t.cs()));
parse(cell->back().nucleus()->cell(0), FLAG_ITEM, MathInset::TEXT_MODE);
cell->back().nucleus()->asParboxInset()->setPosition(pos);
cell->back().nucleus()->asParboxInset()->setWidth(width);
}
#endif
else {
MathAtom at = createMathInset(t.cs());
for (MathInset::idx_type i = 0; i < at->nargs(); ++i)

View File

@ -874,7 +874,6 @@ int paintPars(BufferView const & bv, Painter & pain,
return y;
}
} // namespace anon

View File

@ -1152,7 +1152,7 @@ InsetBase * LyXText::editXY(LCursor & cur, int x, int y) const
// try to descend into nested insets
InsetBase * inset = checkInsetHit(x, y);
lyxerr[Debug::DEBUG] << "inset " << inset << " hit at x: " << x << " y: " << y << endl;
lyxerr << "inset " << inset << " hit at x: " << x << " y: " << y << endl;
if (!inset)
return 0;

View File

@ -184,8 +184,8 @@ string const freefont2string()
}
//takes absolute x,y coordinates
InsetBase * LyXText::checkInsetHit(int x, int y) const
// takes absolute x,y coordinates
InsetBase * LyXText::checkInsetHit(int x, int y) const
{
par_type pit;
par_type end;
@ -202,7 +202,7 @@ InsetBase * LyXText::checkInsetHit(int x, int y) const
InsetList::const_iterator iend = pars_[pit].insetlist.end();
for (; iit != iend; ++iit) {
InsetBase * inset = iit->inset;
#if 0
#if 1
lyxerr << "examining inset " << inset
<< " xo: " << inset->xo() << "..." << inset->xo() + inset->width()
<< " yo: " << inset->yo() - inset->ascent() << "..."
@ -214,7 +214,7 @@ InsetBase * LyXText::checkInsetHit(int x, int y) const
}
}
}
//lyxerr << "No inset hit. " << endl;
lyxerr << "No inset hit. " << endl;
return 0;
}