44 // A single line of the message log. |
44 // A single line of the message log. |
45 class Line |
45 class Line |
46 { |
46 { |
47 public: |
47 public: |
48 // Constructs a line with the given \c text |
48 // Constructs a line with the given \c text |
49 Line (QString text); |
49 Line(QString text); |
50 |
50 |
51 // Check this line's expiry and update alpha accordingly. @changed |
51 // Check this line's expiry and update alpha accordingly. @changed |
52 // is updated to whether the line has somehow changed since the |
52 // is updated to whether the line has somehow changed since the |
53 // last update. |
53 // last update. |
54 // |
54 // |
55 // Returns true if the line is to still stick around, false if it |
55 // Returns true if the line is to still stick around, false if it |
56 // expired. |
56 // expired. |
57 bool update (bool& changed); |
57 bool update(bool& changed); |
58 |
58 |
59 QString text; |
59 QString text; |
60 float alpha; |
60 float alpha; |
61 QDateTime expiry; |
61 QDateTime expiry; |
62 }; |
62 }; |
63 |
63 |
64 // Constructs the message manager. |
64 // Constructs the message manager. |
65 explicit MessageManager (QObject* parent = nullptr); |
65 explicit MessageManager(QObject* parent = nullptr); |
66 |
66 |
67 // Adds a line with the given \c text to the message manager. |
67 // Adds a line with the given \c text to the message manager. |
68 void addLine (QString line); |
68 void addLine(QString line); |
69 |
69 |
70 // Returns all active lines in the message manager. |
70 // Returns all active lines in the message manager. |
71 const QList<Line>& getLines() const; |
71 const QList<Line>& getLines() const; |
72 |
72 |
73 GLRenderer* renderer() const; |
73 GLRenderer* renderer() const; |
74 void setRenderer (GLRenderer* renderer); |
74 void setRenderer(GLRenderer* renderer); |
75 |
75 |
76 private: |
76 private: |
77 QList<Line> m_lines; |
77 QList<Line> m_lines; |
78 QTimer* m_ticker; |
78 QTimer* m_ticker; |
79 GLRenderer* m_renderer; |
79 GLRenderer* m_renderer; |