Blame view

Giac_maj/epsilon-giac/poincare/src/layout/fraction_layout.h 1.14 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
  #ifndef POINCARE_FRACTION_LAYOUT_H
  #define POINCARE_FRACTION_LAYOUT_H
  
  #include <poincare/expression.h>
  #include <poincare/expression_layout.h>
  
  namespace Poincare {
  
  class FractionLayout : public ExpressionLayout {
  public:
    FractionLayout(ExpressionLayout * numerator, ExpressionLayout * denominator);
    ~FractionLayout();
    FractionLayout(const FractionLayout& other) = delete;
    FractionLayout(FractionLayout&& other) = delete;
    FractionLayout& operator=(const FractionLayout& other) = delete;
    FractionLayout& operator=(FractionLayout&& other) = delete;
  protected:
    void render(KDContext * ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor) override;
    KDSize computeSize() override;
    ExpressionLayout * child(uint16_t index) override;
    KDPoint positionOfChild(ExpressionLayout * child) override;
  private:
    constexpr static KDCoordinate k_fractionBorderLength = 2;
    constexpr static KDCoordinate k_fractionBorderMargin = 2;
    constexpr static KDCoordinate k_fractionLineMargin = 2;
    constexpr static KDCoordinate k_fractionLineHeight = 2;
    ExpressionLayout * m_numerator_layout;
    ExpressionLayout * m_denominator_layout;
  };
  
  }
  
  #endif