]> git.lyx.org Git - features.git/commitdiff
Lost files
authorAndré Pönitz <poenitz@gmx.net>
Tue, 7 Aug 2001 04:47:00 +0000 (04:47 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 7 Aug 2001 04:47:00 +0000 (04:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2431 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_bigopinset.C [new file with mode: 0644]
src/mathed/math_bigopinset.h [new file with mode: 0644]

diff --git a/src/mathed/math_bigopinset.C b/src/mathed/math_bigopinset.C
new file mode 100644 (file)
index 0000000..232e0d4
--- /dev/null
@@ -0,0 +1,54 @@
+#include "math_bigopinset.h"
+#include "mathed/math_parser.h"
+#include "support/LOstream.h"
+
+
+using std::ostream;
+
+MathBigopInset::MathBigopInset(const latexkeys * l)
+       : sym_(l)
+{}
+
+
+MathInset * MathBigopInset::clone() const
+{
+       return new MathBigopInset(*this);
+}
+
+
+void MathBigopInset::write(ostream & os, bool /* fragile */) const
+{
+       os << '\\' << sym_->name << ' ';
+}
+
+
+void MathBigopInset::writeNormal(ostream & os) const
+{
+       os << "[bigop " << sym_->name << "] ";
+}
+
+
+void MathBigopInset::metrics(MathStyles st) const
+{
+       size_ = st;
+       
+       if (sym_->id > 0 && sym_->id < 256) {
+               ssym_ = string();
+               ssym_ += sym_->id;
+               code_ = (sym_->token == LM_TK_BIGSYM) ? LM_TC_BSYM : LM_TC_SYMB;
+       } else {
+               ssym_ = sym_->name;
+               code_ = LM_TC_TEXTRM;
+       }
+
+       mathed_string_dim(code_, size(), ssym_, ascent_, descent_, width_);
+}
+
+
+void MathBigopInset::draw(Painter & pain, int x, int y) const
+{  
+       xo(x);
+       yo(y);
+
+       drawStr(pain, code_, size_, x, y, ssym_);
+}
diff --git a/src/mathed/math_bigopinset.h b/src/mathed/math_bigopinset.h
new file mode 100644 (file)
index 0000000..660ccfe
--- /dev/null
@@ -0,0 +1,36 @@
+// -*- C++ -*-
+#ifndef MATH_BIGOPINSET_H
+#define MATH_BIGOPINSET_H
+
+// This inset is for things like "\sum" and "\int" that get displayed
+// larger in displayed formulae and take limits
+
+#include "math_diminset.h"
+
+struct latexkeys;
+
+/// big operators
+class MathBigopInset : public MathDimInset {
+public:
+       ///
+       explicit MathBigopInset(latexkeys const *);
+       ///
+       MathInset * clone() const;
+       ///
+       void write(std::ostream &, bool fragile) const;
+       ///
+       void writeNormal(std::ostream &) const;
+       ///
+       void metrics(MathStyles st) const;
+       ///
+       void draw(Painter &, int x, int y) const;
+       ///
+       bool isScriptable() const { return true; }
+
+private:
+       ///
+       latexkeys const * sym_;
+       ///
+       mutable string ssym_;
+};
+#endif