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 "graph_icon.h"
4 #include "../i18n.h"
5 
6 using namespace Poincare;
7 using namespace Shared;
8 
9 namespace Graph {
10 
11 I18n::Message App::Descriptor::name() {
12  return I18n::Message::FunctionApp;
13 }
14 
15 I18n::Message App::Descriptor::upperName() {
16  return I18n::Message::FunctionAppCapital;
17 }
18 
20  return ImageStore::GraphIcon;
21 }
22 
23 App::Snapshot::Snapshot() :
25  m_functionStore(),
26  m_graphRange(&m_cursor)
27 {
28 }
29 
31  return new App(container, this);
32 }
33 
35  FunctionApp::Snapshot::reset();
36  m_functionStore.removeAll();
37  m_graphRange.setDefault();
38 }
39 
41  static Descriptor descriptor;
42  return &descriptor;
43 }
44 
46  return &m_functionStore;
47 }
48 
50  return &m_graphRange;
51 }
52 
53 void App::Snapshot::tidy() {
54  m_functionStore.tidy();
55  m_graphRange.setDelegate(nullptr);
56 }
57 
58 App::App(Container * container, Snapshot * snapshot) :
59  FunctionApp(container, snapshot, &m_inputViewController),
60  m_listController(&m_listFooter, snapshot->functionStore(), &m_listHeader, &m_listFooter),
61  m_listFooter(&m_listHeader, &m_listController, &m_listController, ButtonRowController::Position::Bottom, ButtonRowController::Style::EmbossedGrey),
62  m_listHeader(&m_listStackViewController, &m_listFooter, &m_listController),
63  m_listStackViewController(&m_tabViewController, &m_listHeader),
64  m_graphController(&m_graphAlternateEmptyViewController, snapshot->functionStore(), snapshot->graphRange(), snapshot->cursor(), snapshot->indexFunctionSelectedByCursor(), snapshot->modelVersion(), snapshot->rangeVersion(), snapshot->angleUnitVersion(), &m_graphHeader),
65  m_graphAlternateEmptyViewController(&m_graphHeader, &m_graphController, &m_graphController),
66  m_graphHeader(&m_graphStackViewController, &m_graphAlternateEmptyViewController, &m_graphController),
67  m_graphStackViewController(&m_tabViewController, &m_graphHeader),
68  m_valuesController(&m_valuesAlternateEmptyViewController, snapshot->functionStore(), snapshot->interval(), &m_valuesHeader),
69  m_valuesAlternateEmptyViewController(&m_valuesHeader, &m_valuesController, &m_valuesController),
70  m_valuesHeader(&m_valuesStackViewController, &m_valuesAlternateEmptyViewController, &m_valuesController),
71  m_valuesStackViewController(&m_tabViewController, &m_valuesHeader),
72  m_tabViewController(&m_inputViewController, snapshot, &m_listStackViewController, &m_graphStackViewController, &m_valuesStackViewController),
73  m_inputViewController(&m_modalViewController, &m_tabViewController, this)
74 {
75 }
76 
78  return &m_inputViewController;
79 }
80 
81 const char * App::XNT() {
82  return "x";
83 }
84 
85 }
const char * XNT() override
Definition: app.cpp:81
App * unpack(Container *container) override
Definition: app.cpp:30
Snapshot * snapshot()
Definition: app.cpp:41
Definition: image.h:6
Definition: app.h:14
Definition: app.cpp:9
InputViewController * inputViewController() override
Definition: app.cpp:77
ModalViewController m_modalViewController
Definition: app.h:65
Descriptor * descriptor() override
Definition: app.cpp:40
Shared::InteractiveCurveViewRange * graphRange()
Definition: app.cpp:49
CartesianFunctionStore * functionStore()
Definition: app.cpp:45
virtual const Image * icon()
Definition: app.cpp:15
virtual I18n::Message upperName()
Definition: app.cpp:11
void reset() override
Definition: app.cpp:34
virtual I18n::Message name()
Definition: app.cpp:7