Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/gui/src/lib/gui/gl/specials/glgui_notifier.h @ 8513

Last change on this file since 8513 was 8509, checked in by bensch, 18 years ago

gui: notifier: outputs stuff

File size: 1.8 KB
Line 
1/*!
2 * @file shell.h
3 * Definition of a on-screen-shell
4 *
5 * @todo Buffer Display in different Colors for different debug mode.
6 * @todo choose color of the Font and the background.
7 */
8
9#ifndef _GLGUI_NOTIFIER_H
10#define _GLGUI_NOTIFIER_H
11
12#include "glgui_widget.h"
13#include "event_listener.h"
14
15#include <stack>
16
17// FORWARD DECLARATION
18class MultiLineText;
19class Text;
20
21//! Namespace of the GLGuiNotifier of ORXONOX.
22namespace OrxGui
23{
24  class GLGuiNotifier : public GLGuiWidget
25  {
26  public:
27    GLGuiNotifier();
28    virtual ~GLGuiNotifier();
29
30    void pushNotifyMessage(const std::string& message);
31
32    // BUFFERS
33    void setDisplayLineCount(unsigned int count);
34
35    void clear();
36
37    // Element2D-functions
38    virtual void tick(float dt);
39    virtual void draw() const;
40
41    void debug() const;
42
43  protected:
44    virtual void resize();
45
46  private:
47    void repositionText();
48    void applyTextSettings(MultiLineText* text);
49    void applySettings();
50    // helpers //
51    Vector2D calculateLinePosition(unsigned int lineNumber);
52
53
54
55  private:
56    typedef struct
57    {
58      float             age;
59      MultiLineText*    text;
60
61    }
62    DisplayLine;
63
64    unsigned int                lineSpacing;            //!< The Spacing between lines.
65
66    // BUFFER
67    unsigned int                bufferDisplaySize;      //!< The Size of the Display-buffer, in lines (not in characters).
68    std::list<DisplayLine>      displayLines;           //!< A list of stored bufferTexts for the display of the buffer.
69
70    std::stack<MultiLineText*>  hiddenText;             //!< Text that is not shown, and not used is thrown in here
71
72
73    unsigned long               linesProcessed;         //!< How many Lines have been processed so far.
74    std::list<std::string>      inputBuffer;            //!<
75
76  };
77
78}
79
80#endif /* _GLGUI_NOTIFIER_H */
Note: See TracBrowser for help on using the repository browser.