mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 06:10:31 +01:00
[poincare] Rename BracketLeftRightLayout -> BracketLayout
Change-Id: If5e7b36a4d0a1d26b2793506f1ffb2eb146bf14f
This commit is contained in:
@@ -93,7 +93,7 @@ objs += $(addprefix poincare/src/layout/,\
|
||||
bounded_static_layout_hierarchy.o\
|
||||
bracket_pair_layout.o\
|
||||
left_bracket_layout.o\
|
||||
bracket_left_right_layout.o\
|
||||
bracket_layout.o\
|
||||
right_bracket_layout.o\
|
||||
ceiling_layout.o\
|
||||
char_layout.o\
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "bracket_left_right_layout.h"
|
||||
#include "bracket_layout.h"
|
||||
#include <poincare/expression_layout_cursor.h>
|
||||
extern "C" {
|
||||
#include <assert.h>
|
||||
@@ -7,18 +7,18 @@ extern "C" {
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
BracketLeftRightLayout::BracketLeftRightLayout() :
|
||||
BracketLayout::BracketLayout() :
|
||||
StaticLayoutHierarchy<0>(),
|
||||
m_operandHeightComputed(false)
|
||||
{
|
||||
}
|
||||
|
||||
void BracketLeftRightLayout::invalidAllSizesPositionsAndBaselines() {
|
||||
void BracketLayout::invalidAllSizesPositionsAndBaselines() {
|
||||
m_operandHeightComputed = false;
|
||||
ExpressionLayout::invalidAllSizesPositionsAndBaselines();
|
||||
}
|
||||
|
||||
bool BracketLeftRightLayout::moveLeft(ExpressionLayoutCursor * cursor, bool * shouldRecomputeLayout) {
|
||||
bool BracketLayout::moveLeft(ExpressionLayoutCursor * cursor, bool * shouldRecomputeLayout) {
|
||||
assert(cursor->pointedExpressionLayout() == this);
|
||||
// Case: Right.
|
||||
// Go Left.
|
||||
@@ -35,7 +35,7 @@ bool BracketLeftRightLayout::moveLeft(ExpressionLayoutCursor * cursor, bool * sh
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BracketLeftRightLayout::moveRight(ExpressionLayoutCursor * cursor, bool * shouldRecomputeLayout) {
|
||||
bool BracketLayout::moveRight(ExpressionLayoutCursor * cursor, bool * shouldRecomputeLayout) {
|
||||
assert(cursor->pointedExpressionLayout() == this);
|
||||
// Case: Left.
|
||||
// Go Right.
|
||||
@@ -53,11 +53,11 @@ bool BracketLeftRightLayout::moveRight(ExpressionLayoutCursor * cursor, bool * s
|
||||
}
|
||||
|
||||
|
||||
KDSize BracketLeftRightLayout::computeSize() {
|
||||
KDSize BracketLayout::computeSize() {
|
||||
return KDSize(k_externWidthMargin + k_lineThickness + k_widthMargin, operandHeight() + k_lineThickness);
|
||||
}
|
||||
|
||||
KDCoordinate BracketLeftRightLayout::operandHeight() {
|
||||
KDCoordinate BracketLayout::operandHeight() {
|
||||
if (!m_operandHeightComputed) {
|
||||
computeOperandHeight();
|
||||
m_operandHeightComputed = true;
|
||||
@@ -65,7 +65,7 @@ KDCoordinate BracketLeftRightLayout::operandHeight() {
|
||||
return m_operandHeight;
|
||||
}
|
||||
|
||||
KDPoint BracketLeftRightLayout::positionOfChild(ExpressionLayout * child) {
|
||||
KDPoint BracketLayout::positionOfChild(ExpressionLayout * child) {
|
||||
assert(false);
|
||||
return KDPointZero;
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
#ifndef POINCARE_BRACKET_LEFT_RIGHT_LAYOUT_H
|
||||
#define POINCARE_BRACKET_LEFT_RIGHT_LAYOUT_H
|
||||
#ifndef POINCARE_BRACKET_LAYOUT_H
|
||||
#define POINCARE_BRACKET_LAYOUT_H
|
||||
|
||||
#include <poincare/static_layout_hierarchy.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class BracketLeftRightLayout : public StaticLayoutHierarchy<0> {
|
||||
class BracketLayout : public StaticLayoutHierarchy<0> {
|
||||
public:
|
||||
BracketLeftRightLayout();
|
||||
BracketLayout();
|
||||
void invalidAllSizesPositionsAndBaselines() override;
|
||||
bool moveLeft(ExpressionLayoutCursor * cursor, bool * shouldRecomputeLayout) override;
|
||||
bool moveRight(ExpressionLayoutCursor * cursor, bool * shouldRecomputeLayout) override;
|
||||
@@ -1,14 +1,14 @@
|
||||
#ifndef POINCARE_BRACKET_LEFT_LAYOUT_H
|
||||
#define POINCARE_BRACKET_LEFT_LAYOUT_H
|
||||
|
||||
#include <poincare/src/layout/bracket_left_right_layout.h>
|
||||
#include <poincare/src/layout/bracket_layout.h>
|
||||
#include <poincare/layout_engine.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class LeftBracketLayout : public BracketLeftRightLayout {
|
||||
class LeftBracketLayout : public BracketLayout {
|
||||
public:
|
||||
using BracketLeftRightLayout::BracketLeftRightLayout;
|
||||
using BracketLayout::BracketLayout;
|
||||
ExpressionLayout * clone() const override;
|
||||
int writeTextInBuffer(char * buffer, int bufferSize, int numberOfSignificantDigits = PrintFloat::k_numberOfStoredSignificantDigits) const override {
|
||||
return LayoutEngine::writeOneCharInBuffer(buffer, bufferSize, '[');
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#ifndef POINCARE_BRACKET_RIGHT_LAYOUT_H
|
||||
#define POINCARE_BRACKET_RIGHT_LAYOUT_H
|
||||
|
||||
#include <poincare/src/layout/bracket_left_right_layout.h>
|
||||
#include <poincare/src/layout/bracket_layout.h>
|
||||
#include <poincare/layout_engine.h>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
class RightBracketLayout : public BracketLeftRightLayout {
|
||||
class RightBracketLayout : public BracketLayout {
|
||||
public:
|
||||
using BracketLeftRightLayout::BracketLeftRightLayout;
|
||||
using BracketLayout::BracketLayout;
|
||||
ExpressionLayout * clone() const override;
|
||||
int writeTextInBuffer(char * buffer, int bufferSize, int numberOfSignificantDigits = PrintFloat::k_numberOfStoredSignificantDigits) const override {
|
||||
return LayoutEngine::writeOneCharInBuffer(buffer, bufferSize, ']');
|
||||
|
||||
Reference in New Issue
Block a user