Numworks Epsilon  1.4.1
Graphing Calculator Operating System
app.cpp
Go to the documentation of this file.
1 #include "app.h"
2 #include "../apps_container.h"
3 #include "sequence_icon.h"
4 
5 using namespace Poincare;
6 
7 namespace Sequence {
8 
9 I18n::Message App::Descriptor::name() {
10  return I18n::Message::SequenceApp;
11 }
12 
13 I18n::Message App::Descriptor::upperName() {
14  return I18n::Message::SequenceAppCapital;
15 }
16 
18  return ImageStore::SequenceIcon;
19 }
20 
21 App::Snapshot::Snapshot() :
22  Shared::FunctionApp::Snapshot::Snapshot(),
23  m_sequenceStore(),
24  m_graphRange(&m_cursor)
25 {
26 }
27 
29  return new App(container, this);
30 }
31 
33  FunctionApp::Snapshot::reset();
34  m_graphRange.setDefault();
35  /* We do not need to invalidate the sequence context cache here as the
36  * context is not allocated yet when reset is call (from the application
37  * settings). */
38  m_sequenceStore.removeAll();
39 }
40 
42  static Descriptor descriptor;
43  return &descriptor;
44 }
45 
47  return &m_sequenceStore;
48 }
49 
51  return &m_graphRange;
52 }
53 
54 void App::Snapshot::tidy() {
55  m_sequenceStore.tidy();
56  m_graphRange.setDelegate(nullptr);
57 }
58 
59 App::App(Container * container, Snapshot * snapshot) :
60  FunctionApp(container, snapshot, &m_inputViewController),
61  m_sequenceContext(((AppsContainer *)container)->globalContext(), snapshot->sequenceStore()),
62  m_listController(&m_listFooter, snapshot->sequenceStore(), &m_listHeader, &m_listFooter),
63  m_listFooter(&m_listHeader, &m_listController, &m_listController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGrey),
64  m_listHeader(nullptr, &m_listFooter, &m_listController),
65  m_listStackViewController(&m_tabViewController, &m_listHeader),
66  m_graphController(&m_graphAlternateEmptyViewController, snapshot->sequenceStore(), snapshot->graphRange(), snapshot->cursor(), snapshot->indexFunctionSelectedByCursor(), snapshot->modelVersion(), snapshot->rangeVersion(), snapshot->angleUnitVersion(), &m_graphHeader),
67  m_graphAlternateEmptyViewController(&m_graphHeader, &m_graphController, &m_graphController),
68  m_graphHeader(&m_graphStackViewController, &m_graphAlternateEmptyViewController, &m_graphController),
69  m_graphStackViewController(&m_tabViewController, &m_graphHeader),
70  m_valuesController(&m_valuesAlternateEmptyViewController, snapshot->sequenceStore(), snapshot->interval(), &m_valuesHeader),
71  m_valuesAlternateEmptyViewController(&m_valuesHeader, &m_valuesController, &m_valuesController),
72  m_valuesHeader(nullptr, &m_valuesAlternateEmptyViewController, &m_valuesController),
73  m_valuesStackViewController(&m_tabViewController, &m_valuesHeader),
74  m_tabViewController(&m_inputViewController, snapshot, &m_listStackViewController, &m_graphStackViewController, &m_valuesStackViewController),
75  m_inputViewController(&m_modalViewController, &m_tabViewController, &m_listController)
76 {
77 }
78 
80  return &m_inputViewController;
81 }
82 
84  return &m_sequenceContext;
85 }
86 
87 const char * App::XNT() {
88  return "n";
89 }
90 
91 }
SequenceContext * localContext() override
Definition: app.cpp:83
Snapshot * snapshot()
Definition: app.cpp:41
SequenceStore * sequenceStore()
Definition: app.cpp:46
Definition: image.h:6
InputViewController * inputViewController() override
Definition: app.cpp:79
CurveViewRange * graphRange()
Definition: app.cpp:50
ModalViewController m_modalViewController
Definition: app.h:65
Descriptor * descriptor() override
Definition: app.cpp:41
virtual const Image * icon()
Definition: app.cpp:15
virtual I18n::Message upperName()
Definition: app.cpp:11
Definition: app.cpp:7
App * unpack(Container *container) override
Definition: app.cpp:28
const char * XNT() override
Definition: app.cpp:87
FunctionApp(Container *container, Snapshot *snapshot, ViewController *rootViewController)
void reset() override
Definition: app.cpp:32
virtual I18n::Message name()
Definition: app.cpp:7