2001-02-13 13:28:32 +00:00
|
|
|
// -*- C++ -*-
|
2003-08-19 13:00:56 +00:00
|
|
|
/**
|
2006-09-17 09:14:18 +00:00
|
|
|
* \file InsetMathHull.h
|
2003-08-19 13:00:56 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2003-08-19 13:00:56 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2001-11-08 12:30:26 +00:00
|
|
|
#ifndef MATH_HULLINSET_H
|
|
|
|
#define MATH_HULLINSET_H
|
2001-02-13 13:28:32 +00:00
|
|
|
|
2006-09-17 09:14:18 +00:00
|
|
|
#include "InsetMathGrid.h"
|
2008-02-15 08:09:35 +00:00
|
|
|
|
2010-07-21 13:19:52 +00:00
|
|
|
#include "DocIterator.h"
|
2010-01-20 19:42:12 +00:00
|
|
|
#include "OutputEnums.h"
|
|
|
|
|
2016-06-02 22:49:36 +00:00
|
|
|
#include "support/unique_ptr.h"
|
2004-04-13 17:38:16 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
2008-03-04 12:22:48 +00:00
|
|
|
class InsetLabel;
|
2015-06-14 16:10:29 +00:00
|
|
|
class MacroNameSet;
|
2008-02-15 08:09:35 +00:00
|
|
|
class ParConstIterator;
|
2004-04-13 17:38:16 +00:00
|
|
|
class RenderPreview;
|
2001-02-13 13:28:32 +00:00
|
|
|
|
2001-02-26 12:53:35 +00:00
|
|
|
|
2003-08-19 13:00:56 +00:00
|
|
|
/// This provides an interface between "LyX insets" and "LyX math insets"
|
2006-09-16 18:11:38 +00:00
|
|
|
class InsetMathHull : public InsetMathGrid {
|
2002-03-21 17:42:56 +00:00
|
|
|
public:
|
2014-05-27 20:17:35 +00:00
|
|
|
/// How a line is numbered
|
|
|
|
enum Numbered {
|
|
|
|
/// not numbered, LaTeX code \\nonumber if line differs from inset
|
|
|
|
NONUMBER,
|
|
|
|
/// numbered, LaTeX code \\number if line differs from inset
|
|
|
|
NUMBER,
|
|
|
|
/// not numbered, LaTeX code \\notag if line differs from inset
|
|
|
|
NOTAG
|
|
|
|
};
|
2001-02-16 09:25:43 +00:00
|
|
|
///
|
2009-11-08 11:45:46 +00:00
|
|
|
InsetMathHull(Buffer * buf);
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
2009-11-08 11:45:46 +00:00
|
|
|
InsetMathHull(Buffer * buf, HullType type);
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
2010-05-03 22:55:40 +00:00
|
|
|
virtual ~InsetMathHull();
|
2004-04-13 17:38:16 +00:00
|
|
|
///
|
2008-03-04 12:22:48 +00:00
|
|
|
void setBuffer(Buffer &);
|
|
|
|
///
|
2010-03-03 22:13:45 +00:00
|
|
|
void updateBuffer(ParIterator const &, UpdateType);
|
2008-03-04 12:22:48 +00:00
|
|
|
///
|
2015-09-27 06:05:00 +00:00
|
|
|
void addToToc(DocIterator const & di, bool output_active,
|
2017-01-13 10:06:48 +00:00
|
|
|
UpdateType utype, TocBackend & backend) const;
|
2008-02-15 08:09:35 +00:00
|
|
|
///
|
2006-09-16 18:11:38 +00:00
|
|
|
InsetMathHull & operator=(InsetMathHull const &);
|
2004-04-13 17:38:16 +00:00
|
|
|
///
|
2002-07-18 11:02:33 +00:00
|
|
|
mode_type currentMode() const;
|
|
|
|
///
|
2007-09-21 20:39:47 +00:00
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
2008-10-25 10:47:38 +00:00
|
|
|
///
|
|
|
|
void drawBackground(PainterInfo & pi, int x, int y) const;
|
2001-02-16 09:25:43 +00:00
|
|
|
///
|
2003-03-21 14:20:48 +00:00
|
|
|
void draw(PainterInfo &, int x, int y) const;
|
2001-02-16 09:25:43 +00:00
|
|
|
///
|
2003-05-28 13:22:36 +00:00
|
|
|
void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
|
2002-03-18 11:45:53 +00:00
|
|
|
///
|
2002-05-02 07:30:49 +00:00
|
|
|
void drawT(TextPainter &, int x, int y) const;
|
2002-03-18 11:45:53 +00:00
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
docstring label(row_type row) const;
|
2001-02-16 09:25:43 +00:00
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
void label(row_type row, docstring const & label);
|
2001-02-16 09:25:43 +00:00
|
|
|
///
|
2010-01-28 09:18:15 +00:00
|
|
|
std::vector<InsetLabel *> const & getLabels() { return label_; }
|
2010-01-27 08:41:19 +00:00
|
|
|
///
|
2009-12-17 14:09:37 +00:00
|
|
|
ColorCode backgroundColor(PainterInfo const &) const;
|
2008-10-25 10:47:38 +00:00
|
|
|
///
|
2014-05-27 20:17:35 +00:00
|
|
|
void numbered(row_type row, bool num) { numbered(row, num ? NUMBER : NONUMBER); }
|
|
|
|
///
|
|
|
|
void numbered(row_type row, Numbered num);
|
2001-02-16 09:25:43 +00:00
|
|
|
///
|
2001-09-26 16:52:34 +00:00
|
|
|
bool numbered(row_type row) const;
|
2001-02-16 09:25:43 +00:00
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
bool numberedType() const;
|
2001-02-16 09:25:43 +00:00
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
bool ams() const;
|
2001-02-16 09:25:43 +00:00
|
|
|
///
|
2016-10-19 22:06:42 +00:00
|
|
|
bool outerDisplay() const;
|
|
|
|
///
|
2001-07-26 06:56:43 +00:00
|
|
|
void validate(LaTeXFeatures & features) const;
|
2005-10-14 10:50:23 +00:00
|
|
|
/// identifies HullInset
|
2006-09-16 18:11:38 +00:00
|
|
|
InsetMathHull const * asHullInset() const { return this; }
|
2001-11-09 08:35:57 +00:00
|
|
|
/// identifies HullInset
|
2006-09-16 18:11:38 +00:00
|
|
|
InsetMathHull * asHullInset() { return this; }
|
2001-02-16 09:25:43 +00:00
|
|
|
|
2002-08-21 13:47:52 +00:00
|
|
|
/// add a row
|
|
|
|
void addRow(row_type row);
|
|
|
|
/// delete a row
|
|
|
|
void delRow(row_type row);
|
2004-11-23 14:43:37 +00:00
|
|
|
/// swap two rows
|
2003-10-06 09:57:03 +00:00
|
|
|
void swapRow(row_type row);
|
2002-08-21 13:47:52 +00:00
|
|
|
/// add a column
|
|
|
|
void addCol(col_type col);
|
|
|
|
/// delete a column
|
|
|
|
void delCol(col_type col);
|
2001-02-16 09:25:43 +00:00
|
|
|
|
2002-07-03 10:36:44 +00:00
|
|
|
/// get type
|
2006-09-03 16:14:51 +00:00
|
|
|
HullType getType() const;
|
2015-12-14 01:54:27 +00:00
|
|
|
/// is mutation implemented for this type?
|
|
|
|
static bool isMutable(HullType type);
|
2001-06-25 00:06:33 +00:00
|
|
|
/// change type
|
2006-09-03 16:14:51 +00:00
|
|
|
void mutate(HullType newtype);
|
2001-09-04 13:32:06 +00:00
|
|
|
|
|
|
|
///
|
2001-09-26 16:52:34 +00:00
|
|
|
int defaultColSpace(col_type col);
|
2001-09-04 13:32:06 +00:00
|
|
|
///
|
2015-12-20 20:56:34 +00:00
|
|
|
int displayColSpace(col_type col) const;
|
|
|
|
///
|
2001-09-26 16:52:34 +00:00
|
|
|
char defaultColAlign(col_type col);
|
2002-06-18 15:44:30 +00:00
|
|
|
///
|
2015-05-17 11:43:37 +00:00
|
|
|
char displayColAlign(idx_type idx) const;
|
2011-10-18 18:46:57 +00:00
|
|
|
///
|
2007-04-26 14:56:30 +00:00
|
|
|
bool idxFirst(Cursor &) const;
|
2002-06-18 15:44:30 +00:00
|
|
|
///
|
2007-04-26 14:56:30 +00:00
|
|
|
bool idxLast(Cursor &) const;
|
2001-02-16 09:25:43 +00:00
|
|
|
|
2001-11-07 18:15:24 +00:00
|
|
|
///
|
2010-07-22 02:20:12 +00:00
|
|
|
void write(WriteStream & os) const;
|
2001-11-09 18:02:20 +00:00
|
|
|
///
|
|
|
|
void normalize(NormalStream &) const;
|
2002-05-30 07:09:54 +00:00
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
void infoize(odocstream & os) const;
|
2001-08-01 13:28:45 +00:00
|
|
|
|
2004-01-30 11:41:12 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
void write(std::ostream & os) const;
|
2004-01-30 11:41:12 +00:00
|
|
|
///
|
2008-11-16 00:18:52 +00:00
|
|
|
void header_write(WriteStream &) const;
|
|
|
|
///
|
|
|
|
void footer_write(WriteStream &) const;
|
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
void read(Lexer & lex);
|
2004-01-30 11:41:12 +00:00
|
|
|
///
|
2008-10-31 15:19:39 +00:00
|
|
|
bool readQuiet(Lexer & lex);
|
2008-10-17 21:40:11 +00:00
|
|
|
///
|
2013-03-08 19:52:18 +00:00
|
|
|
int plaintext(odocstringstream &, OutputParams const &,
|
|
|
|
size_t max_length = INT_MAX) const;
|
2004-01-30 11:41:12 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
int docbook(odocstream &, OutputParams const &) const;
|
2009-11-14 15:25:32 +00:00
|
|
|
///
|
2009-12-15 13:14:57 +00:00
|
|
|
docstring xhtml(XHTMLStream &, OutputParams const &) const;
|
2011-01-11 23:18:56 +00:00
|
|
|
///
|
|
|
|
void mathmlize(MathStream &) const;
|
2011-01-11 23:34:59 +00:00
|
|
|
///
|
|
|
|
void htmlize(HtmlStream &) const;
|
2011-01-11 23:55:20 +00:00
|
|
|
///
|
|
|
|
void mathAsLatex(WriteStream &) const;
|
2010-12-15 01:34:04 +00:00
|
|
|
///
|
|
|
|
void toString(odocstream &) const;
|
2010-12-20 21:55:09 +00:00
|
|
|
///
|
2015-10-04 18:38:47 +00:00
|
|
|
void forOutliner(docstring &, size_t const, bool const) const;
|
2004-01-30 11:41:12 +00:00
|
|
|
|
2004-04-13 17:38:16 +00:00
|
|
|
/// get notification when the cursor leaves this inset
|
2008-02-22 20:45:18 +00:00
|
|
|
bool notifyCursorLeaves(Cursor const & old, Cursor & cur);
|
2004-01-30 11:41:12 +00:00
|
|
|
///
|
2007-10-13 09:04:52 +00:00
|
|
|
//bool insetAllowed(InsetCode code) const;
|
2004-01-30 11:41:12 +00:00
|
|
|
///
|
2009-11-22 21:45:51 +00:00
|
|
|
void addPreview(DocIterator const & inset_pos,
|
2009-11-22 20:50:35 +00:00
|
|
|
graphics::PreviewLoader &) const;
|
2009-12-05 01:07:38 +00:00
|
|
|
/// Recreates the preview if preview is enabled.
|
2010-07-29 15:17:58 +00:00
|
|
|
void reloadPreview(DocIterator const & pos) const;
|
2008-09-26 15:53:15 +00:00
|
|
|
///
|
2015-06-14 16:10:29 +00:00
|
|
|
void usedMacros(MathData const & md, DocIterator const & pos,
|
|
|
|
MacroNameSet & macros, MacroNameSet & defs) const;
|
|
|
|
///
|
2008-09-26 15:53:15 +00:00
|
|
|
void initUnicodeMath() const;
|
2004-01-30 11:41:12 +00:00
|
|
|
|
2006-09-08 13:52:41 +00:00
|
|
|
///
|
|
|
|
static int displayMargin() { return 12; }
|
2007-11-05 23:44:47 +00:00
|
|
|
|
2010-05-22 00:46:57 +00:00
|
|
|
/// Force inset into LTR environment if surroundings are RTL
|
2007-11-05 23:44:47 +00:00
|
|
|
virtual bool forceLTR() const { return true; }
|
2010-07-21 13:19:52 +00:00
|
|
|
///
|
|
|
|
void recordLocation(DocIterator const & di);
|
2007-05-11 02:34:56 +00:00
|
|
|
|
2008-03-09 15:07:27 +00:00
|
|
|
///
|
2011-10-29 14:48:55 +00:00
|
|
|
std::string contextMenuName() const;
|
2009-07-16 19:00:24 +00:00
|
|
|
///
|
|
|
|
InsetCode lyxCode() const { return MATH_HULL_CODE; }
|
2016-05-23 14:06:26 +00:00
|
|
|
///
|
|
|
|
bool canPaintChange(BufferView const &) const;
|
2008-03-09 15:07:27 +00:00
|
|
|
|
2002-08-15 17:41:24 +00:00
|
|
|
protected:
|
2006-09-16 18:11:38 +00:00
|
|
|
InsetMathHull(InsetMathHull const &);
|
2004-11-23 23:04:52 +00:00
|
|
|
|
2007-04-26 14:56:30 +00:00
|
|
|
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
|
2004-11-23 23:04:52 +00:00
|
|
|
|
2004-04-06 19:25:39 +00:00
|
|
|
/// do we want to handle this event?
|
2007-04-26 14:56:30 +00:00
|
|
|
bool getStatus(Cursor & cur, FuncRequest const & cmd,
|
2004-04-06 19:25:39 +00:00
|
|
|
FuncStatus & status) const;
|
2002-12-01 22:59:25 +00:00
|
|
|
///
|
2010-11-06 02:53:29 +00:00
|
|
|
docstring eolString(row_type row, bool fragile, bool latex,
|
|
|
|
bool last_eoln) const;
|
2002-08-15 17:41:24 +00:00
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
private:
|
2007-08-30 18:03:17 +00:00
|
|
|
virtual Inset * clone() const;
|
2010-07-29 15:17:58 +00:00
|
|
|
/// Prepare the preview if preview is enabled.
|
|
|
|
/// \param forexport: whether this is intended for export
|
|
|
|
/// If so, we ignore LyXRC and wait for the image to be generated.
|
|
|
|
void preparePreview(DocIterator const & pos,
|
|
|
|
bool forexport = false) const;
|
|
|
|
/// like reloadPreview, but forces load
|
|
|
|
/// used by image export
|
|
|
|
void loadPreview(DocIterator const & pos) const;
|
2001-09-04 13:32:06 +00:00
|
|
|
///
|
2006-09-03 16:14:51 +00:00
|
|
|
void setType(HullType type);
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
2001-07-26 06:56:43 +00:00
|
|
|
void validate1(LaTeXFeatures & features);
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
docstring nicelabel(row_type row) const;
|
2002-06-24 15:37:14 +00:00
|
|
|
///
|
2007-04-26 14:56:30 +00:00
|
|
|
void doExtern(Cursor & cur, FuncRequest & func);
|
2002-08-14 16:43:16 +00:00
|
|
|
///
|
2010-08-19 13:58:36 +00:00
|
|
|
void glueall(HullType type);
|
2004-09-13 18:14:37 +00:00
|
|
|
/*!
|
|
|
|
* split every row at the first relation operator.
|
|
|
|
* The number of columns must be 1. One column is added.
|
|
|
|
* The first relation operator and everything after it goes to the
|
|
|
|
* second column.
|
|
|
|
*/
|
|
|
|
void splitTo2Cols();
|
|
|
|
/*!
|
|
|
|
* split every row at the first relation operator.
|
|
|
|
* The number of columns must be < 3. One or two columns are added.
|
|
|
|
* The first relation operator goes to the second column.
|
|
|
|
* Everything after it goes to the third column.
|
|
|
|
*/
|
|
|
|
void splitTo3Cols();
|
|
|
|
/// change number of columns, split or combine columns if necessary.
|
|
|
|
void changeCols(col_type);
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
Remove a conversion to_utf8() inside FontSetChanger
This requires to change many docstrings into std::strings. The logic behind that
is that they represent a fixed set of math fonts, and therefore “string” means
here “poor man's enum” rather than text (this is consistent with MetricsBase).
Profiling of scrolling inside a document over macro-instensive areas:
Before the patch:
44,1% BufferView::updateMetrics()
-> 34,8% InsetMathHull::metrics()
-> 9,8% FontSetChanger::FontSetChanger()
28,4% BufferView::draw()
After the patch:
35,3% BufferView::updateMetrics()
-> 27,2% InsetMathHull::metrics
-> 0,4% FontSetChanger::FontSetChanger()
47,5% BufferView::draw()
FontSetChanger::FontSetChanger() is made 41x less expensive (with reference
BV::draw()) just by removing this conversion. The remaining 0,4% could be
squished by replacing the strings with a proper enum, but this is premature. Of
course, this only treats the symptoms: there is no good reason that this
function is called 45500 times over the time of 40 repaints.
2016-06-07 21:58:55 +00:00
|
|
|
std::string standardFont() const;
|
Index: src/mathed/InsetMathHull.cpp
===================================================================
--- src/mathed/InsetMathHull.cpp (revisione 34304)
+++ src/mathed/InsetMathHull.cpp (copia locale)
@@ -328,6 +328,23 @@ docstring InsetMathHull::standardFont()
}
+docstring InsetMathHull::standardColor() const
+{
+ docstring color;
+ switch (type_) {
+ case hullRegexp:
+ color = from_ascii("foreground");
+ break;
+ case hullNone:
+ color = from_ascii("foreground");
+ break;
+ default:
+ color = from_ascii("math");
+ }
+ return color;
+}
+
+
bool InsetMathHull::previewState(BufferView * bv) const
{
if (!editing(bv) && RenderPreview::status() == LyXRC::PREVIEW_ON) {
@@ -417,8 +434,11 @@ void InsetMathHull::draw(PainterInfo & p
return;
}
+ bool const really_change_color = pi.base.font.color() == Color_none;
+ ColorChanger dummy0(pi.base.font, standardColor(), really_change_color);
FontSetChanger dummy1(pi.base, standardFont());
StyleChanger dummy2(pi.base, display() ? LM_ST_DISPLAY : LM_ST_TEXT);
+
InsetMathGrid::draw(pi, x + 1, y);
if (numberedType()) {
Index: src/mathed/MathSupport.cpp
===================================================================
--- src/mathed/MathSupport.cpp (revisione 34311)
+++ src/mathed/MathSupport.cpp (copia locale)
@@ -653,6 +653,13 @@ bool isMathFont(docstring const & name)
}
+bool isTextFont(docstring const & name)
+{
+ fontinfo * f = lookupFont(name);
+ return f && f->color_ == Color_foreground;
+}
+
+
FontInfo getFont(docstring const & name)
{
FontInfo font;
Index: src/mathed/MathSupport.h
===================================================================
--- src/mathed/MathSupport.h (revisione 34311)
+++ src/mathed/MathSupport.h (copia locale)
@@ -51,6 +51,8 @@ bool isFontName(docstring const & name);
bool isMathFont(docstring const & name);
+bool isTextFont(docstring const & name);
+
// converts single cell to string
docstring asString(MathData const & ar);
// converts single inset to string
Index: src/mathed/InsetMathHull.h
===================================================================
--- src/mathed/InsetMathHull.h (revisione 34304)
+++ src/mathed/InsetMathHull.h (copia locale)
@@ -197,6 +197,8 @@ private:
void changeCols(col_type);
///
docstring standardFont() const;
+ ///
+ docstring standardColor() const;
/// consistency check
void check() const;
/// can this change its number of rows?
Index: src/MetricsInfo.cpp
===================================================================
--- src/MetricsInfo.cpp (revisione 34312)
+++ src/MetricsInfo.cpp (copia locale)
@@ -235,11 +235,15 @@ FontSetChanger::FontSetChanger(MetricsBa
save_ = mb;
FontSize oldsize = save_.font.size();
ColorCode oldcolor = save_.font.color();
+ docstring const oldname = from_ascii(save_.fontname);
mb.fontname = name;
mb.font = sane_font;
augmentFont(mb.font, from_ascii(name));
mb.font.setSize(oldsize);
- mb.font.setColor(oldcolor);
+ if (string(name) != "lyxtex"
+ && ((isTextFont(oldname) && oldcolor != Color_foreground)
+ || (isMathFont(oldname) && oldcolor != Color_math)))
+ mb.font.setColor(oldcolor);
}
}
@@ -252,11 +256,15 @@ FontSetChanger::FontSetChanger(MetricsBa
save_ = mb;
FontSize oldsize = save_.font.size();
ColorCode oldcolor = save_.font.color();
+ docstring const oldname = from_ascii(save_.fontname);
mb.fontname = to_utf8(name);
mb.font = sane_font;
augmentFont(mb.font, name);
mb.font.setSize(oldsize);
- mb.font.setColor(oldcolor);
+ if (name != "lyxtex"
+ && ((isTextFont(oldname) && oldcolor != Color_foreground)
+ || (isMathFont(oldname) && oldcolor != Color_math)))
+ mb.font.setColor(oldcolor);
}
}
@@ -294,17 +302,21 @@ WidthChanger::~WidthChanger()
//
/////////////////////////////////////////////////////////////////////////
-ColorChanger::ColorChanger(FontInfo & font, string const & color)
- : Changer<FontInfo, string>(font)
+ColorChanger::ColorChanger(FontInfo & font, docstring const & color,
+ bool really_change_color)
+ : Changer<FontInfo, ColorCode>(font), change_(really_change_color)
{
- save_ = lcolor.getFromLyXName(color);
- font.setColor(lcolor.getFromLyXName(color));
+ if (change_) {
+ save_ = font.color();
+ font.setColor(lcolor.getFromLyXName(to_utf8(color)));
+ }
}
ColorChanger::~ColorChanger()
{
- orig_.setColor(lcolor.getFromLyXName(save_));
+ if (change_)
+ orig_.setColor(save_);
}
Index: src/MetricsInfo.h
===================================================================
--- src/MetricsInfo.h (revisione 34312)
+++ src/MetricsInfo.h (copia locale)
@@ -222,12 +222,16 @@ public:
// temporarily change the used color
-class ColorChanger : public Changer<FontInfo, std::string> {
+class ColorChanger : public Changer<FontInfo, ColorCode> {
public:
///
- ColorChanger(FontInfo & font, std::string const & color);
+ ColorChanger(FontInfo & font, docstring const & color,
+ bool really_change_color = true);
///
~ColorChanger();
+private:
+ ///
+ bool change_;
};
} // namespace lyx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34320 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-28 01:40:11 +00:00
|
|
|
///
|
2010-09-09 13:02:20 +00:00
|
|
|
ColorCode standardColor() const;
|
2001-12-11 15:04:02 +00:00
|
|
|
/// consistency check
|
|
|
|
void check() const;
|
2015-12-11 20:45:57 +00:00
|
|
|
/// does it understand tabular-feature commands?
|
2016-04-22 13:50:51 +00:00
|
|
|
bool allowsTabularFeatures() const;
|
2004-11-23 14:43:37 +00:00
|
|
|
/// can this change its number of rows?
|
|
|
|
bool rowChangeOK() const;
|
2002-08-21 13:47:52 +00:00
|
|
|
/// can this change its number of cols?
|
|
|
|
bool colChangeOK() const;
|
2011-01-12 16:04:59 +00:00
|
|
|
/// are any of the equations numbered?
|
|
|
|
bool haveNumbers() const;
|
2001-02-16 09:25:43 +00:00
|
|
|
|
2002-07-04 11:00:51 +00:00
|
|
|
/// "none", "simple", "display", "eqnarray",...
|
2006-09-03 16:14:51 +00:00
|
|
|
HullType type_;
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
2014-05-27 20:17:35 +00:00
|
|
|
std::vector<Numbered> numbered_;
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
2011-01-11 19:35:52 +00:00
|
|
|
std::vector<docstring> numbers_;
|
|
|
|
///
|
2008-03-04 12:22:48 +00:00
|
|
|
std::vector<InsetLabel *> label_;
|
2004-04-13 17:38:16 +00:00
|
|
|
///
|
2016-06-02 22:49:36 +00:00
|
|
|
unique_ptr<RenderPreview> preview_;
|
2005-07-18 00:45:10 +00:00
|
|
|
///
|
2010-07-21 13:19:52 +00:00
|
|
|
DocIterator docit_;
|
2011-01-12 16:04:59 +00:00
|
|
|
///
|
|
|
|
typedef std::map<docstring, int> CounterMap;
|
|
|
|
/// used to store current values of important counters
|
|
|
|
CounterMap counter_map;
|
2004-01-26 10:13:15 +00:00
|
|
|
//
|
|
|
|
// Incorporate me
|
|
|
|
//
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
virtual void mutateToText();
|
|
|
|
///
|
2007-04-26 14:56:30 +00:00
|
|
|
virtual void revealCodes(Cursor & cur) const;
|
2004-01-26 10:13:15 +00:00
|
|
|
///
|
2009-04-22 20:55:13 +00:00
|
|
|
bool editable() const { return true; }
|
2004-01-26 10:13:15 +00:00
|
|
|
///
|
2008-02-10 19:52:45 +00:00
|
|
|
void edit(Cursor & cur, bool front,
|
2008-02-11 08:20:13 +00:00
|
|
|
EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
|
2004-04-06 19:25:39 +00:00
|
|
|
///
|
2007-04-29 13:39:47 +00:00
|
|
|
Inset * editXY(Cursor & cur, int x, int y);
|
2005-07-15 00:39:44 +00:00
|
|
|
///
|
2007-05-18 14:32:29 +00:00
|
|
|
DisplayType display() const;
|
2004-01-26 10:13:15 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
///
|
2007-04-26 14:56:30 +00:00
|
|
|
void handleFont(Cursor & cur, docstring const & arg,
|
2006-10-22 10:15:23 +00:00
|
|
|
docstring const & font);
|
2005-07-18 00:45:10 +00:00
|
|
|
///
|
2007-04-26 14:56:30 +00:00
|
|
|
void handleFont2(Cursor & cur, docstring const & arg);
|
2004-01-26 10:13:15 +00:00
|
|
|
///
|
2014-03-19 16:43:21 +00:00
|
|
|
bool previewState(BufferView const * const bv) const;
|
|
|
|
///
|
|
|
|
bool previewTooSmall(Dimension const & dim) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
};
|
2001-02-16 09:25:43 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
2001-02-13 13:28:32 +00:00
|
|
|
#endif
|