Numworks Epsilon  1.4.1
Graphing Calculator Operating System
key_view.h
Go to the documentation of this file.
1 #ifndef ESCHER_KEY_VIEW_H
2 #define ESCHER_KEY_VIEW_H
3 
4 #include <escher/view.h>
5 
6 class KeyView : public View {
7 public:
8  enum class Type {
9  Up,
10  Down,
11  Left,
12  Right,
13  Plus,
14  Minus
15  };
16  KeyView(Type type = Type::Up);
17  void setType(Type type);
18  void drawRect(KDContext * ctx, KDRect rect) const override;
19  KDSize minimalSizeForOptimalDisplay() const override;
20  constexpr static KDCoordinate k_keySize = 8;
21 private:
22  const uint8_t * mask() const;
23  Type m_type;
24 };
25 
26 #endif
27 
KDSize minimalSizeForOptimalDisplay() const override
Definition: key_view.cpp:90
int16_t KDCoordinate
Definition: coordinate.h:6
unsigned char uint8_t
Definition: stdint.h:4
Definition: size.h:6
KeyView(Type type=Type::Up)
Definition: key_view.cpp:69
void drawRect(KDContext *ctx, KDRect rect) const override
Definition: key_view.cpp:82
Definition: rect.h:26
static constexpr KDCoordinate k_keySize
Definition: key_view.h:20
Definition: view.h:23
void setType(Type type)
Definition: key_view.cpp:75