diff options
Diffstat (limited to 'linden/indra/newview/llconsole.h')
-rw-r--r-- | linden/indra/newview/llconsole.h | 47 |
1 files changed, 19 insertions, 28 deletions
diff --git a/linden/indra/newview/llconsole.h b/linden/indra/newview/llconsole.h index 2915c48..578670e 100644 --- a/linden/indra/newview/llconsole.h +++ b/linden/indra/newview/llconsole.h | |||
@@ -33,7 +33,8 @@ | |||
33 | #ifndef LL_LLCONSOLE_H | 33 | #ifndef LL_LLCONSOLE_H |
34 | #define LL_LLCONSOLE_H | 34 | #define LL_LLCONSOLE_H |
35 | 35 | ||
36 | #include "llfixedbuffer.h" | 36 | #include "llerrorcontrol.h" // For LLLineBuffer |
37 | #include "llthread.h" | ||
37 | #include "llview.h" | 38 | #include "llview.h" |
38 | #include "v4color.h" | 39 | #include "v4color.h" |
39 | #include <deque> | 40 | #include <deque> |
@@ -47,10 +48,10 @@ private: | |||
47 | F32 mLinePersistTime; // Age at which to stop drawing. | 48 | F32 mLinePersistTime; // Age at which to stop drawing. |
48 | F32 mFadeTime; // Age at which to start fading | 49 | F32 mFadeTime; // Age at which to start fading |
49 | LLFontGL* mFont; | 50 | LLFontGL* mFont; |
50 | S32 mLastBoxHeight; | ||
51 | S32 mLastBoxWidth; | ||
52 | S32 mConsoleWidth; | 51 | S32 mConsoleWidth; |
53 | S32 mConsoleHeight; | 52 | S32 mConsoleHeight; |
53 | LLMutex mQueueMutex; | ||
54 | LLTimer mTimer; | ||
54 | 55 | ||
55 | public: | 56 | public: |
56 | //A paragraph color segment defines the color of text in a line | 57 | //A paragraph color segment defines the color of text in a line |
@@ -80,14 +81,7 @@ public: | |||
80 | 81 | ||
81 | typedef std::list<LineColorSegment> line_color_segments_t; | 82 | typedef std::list<LineColorSegment> line_color_segments_t; |
82 | 83 | ||
83 | //A line is composed of one or more color segments. | 84 | typedef std::list<line_color_segments_t> lines_t; |
84 | class Line | ||
85 | { | ||
86 | public: | ||
87 | line_color_segments_t mLineColorSegments; | ||
88 | }; | ||
89 | |||
90 | typedef std::list<Line> lines_t; | ||
91 | typedef std::list<ParagraphColorSegment> paragraph_color_segments_t; | 85 | typedef std::list<ParagraphColorSegment> paragraph_color_segments_t; |
92 | 86 | ||
93 | //A paragraph is a processed element containing the entire text of the | 87 | //A paragraph is a processed element containing the entire text of the |
@@ -98,7 +92,7 @@ public: | |||
98 | class Paragraph | 92 | class Paragraph |
99 | { | 93 | { |
100 | public: | 94 | public: |
101 | Paragraph (LLWString str, const LLColor4 &color, F32 add_time, LLFontGL* font, F32 screen_width); | 95 | Paragraph (LLWString str, const LLColor4 &color, F32 add_time); |
102 | void makeParagraphColorSegments ( const LLColor4 &color); | 96 | void makeParagraphColorSegments ( const LLColor4 &color); |
103 | void updateLines ( F32 screen_width, LLFontGL* font, bool force_resize=false ); | 97 | void updateLines ( F32 screen_width, LLFontGL* font, bool force_resize=false ); |
104 | public: | 98 | public: |
@@ -111,35 +105,32 @@ public: | |||
111 | }; | 105 | }; |
112 | 106 | ||
113 | //The console contains a deque of paragraphs which represent the individual messages. | 107 | //The console contains a deque of paragraphs which represent the individual messages. |
114 | typedef std::deque<Paragraph> paragraph_t; | 108 | typedef std::deque<Paragraph*> paragraph_t; |
115 | paragraph_t mParagraphs; | 109 | paragraph_t mParagraphs; |
110 | paragraph_t mNewParagraphs; | ||
116 | 111 | ||
117 | // Font size: | 112 | // Font size: |
118 | // -1 = monospace, 0 means small, font size = 1 means big | 113 | // -1 = monospace, 0 means small, font size = 1 means big |
119 | LLConsole(const std::string& name, const U32 max_lines, const LLRect &rect, | 114 | LLConsole(const std::string& name, const LLRect &rect, |
120 | S32 font_size_index, F32 persist_time ); | 115 | S32 font_size_index, F32 persist_time ); |
121 | ~LLConsole(){}; | 116 | ~LLConsole(); |
122 | 117 | ||
123 | // each line lasts this long after being added | 118 | // each line lasts this long after being added |
124 | void setLinePersistTime(F32 seconds); | 119 | void setLinePersistTime(F32 seconds); |
125 | 120 | ||
126 | void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); | 121 | void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); |
127 | 122 | ||
128 | // -1 = monospace, 0 means small, font size = 1 means big | 123 | // -1 = monospace, 0 means small, font size = 1 means big |
129 | void setFontSize(S32 size_index); | 124 | void setFontSize(S32 size_index); |
130 | 125 | ||
131 | void addLine(const std::string& utf8line, F32 size, const LLColor4 &color); | 126 | // From LLLineBuffer |
132 | void addLine(const LLWString& wline, F32 size, const LLColor4 &color); | 127 | /*virtual*/ void clear(); |
128 | /*virtual*/ void addLine(const std::string& utf8line); | ||
129 | void addConsoleLine(const std::string& utf8line, const LLColor4 &color); | ||
130 | void addConsoleLine(const LLWString& wline, const LLColor4 &color); | ||
133 | 131 | ||
134 | // Overrides | 132 | // Overrides |
135 | /*virtual*/ void draw(); | 133 | /*virtual*/ void draw(); |
136 | |||
137 | //do not make these two "virtual" | ||
138 | void addLine(const std::string& utf8line); | ||
139 | void addLine(const LLWString& line); | ||
140 | |||
141 | private: | ||
142 | void updateBuffer() ; | ||
143 | }; | 134 | }; |
144 | 135 | ||
145 | extern LLConsole* gConsole; | 136 | extern LLConsole* gConsole; |