mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[poincare] Change names: LayoutReference-->Layout
This commit is contained in:
@@ -24,7 +24,7 @@ EquationModelsParameterController::EquationModelsParameterController(Responder *
|
||||
for (int i = 0; i < k_numberOfExpressionCells; i++) {
|
||||
Poincare::Expression e = Expression::parse(k_models[i+1]);
|
||||
m_layouts[i] = e.createLayout(Poincare::Preferences::PrintFloatMode::Decimal, Constant::ShortNumberOfSignificantDigits);
|
||||
m_modelCells[i].setLayoutReference(m_layouts[i]);
|
||||
m_modelCells[i].setLayout(m_layouts[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ private:
|
||||
constexpr static int k_numberOfExpressionCells = k_numberOfModels-1;
|
||||
MessageTableCell m_emptyModelCell;
|
||||
ExpressionTableCell m_modelCells[k_numberOfExpressionCells];
|
||||
Poincare::LayoutReference m_layouts[k_numberOfExpressionCells];
|
||||
Poincare::Layout m_layouts[k_numberOfExpressionCells];
|
||||
SelectableTableView m_selectableTableView;
|
||||
EquationStore * m_equationStore;
|
||||
ListController * m_listController;
|
||||
|
||||
@@ -29,7 +29,7 @@ void EquationStore::tidy() {
|
||||
tidySolution();
|
||||
}
|
||||
|
||||
Poincare::LayoutReference EquationStore::exactSolutionLayoutAtIndex(int i, bool exactLayout) {
|
||||
Poincare::Layout EquationStore::exactSolutionLayoutAtIndex(int i, bool exactLayout) {
|
||||
assert(m_type != Type::Monovariable && i >= 0 && (i < m_numberOfSolutions || (i == m_numberOfSolutions && m_type == Type::PolynomialMonovariable)));
|
||||
if (exactLayout) {
|
||||
return m_exactSolutionExactLayouts[i];
|
||||
@@ -311,8 +311,8 @@ EquationStore::Error EquationStore::oneDimensialPolynomialSolve(Expression exact
|
||||
|
||||
void EquationStore::tidySolution() {
|
||||
for (int i = 0; i < k_maxNumberOfExactSolutions; i++) {
|
||||
m_exactSolutionExactLayouts[i] = LayoutReference();
|
||||
m_exactSolutionApproximateLayouts[i] = LayoutReference();
|
||||
m_exactSolutionExactLayouts[i] = Layout();
|
||||
m_exactSolutionApproximateLayouts[i] = Layout();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
* Layout and an approximate layout. For example, 'sqrt(2)' and '1.414213'.
|
||||
* The boolean exactLayout indicates if we want the exact layout or the
|
||||
* approximate one. */
|
||||
Poincare::LayoutReference exactSolutionLayoutAtIndex(int i, bool exactLayout);
|
||||
Poincare::Layout exactSolutionLayoutAtIndex(int i, bool exactLayout);
|
||||
/* Exact layout and approximate layout of an exact solution can be:
|
||||
* - identical: for instance, 5 and 5
|
||||
* - equal: for instance 1/2 and 0.5
|
||||
@@ -86,8 +86,8 @@ private:
|
||||
Type m_type;
|
||||
char m_variables[Poincare::Expression::k_maxNumberOfVariables+1];
|
||||
int m_numberOfSolutions;
|
||||
Poincare::LayoutReference m_exactSolutionExactLayouts[k_maxNumberOfApproximateSolutions];
|
||||
Poincare::LayoutReference m_exactSolutionApproximateLayouts[k_maxNumberOfExactSolutions];
|
||||
Poincare::Layout m_exactSolutionExactLayouts[k_maxNumberOfApproximateSolutions];
|
||||
Poincare::Layout m_exactSolutionApproximateLayouts[k_maxNumberOfExactSolutions];
|
||||
bool m_exactSolutionIdentity[k_maxNumberOfExactSolutions];
|
||||
bool m_exactSolutionEquality[k_maxNumberOfExactSolutions];
|
||||
double m_intervalApproximateSolutions[2];
|
||||
|
||||
@@ -161,7 +161,7 @@ bool ListController::textFieldDidFinishEditing(TextField * textField, const char
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ListController::layoutFieldDidFinishEditing(LayoutField * layoutField, Poincare::LayoutReference layout, Ion::Events::Event event) {
|
||||
bool ListController::layoutFieldDidFinishEditing(LayoutField * layoutField, Poincare::Layout layout, Ion::Events::Event event) {
|
||||
reloadButtonMessage();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
bool textFieldDidReceiveEvent(TextField * textField, Ion::Events::Event event) override;
|
||||
bool layoutFieldDidReceiveEvent(LayoutField * layoutField, Ion::Events::Event event) override;
|
||||
bool textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) override;
|
||||
bool layoutFieldDidFinishEditing(LayoutField * layoutField, Poincare::LayoutReference layout, Ion::Events::Event event) override;
|
||||
bool layoutFieldDidFinishEditing(LayoutField * layoutField, Poincare::Layout layout, Ion::Events::Event event) override;
|
||||
/* Specific to Solver */
|
||||
void resolveEquations();
|
||||
private:
|
||||
|
||||
@@ -66,9 +66,9 @@ SolutionsController::SolutionsController(Responder * parentResponder, EquationSt
|
||||
m_delta2Layout(),
|
||||
m_contentView(this)
|
||||
{
|
||||
m_delta2Layout = HorizontalLayoutReference(VerticalOffsetLayoutReference(CharLayoutReference('2', KDText::FontSize::Small), VerticalOffsetLayoutNode::Type::Superscript), LayoutHelper::String("-4ac", 4, KDText::FontSize::Small));
|
||||
m_delta2Layout = HorizontalLayout(VerticalOffsetLayout(CharLayout('2', KDText::FontSize::Small), VerticalOffsetLayoutNode::Type::Superscript), LayoutHelper::String("-4ac", 4, KDText::FontSize::Small));
|
||||
char deltaB[] = {Ion::Charset::CapitalDelta, '=', 'b'};
|
||||
static_cast<HorizontalLayoutReference&>(m_delta2Layout).addOrMergeChildAtIndex(LayoutHelper::String(deltaB, 3, KDText::FontSize::Small), 0, false);
|
||||
static_cast<HorizontalLayout&>(m_delta2Layout).addOrMergeChildAtIndex(LayoutHelper::String(deltaB, 3, KDText::FontSize::Small), 0, false);
|
||||
for (int i = 0; i < EquationStore::k_maxNumberOfExactSolutions; i++) {
|
||||
m_exactValueCells[i].setParentResponder(m_contentView.selectableTableView());
|
||||
}
|
||||
@@ -145,7 +145,7 @@ void SolutionsController::willDisplayCellAtLocation(HighlightCell * cell, int i,
|
||||
if (i == 0) {
|
||||
if (m_equationStore->type() == EquationStore::Type::PolynomialMonovariable && j == m_equationStore->numberOfSolutions()) {
|
||||
EvenOddExpressionCell * deltaCell = static_cast<EvenOddExpressionCell *>(cell);
|
||||
deltaCell->setLayoutReference(m_delta2Layout);
|
||||
deltaCell->setLayout(m_delta2Layout);
|
||||
} else {
|
||||
EvenOddBufferTextCell * symbolCell = static_cast<EvenOddBufferTextCell *>(cell);
|
||||
symbolCell->setFontSize(KDText::FontSize::Large);
|
||||
@@ -171,7 +171,7 @@ void SolutionsController::willDisplayCellAtLocation(HighlightCell * cell, int i,
|
||||
valueCell->setText(bufferValue);
|
||||
} else {
|
||||
Shared::ScrollableExactApproximateExpressionsCell * valueCell = static_cast<ScrollableExactApproximateExpressionsCell *>(cell);
|
||||
Poincare::LayoutReference exactLayout = m_equationStore->exactSolutionLayoutsAtIndexAreIdentical(j) ? Poincare::LayoutReference() : m_equationStore->exactSolutionLayoutAtIndex(j, true);
|
||||
Poincare::Layout exactLayout = m_equationStore->exactSolutionLayoutsAtIndexAreIdentical(j) ? Poincare::Layout() : m_equationStore->exactSolutionLayoutAtIndex(j, true);
|
||||
valueCell->setLayouts(m_equationStore->exactSolutionLayoutAtIndex(j, false), exactLayout);
|
||||
if (!exactLayout.isUninitialized()) {
|
||||
valueCell->setEqualMessage(m_equationStore->exactSolutionLayoutsAtIndexAreEqual(j) ? I18n::Message::Equal : I18n::Message::AlmostEqual);
|
||||
@@ -194,8 +194,8 @@ KDCoordinate SolutionsController::rowHeight(int j) {
|
||||
if (m_equationStore->type() == EquationStore::Type::Monovariable) {
|
||||
return k_defaultCellHeight;
|
||||
}
|
||||
Poincare::LayoutReference exactLayout = m_equationStore->exactSolutionLayoutAtIndex(j, true);
|
||||
Poincare::LayoutReference approximateLayout = m_equationStore->exactSolutionLayoutAtIndex(j, false);
|
||||
Poincare::Layout exactLayout = m_equationStore->exactSolutionLayoutAtIndex(j, true);
|
||||
Poincare::Layout approximateLayout = m_equationStore->exactSolutionLayoutAtIndex(j, false);
|
||||
KDCoordinate exactLayoutHeight = exactLayout.layoutSize().height();
|
||||
KDCoordinate approximateLayoutHeight = approximateLayout.layoutSize().height();
|
||||
KDCoordinate layoutHeight = max(exactLayout.baseline(), approximateLayout.baseline()) + max(exactLayoutHeight-exactLayout.baseline(), approximateLayoutHeight-approximateLayout.baseline());
|
||||
|
||||
@@ -58,7 +58,7 @@ private:
|
||||
EquationStore * m_equationStore;
|
||||
EvenOddBufferTextCell m_symbolCells[EquationStore::k_maxNumberOfSolutions];
|
||||
EvenOddExpressionCell m_deltaCell;
|
||||
Poincare::LayoutReference m_delta2Layout;
|
||||
Poincare::Layout m_delta2Layout;
|
||||
Shared::ScrollableExactApproximateExpressionsCell m_exactValueCells[EquationStore::k_maxNumberOfExactSolutions];
|
||||
EvenOddBufferTextCell m_approximateValueCells[EquationStore::k_maxNumberOfApproximateSolutions];
|
||||
ContentView m_contentView;
|
||||
|
||||
Reference in New Issue
Block a user