case LFUN_MATH_MACRO:
case LFUN_MATH_SUBSCRIPT:
case LFUN_MATH_SUPERSCRIPT:
- code = MATH_CODE;
+ code = MATH_HULL_CODE;
break;
case LFUN_INSET_MODIFY:
InsetName("flex", FLEX_CODE),
InsetName("space", SPACE_CODE),
InsetName("vspace", VSPACE_CODE),
- InsetName("mathmacroarg", MATHMACROARG_CODE),
+ InsetName("mathmacroarg", MATH_MACROARG_CODE),
InsetName("listings", LISTINGS_CODE),
InsetName("info", INFO_CODE),
InsetName("collapsable", COLLAPSABLE_CODE),
InsetName("newpage", NEWPAGE_CODE),
- InsetName("tablecell", CELL_CODE)
+ InsetName("tablecell", CELL_CODE),
+ InsetName("mathamsarray", MATH_AMSARRAY_CODE),
+ InsetName("matharray", MATH_ARRAY_CODE),
+ InsetName("mathbig", MATH_BIG_CODE),
+ InsetName("mathboldsymbol", MATH_BOLDSYMBOL_CODE),
+ InsetName("mathbox", MATH_BOX_CODE),
+ InsetName("mathbrace", MATH_BRACE_CODE),
+ InsetName("mathcases", MATH_CASES_CODE),
+ InsetName("mathchar", MATH_CHAR_CODE),
+ InsetName("mathcolor", MATH_COLOR_CODE),
+ InsetName("mathcomment", MATH_COMMENT_CODE),
+ InsetName("mathdecoration", MATH_DECORATION_CODE),
+ InsetName("mathdelim", MATH_DELIM_CODE),
+ InsetName("mathdiff", MATH_DIFF_CODE),
+ InsetName("mathdots", MATH_DOTS_CODE),
+ InsetName("mathensuremath", MATH_ENSUREMATH_CODE),
+ InsetName("mathenv", MATH_ENV_CODE),
+ InsetName("mathexfunc", MATH_EXFUNC_CODE),
+ InsetName("mathexint", MATH_EXINT_CODE),
+ InsetName("mathfont", MATH_FONT_CODE),
+ InsetName("mathfontold", MATH_FONTOLD_CODE),
+ InsetName("mathfrac", MATH_FRAC_CODE),
+ InsetName("mathgrid", MATH_GRID_CODE),
+ InsetName("math", MATH_CODE),
+ InsetName("mathhull", MATH_HULL_CODE),
+ InsetName("mathkern", MATH_KERN_CODE),
+ InsetName("mathlefteqn", MATH_LEFTEQN_CODE),
+ InsetName("mathlim", MATH_LIM_CODE),
+ InsetName("mathmatrix", MATH_MATRIX_CODE),
+ InsetName("mathmbox", MATH_MBOX_CODE),
+ InsetName("mathnest", MATH_NEST_CODE),
+ InsetName("mathnumber", MATH_NUMBER_CODE),
+ InsetName("mathoverset", MATH_OVERSET_CODE),
+ InsetName("mathpar", MATH_PAR_CODE),
+ InsetName("mathphantom", MATH_PHANTOM_CODE),
+ InsetName("mathref", MATH_REF_CODE),
+ InsetName("mathroot", MATH_ROOT_CODE),
+ InsetName("mathscript", MATH_SCRIPT_CODE),
+ InsetName("mathsize", MATH_SIZE_CODE),
+ InsetName("mathspace", MATH_SPACE_CODE),
+ InsetName("mathspecialchar", MATH_SPECIALCHAR_CODE),
+ InsetName("mathsplit", MATH_SPLIT_CODE),
+ InsetName("mathsqrt", MATH_SQRT_CODE),
+ InsetName("mathstackrel", MATH_STACKREL_CODE),
+ InsetName("mathstring", MATH_STRING_CODE),
+ InsetName("mathsubstack", MATH_SUBSTACK_CODE),
+ InsetName("mathsymbol", MATH_SYMBOL_CODE),
+ InsetName("mathtabular", MATH_TABULAR_CODE),
+ InsetName("mathunderset", MATH_UNDERSET_CODE),
+ InsetName("mathunknown", MATH_UNKNOWN_CODE),
+ InsetName("mathxarrow", MATH_XARROW_CODE),
+ InsetName("mathxyarrow", MATH_XYARROW_CODE),
+ InsetName("mathxymatrix", MATH_XYMATRIX_CODE),
+ InsetName("mathmacro", MATH_MACRO_CODE),
};
size_t const insetnames_size =
{
if (!buffer_) {
odocstringstream s;
- lyxerr << "LyX Code: " << lyxCode() << " name: " << name() << std::endl;
+ lyxerr << "LyX Code: " << lyxCode() << " name: " << insetName(lyxCode()) << std::endl;
s << "LyX Code: " << lyxCode() << " name: " << name();
LASSERT(false, /**/);
throw ExceptionMessage(BufferException,
void Inset::dispatch(Cursor & cur, FuncRequest & cmd)
{
- LASSERT(cur.buffer() == buffer_, return);
+ LASSERT(cur.buffer() == &buffer(), return);
cur.updateFlags(Update::Force | Update::FitCursor);
cur.dispatched();
doDispatch(cur, cmd);
///
VSPACE_CODE,
///
- MATHMACROARG_CODE, // 40
+ MATH_MACROARG_CODE, // 40
///
NOMENCL_CODE,
///
COLLAPSABLE_CODE,
///
PHANTOM_CODE,
+ ///
+ MATH_AMSARRAY_CODE,
+ ///
+ MATH_ARRAY_CODE,
+ ///
+ MATH_BIG_CODE, // 50
+ ///
+ MATH_BOLDSYMBOL_CODE,
+ ///
+ MATH_BOX_CODE,
+ ///
+ MATH_BRACE_CODE,
+ ///
+ MATH_CASES_CODE,
+ ///
+ MATH_CHAR_CODE, // 55
+ ///
+ MATH_COLOR_CODE,
+ ///
+ MATH_COMMENT_CODE,
+ ///
+ MATH_DECORATION_CODE,
+ ///
+ MATH_DELIM_CODE,
+ ///
+ MATH_DIFF_CODE, // 60
+ ///
+ MATH_DOTS_CODE,
+ ///
+ MATH_ENSUREMATH_CODE,
+ ///
+ MATH_ENV_CODE,
+ ///
+ MATH_EXFUNC_CODE,
+ ///
+ MATH_EXINT_CODE, // 65
+ ///
+ MATH_FONT_CODE,
+ ///
+ MATH_FONTOLD_CODE,
+ ///
+ MATH_FRAC_CODE,
+ ///
+ MATH_GRID_CODE,
+ ///
+ MATH_HULL_CODE, // 70
+ ///
+ MATH_KERN_CODE,
+ ///
+ MATH_LEFTEQN_CODE,
+ ///
+ MATH_LIM_CODE,
+ ///
+ MATH_MATRIX_CODE,
+ ///
+ MATH_MBOX_CODE, // 75
+ ///
+ MATH_NEST_CODE,
+ ///
+ MATH_NUMBER_CODE,
+ ///
+ MATH_OVERSET_CODE,
+ ///
+ MATH_PAR_CODE,
+ ///
+ MATH_PHANTOM_CODE, // 80
+ ///
+ MATH_REF_CODE,
+ ///
+ MATH_ROOT_CODE,
+ ///
+ MATH_SCRIPT_CODE,
+ ///
+ MATH_SIZE_CODE,
+ ///
+ MATH_SPACE_CODE, // 85
+ ///
+ MATH_SPECIALCHAR_CODE,
+ ///
+ MATH_SPLIT_CODE,
+ ///
+ MATH_SQRT_CODE,
+ ///
+ MATH_STACKREL_CODE,
+ ///
+ MATH_STRING_CODE,// 90
+ ///
+ MATH_SUBSTACK_CODE,
+ ///
+ MATH_SYMBOL_CODE,
+ ///
+ MATH_TABULAR_CODE,
+ ///
+ MATH_UNDERSET_CODE,
+ ///
+ MATH_UNKNOWN_CODE, // 95
+ ///
+ MATH_XARROW_CODE,
+ ///
+ MATH_XYARROW_CODE,
+ ///
+ MATH_XYMATRIX_CODE,
+ ///
+ MATH_MACRO_CODE,
};
} // namespace lyx
int docbook(odocstream &, OutputParams const &) const;
///
- InsetCode lyxCode() const { return MATHMACRO_CODE; }
+ InsetCode lyxCode() const { return MATHMACRO_CODE_CODE; }
///
docstring const & getInsetName() const { return name_; }
///
bool editable() const { return true; }
+ ///
+ InsetCode lyxCode() const { return MATH_FORMULA_MACRO_CODE; }
private:
///
MathAtom & tmpl() const;
/// superscript kerning
virtual int kerning(BufferView const *) const { return 0; }
+ ///
+ InsetCode lyxCode() const { return MATH_CODE; }
};
///
void normalize(NormalStream &) const;
///
void validate(LaTeXFeatures & features) const;
+ ///
+ InsetCode lyxCode() const { return MATH_AMSARRAY_CODE; }
private:
virtual Inset * clone() const;
///
void maple(MapleStream & os) const;
///
void validate(LaTeXFeatures & features) const;
+ ///
+ InsetCode lyxCode() const { return MATH_ARRAY_CODE; }
private:
virtual Inset * clone() const;
///
void infoize2(odocstream & os) const;
///
static bool isBigInsetDelim(docstring const &);
-
+ ///
+ InsetCode lyxCode() const { return MATH_BIG_CODE; }
private:
virtual Inset * clone() const;
///
///
void infoize(odocstream & os) const;
///
+ InsetCode lyxCode() const { return MATH_BOLDSYMBOL_CODE; }
+ ///
Kind kind_;
private:
virtual Inset * clone() const;
void infoize(odocstream & os) const;
///
void validate(LaTeXFeatures & features) const;
+ ///
+ InsetCode lyxCode() const { return MATH_BOX_CODE; }
private:
Inset * clone() const { return new InsetMathBox(*this); }
void mathmlize(MathStream &) const;
///
void infoize(odocstream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_BRACE_CODE; }
private:
virtual Inset * clone() const;
};
void write(WriteStream & os) const;
///
void validate(LaTeXFeatures & features) const;
+ ///
+ InsetCode lyxCode() const { return MATH_CASES_CODE; }
private:
virtual Inset * clone() const;
};
char_type getChar() const { return char_; }
///
bool isRelOp() const;
+ ///
+ InsetCode lyxCode() const { return MATH_CHAR_CODE; }
private:
virtual Inset * clone() const;
void normalize(NormalStream & ns) const;
///
void infoize(odocstream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_COLOR_CODE; }
private:
virtual Inset * clone() const;
/// width of '[' in current font
void mathmlize(MathStream &) const;
///
void infoize(odocstream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_COMMENT_CODE; }
private:
virtual Inset * clone() const;
};
bool isScriptable() const;
///
void validate(LaTeXFeatures & features) const;
+ ///
+ InsetCode lyxCode() const { return MATH_DECORATION_CODE; }
private:
virtual Inset * clone() const;
///
void octave(OctaveStream &) const;
///
+ InsetCode lyxCode() const { return MATH_DELIM_CODE; }
+ ///
docstring left_;
///
docstring right_;
void maxima(MaximaStream &) const;
///
void write(WriteStream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_DIFF_CODE; }
private:
virtual Inset * clone() const;
};
docstring name() const;
/// request "external features"
void validate(LaTeXFeatures & features) const;
+ ///
+ InsetCode lyxCode() const { return MATH_DOTS_CODE; }
protected:
/// cache for the thing's height
mutable int dh_;
void write(WriteStream & os) const;
///
void infoize(odocstream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_ENSUREMATH_CODE; }
private:
virtual Inset * clone() const;
};
void metrics(MetricsInfo & mi, Dimension & dim) const;
///
void infoize(odocstream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_ENV_CODE; }
private:
virtual Inset * clone() const;
void mathmlize(MathStream &) const;
///
void octave(OctaveStream &) const;
+ ///
+ InsetCode lyxCode() const { return MATH_EXFUNC_CODE; }
private:
virtual Inset * clone() const;
void mathmlize(MathStream &) const;
///
void write(WriteStream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_EXINT_CODE; }
private:
virtual Inset * clone() const;
///
void infoize(odocstream & os) const;
///
int kerning(BufferView const * bv) const { return cell(0).kerning(bv); }
+ ///
+ InsetCode lyxCode() const { return MATH_FONT_CODE; }
private:
virtual Inset * clone() const;
void infoize(odocstream & os) const;
///
int kerning(BufferView const * bv) const { return cell(0).kerning(bv); }
+ ///
+ InsetCode lyxCode() const { return MATH_FONTOLD_CODE; }
private:
virtual Inset * clone() const;
void mathmlize(MathStream &) const;
///
void validate(LaTeXFeatures & features) const;
+ ///
+ InsetCode lyxCode() const { return MATH_FRAC_CODE; }
private:
Inset * clone() const;
///
std::vector<ColInfo> colinfo_;
/// cell info
std::vector<CellInfo> cellinfo_;
+ ///
+ InsetCode lyxCode() const { return MATH_GRID_CODE; }
+
private:
///
char v_align_; // add approp. type
}
-InsetCode InsetMathHull::lyxCode() const
-{
- return MATH_CODE;
-}
-
-
/////////////////////////////////////////////////////////////////////
///
virtual docstring contextMenu(BufferView const &, int, int) const;
+ ///
+ InsetCode lyxCode() const { return MATH_HULL_CODE; }
protected:
InsetMathHull(InsetMathHull const &);
Inset * editXY(Cursor & cur, int x, int y);
///
DisplayType display() const;
- ///
- InsetCode lyxCode() const;
protected:
///
void write(WriteStream & os) const;
///
void normalize(NormalStream & ns) const;
+ ///
+ InsetCode lyxCode() const { return MATH_KERN_CODE; }
+
private:
virtual Inset * clone() const;
/// width in em
void draw(PainterInfo & pi, int x, int y) const;
///
void infoize(odocstream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_LEFTEQN_CODE; }
+
private:
virtual Inset * clone() const;
};
void mathmlize(MathStream &) const;
///
void write(WriteStream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_LIM_CODE; }
+
private:
virtual Inset * clone() const;
};
///
void cursorPos(BufferView const & bv, CursorSlice const & sl,
bool boundary, int & x, int & y) const;
+ ///
+ InsetCode lyxCode() const { return MATH_MBOX_CODE; }
+
protected:
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
void mathmlize(MathStream &) const;
///
void octave(OctaveStream &) const;
+ ///
+ InsetCode lyxCode() const { return MATH_MATRIX_CODE; }
+
private:
virtual Inset * clone() const;
};
bool insertCompletion(Cursor & cur, docstring const & s, bool finished);
///
void completionPosAndDim(Cursor const &, int & x, int & y, Dimension & dim) const;
+ ///
+ InsetCode lyxCode() const { return MATH_NEST_CODE; }
protected:
///
void mathmlize(MathStream &) const;
///
void write(WriteStream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_NUMBER_CODE; }
private:
virtual Inset * clone() const;
void normalize(NormalStream &) const;
///
void validate(LaTeXFeatures & features) const;
+ ///
+ InsetCode lyxCode() const { return MATH_OVERSET_CODE; }
+
private:
virtual Inset * clone() const;
};
void infoize(odocstream & os) const;
///
void write(WriteStream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_PAR_CODE; }
+
private:
///
virtual Inset * clone() const;
void normalize(NormalStream & ns) const;
///
void infoize(odocstream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_PHANTOM_CODE; }
+
private:
///
virtual Inset * clone() const;
static int getType(docstring const & name);
///
static docstring const & getName(int type);
+ ///
+ InsetCode lyxCode() const { return MATH_REF_CODE; }
+
protected:
///
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
void mathematica(MathematicaStream &) const;
///
void octave(OctaveStream &) const;
+ ///
+ InsetCode lyxCode() const { return MATH_ROOT_CODE; }
+
private:
virtual Inset * clone() const;
};
void infoize(odocstream & os) const;
/// say whether we have displayed limits
void infoize2(odocstream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_SCRIPT_CODE; }
+
protected:
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
private:
void normalize(NormalStream &) const;
///
void infoize(odocstream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_SIZE_CODE; }
+
private:
virtual Inset * clone() const;
///
docstring contextMenu(BufferView const &, int, int) const;
///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
+ ///
+ InsetCode lyxCode() const { return MATH_SPACE_CODE; }
+
protected:
///
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
docstring name() const { return name_; }
///
char_type getChar() const { return char_; }
+ ///
+ InsetCode lyxCode() const { return MATH_SPECIALCHAR_CODE; }
private:
virtual Inset * clone() const;
int defaultColSpace(col_type) { return 0; }
///
char defaultColAlign(col_type);
+ ///
+ InsetCode lyxCode() const { return MATH_SPLIT_CODE; }
+
private:
///
virtual Inset * clone() const;
void octave(OctaveStream &) const;
///
void mathmlize(MathStream &) const;
+ ///
+ InsetCode lyxCode() const { return MATH_SQRT_CODE; }
+
private:
virtual Inset * clone() const;
};
void write(WriteStream & os) const;
///
void normalize(NormalStream &) const;
+ ///
+ InsetCode lyxCode() const { return MATH_STACKREL_CODE; }
+
private:
virtual Inset * clone() const;
};
void mathmlize(MathStream &) const;
///
void write(WriteStream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_STRING_CODE; }
private:
virtual Inset * clone() const;
void maple(MapleStream &) const;
///
void validate(LaTeXFeatures & features) const;
+ ///
+ InsetCode lyxCode() const { return MATH_SUBSTACK_CODE; }
+
private:
virtual Inset * clone() const;
};
void write(WriteStream & os) const;
///
void infoize2(odocstream & os) const;
+ ///
+ InsetCode lyxCode() const { return MATH_SYMBOL_CODE; }
private:
virtual Inset * clone() const;
void normalize(NormalStream &) const;
///
void maple(MapleStream &) const;
+ ///
+ InsetCode lyxCode() const { return MATH_TABULAR_CODE; }
private:
Inset * clone() const;
void normalize(NormalStream & ns) const;
///
void validate(LaTeXFeatures & features) const;
+ ///
+ InsetCode lyxCode() const { return MATH_UNDERSET_CODE; }
+
private:
virtual Inset * clone() const;
};
bool final() const;
///
int kerning(BufferView const *) const { return kerning_; }
+ ///
+ InsetCode lyxCode() const { return MATH_UNKNOWN_CODE; }
private:
///
void normalize(NormalStream & os) const;
///
void validate(LaTeXFeatures & features) const;
+ ///
+ InsetCode lyxCode() const { return MATH_XARROW_CODE; }
private:
virtual Inset * clone() const;
void write(WriteStream & os) const;
///
void normalize(NormalStream &) const;
-
-public:
///
InsetMathXYMatrix const * targetMatrix() const;
///
MathData const & targetCell() const;
///
MathData const & sourceCell() const;
+ ///
+ InsetCode lyxCode() const { return MATH_XYARROW_CODE; }
///
bool up_;
void maple(MapleStream &) const;
///
void validate(LaTeXFeatures & features) const;
+ ///
+ InsetCode lyxCode() const { return MATH_XYMATRIX_CODE; }
+
private:
///
virtual Inset * clone() const;
for (DocIterator it = doc_iterator_begin(buffer, &inset); it; it.forwardChar()) {
if (!it.nextInset())
continue;
- if (it.nextInset()->lyxCode() != MATHMACROARG_CODE)
+ if (it.nextInset()->lyxCode() != MATH_MACROARG_CODE)
continue;
//it.cell().erase(it.pos());
//it.cell().insert(it.pos(), it.nextInset()->asInsetMath()
}
/// Return the maximal number of arguments the macro is greedy for.
size_t appetite() const { return appetite_; }
+ ///
+ InsetCode lyxCode() const { return MATH_MACRO_CODE; }
protected:
friend class MathData;
///
void setNumber(int n);
///
- InsetCode lyxCode() const { return MATHMACROARG_CODE; }
+ InsetCode lyxCode() const { return MATH_MACROARG_CODE; }
///
void normalize(NormalStream &) const;
for (DocIterator it = doc_iterator_begin(&buffer(), this); it; it.forwardChar()) {
if (!it.nextInset())
continue;
- if (it.nextInset()->lyxCode() != MATHMACROARG_CODE)
+ if (it.nextInset()->lyxCode() != MATH_MACROARG_CODE)
continue;
MathMacroArgument * arg = static_cast<MathMacroArgument*>(it.nextInset());
int n = arg->number() - 1;
for (DocIterator it = doc_iterator_begin(&buffer(), this); it; it.forwardChar()) {
if (!it.nextInset())
continue;
- if (it.nextInset()->lyxCode() != MATHMACROARG_CODE)
+ if (it.nextInset()->lyxCode() != MATH_MACROARG_CODE)
continue;
MathMacroArgument * arg = static_cast<MathMacroArgument*>(it.nextInset());
if (arg->number() >= int(from) + 1)
for (; it; it.forwardChar()) {
if (!it.nextInset())
continue;
- if (it.nextInset()->lyxCode() != MATHMACROARG_CODE)
+ if (it.nextInset()->lyxCode() != MATH_MACROARG_CODE)
continue;
MathMacroArgument * arg = static_cast<MathMacroArgument*>(it.nextInset());
maxArg = std::max(int(arg->number()), maxArg);
for (; it && it[0].idx() == idx; it.forwardChar()) {
if (!it.nextInset())
continue;
- if (it.nextInset()->lyxCode() != MATHMACROARG_CODE)
+ if (it.nextInset()->lyxCode() != MATH_MACROARG_CODE)
continue;
MathMacroArgument * arg = static_cast<MathMacroArgument*>(it.nextInset());
found[arg->number() - 1] = true;
void infoize(odocstream & os) const;
///
docstring contextMenu(BufferView const &, int, int) const;
-
protected:
///
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);