]> git.lyx.org Git - features.git/commitdiff
new special-purpose inset for \not
authorAndré Pönitz <poenitz@gmx.net>
Thu, 16 Aug 2001 12:34:48 +0000 (12:34 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 16 Aug 2001 12:34:48 +0000 (12:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2527 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/Makefile.am
src/mathed/math_hash.C
src/mathed/math_notinset.C [new file with mode: 0644]
src/mathed/math_notinset.h [new file with mode: 0644]
src/mathed/math_parser.h
src/mathed/math_symbolinset.C

index 2fa5c1e570ac5ae143c9dd50731467846445df38..55e1e8d9464be882a9d1b8e3f73a4268294c1aa6 100644 (file)
@@ -66,6 +66,8 @@ libmathed_la_SOURCES = \
        math_matrixinset.h \
        math_nestinset.C \
        math_nestinset.h \
+       math_notinset.C \
+       math_notinset.h \
        math_noglyphinset.C \
        math_noglyphinset.h \
        math_parser.C \
index 3fe5ca23ab4b5b39815a7c0f2a29ccd7bbbde704..1b6fb33b3d3f1fa0c36a00bc18ff3e27889fe2fd 100644 (file)
@@ -200,7 +200,7 @@ latexkeys wordlist[] =
        {"ni",  LM_TK_NOGLYPH, 0, LMB_RELATION},
        {"nolimits",  LM_TK_LIMIT, static_cast<unsigned>(-1), LMB_NONE},
        {"nonumber",  LM_TK_NONUM, 0, LMB_NONE},
-       {"not",  LM_TK_DECORATION, LM_not, LMB_NONE},
+       {"not",  LM_TK_NOT, LM_not, LMB_NONE},
        {"nu",  LM_TK_SYM, LM_nu, LMB_NONE},
        {"nwarrow",  LM_TK_NOGLYPH, 0, LMB_NONE},
        {"odot",  LM_TK_NOGLYPH, 0, LMB_OPERATOR},
diff --git a/src/mathed/math_notinset.C b/src/mathed/math_notinset.C
new file mode 100644 (file)
index 0000000..5b72fc8
--- /dev/null
@@ -0,0 +1,45 @@
+#include "math_notinset.h"
+#include "math_parser.h"
+#include "support.h"
+#include "support/LOstream.h"
+
+
+using std::ostream;
+
+MathNotInset::MathNotInset()
+{}
+
+
+MathInset * MathNotInset::clone() const
+{
+       return new MathNotInset(*this);
+}
+
+
+void MathNotInset::write(ostream & os, bool /* fragile */) const
+{
+       os << "\\not ";
+}
+
+
+void MathNotInset::writeNormal(ostream & os) const
+{
+       os << "[not] ";
+}
+
+
+void MathNotInset::metrics(MathStyles st) const
+{
+       size(st);
+       mathed_char_dim(LM_TC_VAR, size_, '/', ascent_, descent_, width_);
+       width_ = 1;
+}
+
+
+void MathNotInset::draw(Painter & pain, int x, int y) const
+{  
+       xo(x);
+       yo(y);
+
+       drawChar(pain, LM_TC_VAR, size_, x + 4, y, '/');
+}
diff --git a/src/mathed/math_notinset.h b/src/mathed/math_notinset.h
new file mode 100644 (file)
index 0000000..917e5bb
--- /dev/null
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+#ifndef MATH_NOTINSET_H
+#define MATH_NOTINSET_H
+
+#include "math_diminset.h"
+
+struct latexkeys;
+
+// \\not
+
+class MathNotInset : public MathDimInset {
+public:
+       ///
+       MathNotInset();
+       ///
+       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;
+};
+#endif
index fa5e770f8af261f27231d72b9cdf7365900315ee..d93ec5d2b6b0d10c1e374d7e4811decb718ad068 100644 (file)
@@ -107,6 +107,8 @@ enum MathTokenEnum
        ///
        LM_TK_MATH,
        ///
+       LM_TK_NOT,
+       ///
        LM_TK_STACK
 };
 
index 1ca489bd5b5f954c53ed405ca561da1302957a59..6a1648ea17dc771390a49a952fb90e2109eab420 100644 (file)
@@ -25,7 +25,7 @@ void MathSymbolInset::write(ostream & os, bool /* fragile */) const
 
 void MathSymbolInset::writeNormal(ostream & os) const
 {
-       os << "[bigop " << sym_->name << "] ";
+       os << "[" << sym_->name << "] ";
 }