summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authordante <dante19031999@gmail.com>2020-11-04 13:49:06 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-07 21:30:22 +0100
commit7acf5fe037e50557c6ddbc8d9a797dc727ce4001 (patch)
tree261058c56f44731b30b988f9aec85204a63be38a /starmath
parent03a9a80125cf887d26348486b71d78d80c99344d (diff)
Added documentation on starmath.
Gives basic description about file content and functionallity. Will allow new programmers to follow the code better. Change-Id: I76a9d61781332e3341130276c1c78ecf82e799a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105290 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/inc/node.hxx42
-rw-r--r--starmath/inc/parse.hxx6
-rw-r--r--starmath/inc/strings.hrc7
-rw-r--r--starmath/inc/strings.hxx6
-rw-r--r--starmath/inc/symbol.hxx5
-rw-r--r--starmath/inc/token.hxx10
-rw-r--r--starmath/inc/visitors.hxx13
7 files changed, 89 insertions, 0 deletions
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index 2f0b940582d8..a1dbe90305f3 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -17,6 +17,48 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+/** The SmNode is the basic structure of formula data.
+ *
+ * Each token is stored in one node of specific kind.
+ * They can have SmNodeType. It allows to identify node type after abstraction.
+ * Here goes the subclasses tree:
+ *
+ * SmRect
+ * SmNode
+ * SmStructureNode Head of tree diagram
+ * SmTableNode binom
+ * SmLineNode A line
+ * SmExpressionNode { content }
+ * SmUnHorNode unary opperators +-; -+; +x; -x; ...
+ * SmRootNode Root structure
+ * SmBinHorNode bynary opperators A + B
+ * SmBinVerNode over; frac; ...
+ * SmBinDiagonalNode wideslash
+ * SmSubSupNode csub, csup, lsub, from, to, ...
+ * SmBraceNode (); []; left lbrace right rbrace; ...
+ * SmBracebodyNode ( content ); [ content ]; ...
+ * SmVerticalBraceNode overbrace; underbrace;
+ * SmOperNode sum from to; int from to;
+ * SmAlignNode text alignment
+ * SmAttributNode font attributtes; bold;
+ * SmFontNode font serif; ...
+ * SmMatrixNode matrix
+ * SmVisibleNode drawable node
+ * SmGraphicNode graphics display
+ * SmRectangleNode
+ * SmPolyLineNode overline; underline; widehat; ...
+ * SmBlankNode blank space; ~; ...
+ * SmTextNode "text"; func functname; ...
+ * SmSpecialNode
+ * SmGlyphSpecialNode %symbolname
+ * SmMathSymbolNode math symbols
+ * SmMathIdentifierNode variable
+ * SmRootSymbolNode root symbol
+ * SmPlaceNode <?>
+ * SmErrorNode red ? for errores
+ *
+ */
+
#ifndef INCLUDED_STARMATH_INC_NODE_HXX
#define INCLUDED_STARMATH_INC_NODE_HXX
diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index e62f855bb723..f0783835fe21 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -16,6 +16,11 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+
+/** Parses the starmath code and creates the nodes.
+ *
+ */
+
#ifndef INCLUDED_STARMATH_INC_PARSE_HXX
#define INCLUDED_STARMATH_INC_PARSE_HXX
@@ -82,6 +87,7 @@ class SmParser
SmParser(const SmParser&) = delete;
SmParser& operator=(const SmParser&) = delete;
+ // Moves between tokens inside starmath code.
void NextToken();
void NextTokenColor();
void NextTokenFontSize();
diff --git a/starmath/inc/strings.hrc b/starmath/inc/strings.hrc
index 8a303127d245..09b2b394c619 100644
--- a/starmath/inc/strings.hrc
+++ b/starmath/inc/strings.hrc
@@ -17,6 +17,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+/** Those are the starmath codes descriptions for ElementsDockingWindow.hxx.
+ *
+ * Those codes will be displayed as formulas on the ElementsDockingWindow.
+ * The user can then graphically insert them.
+ * When passing the mouse over them, those descriptions will be displayed.
+ */
+
#ifndef INCLUDED_SM_INC_STRINGS_HRC
#define INCLUDED_SM_INC_STRINGS_HRC
diff --git a/starmath/inc/strings.hxx b/starmath/inc/strings.hxx
index c38419b5638e..6f81277d1a3e 100644
--- a/starmath/inc/strings.hxx
+++ b/starmath/inc/strings.hxx
@@ -7,6 +7,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+/** Those are the starmath codes for ElementsDockingWindow.hxx.
+ *
+ * Those codes will be displayed as formulas on the ElementsDockingWindow.
+ * The user can then graphically insert them.
+ */
+
#ifndef INCLUDED_STARMATH_INC_STRINGS_HXX
#define INCLUDED_STARMATH_INC_STRINGS_HXX
diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx
index 9a9a595ed13d..58f757c4e3a2 100644
--- a/starmath/inc/symbol.hxx
+++ b/starmath/inc/symbol.hxx
@@ -17,6 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+/** This stuff is used to work with %charname.
+ *
+ * Will remember the char name, char code and font.
+ */
+
#ifndef INCLUDED_STARMATH_INC_SYMBOL_HXX
#define INCLUDED_STARMATH_INC_SYMBOL_HXX
diff --git a/starmath/inc/token.hxx b/starmath/inc/token.hxx
index 4153b91c0caa..353c26275bab 100644
--- a/starmath/inc/token.hxx
+++ b/starmath/inc/token.hxx
@@ -16,6 +16,16 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+
+ /** The tokens cointain the information gathered by the parser.
+ *
+ * They contain:
+ * the data type (~ mathematical operation).
+ * The mathematical char.
+ * The corresponding code or information to recreate it.
+ * Location of the token in the starmath code.
+ */
+
#ifndef INCLUDED_STARMATH_INC_TOKEN_HXX
#define INCLUDED_STARMATH_INC_TOKEN_HXX
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index 1591d3757860..4d3c4decae23 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -6,6 +6,19 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+
+/** Visitors are an easy way to automating operations with nodes.
+ *
+ * The available visitors are:
+ * SmVisitor base class
+ * SmDefaultingVisitor default visitor
+ * SmDrawingVisitor draws formula
+ * SmCaretPosGraphBuildingVisitor position of the node inside starmath code
+ * SmCloningVisitor duplicate nodes
+ * SmNodeToTextVisitor create code from nodes
+ *
+ */
+
#ifndef INCLUDED_STARMATH_INC_VISITORS_HXX
#define INCLUDED_STARMATH_INC_VISITORS_HXX