Numworks Epsilon  1.4.1
Graphing Calculator Operating System
console_line_cell.h
Go to the documentation of this file.
1 #ifndef CODE_CONSOLE_LINE_CELL_H
2 #define CODE_CONSOLE_LINE_CELL_H
3 
6 #include <escher/responder.h>
7 #include <escher/palette.h>
10 #include <assert.h>
11 
12 #include "console_line.h"
13 
14 namespace Code {
15 
16 class ConsoleLineCell : public HighlightCell, public Responder {
17 public:
19  void setLine(ConsoleLine line);
20 
21  /* HighlightCell */
22  void setHighlighted(bool highlight) override;
23  void reloadCell() override;
24  Responder * responder() override {
25  return this;
26  }
27 
28  /* View */
29  int numberOfSubviews() const override;
30  View * subviewAtIndex(int index) override;
31  void layoutSubviews() override;
32 
33  /* Responder */
34  void didBecomeFirstResponder() override;
35 private:
36  class ScrollableConsoleLineView : public ScrollableView, public ScrollViewDataSource {
37  public:
38  class ConsoleLineView : public HighlightCell {
39  public:
41  void setLine(ConsoleLine * line);
42  void drawRect(KDContext * ctx, KDRect rect) const override;
43  KDSize minimalSizeForOptimalDisplay() const override;
44  private:
45  ConsoleLine * m_line;
46  };
47 
48  ScrollableConsoleLineView(Responder * parentResponder);
49  KDSize minimalSizeForOptimalDisplay() const override;
50  ConsoleLineView * consoleLineView() { return &m_consoleLineView; }
51  private:
52  ConsoleLineView m_consoleLineView;
53  };
54  static KDColor textColor(ConsoleLine * line) {
56  }
57  MessageTextView m_promptView;
58  ScrollableConsoleLineView m_scrollableView;
59  ConsoleLine m_line;
60 };
61 
62 }
63 
64 #endif
void layoutSubviews() override
void drawRect(KDContext *ctx, KDRect rect) const override
Responder * parentResponder() const
Definition: responder.cpp:12
static constexpr KDColor GreyDark
Definition: palette.h:15
bool isFromCurrentSession() const
Definition: console_line.h:20
void setLine(ConsoleLine line)
void didBecomeFirstResponder() override
ConsoleLineCell(Responder *parentResponder=nullptr)
void setHighlighted(bool highlight) override
Definition: size.h:6
Definition: app.cpp:7
int numberOfSubviews() const override
constexpr KDColor KDColorBlack
Definition: color.h:41
Responder * responder() override
virtual KDSize minimalSizeForOptimalDisplay() const
Definition: view.cpp:183
Definition: rect.h:26
Definition: color.h:6
View * subviewAtIndex(int index) override
Definition: view.h:23
void reloadCell() override