]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_inset.C
fix typo that put too many include paths for most people
[lyx.git] / src / mathed / math_inset.C
index 0620aefdbda638ba4f1cdf729664a63441f4e697..87af584c5c28098d9a54a4348547f4a58a332f91 100644 (file)
@@ -1,9 +1,9 @@
 /*
  *  File:        math_inset.C
  *  Purpose:     Implementation of insets for mathed
- *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx> 
+ *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
  *  Created:     January 1996
- *  Description: 
+ *  Description:
  *
  *  Dependencies: Xlib, XForms
  *
 #pragma implementation
 #endif
 
+#include <config.h>
+
+#include "Lsstream.h"
 #include "math_inset.h"
 #include "math_scriptinset.h"
+#include "math_mathmlstream.h"
 #include "debug.h"
 
 
-int MathInset::workwidth;
-
-
-MathInset::MathInset()
-       : xo_(0), yo_(0)
-{}
-
-
-MathInset::~MathInset()
-{}
+using std::ostream;
+using std::vector;
 
 
 int MathInset::height() const
@@ -42,44 +38,14 @@ int MathInset::height() const
 }
 
 
-MathStyles MathInset::size() const
-{
-       return size_.size;
-}
-
-
-std::ostream & operator<<(std::ostream & os, MathInset const & inset)
+ostream & operator<<(ostream & os, MathInset const & inset)
 {
-       MathWriteInfo wi(0, os, false);
+       WriteStream wi(os, false, false);
        inset.write(wi);
        return os;
 }
 
 
-int MathInset::xo() const
-{
-       return xo_;
-}
-
-
-int MathInset::yo() const
-{
-       return yo_;
-}
-
-
-void MathInset::xo(int x) const
-{
-       xo_ = x;
-}
-
-
-void MathInset::yo(int y) const
-{
-       yo_ = y;
-}
-
-
 MathInset::size_type MathInset::nargs() const
 {
        return 0;
@@ -90,32 +56,41 @@ MathXArray dummyCell;
 
 MathXArray & MathInset::xcell(idx_type)
 {
-       lyxerr << "I don't have a cell\n";
+       lyxerr << "I don't have a cell 1\n";
        return dummyCell;
 }
 
 
 MathXArray const & MathInset::xcell(idx_type) const
 {
-       lyxerr << "I don't have a cell\n";
+       lyxerr << "I don't have a cell 2\n";
        return dummyCell;
 }
 
 
 MathArray & MathInset::cell(idx_type)
 {
-       lyxerr << "I don't have a cell\n";
+       lyxerr << "I don't have a cell 3\n";
        return dummyCell.data_;
 }
 
 
 MathArray const & MathInset::cell(idx_type) const
 {
-       lyxerr << "I don't have a cell\n";
+       lyxerr << "I don't have a cell 4\n";
        return dummyCell.data_;
 }
 
 
+MathInset::idx_type MathInset::index(row_type row, col_type col) const
+{
+       if (row != 0)
+               lyxerr << "illegal row: " << row << "\n";
+       if (col != 0)
+               lyxerr << "illegal col: " << col << "\n";
+       return 0;
+}
+
 void MathInset::substitute(MathMacro const &)
 {}
 
@@ -144,13 +119,7 @@ bool MathInset::idxLeft(idx_type &, pos_type &) const
 }
 
 
-bool MathInset::idxUp(idx_type &, pos_type &) const
-{
-       return false;
-}
-
-
-bool MathInset::idxDown(idx_type &, pos_type &) const
+bool MathInset::idxUpDown(idx_type &, bool) const
 {
        return false;
 }
@@ -180,104 +149,85 @@ bool MathInset::idxEnd(idx_type &, pos_type &) const
 }
 
 
-void MathInset::idxDelete(idx_type &, bool & popit, bool & deleteit)
+void MathInset::normalize(NormalStream & os) const
 {
-       popit    = false;
-       deleteit = false;
+       os << "[unknown ";
+       WriteStream wi(os.os(), false, true);
+       write(wi);
+       os << "] ";
 }
 
 
-void MathInset::idxDeleteRange(idx_type, idx_type)
-{}
-
-
-void MathInset::getXY(int & x, int & y) const
+void MathInset::dump() const
 {
-   x = xo();
-   y = yo();
+       lyxerr << "---------------------------------------------\n";
+       WriteStream wi(lyxerr, false, true);
+       write(wi);
+       lyxerr << "\n---------------------------------------------\n";
 }
 
 
-/*
-void MathInset::userSetSize(MathStyles sz)
-{
-       if (sz >= 0) {
-               size_ = sz;      
-               flag = flag & ~LMPF_FIXED_SIZE;
-       }
-}
-*/
+void MathInset::validate(LaTeXFeatures &) const
+{}
+
 
