Numworks Epsilon  1.4.1
Graphing Calculator Operating System
ellipsis_view.cpp
Go to the documentation of this file.
1 #include <escher/ellipsis_view.h>
2 #include <kandinsky/color.h>
3 
5  {0xFF, 0xDA, 0xBB, 0xD1, 0xFF, 0xFF, 0xFF, 0xDA, 0xBB, 0xD1, 0xFF, 0xFF, 0xFF, 0xDA, 0xBB, 0xD1, 0xFF},
6  {0xFF, 0xBA, 0x8C, 0xA1, 0xFF, 0xFF, 0xFF, 0xBA, 0x8C, 0xA1, 0xFF, 0xFF, 0xFF, 0xBA, 0x8C, 0xA1, 0xFF},
7  {0xFF, 0xD1, 0xA1, 0xC1, 0xFF, 0xFF, 0xFF, 0xD1, 0xA1, 0xC1, 0xFF, 0xFF, 0xFF, 0xD1, 0xA1, 0xC1, 0xFF},
8 };
9 
11  View()
12 {
13 }
14 
16 
17 void EllipsisView::drawRect(KDContext * ctx, KDRect rect) const {
18  /* Draw the ellipsis vertically and horizontally centered in the view.
19  * The heightCenter is the coordinate of the vertical middle of the view. That
20  * way, (heightCenter-switchHalfHeight) indicates the top the ellipsis. */
21  KDCoordinate widthCenter = bounds().width()/2;
22  KDCoordinate ellipsisHalfWidth = k_ellipsisWidth/2;
23  KDCoordinate heightCenter = bounds().height()/2;
24  KDCoordinate ellipsisHalfHeight = k_ellipsisHeight/2;
25  KDRect frame(widthCenter - ellipsisHalfWidth, heightCenter - ellipsisHalfHeight, k_ellipsisWidth, k_ellipsisHeight);
27 }
28 
31 }
KDSize minimalSizeForOptimalDisplay() const override
static constexpr KDCoordinate k_ellipsisWidth
Definition: ellipsis_view.h:13
int16_t KDCoordinate
Definition: coordinate.h:6
static constexpr KDCoordinate k_ellipsisHeight
Definition: ellipsis_view.h:12
void blendRectWithMask(KDRect rect, KDColor color, const uint8_t *mask, KDColor *workingBuffer)
const uint8_t ellipsisMask[EllipsisView::k_ellipsisHeight][EllipsisView::k_ellipsisWidth]
unsigned char uint8_t
Definition: stdint.h:4
Definition: size.h:6
constexpr KDColor KDColorBlack
Definition: color.h:41
Definition: rect.h:26
Definition: color.h:6
Definition: view.h:23
KDColor s_ellipsisWorkingBuffer[EllipsisView::k_ellipsisWidth *EllipsisView::k_ellipsisHeight]
KDCoordinate width() const
Definition: rect.h:39
void drawRect(KDContext *ctx, KDRect rect) const override
KDCoordinate height() const
Definition: rect.h:40
KDRect bounds() const
Definition: view.cpp:157