]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathDiagram.cpp
Add support for feyn package and Diagram inset.
[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         os << '{';
60         InsetMathGrid::write(os);
61         os << "}\n";
62 }
63
64
65 void InsetMathDiagram::infoize(odocstream & os) const
66 {
67         os << "Diagram ";
68         InsetMathGrid::infoize(os);
69 }
70
71
72 void InsetMathDiagram::normalize(NormalStream & os) const
73 {
74         os << "[Diagram ";
75         InsetMathGrid::normalize(os);
76         os << ']';
77 }
78
79
80 void InsetMathDiagram::maple(MapleStream & os) const
81 {
82         os << "Diagram(";
83         InsetMathGrid::maple(os);
84         os << ')';
85 }
86
87
88 void InsetMathDiagram::validate(LaTeXFeatures & features) const
89 {
90         features.require("feyn");
91         InsetMathGrid::validate(features);
92 }
93
94
95 } // namespace lyx