Blame view

build1/epsilon-master/apps/shared/function_app.cpp 1.56 KB
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
  #include "function_app.h"
  #include "../apps_container.h"
  
  using namespace Poincare;
  
  namespace Shared {
  
  FunctionApp::Snapshot::Snapshot() :
    m_cursor(),
    m_interval(),
    m_indexFunctionSelectedByCursor(0),
    m_modelVersion(0),
    m_rangeVersion(0),
    m_angleUnitVersion(Expression::AngleUnit::Radian)
  {
    m_interval.setStart(0);
    m_interval.setEnd(10);
    m_interval.setStep(1);
  }
  
  CurveViewCursor * FunctionApp::Snapshot::cursor() {
    return &m_cursor;
  }
  
  uint32_t * FunctionApp::Snapshot::modelVersion() {
    return &m_modelVersion;
  }
  
  uint32_t * FunctionApp::Snapshot::rangeVersion() {
    return &m_rangeVersion;
  }
  
  Expression::AngleUnit * FunctionApp::Snapshot::angleUnitVersion() {
    return &m_angleUnitVersion;
  }
  
  Interval * FunctionApp::Snapshot::interval() {
    return &m_interval;
  }
  
  int * FunctionApp::Snapshot::indexFunctionSelectedByCursor() {
    return &m_indexFunctionSelectedByCursor;
  }
  
  void FunctionApp::Snapshot::reset() {
    m_interval.setStart(0);
    m_interval.setEnd(10);
    m_interval.setStep(1);
    m_indexFunctionSelectedByCursor = 0;
    m_modelVersion = 0;
    m_rangeVersion = 0;
    setActiveTab(0);
  }
  
  FunctionApp::FunctionApp(Container * container, Snapshot * snapshot, ViewController * rootViewController) :
    ExpressionFieldDelegateApp(container, snapshot, rootViewController)
  {
  }
  
  void FunctionApp::willBecomeInactive() {
    if (m_modalViewController.isDisplayingModal()) {
      m_modalViewController.dismissModalViewController();
    }
    if (inputViewController()->isDisplayingModal()) {
      inputViewController()->abortEditionAndDismiss();
    }
    ::App::willBecomeInactive();
  }
  
  }