[poincare] Serialize expression layout.

We can now convert layouts into text: we will be able to parse them
into an Expression.

Change-Id: I82f4834c08f5b2c5fb294bdcb9a49257b574e20b
This commit is contained in:
Léa Saviot
2018-01-02 16:11:06 +01:00
parent 1773dcbc34
commit ccd25a360d
38 changed files with 471 additions and 50 deletions

View File

@@ -10,17 +10,19 @@ using namespace Poincare;
* and the text which would be edited by clicking on the row. When the node is a
* subtree, the edited text is set at I18n::Message::Default. */
const int pointedLayoutPathIntegral[] = {2, 0};
const int pointedLayoutPathSum[] = {2, 1};
const int pointedLayoutPathIntegral[] = {0, 0};
const int pointedLayoutPathSum[] = {0, 1};
const ToolboxMessageTree calculChildren[4] = {
ToolboxMessageTree(I18n::Message::DiffCommandWithArg, I18n::Message::DerivateNumber, I18n::Message::DiffCommandWithArg, nullptr, 0),
ToolboxMessageTree(I18n::Message::IntCommandWithArg, I18n::Message::Integral, I18n::Message::IntCommandWithArg, nullptr, 0,
new IntegralLayout(
new EmptyVisibleLayout(),
new EmptyVisibleLayout(),
new HorizontalLayout(const_cast<Poincare::ExpressionLayout**>(Poincare::ExpressionLayout::ExpressionLayoutArray2(
new HorizontalLayout(
const_cast<Poincare::ExpressionLayout**>(Poincare::ExpressionLayout::ExpressionLayoutArray2(
new EmptyVisibleLayout(),
new StringLayout("dx",2))), 2, false), false),
new StringLayout("dx",2))), 2, false),
new EmptyVisibleLayout(),
new EmptyVisibleLayout(),
false),
const_cast<int *>(&pointedLayoutPathIntegral[0]),
2),
ToolboxMessageTree(I18n::Message::SumCommandWithArg, I18n::Message::Sum, I18n::Message::SumCommandWithArg, nullptr, 0,