]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathDiagram.cpp
Replace boost::scoped_ptr with unique_ptr
[lyx.git] / src / mathed / InsetMathDiagram.cpp
1 /**
2  * \file InsetMathDiagram.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  * \author Ronen Abravanel
8 *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "InsetMathDiagram.h"
15
16 #include "LaTeXFeatures.h"
17 #include "MathStream.h"
18
19 #include <ostream>
20
21 namespace lyx {
22
23
24 InsetMathDiagram::InsetMathDiagram(Buffer * buf) : InsetMathGrid(buf, 1, 1)
25 {
26 }
27
28
29 Inset * InsetMathDiagram::clone() const
30 {
31         return new InsetMathDiagram(*this);
32 }
33
34
35 int InsetMathDiagram::colsep() const
36 {
37         return 10;
38 }
39
40
41 int InsetMathDiagram::rowsep() const
42 {
43         return 10;
44 }
45
46
47 void InsetMathDiagram::metrics(MetricsInfo & mi, Dimension & dim) const
48 {
49         if (mi.base.style == LM_ST_DISPLAY)
50                 mi.base.style = LM_ST_TEXT;
51         InsetMathGrid::metrics(mi, dim);
52 }
53
54
55 void InsetMathDiagram::write(WriteStream & os) const
56 {
57         MathEnsurer ensurer(os);
58         os << "\\Diagram";
59         bool open = os.startOuterRow();
60         os << '{';
61         InsetMathGrid::write(os);
62         os << "}\n";
63         if (open)
64                 os.startOuterRow();
65 }
66
67
68 void InsetMathDiagram::infoize(odocstream & os) const
69 {
70         os << "Diagram ";
71         InsetMathGrid::infoize(os);
72 }
73
74
75 void InsetMathDiagram::normalize(NormalStream & os) const
76 {
77         os << "[Diagram ";
78         InsetMathGrid::normalize(os);
79         os << ']';
80 }
81
82
83 void InsetMathDiagram::maple(MapleStream & os) const
84 {
85         os << "Diagram(";
86         InsetMathGrid::maple(os);
87         os << ')';
88 }
89
90
91 void InsetMathDiagram::validate(LaTeXFeatures & features) const
92 {
93         features.require("feyn");
94         InsetMathGrid::validate(features);
95 }
96
97
98 } // namespace lyx