[VariableBox] Added sequences to the variable box

It is now possible to call the value of a defined sequence anywhere.

Change-Id: I1990e93c50f9add175b7ea274e07004ba63289e5
This commit is contained in:
Arthur Camouseigt
2020-09-04 16:20:33 +02:00
committed by Émilie Feral
parent c006ed7b10
commit 3dca515441
50 changed files with 297 additions and 152 deletions

View File

@@ -1,6 +1,7 @@
#include "app.h"
#include "../apps_container.h"
#include "sequence_icon.h"
#include "../shared/global_context.h"
using namespace Poincare;
@@ -20,7 +21,6 @@ const Image * App::Descriptor::icon() {
App::Snapshot::Snapshot() :
Shared::FunctionApp::Snapshot::Snapshot(),
m_sequenceStore(),
m_graphRange()
{
}
@@ -40,13 +40,12 @@ App::Descriptor * App::Snapshot::descriptor() {
}
void App::Snapshot::tidy() {
m_sequenceStore.tidy();
m_graphRange.setDelegate(nullptr);
}
App::App(Snapshot * snapshot) :
FunctionApp(snapshot, &m_inputViewController),
m_sequenceContext(AppsContainer::sharedAppsContainer()->globalContext(), snapshot->functionStore()),
m_sequenceContext(AppsContainer::sharedAppsContainer()->globalContext(), static_cast<Shared::GlobalContext *>(AppsContainer::sharedAppsContainer()->globalContext())->sequenceStore()),
m_listController(&m_listFooter, this, &m_listHeader, &m_listFooter),
m_listFooter(&m_listHeader, &m_listController, &m_listController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGray),
m_listHeader(nullptr, &m_listFooter, &m_listController),

View File

@@ -10,6 +10,8 @@
#include "values/values_controller.h"
#include "../shared/function_app.h"
#include "../shared/interval.h"
#include "../shared/global_context.h"
#include "../apps_container.h"
namespace Sequence {
@@ -27,12 +29,11 @@ public:
App * unpack(Container * container) override;
void reset() override;
Descriptor * descriptor() override;
Shared::SequenceStore * functionStore() override { return &m_sequenceStore; }
Shared::SequenceStore * functionStore() override { return static_cast<Shared::GlobalContext *>(AppsContainer::sharedAppsContainer()->globalContext())->sequenceStore(); }
CurveViewRange * graphRange() { return &m_graphRange; }
Shared::Interval * interval() { return &m_interval; }
private:
void tidy() override;
Shared::SequenceStore m_sequenceStore;
CurveViewRange m_graphRange;
Shared::Interval m_interval;
};
@@ -47,7 +48,7 @@ public:
// NestedMenuController * variableBoxForInputEventHandler(InputEventHandler * textInput) override;
CodePoint XNT() override { return 'n'; }
Shared::SequenceContext * localContext() override;
Shared::SequenceStore * functionStore() override { return snapshot()->functionStore(); }
Shared::SequenceStore * functionStore() override { return static_cast<Shared::GlobalContext *>(AppsContainer::sharedAppsContainer()->globalContext())->sequenceStore(); }
Shared::Interval * interval() { return snapshot()->interval(); }
ValuesController * valuesController() override {
return &m_valuesController;