[poincare] Rename ParenthesisRightLayout into RightParenthesisLayout

Change-Id: I4f104d5a214c98024ad2e0a0bb2f5ffe63c92495
This commit is contained in:
Léa Saviot
2018-04-19 15:07:04 +02:00
parent dfd34cbd04
commit 16fa9a0975
9 changed files with 26 additions and 26 deletions

View File

@@ -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\

View File

@@ -20,7 +20,7 @@
#include <poincare/src/layout/matrix_layout.h>
#include <poincare/src/layout/nth_root_layout.h>
#include <poincare/src/layout/parenthesis_left_layout.h>
#include <poincare/src/layout/parenthesis_right_layout.h>
#include <poincare/src/layout/right_parenthesis_layout.h>
#include <poincare/src/layout/product_layout.h>
#include <poincare/src/layout/sequence_layout.h>
#include <poincare/src/layout/sum_layout.h>

View File

@@ -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] == ']') {

View File

@@ -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 <poincare/expression_layout_cursor.h>
#include <poincare/expression_layout_array.h>
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()) {

View File

@@ -1,4 +1,4 @@
#include "parenthesis_right_layout.h"
#include "right_parenthesis_layout.h"
extern "C" {
#include <assert.h>
#include <stdlib.h>
@@ -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,

View File

@@ -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 <poincare/src/layout/parenthesis_layout.h>
#include <poincare/layout_engine.h>
namespace Poincare {
class ParenthesisRightLayout : public ParenthesisLayout {
class RightParenthesisLayout : public ParenthesisLayout {
friend class BinomialCoefficientLayout;
friend class SequenceLayout;
public:

View File

@@ -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 <poincare/expression_layout_cursor.h>
#include <assert.h>
@@ -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());

View File

@@ -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 <ion/charset.h>
#include <poincare/expression_layout_cursor.h>
#include <poincare/layout_engine.h>
@@ -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;
}

View File

@@ -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<assert.h>
@@ -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;
}