24 #include "common.h" |
24 #include "common.h" |
25 #include "types.h" |
25 #include "types.h" |
26 |
26 |
27 class GLRenderer; |
27 class GLRenderer; |
28 class QTimer; |
28 class QTimer; |
29 class MessageManager : public QObject |
29 |
30 { |
30 /* The message manager is an object which keeps track of messages that appear |
|
31 * on the renderer's screen. Each line is contained in a separate object which |
|
32 * contains the text, expiry time and alpha. The message manager is doubly |
|
33 * linked to its corresponding renderer. |
|
34 * |
|
35 * Message manager calls its tick() function regularly to update the messages, |
|
36 * where each line's expiry is checked for. Lines begin to fade out when nearing |
|
37 * their expiry. If the message manager's lines change, the renderer undergoes |
|
38 * repainting. |
|
39 */ |
|
40 class MessageManager : public QObject { |
31 Q_OBJECT |
41 Q_OBJECT |
32 PROPERTY( GLRenderer*, renderer, setRenderer ) |
42 PROPERTY( GLRenderer*, renderer, setRenderer ) |
33 |
43 |
34 public: |
44 public: |
35 class Line |
45 // Single line of the message log. |
36 { |
46 class Line { |
37 public: |
47 public: |
38 Line( str text ); |
48 Line( str text ); |
39 bool update( bool& changed ); |
49 bool update( bool& changed ); |
40 |
50 |
41 str text; |
51 str text; |