]> git.lyx.org Git - features.git/commitdiff
Cleanup headers
authorYuriy Skalko <yuriy.skalko@gmail.com>
Wed, 2 Dec 2020 15:13:32 +0000 (17:13 +0200)
committerYuriy Skalko <yuriy.skalko@gmail.com>
Wed, 2 Dec 2020 22:38:27 +0000 (00:38 +0200)
17 files changed:
src/Buffer.cpp
src/BufferView.cpp
src/Undo.cpp
src/insets/InsetCommand.cpp
src/insets/InsetTabular.cpp
src/mathed/InsetMath.cpp
src/mathed/InsetMath.h
src/mathed/InsetMathBox.h
src/mathed/InsetMathCommand.h
src/mathed/InsetMathFrac.h
src/mathed/InsetMathGrid.h
src/mathed/InsetMathMacro.cpp
src/mathed/InsetMathMacroTemplate.cpp
src/mathed/MathData.cpp
src/mathed/MathData.h
src/mathed/MathRow.cpp
src/mathed/MathRow.h

index 0d5de8c78c8e15f12017869badd9da5ebcc9ab54..4f397efc5ecf29d593a0fecedade8424b42bb834 100644 (file)
@@ -69,7 +69,6 @@
 
 #include "insets/InsetBranch.h"
 #include "insets/InsetInclude.h"
-#include "insets/InsetTabular.h"
 #include "insets/InsetText.h"
 
 #include "mathed/InsetMathHull.h"
index f7567bd4dd9d6c35807b09bc1761586f2d119653..758a9928f16386fd0ec3ae0ed018fd66cf12d756 100644 (file)
@@ -50,7 +50,9 @@
 #include "insets/InsetRef.h"
 #include "insets/InsetText.h"
 
+#include "mathed/InsetMath.h"
 #include "mathed/MathData.h"
+#include "mathed/MathRow.h"
 
 #include "frontends/alert.h"
 #include "frontends/CaretGeometry.h"
index c6b7eaa331faec318ed95ecfd6bc9be5338fb37e..ebe2350b799558787a0efc1e5437c44654fcc324 100644 (file)
@@ -27,7 +27,9 @@
 #include "ParagraphList.h"
 #include "Text.h"
 
+#include "mathed/InsetMath.h"
 #include "mathed/MathData.h"
+#include "mathed/MathRow.h"
 
 #include "insets/InsetText.h"
 
index 8d9d174e165d3dff920a009cc15993acee698696..67ff5fc6b6ed8c7618a875f1b3b459eac19bf63f 100644 (file)
@@ -18,7 +18,6 @@
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "Cursor.h"
-#include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "Lexer.h"
 
 #include "insets/InsetBox.h"
 #include "insets/InsetBranch.h"
-#include "insets/InsetCommand.h"
 #include "insets/InsetERT.h"
 #include "insets/InsetExternal.h"
 #include "insets/InsetFloat.h"
 #include "insets/InsetGraphics.h"
 #include "insets/InsetIndex.h"
-#include "insets/InsetLine.h"
 #include "insets/InsetListings.h"
 #include "insets/InsetNote.h"
 #include "insets/InsetPhantom.h"
 #include "insets/InsetSpace.h"
-#include "insets/InsetTabular.h"
 #include "insets/InsetVSpace.h"
 #include "insets/InsetWrap.h"
 
index 53d9ac1ae5584463a3ec8445a9713652d74e2150..181e68cb7c56bc80b6df31e33cd84f1281577b59 100644 (file)
@@ -45,7 +45,6 @@
 #include "xml.h"
 #include "output_xhtml.h"
 #include "Paragraph.h"
-#include "ParagraphParameters.h"
 #include "ParIterator.h"
 #include "TexRow.h"
 #include "texstream.h"
index 40cb9066062eaa99c68d7affd3705232af987bfc..d12474f2495e24548bae81f28f6c180d4743850e 100644 (file)
@@ -94,9 +94,9 @@ MathData const & InsetMath::cell(idx_type) const
 }
 
 
-InsetMath::marker_type InsetMath::marker(BufferView const *) const
+marker_type InsetMath::marker(BufferView const *) const
 {
-       return nargs() > 0 ? MARKER : NO_MARKER;
+       return nargs() > 0 ? marker_type::MARKER : marker_type::NO_MARKER;
 }
 
 
@@ -104,7 +104,7 @@ bool InsetMath::addToMathRow(MathRow & mrow, MetricsInfo & mi) const
 {
        MathRow::Element e(mi, MathRow::INSET, mathClass());
        e.inset = this;
-       e.marker = mi.base.macro_nesting ? NO_MARKER : marker(mi.base.bv);
+       e.marker = mi.base.macro_nesting ? marker_type::NO_MARKER : marker(mi.base.bv);
        mrow.push_back(e);
        return true;
 }
