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
9
ConjugateLayout::ConjugateLayout
(
ExpressionLayout
* operandLayout) :
10
ExpressionLayout
(),
11
m_operandLayout(operandLayout)
12
{
13
m_operandLayout->
setParent
(
this
);
14
m_baseline
= m_operandLayout->
baseline
()+k_overlineWidth+k_overlineMargin;
15
}
16
17
ConjugateLayout::~ConjugateLayout
() {
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
25
KDSize
ConjugateLayout::computeSize
() {
26
KDSize
operandSize = m_operandLayout->
size
();
27
return
KDSize
(operandSize.
width
(), operandSize.
height
()+k_overlineWidth+k_overlineMargin);
28
}
29
30
ExpressionLayout
*
ConjugateLayout::child
(
uint16_t
index) {
31
if
(index == 0) {
32
return
m_operandLayout;
33
}
34
return
nullptr
;
35
}
36
37
KDPoint
ConjugateLayout::positionOfChild
(
ExpressionLayout
* child) {
38
return
KDPoint
(0, k_overlineWidth+k_overlineMargin);
39
}
40
41
}
42
conjugate_layout.h
KDPoint::y
KDCoordinate y() const
Definition:
point.h:11
Poincare::ExpressionLayout::size
KDSize size()
Definition:
expression_layout.cpp:48
KDSize::width
constexpr KDCoordinate width() const
Definition:
size.h:10
Poincare::ConjugateLayout::render
void render(KDContext *ctx, KDPoint p, KDColor expressionColor, KDColor backgroundColor) override
Definition:
conjugate_layout.cpp:21
Poincare::ConjugateLayout::computeSize
KDSize computeSize() override
Definition:
conjugate_layout.cpp:25
Poincare
Definition:
absolute_value.h:8
uint16_t
unsigned short uint16_t
Definition:
stdint.h:5
KDPoint
Definition:
point.h:6
KDSize
Definition:
size.h:6
assert.h
Poincare::ExpressionLayout::m_baseline
KDCoordinate m_baseline
Definition:
expression_layout.h:23
Poincare::ExpressionLayout
Definition:
expression_layout.h:8
KDContext
Definition:
context.h:8
Poincare::ConjugateLayout::positionOfChild
KDPoint positionOfChild(ExpressionLayout *child) override
Definition:
conjugate_layout.cpp:37
Poincare::ExpressionLayout::baseline
KDCoordinate baseline()
Definition:
expression_layout.cpp:15
KDRect
Definition:
rect.h:26
KDContext::fillRect
void fillRect(KDRect rect, KDColor color)
Definition:
context_rect.cpp:8
KDColor
Definition:
color.h:6
Poincare::ConjugateLayout::~ConjugateLayout
~ConjugateLayout()
Definition:
conjugate_layout.cpp:17
KDPoint::x
KDCoordinate x() const
Definition:
point.h:10
stdlib.h
Poincare::ExpressionLayout::setParent
void setParent(ExpressionLayout *parent)
Definition:
expression_layout.cpp:56
Poincare::ConjugateLayout::child
ExpressionLayout * child(uint16_t index) override
Definition:
conjugate_layout.cpp:30
Poincare::ConjugateLayout::ConjugateLayout
ConjugateLayout(ExpressionLayout *operandLayout)
Definition:
conjugate_layout.cpp:9
KDSize::height
constexpr KDCoordinate height() const
Definition:
size.h:11
epsilon
poincare
src
layout
conjugate_layout.cpp
Generated by
1.8.14