Numworks Epsilon  1.4.1
Graphing Calculator Operating System
chevron_view.cpp
Go to the documentation of this file.
1 #include <escher/chevron_view.h>
2 #include <escher/palette.h>
3 
5  {0x0C, 0xE1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
6  {0x00, 0x00, 0x45, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
7  {0x00, 0x00, 0x00, 0x0C, 0xE1, 0xFF, 0xFF, 0xFF},
8  {0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0xFF, 0xFF},
9  {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x45},
10  {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x45},
11  {0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0xFF, 0xFF},
12  {0x00, 0x00, 0x00, 0x0C, 0xE1, 0xFF, 0xFF, 0xFF},
13  {0x00, 0x00, 0x45, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
14  {0x0C, 0xE1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
15 };
16 
18  View()
19 {
20 }
21 
23 
24 void ChevronView::drawRect(KDContext * ctx, KDRect rect) const {
25  /* Draw the chevron aligned on the right of the view and vertically centered.
26  * The heightCenter is the coordinate of the vertical middle of the view. That
27  * way, (heightCenter-switchHalfHeight) indicates the top the chevron. */
28  KDCoordinate width = bounds().width();
29  KDCoordinate heightCenter = bounds().height()/2;
30  KDCoordinate chevronHalfHeight = k_chevronHeight/2;
31  KDRect frame(width - k_chevronWidth, heightCenter -chevronHalfHeight, k_chevronWidth, k_chevronHeight);
33 }
34 
37 }
static constexpr KDColor YellowDark
Definition: palette.h:8
int16_t KDCoordinate
Definition: coordinate.h:6
void blendRectWithMask(KDRect rect, KDColor color, const uint8_t *mask, KDColor *workingBuffer)
unsigned char uint8_t
Definition: stdint.h:4
static constexpr KDCoordinate k_chevronWidth
Definition: chevron_view.h:13
KDColor s_workingBuffer[ChevronView::k_chevronWidth *ChevronView::k_chevronHeight]
Definition: size.h:6
KDSize minimalSizeForOptimalDisplay() const override
void drawRect(KDContext *ctx, KDRect rect) const override
Definition: rect.h:26
Definition: color.h:6
static constexpr KDCoordinate k_chevronHeight
Definition: chevron_view.h:12
Definition: view.h:23
KDCoordinate width() const
Definition: rect.h:39
const uint8_t chevronMask[ChevronView::k_chevronHeight][ChevronView::k_chevronWidth]
Definition: chevron_view.cpp:4
KDCoordinate height() const
Definition: rect.h:40
KDRect bounds() const
Definition: view.cpp:157