mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
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:
parent
2cbf623b37
commit
b76821ddff
@ -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 \
|
||||
|
@ -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},
|
||||
|
45
src/mathed/math_notinset.C
Normal file
45
src/mathed/math_notinset.C
Normal 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, '/');
|
||||
}
|
26
src/mathed/math_notinset.h
Normal file
26
src/mathed/math_notinset.h
Normal 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
|
@ -107,6 +107,8 @@ enum MathTokenEnum
|
||||
///
|
||||
LM_TK_MATH,
|
||||
///
|
||||
LM_TK_NOT,
|
||||
///
|
||||
LM_TK_STACK
|
||||
};
|
||||
|
||||
|
@ -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 << "] ";
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user