Numworks Epsilon  1.4.1
Graphing Calculator Operating System
conjugate_layout.cpp
Go to the documentation of this file.
1 #include "conjugate_layout.h"
2 extern "C" {
3 #include <assert.h>
4 #include <stdlib.h>
5 }
6 
7 namespace Poincare {
8 
11  m_operandLayout(operandLayout)
12 {
13  m_operandLayout->setParent(this);
14  m_baseline = m_operandLayout->baseline()+k_overlineWidth+k_overlineMargin;
15 }
16 
18  delete m_operandLayout;
19 }
20 
21 void ConjugateLayout::render(KDContext * ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor) {
22  ctx->fillRect(KDRect(p.x(), p.y(), m_operandLayout->size().width(), k_overlineWidth), expressionColor);
23 }
24 
26  KDSize operandSize = m_operandLayout->size();
27  return KDSize(operandSize.width(), operandSize.height()+k_overlineWidth+k_overlineMargin);
28 }
29 
31  if (index == 0) {
32  return m_operandLayout;
33  }
34  return nullptr;
35 }
36 
38  return KDPoint(0, k_overlineWidth+k_overlineMargin);
39 }
40 
41 }
42 
KDCoordinate y() const
Definition: point.h:11
constexpr KDCoordinate width() const
Definition: size.h:10
void render(KDContext *ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor) override
KDSize computeSize() override
unsigned short uint16_t
Definition: stdint.h:5
Definition: point.h:6
Definition: size.h:6
KDPoint positionOfChild(ExpressionLayout *child) override
Definition: rect.h:26
void fillRect(KDRect rect, KDColor color)
Definition: context_rect.cpp:8
Definition: color.h:6
KDCoordinate x() const
Definition: point.h:10
void setParent(ExpressionLayout *parent)
ExpressionLayout * child(uint16_t index) override
ConjugateLayout(ExpressionLayout *operandLayout)
constexpr KDCoordinate height() const
Definition: size.h:11