-void MathInset::writeNormal(std::ostream & os) const
+vector<MathInset::idx_type>
+       MathInset::idxBetween(idx_type from, idx_type to) const
 {
-       os << "[unknown ";
-       MathWriteInfo wi(0, os, false);
-       write(wi);
-       os << "] ";
+       vector<idx_type> res;
+       for (idx_type i = from; i <= to; ++i)
+               res.push_back(i);
+       return res;
 }
 
 
-void MathInset::dump() const
+void MathInset::metrics(MathMetricsInfo const &) const
 {
-       lyxerr << "---------------------------------------------\n";
-       MathWriteInfo wi(0, lyxerr, false);
-       write(wi);
-       lyxerr << "\n---------------------------------------------\n";
+       lyxerr << "MathInset::metrics() called directly!\n";
 }
 
 
-void MathInset::push_back(unsigned char, MathTextCodes)
+void MathInset::draw(Painter &, int, int) const
 {
-       lyxerr << "can't push without a cell\n";
+       lyxerr << "MathInset::draw() called directly!\n";
 }
 
 
-void MathInset::push_back(MathInset *)
+void MathInset::metricsT(TextMetricsInfo const &) const
 {
-       lyxerr << "can't push without a cell\n";
+       lyxerr << "MathInset::metricsT(Text) called directly!\n";
 }
 
 
-bool MathInset::covers(int x, int y) const
+void MathInset::drawT(TextPainter &, int, int) const
 {
-       //lyxerr << "cover? p: " << this << " x: " << x << " y: " <<  y
-       //      << " xo_: " << xo_ << " yo_: " << yo_  << endl;
-       return
-               x >= xo_ &&
-               x <= xo_ + width() &&
-               y >= yo_ - ascent() &&
-               y <= yo_ + descent();
+       lyxerr << "MathInset::drawT(Text) called directly!\n";
 }
 
 
-void MathInset::validate(LaTeXFeatures &) const
-{}
-
 
-std::vector<MathInset::idx_type>
-       MathInset::idxBetween(idx_type from, idx_type to) const
+void MathInset::write(WriteStream &) const
 {
-       std::vector<idx_type> res;
-       for (idx_type i = from; i <= to; ++i)
-               res.push_back(i);
-       return res;
+       lyxerr << "MathInset::write() called directly!\n";
 }
 
 
-void MathInset::metrics(MathMetricsInfo const & st) const
+void MathInset::octavize(OctaveStream & os) const
 {
-       lyxerr << "MathInset::metrics() called directly!\n";
-       size_ = st;
+       NormalStream ns(os.os());
+       normalize(ns);
 }
 
 
-void MathInset::draw(Painter &, int, int) const
+void MathInset::maplize(MapleStream & os) const
 {
-       lyxerr << "MathInset::draw() called directly!\n";
+       NormalStream ns(os.os());
+       normalize(ns);
 }
 
 
-void MathInset::write(MathWriteInfo &) const
+void MathInset::mathmlize(MathMLStream & os) const
 {
-       lyxerr << "MathInset::write() called directly!\n";
+       NormalStream ns(os.os());
+       normalize(ns);
 }