diff options
Diffstat (limited to 'linden/indra/newview/lllcd.cpp')
-rw-r--r-- | linden/indra/newview/lllcd.cpp | 703 |
1 files changed, 703 insertions, 0 deletions
diff --git a/linden/indra/newview/lllcd.cpp b/linden/indra/newview/lllcd.cpp new file mode 100644 index 0000000..f6fec7d --- /dev/null +++ b/linden/indra/newview/lllcd.cpp | |||
@@ -0,0 +1,703 @@ | |||
1 | /** | ||
2 | * @file lllcd.cpp | ||
3 | * @brief Lcd panel class | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
15 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
16 | * | ||
17 | * There are special exceptions to the terms and conditions of the GPL as | ||
18 | * it is applied to this Source Code. View the full text of the exception | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlife.com/developers/opensource/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | * $/LicenseInfo$ | ||
30 | */ | ||
31 | |||
32 | |||
33 | #include "llviewerprecompiledheaders.h" | ||
34 | #include "llcontrol.h" | ||
35 | #include "llstatusbar.h" | ||
36 | #include "llviewerregion.h" | ||
37 | #include "llviewerstats.h" | ||
38 | #include "llvieweruictrlfactory.h" | ||
39 | |||
40 | #if LL_LCD_COMPILE | ||
41 | |||
42 | extern LLControlGroup gSavedSettings; | ||
43 | |||
44 | #define ICON_WIDTH 28 | ||
45 | |||
46 | #if LL_WINDOWS | ||
47 | // for Logitech LCD keyboards / speakers | ||
48 | #include "EZ_LCD.h" | ||
49 | #include "lllogitechlcd.h" | ||
50 | #include "lllcd.h" | ||
51 | |||
52 | // not happy about this, but there's no local class to put it in. | ||
53 | LLPanel *bogus = NULL; | ||
54 | |||
55 | // oh yeah baby! Construct those LCD page group handlers - make them all and we just turn off displaying them according to the preferences set up | ||
56 | void CreateLCDDebugWindows() | ||
57 | { | ||
58 | if (gLcdScreen->Enabled()) | ||
59 | { | ||
60 | // load up the text so we are sure it's externalized and localized correctly. | ||
61 | bogus = new LLPanel(); | ||
62 | gUICtrlFactory->buildPanel(bogus, "lcd_text.xml"); | ||
63 | |||
64 | llLCDPageGroup *pageGroup = NULL; | ||
65 | pageGroup = new llDefaultPageGroup(gLcdScreen->mLCD, llLCD::kLCDDefault, gLcdScreen->mSLIcon); | ||
66 | // push this new group onto the array | ||
67 | gLcdScreen->mPageGroupArray.push_back(pageGroup); | ||
68 | |||
69 | pageGroup = new llChatPageGroup(gLcdScreen->mLCD, llLCD::kLCDChat, gLcdScreen->mSLIcon); | ||
70 | // push this new group onto the array | ||
71 | gLcdScreen->mPageGroupArray.push_back(pageGroup); | ||
72 | |||
73 | pageGroup = new llIMPageGroup(gLcdScreen->mLCD, llLCD::kLCDIM, gLcdScreen->mSLIcon); | ||
74 | // push this new group onto the array | ||
75 | gLcdScreen->mPageGroupArray.push_back(pageGroup); | ||
76 | |||
77 | pageGroup = new llDebugPageGroup(gLcdScreen->mLCD, llLCD::kLCDDebug, gLcdScreen->mSLIcon); | ||
78 | // push this new group onto the array | ||
79 | gLcdScreen->mPageGroupArray.push_back(pageGroup); | ||
80 | |||
81 | pageGroup = new llLindenPageGroup(gLcdScreen->mLCD, llLCD::kLCDLinden, gLcdScreen->mSLIcon); | ||
82 | // push this new group onto the array | ||
83 | gLcdScreen->mPageGroupArray.push_back(pageGroup); | ||
84 | |||
85 | pageGroup = new llRegionPageGroup(gLcdScreen->mLCD, llLCD::kLCDRegion, gLcdScreen->mSLIcon); | ||
86 | // push this new group onto the array | ||
87 | gLcdScreen->mPageGroupArray.push_back(pageGroup); | ||
88 | |||
89 | pageGroup = new llDebugConsolePageGroup(gLcdScreen->mLCD, llLCD::kLCDDebugConsole, gLcdScreen->mSLIcon); | ||
90 | // push this new group onto the array | ||
91 | gLcdScreen->mPageGroupArray.push_back(pageGroup); | ||
92 | } | ||
93 | } | ||
94 | |||
95 | // functions that allow the chat and IM handler to insert new lines directly into the LCD page group handlers | ||
96 | void AddNewIMToLCD(const LLString &newLine) | ||
97 | { | ||
98 | if (gLcdScreen->Enabled()) | ||
99 | { | ||
100 | llIMPageGroup *imGroup = (llIMPageGroup *)gLcdScreen->mPageGroupArray[2]; | ||
101 | imGroup->InsertText(newLine); | ||
102 | } | ||
103 | } | ||
104 | |||
105 | void AddNewChatToLCD(const LLString &newLine) | ||
106 | { | ||
107 | if (gLcdScreen->Enabled()) | ||
108 | { | ||
109 | llChatPageGroup *chatGroup = (llChatPageGroup *)gLcdScreen->mPageGroupArray[1]; | ||
110 | chatGroup->InsertText(newLine); | ||
111 | } | ||
112 | } | ||
113 | |||
114 | void AddNewDebugConsoleToLCD(const LLWString &newLine) | ||
115 | { | ||
116 | if (gLcdScreen->Enabled()) | ||
117 | { | ||
118 | llDebugConsolePageGroup *debugGroup = (llDebugConsolePageGroup *)gLcdScreen->mPageGroupArray[6]; | ||
119 | debugGroup->InsertText(newLine); | ||
120 | } | ||
121 | } | ||
122 | |||
123 | ///////////////////////////////////// | ||
124 | // | ||
125 | // Debug Console Page group class | ||
126 | // | ||
127 | ///////////////////////////////////// | ||
128 | |||
129 | void llDebugConsolePageGroup::UpdateDetails() | ||
130 | { | ||
131 | mLCD->ModifyControlsOnPage(mPageArray[0].mPageIndex); | ||
132 | mLCD->SetText(mPageArray[0].mDisplayItemArray[0], (LPCTSTR)(wstring_to_utf16str(mLine1).c_str())); | ||
133 | mLCD->SetText(mPageArray[0].mDisplayItemArray[1], (LPCTSTR)(wstring_to_utf16str(mLine2).c_str())); | ||
134 | mLCD->SetText(mPageArray[0].mDisplayItemArray[2], (LPCTSTR)(wstring_to_utf16str(mLine3).c_str())); | ||
135 | } | ||
136 | |||
137 | void llDebugConsolePageGroup::GetDisplayable() | ||
138 | { | ||
139 | mDisplayPage = gSavedSettings.getBOOL("DisplayDebugConsole"); | ||
140 | } | ||
141 | |||
142 | void llDebugConsolePageGroup::InsertText(const LLWString &newLine) | ||
143 | { | ||
144 | mLine1 = mLine2; | ||
145 | mLine2 = mLine3; | ||
146 | mLine3 = newLine; | ||
147 | } | ||
148 | |||
149 | llDebugConsolePageGroup::llDebugConsolePageGroup(CEzLcd *LCD, int type, HICON SLIcon) | ||
150 | :llLCDPageGroup(LCD, type, SLIcon) | ||
151 | { | ||
152 | // create a new specific pagea | ||
153 | llLCDSpecificPage newPage; | ||
154 | newPage.mPageIndex = mLCD->AddNewPage() - 1; | ||
155 | mLCD->ModifyControlsOnPage(newPage.mPageIndex); | ||
156 | |||
157 | // add in all the display parts for this specific page | ||
158 | |||
159 | // add in the icon - all pages have this - we don't need to track this because we never update it | ||
160 | HANDLE m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32); | ||
161 | mLCD->SetOrigin(m_rightIcon, 0, 0); | ||
162 | |||
163 | // add Title | ||
164 | HANDLE title = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_CENTER, 128); | ||
165 | mLCD->SetOrigin(title, 32, 0); | ||
166 | mLCD->SetText(title, _T("Debug Console")); | ||
167 | |||
168 | // add line | ||
169 | HANDLE chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH); | ||
170 | mLCD->SetOrigin(chatLine, ICON_WIDTH, 11); | ||
171 | mLCD->SetText(chatLine, _T("")); | ||
172 | newPage.mDisplayItemArray.push_back(chatLine); | ||
173 | |||
174 | // add line | ||
175 | chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH); | ||
176 | mLCD->SetOrigin(chatLine, ICON_WIDTH, 22); | ||
177 | mLCD->SetText(chatLine, _T("")); | ||
178 | newPage.mDisplayItemArray.push_back(chatLine); | ||
179 | |||
180 | // add line | ||
181 | chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH); | ||
182 | mLCD->SetOrigin(chatLine, ICON_WIDTH, 33); | ||
183 | mLCD->SetText(chatLine, _T("")); | ||
184 | newPage.mDisplayItemArray.push_back(chatLine); | ||
185 | |||
186 | // and then insert it | ||
187 | mPageArray.push_back(newPage); | ||
188 | } | ||
189 | |||
190 | ///////////////////////////////////// | ||
191 | // | ||
192 | // Network Comms Page group class | ||
193 | // | ||
194 | ///////////////////////////////////// | ||
195 | |||
196 | void llDebugPageGroup::UpdateDetails() | ||
197 | { | ||
198 | mLCD->ModifyControlsOnPage(mPageArray[0].mPageIndex); | ||
199 | LLString ping = llformat("1000"); | ||
200 | LLString packetsIn = llformat("0"); | ||
201 | LLString packetsOut = llformat("0"); | ||
202 | LLString packetLoss = llformat("0"); | ||
203 | LLString fps = llformat("0"); | ||
204 | LLString simfps = llformat("0"); | ||
205 | // region name | ||
206 | if (gStatusBar) | ||
207 | { | ||
208 | ping = llformat("%d", gStatusBar->mRegionDetails.mPing); | ||
209 | } | ||
210 | |||
211 | if (gViewerStats) | ||
212 | { | ||
213 | packetLoss = llformat("%.1f%%", gViewerStats->mPacketsLostPercentStat.getCurrent()); | ||
214 | simfps = llformat("%d", (int)gViewerStats->mSimFPS.getCurrent()); | ||
215 | fps = llformat("%.1f%", gViewerStats->mFPSStat.getMeanPerSec()); | ||
216 | packetsIn = llformat("%d", (int)gViewerStats->mSimInPPS.getCurrent()); | ||
217 | packetsOut = llformat("%d", (int)gViewerStats->mSimOutPPS.getCurrent()); | ||
218 | } | ||
219 | |||
220 | // fps | ||
221 | mLCD->SetText(mPageArray[0].mDisplayItemArray[0], (LPCTSTR)(utf8str_to_utf16str(fps).c_str())); | ||
222 | // simfps | ||
223 | mLCD->SetText(mPageArray[0].mDisplayItemArray[1], (LPCTSTR)(utf8str_to_utf16str(simfps).c_str())); | ||
224 | // packets in | ||
225 | mLCD->SetText(mPageArray[0].mDisplayItemArray[2], (LPCTSTR)(utf8str_to_utf16str(packetsIn).c_str())); | ||
226 | // packets out | ||
227 | mLCD->SetText(mPageArray[0].mDisplayItemArray[3], (LPCTSTR)(utf8str_to_utf16str(packetsOut).c_str())); | ||
228 | // packet loss | ||
229 | mLCD->SetText(mPageArray[0].mDisplayItemArray[4], (LPCTSTR)(utf8str_to_utf16str(packetLoss).c_str())); | ||
230 | // ping | ||
231 | mLCD->SetText(mPageArray[0].mDisplayItemArray[5], (LPCTSTR)(utf8str_to_utf16str(ping).c_str())); | ||
232 | } | ||
233 | |||
234 | void llDebugPageGroup::GetDisplayable() | ||
235 | { | ||
236 | mDisplayPage = gSavedSettings.getBOOL("DisplayDebug"); | ||
237 | } | ||
238 | |||
239 | llDebugPageGroup::llDebugPageGroup(CEzLcd *LCD, int type, HICON SLIcon) | ||
240 | :llLCDPageGroup(LCD, type, SLIcon) | ||
241 | { | ||
242 | // create a new specific page | ||
243 | llLCDSpecificPage newPage; | ||
244 | newPage.mPageIndex = mLCD->AddNewPage() - 1; | ||
245 | mLCD->ModifyControlsOnPage(newPage.mPageIndex); | ||
246 | |||
247 | // add in all the display parts for this specific page | ||
248 | |||
249 | // add in the icon - all pages have this - we don't need to track this because we never update it | ||
250 | HANDLE m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32); | ||
251 | mLCD->SetOrigin(m_rightIcon, 0, 0); | ||
252 | |||
253 | // add Title | ||
254 | HANDLE title = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_CENTER, 128); | ||
255 | mLCD->SetOrigin(title, 32, 0); | ||
256 | mLCD->SetText(title, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("DebugInfo")).c_str())); | ||
257 | |||
258 | HANDLE fpsStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 18); | ||
259 | mLCD->SetOrigin(fpsStatic, ICON_WIDTH, 11); | ||
260 | mLCD->SetText(fpsStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("FPS")).c_str())); | ||
261 | |||
262 | HANDLE fps = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 25); | ||
263 | mLCD->SetOrigin(fps, ICON_WIDTH+25, 11); | ||
264 | mLCD->SetText(fps, _T("")); | ||
265 | newPage.mDisplayItemArray.push_back(fps); | ||
266 | |||
267 | HANDLE simfpsStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 35); | ||
268 | mLCD->SetOrigin(simfpsStatic, ICON_WIDTH+37+25, 11); | ||
269 | mLCD->SetText(simfpsStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("SimFPS")).c_str())); | ||
270 | |||
271 | HANDLE simfps = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 25); | ||
272 | mLCD->SetOrigin(simfps, ICON_WIDTH+37+27+37, 11); | ||
273 | mLCD->SetText(simfps, _T("")); | ||
274 | newPage.mDisplayItemArray.push_back(simfps); | ||
275 | |||
276 | HANDLE packetsinStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 25); | ||
277 | mLCD->SetOrigin(packetsinStatic, ICON_WIDTH, 22); | ||
278 | mLCD->SetText(packetsinStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Pin")).c_str())); | ||
279 | |||
280 | HANDLE packetsin = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 25); | ||
281 | mLCD->SetOrigin(packetsin, ICON_WIDTH+32, 22); | ||
282 | mLCD->SetText(packetsin, _T("")); | ||
283 | newPage.mDisplayItemArray.push_back(packetsin); | ||
284 | |||
285 | HANDLE packetsoutStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30); | ||
286 | mLCD->SetOrigin(packetsoutStatic, ICON_WIDTH+37+25, 22); | ||
287 | mLCD->SetText(packetsoutStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Pout")).c_str())); | ||
288 | |||
289 | HANDLE packetsout = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 25); | ||
290 | mLCD->SetOrigin(packetsout, ICON_WIDTH+37+27+37, 22); | ||
291 | mLCD->SetText(packetsout, _T("")); | ||
292 | newPage.mDisplayItemArray.push_back(packetsout); | ||
293 | |||
294 | HANDLE packetlossStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30); | ||
295 | mLCD->SetOrigin(packetlossStatic, ICON_WIDTH, 33); | ||
296 | mLCD->SetText(packetlossStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("PLoss")).c_str())); | ||
297 | |||
298 | HANDLE packetloss = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 35); | ||
299 | mLCD->SetOrigin(packetloss, ICON_WIDTH+33, 33); | ||
300 | mLCD->SetText(packetloss, _T("")); | ||
301 | newPage.mDisplayItemArray.push_back(packetloss); | ||
302 | |||
303 | HANDLE pingStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 20); | ||
304 | mLCD->SetOrigin(pingStatic, ICON_WIDTH+32+38, 33); | ||
305 | mLCD->SetText(pingStatic,(LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Ping")).c_str())); | ||
306 | |||
307 | HANDLE ping = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30); | ||
308 | mLCD->SetOrigin(ping, ICON_WIDTH+37+27+37, 33); | ||
309 | mLCD->SetText(ping, _T("")); | ||
310 | newPage.mDisplayItemArray.push_back(ping); | ||
311 | |||
312 | // and then insert it | ||
313 | mPageArray.push_back(newPage); | ||
314 | } | ||
315 | |||
316 | ///////////////////////////////////// | ||
317 | // | ||
318 | // Linden Account group class | ||
319 | // | ||
320 | ///////////////////////////////////// | ||
321 | |||
322 | void llLindenPageGroup::UpdateDetails() | ||
323 | { | ||
324 | mLCD->ModifyControlsOnPage(mPageArray[0].mPageIndex); | ||
325 | LLString time = llformat("Unknown"); | ||
326 | LLString balance = llformat("Unknown"); | ||
327 | // region name | ||
328 | if (gStatusBar) | ||
329 | { | ||
330 | time = gStatusBar->mRegionDetails.mTime; | ||
331 | balance = llformat("%d", gStatusBar->mRegionDetails.mBalance); | ||
332 | } | ||
333 | |||
334 | // time name | ||
335 | mLCD->SetText(mPageArray[0].mDisplayItemArray[0], (LPCTSTR)(utf8str_to_utf16str(time).c_str())); | ||
336 | // balance | ||
337 | mLCD->SetText(mPageArray[0].mDisplayItemArray[1], (LPCTSTR)(utf8str_to_utf16str(balance).c_str())); | ||
338 | } | ||
339 | |||
340 | void llLindenPageGroup::GetDisplayable() | ||
341 | { | ||
342 | mDisplayPage = gSavedSettings.getBOOL("DisplayLinden"); | ||
343 | } | ||
344 | |||
345 | llLindenPageGroup::llLindenPageGroup(CEzLcd *LCD, int type, HICON SLIcon) | ||
346 | :llLCDPageGroup(LCD, type, SLIcon) | ||
347 | { | ||
348 | // create a new specific page | ||
349 | llLCDSpecificPage newPage; | ||
350 | newPage.mPageIndex = mLCD->AddNewPage() - 1; | ||
351 | mLCD->ModifyControlsOnPage(newPage.mPageIndex); | ||
352 | |||
353 | // add in all the display parts for this specific page | ||
354 | |||
355 | // add in the icon - all pages have this - we don't need to track this because we never update it | ||
356 | HANDLE m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32); | ||
357 | mLCD->SetOrigin(m_rightIcon, 0, 0); | ||
358 | |||
359 | // add Title | ||
360 | HANDLE title = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_CENTER, 128); | ||
361 | mLCD->SetOrigin(title, 32, 0); | ||
362 | mLCD->SetText(title, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("AccountDetails")).c_str())); | ||
363 | |||
364 | HANDLE timeStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30); | ||
365 | mLCD->SetOrigin(timeStatic, ICON_WIDTH, 11); | ||
366 | mLCD->SetText(timeStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Time")).c_str())); | ||
367 | |||
368 | HANDLE time = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH - 32); | ||
369 | mLCD->SetOrigin(time, ICON_WIDTH+32, 11); | ||
370 | mLCD->SetText(time, _T("")); | ||
371 | newPage.mDisplayItemArray.push_back(time); | ||
372 | |||
373 | HANDLE balanceStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30); | ||
374 | mLCD->SetOrigin(balanceStatic, ICON_WIDTH, 22); | ||
375 | mLCD->SetText(balanceStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("LBal")).c_str())); | ||
376 | |||
377 | HANDLE balance = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH - 35); | ||
378 | mLCD->SetOrigin(balance, ICON_WIDTH+35, 22); | ||
379 | mLCD->SetText(balance, _T("")); | ||
380 | newPage.mDisplayItemArray.push_back(balance); | ||
381 | |||
382 | // and then insert it | ||
383 | mPageArray.push_back(newPage); | ||
384 | } | ||
385 | |||
386 | ///////////////////////////////////// | ||
387 | // | ||
388 | // Region Group page | ||
389 | // | ||
390 | ///////////////////////////////////// | ||
391 | |||
392 | void llRegionPageGroup::UpdateDetails() | ||
393 | { | ||
394 | LLString pos = llformat("Unknown"); | ||
395 | LLString parcel = llformat("Unknown"); | ||
396 | LLString region = llformat("Unknown"); | ||
397 | LLString owner = llformat("Unknown"); | ||
398 | LLString forsale = bogus->childGetText("No"); | ||
399 | LLString rtype = llformat("Unknown"); | ||
400 | LLString sqm = llformat("0"); | ||
401 | LLString traffic = llformat("0"); | ||
402 | |||
403 | // region name | ||
404 | if (gStatusBar) | ||
405 | { | ||
406 | pos = llformat(" %d, %d, %d", gStatusBar->mRegionDetails.mX, gStatusBar->mRegionDetails.mY, gStatusBar->mRegionDetails.mZ); | ||
407 | parcel = llformat("%s", gStatusBar->mRegionDetails.mParcelName); | ||
408 | region = gStatusBar->mRegionDetails.mRegionName; | ||
409 | rtype = llformat("%s", gStatusBar->mRegionDetails.mAccesString); | ||
410 | sqm = llformat("%d", gStatusBar->mRegionDetails.mArea); | ||
411 | if (gStatusBar->mRegionDetails.mForSale) | ||
412 | { | ||
413 | forsale = bogus->childGetText("Yes"); | ||
414 | } | ||
415 | owner = llformat("%s", gStatusBar->mRegionDetails.mOwner); | ||
416 | traffic = llformat("%d", (int)gStatusBar->mRegionDetails.mTraffic); | ||
417 | } | ||
418 | |||
419 | // update first page | ||
420 | mLCD->ModifyControlsOnPage(mPageArray[0].mPageIndex); | ||
421 | // region name | ||
422 | mLCD->SetText(mPageArray[0].mDisplayItemArray[0], (LPCTSTR)(utf8str_to_utf16str(region).c_str())); | ||
423 | // parcel name | ||
424 | mLCD->SetText(mPageArray[0].mDisplayItemArray[1], (LPCTSTR)(utf8str_to_utf16str(parcel).c_str())); | ||
425 | // position name | ||
426 | mLCD->SetText(mPageArray[0].mDisplayItemArray[2], (LPCTSTR)(utf8str_to_utf16str(pos).c_str())); | ||
427 | // Sqm | ||
428 | mLCD->SetText(mPageArray[0].mDisplayItemArray[3], (LPCTSTR)(utf8str_to_utf16str(sqm).c_str())); | ||
429 | |||
430 | // update second page | ||
431 | mLCD->ModifyControlsOnPage(mPageArray[1].mPageIndex); | ||
432 | // owner | ||
433 | mLCD->SetText(mPageArray[1].mDisplayItemArray[0], (LPCTSTR)(utf8str_to_utf16str(owner).c_str())); | ||
434 | // access type | ||
435 | mLCD->SetText(mPageArray[1].mDisplayItemArray[1], (LPCTSTR)(utf8str_to_utf16str(rtype).c_str())); | ||
436 | // forsale | ||
437 | mLCD->SetText(mPageArray[1].mDisplayItemArray[2], (LPCTSTR)(utf8str_to_utf16str(forsale).c_str())); | ||
438 | // traffic | ||
439 | mLCD->SetText(mPageArray[1].mDisplayItemArray[3], (LPCTSTR)(utf8str_to_utf16str(traffic).c_str())); | ||
440 | |||
441 | } | ||
442 | |||
443 | void llRegionPageGroup::GetDisplayable() | ||
444 | { | ||
445 | mDisplayPage = gSavedSettings.getBOOL("DisplayRegion"); | ||
446 | } | ||
447 | |||
448 | llRegionPageGroup::llRegionPageGroup(CEzLcd *LCD, int type, HICON SLIcon) | ||
449 | :llLCDPageGroup(LCD, type, SLIcon) | ||
450 | { | ||
451 | // create a new specific page | ||
452 | llLCDSpecificPage newPage; | ||
453 | newPage.mPageIndex = mLCD->AddNewPage() - 1; | ||
454 | mLCD->ModifyControlsOnPage(newPage.mPageIndex); | ||
455 | |||
456 | // add in all the display parts for this specific page | ||
457 | |||
458 | // add in the icon - all pages have this - we don't need to track this because we never update it | ||
459 | HANDLE m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32); | ||
460 | mLCD->SetOrigin(m_rightIcon, 0, 0); | ||
461 | |||
462 | // add Title | ||
463 | HANDLE title = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_CENTER, 128); | ||
464 | mLCD->SetOrigin(title, 32, 0); | ||
465 | mLCD->SetText(title, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("LocationDetails1")).c_str())); | ||
466 | |||
467 | HANDLE regionNameStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30); | ||
468 | mLCD->SetOrigin(regionNameStatic, ICON_WIDTH, 11); | ||
469 | mLCD->SetText(regionNameStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Region")).c_str())); | ||
470 | |||
471 | HANDLE regionName = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH - 30 - 2); | ||
472 | mLCD->SetOrigin(regionName, ICON_WIDTH+32, 11); | ||
473 | mLCD->SetText(regionName, _T("")); | ||
474 | newPage.mDisplayItemArray.push_back(regionName); | ||
475 | |||
476 | HANDLE parcelStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30); | ||
477 | mLCD->SetOrigin(parcelStatic, ICON_WIDTH, 22); | ||
478 | mLCD->SetText(parcelStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Parcel")).c_str())); | ||
479 | |||
480 | HANDLE parcel = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_CENTER, 160 - ICON_WIDTH - 30 - 2); | ||
481 | mLCD->SetOrigin(parcel, ICON_WIDTH+32, 22); | ||
482 | mLCD->SetText(parcel, _T("")); | ||
483 | newPage.mDisplayItemArray.push_back(parcel); | ||
484 | |||
485 | HANDLE positionStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 18); | ||
486 | mLCD->SetOrigin(positionStatic, 0, 33); | ||
487 | mLCD->SetText(positionStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Parcel")).c_str())); | ||
488 | |||
489 | HANDLE position = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 60); | ||
490 | mLCD->SetOrigin(position, 20, 33); | ||
491 | mLCD->SetText(position, _T("100, 100, 100")); | ||
492 | newPage.mDisplayItemArray.push_back(position); | ||
493 | |||
494 | HANDLE sqmStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 18); | ||
495 | mLCD->SetOrigin(sqmStatic, 90, 33); | ||
496 | mLCD->SetText(sqmStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Sqm")).c_str())); | ||
497 | |||
498 | HANDLE sqm = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 40); | ||
499 | mLCD->SetOrigin(sqm, 90 + 20, 33); | ||
500 | mLCD->SetText(sqm, _T("1000")); | ||
501 | newPage.mDisplayItemArray.push_back(sqm); | ||
502 | |||
503 | // and then insert it | ||
504 | mPageArray.push_back(newPage); | ||
505 | |||
506 | // create a new specific page | ||
507 | llLCDSpecificPage newPage2; | ||
508 | newPage2.mPageIndex = mLCD->AddNewPage() - 1; | ||
509 | mLCD->ModifyControlsOnPage(newPage2.mPageIndex); | ||
510 | |||
511 | // add in all the display parts for this specific page | ||
512 | |||
513 | // add in the icon - all pages have this - we don't need to track this because we never update it | ||
514 | m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32); | ||
515 | mLCD->SetOrigin(m_rightIcon, 0, 0); | ||
516 | |||
517 | // add Title | ||
518 | title = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_CENTER, 128); | ||
519 | mLCD->SetOrigin(title, 32, 0); | ||
520 | mLCD->SetText(title, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("LocationDetails2")).c_str())); | ||
521 | |||
522 | HANDLE ownerStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30); | ||
523 | mLCD->SetOrigin(ownerStatic, ICON_WIDTH, 11); | ||
524 | mLCD->SetText(ownerStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Owner")).c_str())); | ||
525 | |||
526 | HANDLE owner = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - 30 - ICON_WIDTH - 2); | ||
527 | mLCD->SetOrigin(owner, ICON_WIDTH+32, 11); | ||
528 | mLCD->SetText(owner, _T("")); | ||
529 | newPage2.mDisplayItemArray.push_back(owner); | ||
530 | |||
531 | HANDLE typeStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30); | ||
532 | mLCD->SetOrigin(typeStatic, ICON_WIDTH, 22); | ||
533 | mLCD->SetText(typeStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Type")).c_str())); | ||
534 | |||
535 | HANDLE rtype = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 160 - 30 - ICON_WIDTH - 2); | ||
536 | mLCD->SetOrigin(rtype, ICON_WIDTH+32, 22); | ||
537 | mLCD->SetText(rtype, _T("")); | ||
538 | newPage2.mDisplayItemArray.push_back(rtype); | ||
539 | |||
540 | HANDLE forsaleStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 40); | ||
541 | mLCD->SetOrigin(forsaleStatic, 0, 33); | ||
542 | mLCD->SetText(forsaleStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Forsale")).c_str())); | ||
543 | |||
544 | HANDLE forsale = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30); | ||
545 | mLCD->SetOrigin(forsale, 42, 33); | ||
546 | mLCD->SetText(forsale, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("No")).c_str())); | ||
547 | newPage2.mDisplayItemArray.push_back(forsale); | ||
548 | |||
549 | HANDLE trafficStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 50); | ||
550 | mLCD->SetOrigin(trafficStatic, 70, 33); | ||
551 | mLCD->SetText(trafficStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Traffic")).c_str())); | ||
552 | |||
553 | HANDLE traffic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30); | ||
554 | mLCD->SetOrigin(traffic, 122, 33); | ||
555 | mLCD->SetText(traffic, _T("200")); | ||
556 | newPage2.mDisplayItemArray.push_back(traffic); | ||
557 | |||
558 | // and then insert it | ||
559 | mPageArray.push_back(newPage2); | ||
560 | } | ||
561 | |||
562 | ///////////////////////////////////// | ||
563 | // | ||
564 | // Chat group Page class | ||
565 | // | ||
566 | ///////////////////////////////////// | ||
567 | |||
568 | void llChatPageGroup::UpdateDetails() | ||
569 | { | ||
570 | mLCD->ModifyControlsOnPage(mPageArray[0].mPageIndex); | ||
571 | mLCD->SetText(mPageArray[0].mDisplayItemArray[0], (LPCTSTR)(utf8str_to_utf16str(mLine1).c_str())); | ||
572 | mLCD->SetText(mPageArray[0].mDisplayItemArray[1], (LPCTSTR)(utf8str_to_utf16str(mLine2).c_str())); | ||
573 | mLCD->SetText(mPageArray[0].mDisplayItemArray[2], (LPCTSTR)(utf8str_to_utf16str(mLine3).c_str())); | ||
574 | } | ||
575 | |||
576 | void llChatPageGroup::GetDisplayable() | ||
577 | { | ||
578 | mDisplayPage = gSavedSettings.getBOOL("DisplayChat"); | ||
579 | } | ||
580 | |||
581 | void llChatPageGroup::InsertText(const LLString &newLine) | ||
582 | { | ||
583 | mLine1 = mLine2; | ||
584 | mLine2 = mLine3; | ||
585 | mLine3 = newLine; | ||
586 | } | ||
587 | |||
588 | llChatPageGroup::llChatPageGroup(CEzLcd *LCD, int type, HICON SLIcon) | ||
589 | :llLCDPageGroup(LCD, type, SLIcon) | ||
590 | { | ||
591 | mLine1 = llformat(""); | ||
592 | mLine2 = llformat(""); | ||
593 | mLine3 = llformat(""); | ||
594 | // create a new specific page | ||
595 | llLCDSpecificPage newPage; | ||
596 | newPage.mPageIndex = mLCD->AddNewPage() - 1; | ||
597 | mLCD->ModifyControlsOnPage(newPage.mPageIndex); | ||
598 | |||
599 | // add in all the display parts for this specific page | ||
600 | |||
601 | // add in the icon - all pages have this - we don't need to track this because we never update it | ||
602 | HANDLE m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32); | ||
603 | mLCD->SetOrigin(m_rightIcon, 0, 0); | ||
604 | |||
605 | // add Title | ||
606 | HANDLE title = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_CENTER, 128); | ||
607 | mLCD->SetOrigin(title, 32, 0); | ||
608 | mLCD->SetText(title, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Last3ChatLines")).c_str())); | ||
609 | |||
610 | // add line | ||
611 | HANDLE chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH); | ||
612 | mLCD->SetOrigin(chatLine, ICON_WIDTH, 11); | ||
613 | mLCD->SetText(chatLine, _T("")); | ||
614 | newPage.mDisplayItemArray.push_back(chatLine); | ||
615 | |||
616 | // add line | ||
617 | chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH); | ||
618 | mLCD->SetOrigin(chatLine, ICON_WIDTH, 22); | ||
619 | mLCD->SetText(chatLine, _T("")); | ||
620 | newPage.mDisplayItemArray.push_back(chatLine); | ||
621 | |||
622 | // add line | ||
623 | chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH); | ||
624 | mLCD->SetOrigin(chatLine, ICON_WIDTH, 33); | ||
625 | mLCD->SetText(chatLine, _T("")); | ||
626 | newPage.mDisplayItemArray.push_back(chatLine); | ||
627 | |||
628 | // and then insert it | ||
629 | mPageArray.push_back(newPage); | ||
630 | } | ||
631 | |||
632 | ///////////////////////////////////// | ||
633 | // | ||
634 | // IM Page Group class | ||
635 | // | ||
636 | ///////////////////////////////////// | ||
637 | |||
638 | void llIMPageGroup::UpdateDetails() | ||
639 | { | ||
640 | mLCD->ModifyControlsOnPage(mPageArray[0].mPageIndex); | ||
641 | mLCD->SetText(mPageArray[0].mDisplayItemArray[0], (LPCTSTR)(utf8str_to_utf16str(mLine1).c_str())); | ||
642 | mLCD->SetText(mPageArray[0].mDisplayItemArray[1], (LPCTSTR)(utf8str_to_utf16str(mLine2).c_str())); | ||
643 | mLCD->SetText(mPageArray[0].mDisplayItemArray[2], (LPCTSTR)(utf8str_to_utf16str(mLine3).c_str())); | ||
644 | } | ||
645 | |||
646 | void llIMPageGroup::GetDisplayable() | ||
647 | { | ||
648 | mDisplayPage = gSavedSettings.getBOOL("DisplayIM"); | ||
649 | } | ||
650 | |||
651 | void llIMPageGroup::InsertText(const LLString &newLine) | ||
652 | { | ||
653 | mLine1 = mLine2; | ||
654 | mLine2 = mLine3; | ||
655 | mLine3 = newLine; | ||
656 | } | ||
657 | |||
658 | llIMPageGroup::llIMPageGroup(CEzLcd *LCD, int type, HICON SLIcon) | ||
659 | :llLCDPageGroup(LCD, type, SLIcon) | ||
660 | { | ||
661 | mLine1 = llformat(""); | ||
662 | mLine2 = llformat(""); | ||
663 | mLine3 = llformat(""); | ||
664 | // create a new specific page | ||
665 | llLCDSpecificPage newPage; | ||
666 | newPage.mPageIndex = mLCD->AddNewPage() - 1; | ||
667 | mLCD->ModifyControlsOnPage(newPage.mPageIndex); | ||
668 | |||
669 | // add in all the display parts for this specific page | ||
670 | |||
671 | // add in the icon - all pages have this - we don't need to track this because we never update it | ||
672 | HANDLE m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32); | ||
673 | mLCD->SetOrigin(m_rightIcon, 0, 0); | ||
674 | |||
675 | // add Title | ||
676 | HANDLE title = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_CENTER, 128); | ||
677 | mLCD->SetOrigin(title, 32, 0); | ||
678 | mLCD->SetText(title, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Last3IMLines")).c_str())); | ||
679 | |||
680 | // add line | ||
681 | HANDLE chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH); | ||
682 | mLCD->SetOrigin(chatLine, ICON_WIDTH, 11); | ||
683 | mLCD->SetText(chatLine, _T("")); | ||
684 | newPage.mDisplayItemArray.push_back(chatLine); | ||
685 | |||
686 | // add line | ||
687 | chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH); | ||
688 | mLCD->SetOrigin(chatLine, ICON_WIDTH, 22); | ||
689 | mLCD->SetText(chatLine, _T("")); | ||
690 | newPage.mDisplayItemArray.push_back(chatLine); | ||
691 | |||
692 | // add line | ||
693 | chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH); | ||
694 | mLCD->SetOrigin(chatLine, ICON_WIDTH, 33); | ||
695 | mLCD->SetText(chatLine, _T("")); | ||
696 | newPage.mDisplayItemArray.push_back(chatLine); | ||
697 | |||
698 | // and then insert it | ||
699 | mPageArray.push_back(newPage); | ||
700 | } | ||
701 | |||
702 | #endif //LL_WINDOWS | ||
703 | #endif //LL_LCD_COMPILE \ No newline at end of file | ||