lllcd.cpp

Go to the documentation of this file.
00001 
00033 #include "llviewerprecompiledheaders.h"
00034 #include "llcontrol.h"
00035 #include "llstatusbar.h"
00036 #include "llviewerregion.h"
00037 #include "llviewerstats.h"
00038 #include "llvieweruictrlfactory.h"
00039 
00040 #if LL_LCD_COMPILE
00041 
00042 extern LLControlGroup gSavedSettings;
00043 
00044 #define ICON_WIDTH 28
00045 
00046 #if LL_WINDOWS
00047 // for Logitech LCD keyboards / speakers
00048 #include "EZ_LCD.h"
00049 #include "lllogitechlcd.h"
00050 #include "lllcd.h"
00051 
00052 // not happy about this, but there's no local class to put it in.
00053 LLPanel *bogus = NULL;
00054 
00055 // 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
00056 void CreateLCDDebugWindows()
00057 {
00058         if (gLcdScreen->Enabled())
00059         {
00060                 // load up the text so we are sure it's externalized and localized correctly.
00061                 bogus = new LLPanel();
00062                 gUICtrlFactory->buildPanel(bogus, "lcd_text.xml");
00063 
00064                 llLCDPageGroup *pageGroup = NULL;
00065                 pageGroup = new llDefaultPageGroup(gLcdScreen->mLCD, llLCD::kLCDDefault, gLcdScreen->mSLIcon);
00066                 // push this new group onto the array
00067                 gLcdScreen->mPageGroupArray.push_back(pageGroup);
00068 
00069                 pageGroup = new llChatPageGroup(gLcdScreen->mLCD, llLCD::kLCDChat, gLcdScreen->mSLIcon);
00070                 // push this new group onto the array
00071                 gLcdScreen->mPageGroupArray.push_back(pageGroup);
00072 
00073                 pageGroup = new llIMPageGroup(gLcdScreen->mLCD, llLCD::kLCDIM, gLcdScreen->mSLIcon);
00074                 // push this new group onto the array
00075                 gLcdScreen->mPageGroupArray.push_back(pageGroup);
00076 
00077                 pageGroup = new llDebugPageGroup(gLcdScreen->mLCD, llLCD::kLCDDebug, gLcdScreen->mSLIcon);
00078                 // push this new group onto the array
00079                 gLcdScreen->mPageGroupArray.push_back(pageGroup);
00080 
00081                 pageGroup = new llLindenPageGroup(gLcdScreen->mLCD, llLCD::kLCDLinden, gLcdScreen->mSLIcon);
00082                 // push this new group onto the array
00083                 gLcdScreen->mPageGroupArray.push_back(pageGroup);
00084 
00085                 pageGroup = new llRegionPageGroup(gLcdScreen->mLCD, llLCD::kLCDRegion, gLcdScreen->mSLIcon);
00086                 // push this new group onto the array
00087                 gLcdScreen->mPageGroupArray.push_back(pageGroup);
00088 
00089                 pageGroup = new llDebugConsolePageGroup(gLcdScreen->mLCD, llLCD::kLCDDebugConsole, gLcdScreen->mSLIcon);
00090                 // push this new group onto the array
00091                 gLcdScreen->mPageGroupArray.push_back(pageGroup);
00092         }
00093 }
00094 
00095 // functions that allow the chat and IM handler to insert new lines directly into the LCD page group handlers
00096 void AddNewIMToLCD(const LLString &newLine)
00097 {
00098         if (gLcdScreen->Enabled())
00099         {
00100                 llIMPageGroup *imGroup = (llIMPageGroup *)gLcdScreen->mPageGroupArray[2];
00101                 imGroup->InsertText(newLine);
00102         }
00103 }
00104 
00105 void AddNewChatToLCD(const LLString &newLine)
00106 {
00107         if (gLcdScreen->Enabled())
00108         {
00109                 llChatPageGroup *chatGroup = (llChatPageGroup *)gLcdScreen->mPageGroupArray[1];
00110                 chatGroup->InsertText(newLine);
00111         }
00112 }
00113 
00114 void AddNewDebugConsoleToLCD(const LLWString &newLine)
00115 {
00116         if (gLcdScreen->Enabled())
00117         {
00118                 llDebugConsolePageGroup *debugGroup = (llDebugConsolePageGroup *)gLcdScreen->mPageGroupArray[6];
00119                 debugGroup->InsertText(newLine);
00120         }
00121 }
00122 
00124 //
00125 //      Debug Console Page group class
00126 //
00128 
00129 void llDebugConsolePageGroup::UpdateDetails()
00130 {
00131         mLCD->ModifyControlsOnPage(mPageArray[0].mPageIndex); 
00132         mLCD->SetText(mPageArray[0].mDisplayItemArray[0], (LPCTSTR)(wstring_to_utf16str(mLine1).c_str()));
00133         mLCD->SetText(mPageArray[0].mDisplayItemArray[1], (LPCTSTR)(wstring_to_utf16str(mLine2).c_str()));
00134         mLCD->SetText(mPageArray[0].mDisplayItemArray[2], (LPCTSTR)(wstring_to_utf16str(mLine3).c_str()));
00135 }
00136 
00137 void llDebugConsolePageGroup::GetDisplayable()
00138 {
00139         mDisplayPage = gSavedSettings.getBOOL("DisplayDebugConsole");
00140 }
00141 
00142 void llDebugConsolePageGroup::InsertText(const LLWString &newLine)
00143 {
00144         mLine1 = mLine2;
00145         mLine2 = mLine3;
00146         mLine3 = newLine;
00147 }
00148 
00149 llDebugConsolePageGroup::llDebugConsolePageGroup(CEzLcd *LCD, int type, HICON SLIcon)
00150 :llLCDPageGroup(LCD, type, SLIcon)
00151 {
00152         // create a new specific pagea
00153         llLCDSpecificPage newPage;
00154         newPage.mPageIndex = mLCD->AddNewPage() - 1;
00155         mLCD->ModifyControlsOnPage(newPage.mPageIndex);
00156 
00157         // add in all the display parts for this specific page
00158 
00159         // add in the icon - all pages have this - we don't need to track this because we never update it
00160         HANDLE m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32);
00161         mLCD->SetOrigin(m_rightIcon, 0, 0);
00162 
00163         // add Title
00164         HANDLE title = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_CENTER, 128);
00165         mLCD->SetOrigin(title, 32, 0);
00166         mLCD->SetText(title, _T("Debug Console"));
00167 
00168         // add line
00169         HANDLE chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH);
00170         mLCD->SetOrigin(chatLine, ICON_WIDTH, 11);
00171         mLCD->SetText(chatLine, _T(""));
00172         newPage.mDisplayItemArray.push_back(chatLine);
00173 
00174         // add line
00175         chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH);
00176         mLCD->SetOrigin(chatLine, ICON_WIDTH, 22);
00177         mLCD->SetText(chatLine, _T(""));
00178         newPage.mDisplayItemArray.push_back(chatLine);
00179 
00180         // add line
00181         chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH);
00182         mLCD->SetOrigin(chatLine, ICON_WIDTH, 33);
00183         mLCD->SetText(chatLine, _T(""));
00184         newPage.mDisplayItemArray.push_back(chatLine);
00185 
00186         // and then insert it
00187         mPageArray.push_back(newPage);
00188 }
00189 
00191 //
00192 //      Network Comms Page group class
00193 //
00195 
00196 void llDebugPageGroup::UpdateDetails()
00197 {
00198         mLCD->ModifyControlsOnPage(mPageArray[0].mPageIndex);
00199         LLString ping = llformat("1000");
00200         LLString packetsIn = llformat("0");
00201         LLString packetsOut = llformat("0");
00202         LLString packetLoss = llformat("0");
00203         LLString fps = llformat("0");
00204         LLString simfps = llformat("0");
00205         // region name
00206         if (gStatusBar)
00207         { 
00208                 ping = llformat("%d", gStatusBar->mRegionDetails.mPing);        
00209         }
00210 
00211         if (gViewerStats)
00212         {
00213                 packetLoss = llformat("%.1f%%", gViewerStats->mPacketsLostPercentStat.getCurrent());
00214                 simfps = llformat("%d", (int)gViewerStats->mSimFPS.getCurrent());
00215                 fps = llformat("%.1f%", gViewerStats->mFPSStat.getMeanPerSec());
00216                 packetsIn = llformat("%d", (int)gViewerStats->mSimInPPS.getCurrent());
00217                 packetsOut = llformat("%d", (int)gViewerStats->mSimOutPPS.getCurrent());
00218         }
00219 
00220         // fps
00221         mLCD->SetText(mPageArray[0].mDisplayItemArray[0], (LPCTSTR)(utf8str_to_utf16str(fps).c_str()));
00222         // simfps
00223         mLCD->SetText(mPageArray[0].mDisplayItemArray[1], (LPCTSTR)(utf8str_to_utf16str(simfps).c_str()));
00224         // packets in
00225         mLCD->SetText(mPageArray[0].mDisplayItemArray[2], (LPCTSTR)(utf8str_to_utf16str(packetsIn).c_str()));
00226         // packets out
00227         mLCD->SetText(mPageArray[0].mDisplayItemArray[3], (LPCTSTR)(utf8str_to_utf16str(packetsOut).c_str()));
00228         // packet loss
00229         mLCD->SetText(mPageArray[0].mDisplayItemArray[4], (LPCTSTR)(utf8str_to_utf16str(packetLoss).c_str()));
00230         // ping
00231         mLCD->SetText(mPageArray[0].mDisplayItemArray[5], (LPCTSTR)(utf8str_to_utf16str(ping).c_str())); 
00232 }
00233 
00234 void llDebugPageGroup::GetDisplayable()
00235 {
00236         mDisplayPage = gSavedSettings.getBOOL("DisplayDebug");
00237 }
00238 
00239 llDebugPageGroup::llDebugPageGroup(CEzLcd *LCD, int type, HICON SLIcon)
00240 :llLCDPageGroup(LCD, type, SLIcon)
00241 {
00242         // create a new specific page
00243         llLCDSpecificPage newPage;
00244         newPage.mPageIndex = mLCD->AddNewPage() - 1;
00245         mLCD->ModifyControlsOnPage(newPage.mPageIndex);
00246 
00247         // add in all the display parts for this specific page
00248 
00249         // add in the icon - all pages have this - we don't need to track this because we never update it
00250         HANDLE m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32);
00251         mLCD->SetOrigin(m_rightIcon, 0, 0);
00252 
00253         // add Title
00254         HANDLE title = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_CENTER, 128);
00255         mLCD->SetOrigin(title, 32, 0);
00256         mLCD->SetText(title, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("DebugInfo")).c_str()));
00257 
00258         HANDLE fpsStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 18);
00259         mLCD->SetOrigin(fpsStatic, ICON_WIDTH, 11);
00260         mLCD->SetText(fpsStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("FPS")).c_str()));
00261 
00262         HANDLE fps = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 25);
00263         mLCD->SetOrigin(fps, ICON_WIDTH+25, 11);
00264         mLCD->SetText(fps, _T(""));
00265         newPage.mDisplayItemArray.push_back(fps);
00266 
00267         HANDLE simfpsStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 35);
00268         mLCD->SetOrigin(simfpsStatic, ICON_WIDTH+37+25, 11);
00269         mLCD->SetText(simfpsStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("SimFPS")).c_str()));
00270 
00271         HANDLE simfps = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 25);
00272         mLCD->SetOrigin(simfps, ICON_WIDTH+37+27+37, 11);
00273         mLCD->SetText(simfps, _T(""));
00274         newPage.mDisplayItemArray.push_back(simfps);
00275 
00276         HANDLE packetsinStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 25);
00277         mLCD->SetOrigin(packetsinStatic, ICON_WIDTH, 22);
00278         mLCD->SetText(packetsinStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Pin")).c_str()));
00279 
00280         HANDLE packetsin = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 25);
00281         mLCD->SetOrigin(packetsin, ICON_WIDTH+32, 22);
00282         mLCD->SetText(packetsin, _T(""));
00283         newPage.mDisplayItemArray.push_back(packetsin);
00284 
00285         HANDLE packetsoutStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30);
00286         mLCD->SetOrigin(packetsoutStatic, ICON_WIDTH+37+25, 22);
00287         mLCD->SetText(packetsoutStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Pout")).c_str()));
00288 
00289         HANDLE packetsout = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 25);
00290         mLCD->SetOrigin(packetsout, ICON_WIDTH+37+27+37, 22);
00291         mLCD->SetText(packetsout, _T(""));
00292         newPage.mDisplayItemArray.push_back(packetsout);
00293 
00294         HANDLE packetlossStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30);
00295         mLCD->SetOrigin(packetlossStatic, ICON_WIDTH, 33);
00296         mLCD->SetText(packetlossStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("PLoss")).c_str()));
00297 
00298         HANDLE packetloss = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 35);
00299         mLCD->SetOrigin(packetloss, ICON_WIDTH+33, 33);
00300         mLCD->SetText(packetloss, _T(""));
00301         newPage.mDisplayItemArray.push_back(packetloss);
00302 
00303         HANDLE pingStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 20);
00304         mLCD->SetOrigin(pingStatic, ICON_WIDTH+32+38, 33);
00305         mLCD->SetText(pingStatic,(LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Ping")).c_str()));
00306 
00307         HANDLE ping = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30);
00308         mLCD->SetOrigin(ping, ICON_WIDTH+37+27+37, 33);
00309         mLCD->SetText(ping, _T(""));
00310         newPage.mDisplayItemArray.push_back(ping);
00311 
00312         // and then insert it
00313         mPageArray.push_back(newPage);
00314 }
00315 
00317 //
00318 //      Linden Account group class
00319 //
00321 
00322 void llLindenPageGroup::UpdateDetails()
00323 {
00324         mLCD->ModifyControlsOnPage(mPageArray[0].mPageIndex);
00325         LLString time = llformat("Unknown");
00326         LLString balance = llformat("Unknown");
00327         // region name
00328         if (gStatusBar)
00329         { 
00330                 time = gStatusBar->mRegionDetails.mTime;
00331                 balance = llformat("%d", gStatusBar->mRegionDetails.mBalance);
00332         }
00333 
00334         // time name
00335         mLCD->SetText(mPageArray[0].mDisplayItemArray[0], (LPCTSTR)(utf8str_to_utf16str(time).c_str()));
00336         // balance
00337         mLCD->SetText(mPageArray[0].mDisplayItemArray[1], (LPCTSTR)(utf8str_to_utf16str(balance).c_str()));
00338 }
00339 
00340 void llLindenPageGroup::GetDisplayable()
00341 {
00342         mDisplayPage = gSavedSettings.getBOOL("DisplayLinden");
00343 }
00344 
00345 llLindenPageGroup::llLindenPageGroup(CEzLcd *LCD, int type, HICON SLIcon)
00346 :llLCDPageGroup(LCD, type, SLIcon)
00347 {
00348         // create a new specific page
00349         llLCDSpecificPage newPage;
00350         newPage.mPageIndex = mLCD->AddNewPage() - 1;
00351         mLCD->ModifyControlsOnPage(newPage.mPageIndex);
00352 
00353         // add in all the display parts for this specific page
00354 
00355         // add in the icon - all pages have this - we don't need to track this because we never update it
00356         HANDLE m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32);
00357         mLCD->SetOrigin(m_rightIcon, 0, 0);
00358 
00359         // add Title
00360         HANDLE title = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_CENTER, 128);
00361         mLCD->SetOrigin(title, 32, 0);
00362         mLCD->SetText(title, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("AccountDetails")).c_str()));
00363 
00364         HANDLE timeStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30);
00365         mLCD->SetOrigin(timeStatic, ICON_WIDTH, 11);
00366         mLCD->SetText(timeStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Time")).c_str()));
00367 
00368         HANDLE time = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH - 32);
00369         mLCD->SetOrigin(time, ICON_WIDTH+32, 11);
00370         mLCD->SetText(time, _T(""));
00371         newPage.mDisplayItemArray.push_back(time);
00372 
00373         HANDLE balanceStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30);
00374         mLCD->SetOrigin(balanceStatic, ICON_WIDTH, 22);
00375         mLCD->SetText(balanceStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("LBal")).c_str()));
00376 
00377         HANDLE balance = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH - 35);
00378         mLCD->SetOrigin(balance, ICON_WIDTH+35, 22);
00379         mLCD->SetText(balance, _T(""));
00380         newPage.mDisplayItemArray.push_back(balance);
00381 
00382         // and then insert it
00383         mPageArray.push_back(newPage);
00384 }
00385 
00387 //
00388 //      Region Group page
00389 //
00391 
00392 void llRegionPageGroup::UpdateDetails()
00393 {
00394         LLString pos = llformat("Unknown");
00395         LLString parcel = llformat("Unknown");
00396         LLString region = llformat("Unknown");
00397         LLString owner = llformat("Unknown");
00398         LLString forsale = bogus->childGetText("No");
00399         LLString rtype = llformat("Unknown");
00400         LLString sqm = llformat("0");
00401         LLString traffic = llformat("0");
00402 
00403         // region name
00404         if (gStatusBar)
00405         {
00406                 pos = llformat(" %d, %d, %d", gStatusBar->mRegionDetails.mX, gStatusBar->mRegionDetails.mY, gStatusBar->mRegionDetails.mZ);
00407                 parcel = llformat("%s", gStatusBar->mRegionDetails.mParcelName);
00408                 region = gStatusBar->mRegionDetails.mRegionName;
00409                 rtype = llformat("%s", gStatusBar->mRegionDetails.mAccesString);
00410                 sqm = llformat("%d", gStatusBar->mRegionDetails.mArea);
00411                 if (gStatusBar->mRegionDetails.mForSale)
00412                 {
00413                         forsale = bogus->childGetText("Yes");
00414                 }
00415                 owner = llformat("%s", gStatusBar->mRegionDetails.mOwner);
00416                 traffic = llformat("%d", (int)gStatusBar->mRegionDetails.mTraffic);
00417         }
00418 
00419         // update first page
00420         mLCD->ModifyControlsOnPage(mPageArray[0].mPageIndex);
00421         // region name
00422         mLCD->SetText(mPageArray[0].mDisplayItemArray[0], (LPCTSTR)(utf8str_to_utf16str(region).c_str()));
00423         // parcel name
00424         mLCD->SetText(mPageArray[0].mDisplayItemArray[1], (LPCTSTR)(utf8str_to_utf16str(parcel).c_str()));
00425         // position name
00426         mLCD->SetText(mPageArray[0].mDisplayItemArray[2], (LPCTSTR)(utf8str_to_utf16str(pos).c_str()));
00427         // Sqm
00428         mLCD->SetText(mPageArray[0].mDisplayItemArray[3], (LPCTSTR)(utf8str_to_utf16str(sqm).c_str()));
00429 
00430         // update second page
00431         mLCD->ModifyControlsOnPage(mPageArray[1].mPageIndex);
00432         // owner
00433         mLCD->SetText(mPageArray[1].mDisplayItemArray[0], (LPCTSTR)(utf8str_to_utf16str(owner).c_str()));
00434         // access type
00435         mLCD->SetText(mPageArray[1].mDisplayItemArray[1], (LPCTSTR)(utf8str_to_utf16str(rtype).c_str()));
00436         // forsale
00437         mLCD->SetText(mPageArray[1].mDisplayItemArray[2], (LPCTSTR)(utf8str_to_utf16str(forsale).c_str()));
00438         // traffic
00439         mLCD->SetText(mPageArray[1].mDisplayItemArray[3], (LPCTSTR)(utf8str_to_utf16str(traffic).c_str()));
00440 
00441 }
00442 
00443 void llRegionPageGroup::GetDisplayable()
00444 {
00445         mDisplayPage = gSavedSettings.getBOOL("DisplayRegion");
00446 }
00447 
00448 llRegionPageGroup::llRegionPageGroup(CEzLcd *LCD, int type, HICON SLIcon)
00449 :llLCDPageGroup(LCD, type, SLIcon)
00450 {
00451         // create a new specific page
00452         llLCDSpecificPage newPage;
00453         newPage.mPageIndex = mLCD->AddNewPage() - 1;
00454         mLCD->ModifyControlsOnPage(newPage.mPageIndex);
00455 
00456         // add in all the display parts for this specific page
00457 
00458         // add in the icon - all pages have this - we don't need to track this because we never update it
00459         HANDLE m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32);
00460         mLCD->SetOrigin(m_rightIcon, 0, 0);
00461 
00462         // add Title
00463         HANDLE title = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_CENTER, 128);
00464         mLCD->SetOrigin(title, 32, 0);
00465         mLCD->SetText(title, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("LocationDetails1")).c_str()));
00466 
00467         HANDLE regionNameStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30);
00468         mLCD->SetOrigin(regionNameStatic, ICON_WIDTH, 11);
00469         mLCD->SetText(regionNameStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Region")).c_str()));
00470 
00471         HANDLE regionName = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH - 30 - 2);
00472         mLCD->SetOrigin(regionName, ICON_WIDTH+32, 11);
00473         mLCD->SetText(regionName, _T(""));
00474         newPage.mDisplayItemArray.push_back(regionName);
00475 
00476         HANDLE parcelStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30);
00477         mLCD->SetOrigin(parcelStatic, ICON_WIDTH, 22);
00478         mLCD->SetText(parcelStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Parcel")).c_str()));
00479 
00480         HANDLE parcel = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_CENTER, 160 - ICON_WIDTH - 30 - 2);
00481         mLCD->SetOrigin(parcel, ICON_WIDTH+32, 22);
00482         mLCD->SetText(parcel, _T(""));
00483         newPage.mDisplayItemArray.push_back(parcel);
00484 
00485         HANDLE positionStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 18);
00486         mLCD->SetOrigin(positionStatic, 0, 33);
00487         mLCD->SetText(positionStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Parcel")).c_str()));
00488 
00489         HANDLE position = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 60);
00490         mLCD->SetOrigin(position, 20, 33);
00491         mLCD->SetText(position, _T("100, 100, 100"));
00492         newPage.mDisplayItemArray.push_back(position);
00493 
00494         HANDLE sqmStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 18);
00495         mLCD->SetOrigin(sqmStatic, 90, 33);
00496         mLCD->SetText(sqmStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Sqm")).c_str()));
00497 
00498         HANDLE sqm = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 40);
00499         mLCD->SetOrigin(sqm, 90 + 20, 33);
00500         mLCD->SetText(sqm, _T("1000"));
00501         newPage.mDisplayItemArray.push_back(sqm);
00502 
00503         // and then insert it
00504         mPageArray.push_back(newPage);
00505 
00506         // create a new specific page
00507         llLCDSpecificPage newPage2;
00508         newPage2.mPageIndex = mLCD->AddNewPage() - 1;
00509         mLCD->ModifyControlsOnPage(newPage2.mPageIndex);
00510 
00511         // add in all the display parts for this specific page
00512 
00513         // add in the icon - all pages have this - we don't need to track this because we never update it
00514         m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32);
00515         mLCD->SetOrigin(m_rightIcon, 0, 0);
00516 
00517         // add Title
00518         title = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_CENTER, 128);
00519         mLCD->SetOrigin(title, 32, 0);
00520         mLCD->SetText(title, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("LocationDetails2")).c_str()));
00521 
00522         HANDLE ownerStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30);
00523         mLCD->SetOrigin(ownerStatic, ICON_WIDTH, 11);
00524         mLCD->SetText(ownerStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Owner")).c_str()));
00525 
00526         HANDLE owner = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - 30 - ICON_WIDTH - 2);
00527         mLCD->SetOrigin(owner, ICON_WIDTH+32, 11);
00528         mLCD->SetText(owner, _T(""));
00529         newPage2.mDisplayItemArray.push_back(owner);
00530 
00531         HANDLE typeStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30);
00532         mLCD->SetOrigin(typeStatic, ICON_WIDTH, 22);
00533         mLCD->SetText(typeStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Type")).c_str()));
00534 
00535         HANDLE rtype = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 160 - 30 - ICON_WIDTH - 2);
00536         mLCD->SetOrigin(rtype, ICON_WIDTH+32, 22);
00537         mLCD->SetText(rtype, _T(""));
00538         newPage2.mDisplayItemArray.push_back(rtype);
00539 
00540         HANDLE forsaleStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 40);
00541         mLCD->SetOrigin(forsaleStatic, 0, 33);
00542         mLCD->SetText(forsaleStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Forsale")).c_str()));
00543 
00544         HANDLE forsale = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30);
00545         mLCD->SetOrigin(forsale, 42, 33);
00546         mLCD->SetText(forsale, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("No")).c_str()));
00547         newPage2.mDisplayItemArray.push_back(forsale);
00548 
00549         HANDLE trafficStatic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 50);
00550         mLCD->SetOrigin(trafficStatic, 70, 33);
00551         mLCD->SetText(trafficStatic, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Traffic")).c_str()));
00552 
00553         HANDLE traffic = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_LEFT, 30);
00554         mLCD->SetOrigin(traffic, 122, 33);
00555         mLCD->SetText(traffic, _T("200"));
00556         newPage2.mDisplayItemArray.push_back(traffic);
00557 
00558         // and then insert it
00559         mPageArray.push_back(newPage2);
00560 }
00561 
00563 //
00564 //      Chat group Page class
00565 //
00567 
00568 void llChatPageGroup::UpdateDetails()
00569 {
00570         mLCD->ModifyControlsOnPage(mPageArray[0].mPageIndex);
00571         mLCD->SetText(mPageArray[0].mDisplayItemArray[0], (LPCTSTR)(utf8str_to_utf16str(mLine1).c_str()));
00572         mLCD->SetText(mPageArray[0].mDisplayItemArray[1], (LPCTSTR)(utf8str_to_utf16str(mLine2).c_str()));
00573         mLCD->SetText(mPageArray[0].mDisplayItemArray[2], (LPCTSTR)(utf8str_to_utf16str(mLine3).c_str()));
00574 }
00575 
00576 void llChatPageGroup::GetDisplayable()
00577 {
00578         mDisplayPage = gSavedSettings.getBOOL("DisplayChat");
00579 }
00580 
00581 void llChatPageGroup::InsertText(const LLString &newLine)
00582 {
00583         mLine1 = mLine2;
00584         mLine2 = mLine3;
00585         mLine3 = newLine;
00586 }
00587 
00588 llChatPageGroup::llChatPageGroup(CEzLcd *LCD, int type, HICON SLIcon)
00589 :llLCDPageGroup(LCD, type, SLIcon)
00590 {
00591         mLine1 = llformat("");
00592         mLine2 = llformat("");
00593         mLine3 = llformat("");
00594         // create a new specific page
00595         llLCDSpecificPage newPage;
00596         newPage.mPageIndex = mLCD->AddNewPage() - 1;
00597         mLCD->ModifyControlsOnPage(newPage.mPageIndex);
00598 
00599         // add in all the display parts for this specific page
00600 
00601         // add in the icon - all pages have this - we don't need to track this because we never update it
00602         HANDLE m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32);
00603         mLCD->SetOrigin(m_rightIcon, 0, 0);
00604 
00605         // add Title
00606         HANDLE title = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_CENTER, 128);
00607         mLCD->SetOrigin(title, 32, 0);
00608         mLCD->SetText(title, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Last3ChatLines")).c_str()));
00609 
00610         // add line
00611         HANDLE chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH);
00612         mLCD->SetOrigin(chatLine, ICON_WIDTH, 11);
00613         mLCD->SetText(chatLine, _T(""));
00614         newPage.mDisplayItemArray.push_back(chatLine);
00615 
00616         // add line
00617         chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH);
00618         mLCD->SetOrigin(chatLine, ICON_WIDTH, 22);
00619         mLCD->SetText(chatLine, _T(""));
00620         newPage.mDisplayItemArray.push_back(chatLine);
00621 
00622         // add line
00623         chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH);
00624         mLCD->SetOrigin(chatLine, ICON_WIDTH, 33);
00625         mLCD->SetText(chatLine, _T(""));
00626         newPage.mDisplayItemArray.push_back(chatLine);
00627 
00628         // and then insert it
00629         mPageArray.push_back(newPage);
00630 }
00631 
00633 //
00634 //      IM Page Group class
00635 //
00637 
00638 void llIMPageGroup::UpdateDetails()
00639 {
00640         mLCD->ModifyControlsOnPage(mPageArray[0].mPageIndex);
00641         mLCD->SetText(mPageArray[0].mDisplayItemArray[0], (LPCTSTR)(utf8str_to_utf16str(mLine1).c_str()));
00642         mLCD->SetText(mPageArray[0].mDisplayItemArray[1], (LPCTSTR)(utf8str_to_utf16str(mLine2).c_str()));
00643         mLCD->SetText(mPageArray[0].mDisplayItemArray[2], (LPCTSTR)(utf8str_to_utf16str(mLine3).c_str()));
00644 }
00645 
00646 void llIMPageGroup::GetDisplayable()
00647 {
00648         mDisplayPage = gSavedSettings.getBOOL("DisplayIM");
00649 }
00650 
00651 void llIMPageGroup::InsertText(const LLString &newLine)
00652 {
00653         mLine1 = mLine2;
00654         mLine2 = mLine3;
00655         mLine3 = newLine;
00656 }
00657 
00658 llIMPageGroup::llIMPageGroup(CEzLcd *LCD, int type, HICON SLIcon)
00659 :llLCDPageGroup(LCD, type, SLIcon)
00660 {
00661         mLine1 = llformat("");
00662         mLine2 = llformat("");
00663         mLine3 = llformat("");
00664         // create a new specific page
00665         llLCDSpecificPage newPage;
00666         newPage.mPageIndex = mLCD->AddNewPage() - 1;
00667         mLCD->ModifyControlsOnPage(newPage.mPageIndex);
00668 
00669         // add in all the display parts for this specific page
00670 
00671         // add in the icon - all pages have this - we don't need to track this because we never update it
00672         HANDLE m_rightIcon = mLCD->AddIcon(mSLIcon, 32, 32);
00673         mLCD->SetOrigin(m_rightIcon, 0, 0);
00674 
00675         // add Title
00676         HANDLE title = mLCD->AddText(LG_STATIC_TEXT, LG_SMALL, DT_CENTER, 128);
00677         mLCD->SetOrigin(title, 32, 0);
00678         mLCD->SetText(title, (LPCTSTR)(utf8str_to_utf16str(bogus->childGetText("Last3IMLines")).c_str()));
00679 
00680         // add line
00681         HANDLE chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH);
00682         mLCD->SetOrigin(chatLine, ICON_WIDTH, 11);
00683         mLCD->SetText(chatLine, _T(""));
00684         newPage.mDisplayItemArray.push_back(chatLine);
00685 
00686         // add line
00687         chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH);
00688         mLCD->SetOrigin(chatLine, ICON_WIDTH, 22);
00689         mLCD->SetText(chatLine, _T(""));
00690         newPage.mDisplayItemArray.push_back(chatLine);
00691 
00692         // add line
00693         chatLine = mLCD->AddText(LG_SCROLLING_TEXT, LG_SMALL, DT_LEFT, 160 - ICON_WIDTH);
00694         mLCD->SetOrigin(chatLine, ICON_WIDTH, 33);
00695         mLCD->SetText(chatLine, _T(""));
00696         newPage.mDisplayItemArray.push_back(chatLine);
00697 
00698         // and then insert it
00699         mPageArray.push_back(newPage);
00700 }
00701 
00702 #endif //LL_WINDOWS
00703 #endif //LL_LCD_COMPILE

Generated on Thu Jul 1 06:08:48 2010 for Second Life Viewer by  doxygen 1.4.7