[poincare] Add files to temporary Makefile

This commit is contained in:
Émilie Feral
2018-08-09 11:00:38 +02:00
parent fae7ab713f
commit 01dabbfe01
5 changed files with 19 additions and 3 deletions

View File

@@ -11,6 +11,10 @@ objs += $(addprefix poincare/src/,\
subtraction.o\
undefined.o\
infinity.o\
integer.o\
opposite.o\
decimal.o\
rational.o\
)
objsExpected += $(addprefix poincare/src/,\

View File

@@ -26,8 +26,11 @@ public:
int serialize(char * buffer, int bufferSize, Preferences::PrintFloatMode floatDisplayMode, int numberOfSignificantDigits) const override;
bool isCollapsable(int * numberOfOpenParenthesis, bool goingLeft) const override;
// TreeNode
// AllocationFailure
static CharLayoutNode * FailedAllocationStaticNode();
CharLayoutNode * failedAllocationStaticNode() override { return FailedAllocationStaticNode(); }
// TreeNode
size_t size() const override { return sizeof(CharLayoutNode); }
int numberOfChildren() const override { return 0; }
#if TREE_LOG

View File

@@ -11,6 +11,10 @@ class FractionLayoutNode : public LayoutNode {
public:
using LayoutNode::LayoutNode;
// AllocationFailure
static FractionLayoutNode * FailedAllocationStaticNode();
FractionLayoutNode * failedAllocationStaticNode() override { return FailedAllocationStaticNode(); }
// LayoutNode
void moveCursorLeft(LayoutCursor * cursor, bool * shouldRecomputeLayout) override;
void moveCursorRight(LayoutCursor * cursor, bool * shouldRecomputeLayout) override;
@@ -54,7 +58,7 @@ private:
class FractionLayoutRef : public LayoutReference {
public:
FractionLayoutRef(LayoutRef numerator, LayoutRef denominator) :
LayoutReference(TreePool::sharedPool()->createTreeNode<FractionLayoutNode>(), true)
LayoutReference(TreePool::sharedPool()->createTreeNode<FractionLayoutNode>())
{
replaceChildAtIndexInPlace(0, numerator);
replaceChildAtIndexInPlace(1, denominator);

View File

@@ -10,6 +10,11 @@ namespace Poincare {
static inline KDCoordinate max(KDCoordinate x, KDCoordinate y) { return x > y ? x : y; }
FractionLayoutNode * FractionLayoutNode::FailedAllocationStaticNode() {
static AllocationFailureLayoutNode<FractionLayoutNode> failure;
return &failure;
}
void FractionLayoutNode::moveCursorLeft(LayoutCursor * cursor, bool * shouldRecomputeLayout) {
if (cursor->position() == LayoutCursor::Position::Left
&& ((numeratorLayout() && cursor->layoutNode() == numeratorLayout())

View File

@@ -1,7 +1,7 @@
#include <poincare/integer.h>
#include <poincare/ieee754.h>
#include <poincare/layout_helper.h>
//#include <poincare/char_layout_node.h>
#include <poincare/char_layout_node.h>
#include <poincare/rational.h>
#include <cmath>
#include <utility>