index 9a970c5839fe89c5f44078a5265495b3b6a02a38..220795695d8efdaca94ec5770055027e7c744b66 100644 (file)
@@ -50,6 +50,15 @@ enum Limits {
 };
 
 
+/// The possible marker types for math insets
+enum class marker_type : int {
+       NO_MARKER,
+       MARKER2,
+       MARKER,
+       BOX_MARKER
+};
+
+
 /**
 
 Abstract base class for all math objects.  A math insets is for use of the
@@ -123,8 +132,6 @@ public:
        /// this is overridden by specific insets
        mode_type currentMode() const override { return MATH_MODE; }
 
-       // The possible marker types for math insets
-       enum marker_type { NO_MARKER, MARKER2, MARKER, BOX_MARKER };
        /// this is overridden by insets with specific edit marker type
        virtual marker_type marker(BufferView const *) const;
 
index 0a8bf74cd25f247de2f05ce731b3ff5ff2b54bce..93d8954a2e7000d72ccc704b276f9c21dd6e9721 100644 (file)
@@ -58,7 +58,7 @@ public:
        ///
        mode_type currentMode() const override { return TEXT_MODE; }
        ///
-       marker_type marker(BufferView const *) const override { return NO_MARKER; }
+       marker_type marker(BufferView const *) const override { return marker_type::NO_MARKER; }
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const override;
        ///
@@ -118,7 +118,7 @@ public:
        ///
        explicit InsetMathBoxed(Buffer * buf);
        ///
-       marker_type marker(BufferView const *) const override { return NO_MARKER; }
+       marker_type marker(BufferView const *) const override { return marker_type::NO_MARKER; }
        ///
        void validate(LaTeXFeatures & features) const override;
        ///
index 47ed450a5845da86bbb80181be194bc2ae475915..0c96a25d7ff56c6494ea3e613f0d9c51f04f8a51 100644 (file)
@@ -28,7 +28,7 @@ public:
        explicit InsetMathCommand(Buffer * buf, docstring const & name,
                bool needs_math_mode = true);
        ///
-       marker_type marker(BufferView const *) const override { return NO_MARKER; }
+       marker_type marker(BufferView const *) const override { return marker_type::NO_MARKER; }
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const override;
        ///
index 0ced11473a7df0819efba0cb16247a9587213fbf..c8c65da9bdd96f6d59f00f0fe60711baa4ed126e 100644 (file)
@@ -25,7 +25,7 @@ public:
        ///
        InsetMathFracBase(Buffer * buf, idx_type ncells = 2);
        ///
-       marker_type marker(BufferView const *) const override { return MARKER2; }
+       marker_type marker(BufferView const *) const override { return marker_type::MARKER2; }
        ///
        bool idxUpDown(Cursor &, bool up) const override;
        ///
index cf24dcffd105124b9fd5bed34b7456113945805c..dd61efd71ac8fca4df4a6f557d5e7f8cd8befa2c 100644 (file)
@@ -94,7 +94,7 @@ public:
        InsetMathGrid(Buffer * buf, col_type m, row_type n, char valign,
                docstring const & halign);
        ///
-       marker_type marker(BufferView const *) const override { return MARKER2; };
+       marker_type marker(BufferView const *) const override { return marker_type::MARKER2; };
        ///
        void metrics(MetricsInfo & mi, Dimension &) const override;
        ///
index 1e29fa54a68ff90ec8f5eaceacaa68b00312fd7c..c35226fd6ca41af04334bf29dbff975fe0e9ae81 100644 (file)
@@ -19,6 +19,7 @@
 #include "MathCompletionList.h"
 #include "MathExtern.h"
 #include "MathFactory.h"
+#include "MathRow.h"
 #include "MathStream.h"
 #include "MathSupport.h"
 
@@ -74,7 +75,7 @@ public:
        ///
        InsetMathMacro const * owner() { return mathMacro_; }
        ///
-       marker_type marker(BufferView const *) const override { return NO_MARKER; }
+       marker_type marker(BufferView const *) const override { return marker_type::NO_MARKER; }
        ///
        InsetCode lyxCode() const override { return ARGUMENT_PROXY_CODE; }
        /// The math data to use for display
@@ -352,7 +353,7 @@ bool InsetMathMacro::addToMathRow(MathRow & mrow, MetricsInfo & mi) const
 
        MathRow::Element e_beg(mi, MathRow::BEGIN);
        e_beg.inset = this;
-       e_beg.marker = (d->nesting_ == 1) ? marker(mi.base.bv) : NO_MARKER;
+       e_beg.marker = (d->nesting_ == 1) ? marker(mi.base.bv) : marker_type::NO_MARKER;
        mrow.push_back(e_beg);
 
        d->macro_->lock();
@@ -371,7 +372,7 @@ bool InsetMathMacro::addToMathRow(MathRow & mrow, MetricsInfo & mi) const
 
        MathRow::Element e_end(mi, MathRow::END);
        e_end.inset = this;
-       e_end.marker = (d->nesting_ == 1) ? marker(mi.base.bv) : NO_MARKER;
+       e_end.marker = (d->nesting_ == 1) ? marker(mi.base.bv) : marker_type::NO_MARKER;
        mrow.push_back(e_end);
 
        return has_contents;
@@ -544,29 +545,29 @@ bool InsetMathMacro::editMetrics(BufferView const * bv) const
 }
 
 
-InsetMath::marker_type InsetMathMacro::marker(BufferView const * bv) const
+marker_type InsetMathMacro::marker(BufferView const * bv) const
 {
        if (nargs() == 0)
-               return NO_MARKER;
+               return marker_type::NO_MARKER;
 
        switch (d->displayMode_) {
        case DISPLAY_INIT:
        case DISPLAY_INTERACTIVE_INIT:
-               return NO_MARKER;
+               return marker_type::NO_MARKER;
        case DISPLAY_UNFOLDED:
-               return MARKER;
+               return marker_type::MARKER;
        case DISPLAY_NORMAL:
                switch (lyxrc.macro_edit_style) {
                case LyXRC::MACRO_EDIT_INLINE:
-                       return MARKER2;
+                       return marker_type::MARKER2;
                case LyXRC::MACRO_EDIT_INLINE_BOX:
-                       return d->editing_[bv] ? BOX_MARKER : MARKER2;
+                       return d->editing_[bv] ? marker_type::BOX_MARKER : marker_type::MARKER2;
                case LyXRC::MACRO_EDIT_LIST:
-                       return MARKER2;
+                       return marker_type::MARKER2;
                }
        }
        // please gcc 4.6
-       return NO_MARKER;
+       return marker_type::NO_MARKER;
 }
 
 
index 7f4358651394707b1447a8cebe4afd471ef9e633..7b24784ae965378a1360dc8162ee0881faaf8a7e 100644 (file)
@@ -216,13 +216,13 @@ Inset * InsetDisplayLabelBox::clone() const
 }
 
 
-InsetMath::marker_type InsetDisplayLabelBox::marker(BufferView const * bv) const
+marker_type InsetDisplayLabelBox::marker(BufferView const * bv) const
 {
        if (parent_.editing(bv)
            || !parent_.cell(parent_.displayIdx()).empty())
-               return MARKER;
+               return marker_type::MARKER;
        else
-               return NO_MARKER;
+               return marker_type::NO_MARKER;
 }
 
 
index 610a3e20eb64ebae7e237f77baa6c67ccf8ff5bf..b4cbfe4ddd12c48fff24fdccea2a0b7e22e7cc68 100644 (file)
 
 #include "InsetMathBrace.h"
 #include "InsetMathFont.h"
+#include "InsetMathMacro.h"
 #include "InsetMathScript.h"
 #include "MacroTable.h"
-#include "InsetMathMacro.h"
+#include "MathRow.h"
 #include "MathStream.h"
 #include "MathSupport.h"
 #include "MetricsInfo.h"
index c27b9f58d69294bc6d85dfff36e789b7d34d99b3..0afaf182c364b6818fd4e3707fb790701c06c5db 100644 (file)
@@ -16,8 +16,9 @@
 #define MATH_DATA_H
 
 #include "MathAtom.h"
-#include "MathRow.h"
+#include "MathClass.h"
 
+#include "Dimension.h"
 #include "OutputEnums.h"
 
 #include "support/strfwd.h"
@@ -33,13 +34,14 @@ class BufferView;
 class Cursor;
 class Dimension;
 class DocIterator;
+class InsetMathMacro;
 class LaTeXFeatures;
-class ReplaceData;
 class MacroContext;
-class InsetMathMacro;
+class MathRow;
 class MetricsInfo;
 class PainterInfo;
 class ParIterator;
+class ReplaceData;
 class TextMetricsInfo;
 class TextPainter;
 
index 16b64c6b7f2bc2274e1e44be670917bd053370e1..b8a9a9518b5ba404d93bc7b38f7ab02542ccd6fa 100644 (file)
@@ -20,6 +20,8 @@
 #include "CoordCache.h"
 #include "MetricsInfo.h"
 
+#include "mathed/InsetMath.h"
+
 #include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
 
@@ -37,7 +39,7 @@ namespace lyx {
 
 MathRow::Element::Element(MetricsInfo const & mi, Type t, MathClass mc)
        : type(t), mclass(mc), before(0), after(0), macro_nesting(mi.base.macro_nesting),
-         marker(InsetMath::NO_MARKER), inset(nullptr), compl_unique_to(0), ar(nullptr),
+         marker(marker_type::NO_MARKER), inset(nullptr), compl_unique_to(0), ar(nullptr),
          color(Color_red)
 {}
 
@@ -49,11 +51,11 @@ namespace {
 int markerMargin(MathRow::Element const & e)
 {
        switch(e.marker) {
-       case InsetMath::MARKER:
-       case InsetMath::MARKER2:
-       case InsetMath::BOX_MARKER:
+       case marker_type::MARKER:
+       case marker_type::MARKER2:
+       case marker_type::BOX_MARKER:
                return 2;
-       case InsetMath::NO_MARKER:
+       case marker_type::NO_MARKER:
                return 0;
        }
        // should not happen
@@ -66,16 +68,16 @@ void afterMetricsMarkers(MetricsInfo const & , MathRow::Element & e,
 {
        // handle vertical space for markers
        switch(e.marker) {
-       case InsetMath::NO_MARKER:
+       case marker_type::NO_MARKER:
                break;
-       case InsetMath::MARKER:
+       case marker_type::MARKER:
                ++dim.des;
                break;
-       case InsetMath::MARKER2:
+       case marker_type::MARKER2:
                ++dim.asc;
                ++dim.des;
                break;
-       case InsetMath::BOX_MARKER:
+       case marker_type::BOX_MARKER:
                FontInfo font;
                font.setSize(TINY_SIZE);
                Dimension namedim;
@@ -93,7 +95,7 @@ void afterMetricsMarkers(MetricsInfo const & , MathRow::Element & e,
 void drawMarkers(PainterInfo const & pi, MathRow::Element const & e,
                  int const x, int const y)
 {
-       if (e.marker == InsetMath::NO_MARKER)
+       if (e.marker == marker_type::NO_MARKER)
                return;
 
        CoordCache const & coords = pi.base.bv->coordCache();
@@ -104,7 +106,7 @@ void drawMarkers(PainterInfo const & pi, MathRow::Element const & e,
        int const r = x + dim.width() - e.after;
 
        // Grey lower box
-       if (e.marker == InsetMath::BOX_MARKER) {
+       if (e.marker == marker_type::BOX_MARKER) {
                // draw header and rectangle around
                FontInfo font;
                font.setSize(TINY_SIZE);
@@ -132,8 +134,8 @@ void drawMarkers(PainterInfo const & pi, MathRow::Element const & e,
        pi.pain.line(r - 3, d, r, d, pen_color);
 
        // Upper corners
-       if (e.marker == InsetMath::BOX_MARKER
-           || e.marker == InsetMath::MARKER2) {
+       if (e.marker == marker_type::BOX_MARKER
+           || e.marker == marker_type::MARKER2) {
                int const a = y - dim.ascent();
                pi.pain.line(l, a + 3, l, a, pen_color);
                pi.pain.line(r, a + 3, r, a, pen_color);
@@ -198,7 +200,7 @@ MathRow::MathRow(MetricsInfo & mi, MathData const * ar)
                // for linearized insets (macros...) too
                if (e.type == BEGIN)
                        bef.after = max(bef.after, markerMargin(e));
-               if (e.type == END && e.marker != InsetMath::NO_MARKER) {
+               if (e.type == END && e.marker != marker_type::NO_MARKER) {
                        Element & aft = elements_[after(i)];
                        aft.before = max(aft.before, markerMargin(e));
                }
index 6d929ca947dceda60316d6e0cb316c40168b4735..9efab92e8535c03c52c73ddab6ffd3ad5200a10a 100644 (file)
@@ -12,7 +12,6 @@
 #ifndef MATH_ROW_H
 #define MATH_ROW_H
 
-#include "InsetMath.h"
 #include "MathClass.h"
 
 #include "ColorCode.h"
 namespace lyx {
 
 class BufferView;
+class InsetMath;
 class MathData;
 class MetricsInfo;
 class PainterInfo;
 
+enum class marker_type : int;
 
 /*
  * While for editing purpose it is important that macros are counted
@@ -67,7 +68,7 @@ public:
                /// count whether the current mathdata is nested in macro(s)
                int macro_nesting;
                /// Marker type
-               InsetMath::marker_type marker;
+               marker_type marker;
 
                /// When type is INSET
                /// the math inset (also for BEGIN and END)