Blame view

build2/epsilon-master/apps/settings/helpers.cpp 974 Bytes
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
  #include "helpers.h"
  #include <poincare/layout_engine.h>
  #include <ion/charset.h>
  #include "../../poincare/src/layout/horizontal_layout.h"
  #include "../../poincare/src/layout/vertical_offset_layout.h"
  
  using namespace Poincare;
  
  namespace Settings {
  namespace Helpers {
  
  ExpressionLayout * CartesianComplexFormat(KDText::FontSize fontSize) {
    const char text[] = {'a','+', Ion::Charset::IComplex, 'b', ' '};
    return LayoutEngine::createStringLayout(text, sizeof(text), fontSize);
  }
  
  ExpressionLayout * PolarComplexFormat(KDText::FontSize fontSize) {
    const char base[] = {'r', Ion::Charset::Exponential};
    const char superscript[] = {Ion::Charset::IComplex, Ion::Charset::SmallTheta, ' '};
    return new HorizontalLayout(
        LayoutEngine::createStringLayout(base, sizeof(base), fontSize),
        new VerticalOffsetLayout(LayoutEngine::createStringLayout(superscript, sizeof(superscript), fontSize), VerticalOffsetLayout::Type::Superscript, false),
        false);
  }
  
  }
  }