diff --git a/poincare/Makefile b/poincare/Makefile index 4634ba8c1..7c4f18a88 100644 --- a/poincare/Makefile +++ b/poincare/Makefile @@ -111,7 +111,7 @@ objs += $(addprefix poincare/src/layout/,\ nth_root_layout.o\ parenthesis_left_layout.o\ parenthesis_layout.o\ - parenthesis_right_layout.o\ + right_parenthesis_layout.o\ product_layout.o\ sequence_layout.o\ static_layout_hierarchy.o\ diff --git a/poincare/include/poincare_layouts.h b/poincare/include/poincare_layouts.h index 28e742db7..fff7cef2c 100644 --- a/poincare/include/poincare_layouts.h +++ b/poincare/include/poincare_layouts.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/poincare/src/expression_layout_cursor.cpp b/poincare/src/expression_layout_cursor.cpp index 3c835d8d9..442b90c21 100644 --- a/poincare/src/expression_layout_cursor.cpp +++ b/poincare/src/expression_layout_cursor.cpp @@ -176,7 +176,7 @@ void ExpressionLayoutCursor::insertText(const char * text) { pointedChild = newChild; } } else if (text[i] == ')') { - newChild = new ParenthesisRightLayout(); + newChild = new RightParenthesisLayout(); } else if (text[i] == '[') { newChild = new BracketLeftLayout(); } else if (text[i] == ']') { diff --git a/poincare/src/layout/binomial_coefficient_layout.cpp b/poincare/src/layout/binomial_coefficient_layout.cpp index 7e39c9883..c1b8167c1 100644 --- a/poincare/src/layout/binomial_coefficient_layout.cpp +++ b/poincare/src/layout/binomial_coefficient_layout.cpp @@ -4,7 +4,7 @@ #include "horizontal_layout.h" #include "parenthesis_left_layout.h" #include "parenthesis_layout.h" -#include "parenthesis_right_layout.h" +#include "right_parenthesis_layout.h" #include #include extern "C" { @@ -97,7 +97,7 @@ bool BinomialCoefficientLayout::moveDown(ExpressionLayoutCursor * cursor, bool * void BinomialCoefficientLayout::render(KDContext * ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor) { // Render the parentheses. ParenthesisLeftLayout * dummyLeftParenthesis = new ParenthesisLeftLayout(); - ParenthesisRightLayout * dummyRightParenthesis = new ParenthesisRightLayout(); + RightParenthesisLayout * dummyRightParenthesis = new RightParenthesisLayout(); GridLayout * dummyGridLayout = new GridLayout(ExpressionLayoutArray(nLayout(), kLayout()).array(), 2, 1, true); HorizontalLayout dummyLayout(dummyLeftParenthesis, dummyGridLayout, dummyRightParenthesis, false); KDPoint leftParenthesisPoint = dummyLayout.positionOfChild(dummyLeftParenthesis); @@ -118,7 +118,7 @@ void BinomialCoefficientLayout::computeBaseline() { KDPoint BinomialCoefficientLayout::positionOfChild(ExpressionLayout * child) { ParenthesisLeftLayout * dummyLeftParenthesis = new ParenthesisLeftLayout(); - ParenthesisRightLayout * dummyRightParenthesis = new ParenthesisRightLayout(); + RightParenthesisLayout * dummyRightParenthesis = new RightParenthesisLayout(); GridLayout * dummyGridLayout = new GridLayout(ExpressionLayoutArray(nLayout(), kLayout()).array(), 2, 1, true); HorizontalLayout dummyLayout(dummyLeftParenthesis, dummyGridLayout, dummyRightParenthesis, false); if (child == nLayout()) { diff --git a/poincare/src/layout/parenthesis_right_layout.cpp b/poincare/src/layout/right_parenthesis_layout.cpp similarity index 89% rename from poincare/src/layout/parenthesis_right_layout.cpp rename to poincare/src/layout/right_parenthesis_layout.cpp index 7ac78ef93..369cca075 100644 --- a/poincare/src/layout/parenthesis_right_layout.cpp +++ b/poincare/src/layout/right_parenthesis_layout.cpp @@ -1,4 +1,4 @@ -#include "parenthesis_right_layout.h" +#include "right_parenthesis_layout.h" extern "C" { #include #include @@ -26,12 +26,12 @@ const uint8_t bottomRightCurve[ParenthesisLayout::k_parenthesisCurveHeight][Pare {0x66, 0xF9, 0xFF, 0xFF, 0xFF}, }; -ExpressionLayout * ParenthesisRightLayout::clone() const { - ParenthesisRightLayout * layout = new ParenthesisRightLayout(); +ExpressionLayout * RightParenthesisLayout::clone() const { + RightParenthesisLayout * layout = new RightParenthesisLayout(); return layout; } -bool ParenthesisRightLayout::isCollapsable(int * numberOfOpenParenthesis, bool goingLeft) const { +bool RightParenthesisLayout::isCollapsable(int * numberOfOpenParenthesis, bool goingLeft) const { if (*numberOfOpenParenthesis == 0 && !goingLeft) { return false; } @@ -39,7 +39,7 @@ bool ParenthesisRightLayout::isCollapsable(int * numberOfOpenParenthesis, bool g return true; } -void ParenthesisRightLayout::render(KDContext * ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor) { +void RightParenthesisLayout::render(KDContext * ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor) { KDRect frame = KDRect(p.x() + ParenthesisLayout::k_widthMargin + ParenthesisLayout::k_lineThickness - ParenthesisLayout::k_parenthesisCurveWidth, p.y() + ParenthesisLayout::k_externHeightMargin, ParenthesisLayout::k_parenthesisCurveWidth, diff --git a/poincare/src/layout/parenthesis_right_layout.h b/poincare/src/layout/right_parenthesis_layout.h similarity index 84% rename from poincare/src/layout/parenthesis_right_layout.h rename to poincare/src/layout/right_parenthesis_layout.h index 63565c827..a4606acce 100644 --- a/poincare/src/layout/parenthesis_right_layout.h +++ b/poincare/src/layout/right_parenthesis_layout.h @@ -1,12 +1,12 @@ -#ifndef POINCARE_PARENTHESIS_RIGHT_LAYOUT_H -#define POINCARE_PARENTHESIS_RIGHT_LAYOUT_H +#ifndef POINCARE_RIGHT_PARENTHESIS_LAYOUT_H +#define POINCARE_RIGHT_PARENTHESIS_LAYOUT_H #include #include namespace Poincare { -class ParenthesisRightLayout : public ParenthesisLayout { +class RightParenthesisLayout : public ParenthesisLayout { friend class BinomialCoefficientLayout; friend class SequenceLayout; public: diff --git a/poincare/src/layout/sequence_layout.cpp b/poincare/src/layout/sequence_layout.cpp index 96a192d29..76a17985e 100644 --- a/poincare/src/layout/sequence_layout.cpp +++ b/poincare/src/layout/sequence_layout.cpp @@ -2,7 +2,7 @@ #include "char_layout.h" #include "horizontal_layout.h" #include "parenthesis_left_layout.h" -#include "parenthesis_right_layout.h" +#include "right_parenthesis_layout.h" #include #include @@ -194,7 +194,7 @@ ExpressionLayout * SequenceLayout::argumentLayout() { KDSize SequenceLayout::computeSize() { KDSize lowerBoundSizeWithNEquals = HorizontalLayout(new CharLayout('n'), new CharLayout('='), lowerBoundLayout()->clone(), false).size(); ParenthesisLeftLayout * dummyLeftParenthesis = new ParenthesisLeftLayout(); - ParenthesisRightLayout * dummyRightParenthesis = new ParenthesisRightLayout(); + RightParenthesisLayout * dummyRightParenthesis = new RightParenthesisLayout(); HorizontalLayout dummyLayout2(dummyLeftParenthesis, argumentLayout()->clone(), dummyRightParenthesis, false); KDSize dummyLayoutSize = dummyLayout2.size(); KDSize upperBoundSize = upperBoundLayout()->size(); @@ -240,7 +240,7 @@ void SequenceLayout::render(KDContext * ctx, KDPoint p, KDColor expressionColor, // Render the parentheses. ParenthesisLeftLayout * dummyLeftParenthesis = new ParenthesisLeftLayout(); - ParenthesisRightLayout * dummyRightParenthesis = new ParenthesisRightLayout(); + RightParenthesisLayout * dummyRightParenthesis = new RightParenthesisLayout(); HorizontalLayout dummyLayout2(dummyLeftParenthesis, argumentLayout()->clone(), dummyRightParenthesis, false); KDPoint leftParenthesisPoint = positionOfChild(argumentLayout()).translatedBy(dummyLayout2.positionOfChild(dummyLeftParenthesis)).translatedBy(dummyLayout2.positionOfChild(dummyLayout2.editableChild(1)).opposite()); KDPoint rightParenthesisPoint = positionOfChild(argumentLayout()).translatedBy(dummyLayout2.positionOfChild(dummyRightParenthesis)).translatedBy(dummyLayout2.positionOfChild(dummyLayout2.editableChild(1)).opposite()); diff --git a/poincare/src/layout/vertical_offset_layout.cpp b/poincare/src/layout/vertical_offset_layout.cpp index 9a4e9e2a4..7d523a402 100644 --- a/poincare/src/layout/vertical_offset_layout.cpp +++ b/poincare/src/layout/vertical_offset_layout.cpp @@ -1,7 +1,7 @@ #include "vertical_offset_layout.h" #include "empty_layout.h" #include "parenthesis_left_layout.h" -#include "parenthesis_right_layout.h" +#include "right_parenthesis_layout.h" #include #include #include @@ -296,18 +296,18 @@ void VerticalOffsetLayout::privateAddBrother(ExpressionLayoutCursor * cursor, Ex indexInParent++; // Add the Right parenthesis - ParenthesisRightLayout * parenthesisRight = new ParenthesisRightLayout(); + RightParenthesisLayout * rightParenthesis = new RightParenthesisLayout(); if (cursor->position() == ExpressionLayoutCursor::Position::Right) { - m_parent->addChildAtIndex(parenthesisRight, indexInParent + 1); + m_parent->addChildAtIndex(rightParenthesis, indexInParent + 1); } else { assert(cursor->position() == ExpressionLayoutCursor::Position::Left); - m_parent->addChildAtIndex(parenthesisRight, indexInParent); + m_parent->addChildAtIndex(rightParenthesis, indexInParent); } - cursor->setPointedExpressionLayout(parenthesisRight); + cursor->setPointedExpressionLayout(rightParenthesis); if (moveCursor) { - parenthesisRight->addBrotherAndMoveCursor(cursor, brother); + rightParenthesis->addBrotherAndMoveCursor(cursor, brother); } else { - parenthesisRight->addBrother(cursor, brother); + rightParenthesis->addBrother(cursor, brother); } return; } diff --git a/poincare/src/layout_engine.cpp b/poincare/src/layout_engine.cpp index 48f21fd80..4bc28c2d0 100644 --- a/poincare/src/layout_engine.cpp +++ b/poincare/src/layout_engine.cpp @@ -2,7 +2,7 @@ #include "layout/char_layout.h" #include "layout/horizontal_layout.h" #include "layout/parenthesis_left_layout.h" -#include "layout/parenthesis_right_layout.h" +#include "layout/right_parenthesis_layout.h" #include "layout/vertical_offset_layout.h" extern "C" { #include @@ -59,7 +59,7 @@ ExpressionLayout * LayoutEngine::createParenthesedLayout(ExpressionLayout * layo if (layout != nullptr) { result->addOrMergeChildAtIndex(cloneLayout ? layout->clone() : layout, 1, true); } - result->addChildAtIndex(new ParenthesisRightLayout(), result->numberOfChildren()); + result->addChildAtIndex(new RightParenthesisLayout(), result->numberOfChildren()); return result; }