]> git.lyx.org Git - features.git/commitdiff
remove unused mathed parts
authorAndré Pönitz <poenitz@gmx.net>
Fri, 13 Aug 2004 22:24:42 +0000 (22:24 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Fri, 13 Aug 2004 22:24:42 +0000 (22:24 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8915 a592a061-630c-0410-9148-cb99ea01b6c8

12 files changed:
src/insets/insetcollapsable.C
src/insets/insettabular.C
src/mathed/Makefile.am
src/mathed/math_data.C
src/mathed/math_data.h
src/mathed/math_factory.C
src/mathed/math_parboxinset.C [deleted file]
src/mathed/math_parboxinset.h [deleted file]
src/mathed/math_parser.C
src/rowpainter.C
src/text2.C
src/text3.C

index 7f7fb2b766f16511baa1c2b9bb4139021ca0ccac..31c4350b5334d64b742e18f423a74f80c61197e8 100644 (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:
index a0c75ba21bec3bb7464bb13827f451dd7572e431..f3e49bf25d514596999056981a00e5895020c889 100644 (file)
@@ -414,16 +414,22 @@ void InsetTabular::priv_dispatch(LCursor & cur, FuncRequest & cmd)
        switch (cmd.action) {
 
        case LFUN_MOUSE_PRESS:
-               // we'll pop up the table dialog on release
-               if (cmd.button() == mouse_button::button3)
+               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;
-               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;
+
+               // we'll pop up the table dialog on release
+               if (cmd.button() == mouse_button::button3)
+                       break;
                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;
index a89e9c12a65bf5720de1f69487acce01c61dea6b..524b91b37c4244d67c2fa9a2b6dfb3337a40d6d8 100644 (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 \
index b6480ee7c073fd1ae2ba8fe5b8c890a37c145351..e3422913756d3b61caa273e77de98eeaa09239c1 100644 (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;
index f9b58cc428ac7157ff1075187494f93a71fc1491..7e774d2850dadbe3a14e9071084b945aa839fd0a 100644 (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_;
 };
 
 ///
index 744f5aa34d1e1a4c57205bb87013c4e87874c4b1..039a7947a27365a68e43707f7fc5db5c482be9ed 100644 (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")
diff --git a/src/mathed/math_parboxinset.C b/src/mathed/math_parboxinset.C
deleted file mode 100644 (file)
index 176d349..0000000
+++ /dev/null
@@ -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_;
-}
diff --git a/src/mathed/math_parboxinset.h b/src/mathed/math_parboxinset.h
deleted file mode 100644 (file)
index 01b0af9..0000000
+++ /dev/null
@@ -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
index 087cd2c117753cdf9562dc2eb7cb7a2f4bf64f67..cd2bf6ba90d4feea1b1595637c27a651a2d5163f 100644 (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)
index 96c74c6f14fdd0af95e60e5c3706e886af6457ab..6bdae7a8131253d091002d9a0071ada0a9aee06f 100644 (file)
@@ -874,7 +874,6 @@ int paintPars(BufferView const & bv, Painter & pain,
        return y;
 }
 
-
 } // namespace anon
 
 
index d7a8733ba0b39a8907e95070a625562c92338efe..f87fbe2fb6db2b552607c01f4686222df67221fd 100644 (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;
 
index fd6d9b298e7e0f97c6b4c8c10ad72cb7f8be56b9..a185e9d0a67d84157407040fdbcab6dedf18ca7e 100644 (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;
 }