Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 9364 was 8619, checked in by bensch, 18 years ago

trunk: merged the gui-branche back.
merged with command:
svn merge -r8520:HEAD https://svn.orxonox.net/orxonox/branches/gui
no conflicts

File size: 2.3 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    /// Setup
33    void setDisplayLineCount(unsigned int count);
34    void setFadeAge(float fadeAge);
35    void setHideAge(float hideAge);
36
37    /** @returns the beginning of the Hiding process */
38    inline float fadeAge() const { return _fadeAge; };
39    /** @returns at what age elements should be fully hidden */
40    inline float hideAge() const { return _hideAge; };
41
42    void clear();
43
44    // Element2D-functions
45    virtual void tick(float dt);
46    virtual void draw() const;
47
48    void debug() const;
49
50  protected:
51    virtual void resize();
52
53  private:
54    void repositionText();
55    void applyTextSettings(MultiLineText* text);
56    void applySettings();
57    // helpers //
58    Vector2D calculateLinePosition(unsigned int lineNumber);
59
60
61
62  private:
63    //! structure that defines a Displayed line.
64    typedef struct
65    {
66      float             age;
67      MultiLineText*    text;
68
69    } DisplayLine;
70
71
72    float                       _fadeAge;
73    float                       _hideAge;
74    float                       _transformAge;
75
76    unsigned int                lineSpacing;            //!< The Spacing between lines.
77
78    // BUFFER
79    unsigned int                bufferDisplaySize;      //!< The Size of the Display-buffer, in lines (not in characters).
80    std::list<DisplayLine>      displayLines;           //!< A list of stored bufferTexts for the display of the buffer.
81
82    std::stack<MultiLineText*>  hiddenText;             //!< Text that is not shown, and not used is thrown in here
83
84
85    unsigned long               linesProcessed;         //!< How many Lines have been processed so far.
86    std::list<std::string>      inputBuffer;            //!< The input buffer for lines that were not yet printet out, because there is too much input.
87
88  };
89
90}
91
92#endif /* _GLGUI_NOTIFIER_H */
Note: See TracBrowser for help on using the repository browser.