new special-purpose inset for \not

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2527 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-08-16 12:34:48 +00:00
parent 2cbf623b37
commit b76821ddff
6 changed files with 77 additions and 2 deletions

View 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 \

View 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},

View File

@ -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, '/');
}

View File

@ -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

View File

@ -107,6 +107,8 @@ enum MathTokenEnum
///
LM_TK_MATH,
///
LM_TK_NOT,
///
LM_TK_STACK
};

View 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 << "] ";
}