From ed1eb29c7e329fa4de31fdad4272348059462d73 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Mon, 4 Jan 2010 13:48:13 +0200 Subject: implemented EXT-3642 Default mic states for voice calls --HG-- branch : product-engine --- indra/newview/llvoicechannel.cpp | 21 +++++++++++++++++++-- indra/newview/llvoiceclient.cpp | 4 ++++ indra/newview/llvoiceclient.h | 1 + 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 993853b9a6..8eafb98f4e 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -279,10 +279,14 @@ void LLVoiceChannel::deactivate() if (callStarted()) { setState(STATE_HUNG_UP); - // mute the microphone if required when returning to the proximal channel - if (gSavedSettings.getBOOL("AutoDisengageMic") && sCurrentVoiceChannel == this) + + //Default mic is OFF when leaving voice calls + if (gSavedSettings.getBOOL("AutoDisengageMic") && + sCurrentVoiceChannel == this && + gVoiceClient->getUserPTTState()) { gSavedSettings.setBOOL("PTTCurrentlyEnabled", true); + gVoiceClient->inputUserControlState(true); } } @@ -499,6 +503,13 @@ void LLVoiceChannelGroup::activate() LLRecentPeople::instance().add(buddy_id); } #endif + + //Mic default state is OFF on initiating/joining Ad-Hoc/Group calls + if (gVoiceClient->getUserPTTState() && gVoiceClient->getPTTIsToggle()) + { + gVoiceClient->inputUserControlState(true); + } + } } @@ -812,6 +823,12 @@ void LLVoiceChannelP2P::activate() // Add the party to the list of people with which we've recently interacted. LLRecentPeople::instance().add(mOtherUserID); + + //Default mic is ON on initiating/joining P2P calls + if (!gVoiceClient->getUserPTTState() && gVoiceClient->getPTTIsToggle()) + { + gVoiceClient->inputUserControlState(true); + } } } diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index c2d26a1971..899cc35238 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -5883,6 +5883,10 @@ void LLVoiceClient::setPTTIsToggle(bool PTTIsToggle) mPTTIsToggle = PTTIsToggle; } +bool LLVoiceClient::getPTTIsToggle() +{ + return mPTTIsToggle; +} void LLVoiceClient::setPTTKey(std::string &key) { diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 347fae6156..724179847d 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -193,6 +193,7 @@ static void updatePosition(void); static bool voiceEnabled(); void setUsePTT(bool usePTT); void setPTTIsToggle(bool PTTIsToggle); + bool getPTTIsToggle(); void setPTTKey(std::string &key); void setEarLocation(S32 loc); void setVoiceVolume(F32 volume); -- cgit v1.2.3 From 8288b33c83abde3adaec2638c9e8d1a164d4138e Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Mon, 4 Jan 2010 14:57:07 +0200 Subject: fix for major EXT-3771 Toasts that pop up from group chat should be clickable anywhere --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_instant_message.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_instant_message.xml b/indra/newview/skins/default/xui/en/panel_instant_message.xml index ccd754ac5e..7204e57479 100644 --- a/indra/newview/skins/default/xui/en/panel_instant_message.xml +++ b/indra/newview/skins/default/xui/en/panel_instant_message.xml @@ -21,6 +21,7 @@ label="im_header" layout="topleft" left="5" + mouse_opaque="false" name="im_header" top="5" width="295"> @@ -30,7 +31,7 @@ image_name="Generic_Person" layout="topleft" left="3" - mouse_opaque="true" + mouse_opaque="false" name="avatar_icon" top="3" width="18" /> -- cgit v1.2.3 From e673fdea3f9e6a3e48736461e00fd8bb1f2a2876 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 4 Jan 2010 15:33:56 +0200 Subject: Fixed low bug EXT-3897 ( Turn off log spam: "LLIMModel::getSpeakerManager: session 00000000-0000-0000-0000-000000000000does not exist" from Voice Client) -- added check of session UUID to null before calling LLIMModel::getSpeakerManager (implemented for the EXT-3544 bug) --HG-- branch : product-engine --- indra/newview/llimview.cpp | 2 +- indra/newview/llvoiceclient.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 40227539d0..b9af49a50d 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -781,7 +781,7 @@ LLIMSpeakerMgr* LLIMModel::getSpeakerManager( const LLUUID& session_id ) const LLIMSession* session = findIMSession(session_id); if (!session) { - llwarns << "session " << session_id << "does not exist " << llendl; + llwarns << "session " << session_id << " does not exist " << llendl; return NULL; } diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 899cc35238..423c46e14c 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -4445,7 +4445,7 @@ void LLVoiceClient::participantUpdatedEvent( participant->mVolume = volume; - // *HACH: mantipov: added while working on EXT-3544 + // *HACK: mantipov: added while working on EXT-3544 /* Sometimes LLVoiceClient::participantUpdatedEvent callback is called BEFORE LLViewerChatterBoxSessionAgentListUpdates::post() sometimes AFTER. @@ -4462,7 +4462,9 @@ void LLVoiceClient::participantUpdatedEvent( in LLCallFloater::draw() */ LLVoiceChannel* voice_cnl = LLVoiceChannel::getCurrentVoiceChannel(); - if (voice_cnl) + + // ignore session ID of local chat + if (voice_cnl && voice_cnl->getSessionID().notNull()) { LLSpeakerMgr* speaker_manager = LLIMModel::getInstance()->getSpeakerManager(voice_cnl->getSessionID()); if (speaker_manager) -- cgit v1.2.3 From 0782f64b642756c02ffa1ec72c2f2e5874ed26e9 Mon Sep 17 00:00:00 2001 From: Yuri Chebotarev Date: Mon, 4 Jan 2010 15:42:18 +0200 Subject: fix for normal EXT-3763 URL clicked on nearby chat toast opens chat history, not URL in browser. also move real action from mouse_down to mouse_up (since clicking on url is processing in mouse_up). --HG-- branch : product-engine --- indra/newview/llchatitemscontainerctrl.cpp | 26 ++++++++++++++++++++++++-- indra/newview/llchatitemscontainerctrl.h | 1 + 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index 92df281307..60a37ac4af 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -252,11 +252,33 @@ void LLNearbyChatToastPanel::onMouseEnter (S32 x, S32 y, MASK mask) } BOOL LLNearbyChatToastPanel::handleMouseDown (S32 x, S32 y, MASK mask) +{ + return LLPanel::handleMouseDown(x,y,mask); +} + +BOOL LLNearbyChatToastPanel::handleMouseUp (S32 x, S32 y, MASK mask) { if(mSourceType != CHAT_SOURCE_AGENT) - return LLPanel::handleMouseDown(x,y,mask); + return LLPanel::handleMouseUp(x,y,mask); + + LLChatMsgBox* text_box = getChild("msg_text", false); + S32 local_x = x - text_box->getRect().mLeft; + S32 local_y = y - text_box->getRect().mBottom; + + //if text_box process mouse up (ussually this is click on url) - we didn't show nearby_chat. + if (text_box->pointInView(local_x, local_y) ) + { + if (text_box->handleMouseUp(local_x,local_y,mask) == TRUE) + return TRUE; + else + { + LLFloaterReg::showInstance("nearby_chat",LLSD()); + return FALSE; + } + } + LLFloaterReg::showInstance("nearby_chat",LLSD()); - return LLPanel::handleMouseDown(x,y,mask); + return LLPanel::handleMouseUp(x,y,mask); } void LLNearbyChatToastPanel::setHeaderVisibility(EShowItemHeader e) diff --git a/indra/newview/llchatitemscontainerctrl.h b/indra/newview/llchatitemscontainerctrl.h index 0a85c52401..f4b8655054 100644 --- a/indra/newview/llchatitemscontainerctrl.h +++ b/indra/newview/llchatitemscontainerctrl.h @@ -68,6 +68,7 @@ public: void onMouseLeave (S32 x, S32 y, MASK mask); void onMouseEnter (S32 x, S32 y, MASK mask); BOOL handleMouseDown (S32 x, S32 y, MASK mask); + BOOL handleMouseUp (S32 x, S32 y, MASK mask); virtual BOOL postBuild(); -- cgit v1.2.3 From 0508dab52393a02e9ace36441b3b755eb3617d08 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Mon, 4 Jan 2010 16:18:57 +0200 Subject: =?UTF-8?q?fixed=20=20EXT-3765=20=E2=80=9CThere=20is=20no=20tongue?= =?UTF-8?q?=20for=20voice=20control=20panel=20in=20docked=20state=E2=80=9D?= =?UTF-8?q?,=20made=20dockable=20floaters=20have=20tongue=20by=20default;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/llui/lldockablefloater.cpp | 9 +++++++++ indra/llui/lldockablefloater.h | 17 +++++++++++++++++ indra/llui/lldockcontrol.cpp | 12 ++++++------ indra/newview/llnearbychat.cpp | 2 +- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index 6a5b475134..74438b184a 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -57,11 +57,20 @@ LLDockableFloater::LLDockableFloater(LLDockControl* dockControl, , mOverlapsScreenChannel(false) { init(this); + mUseTongue = true; } LLDockableFloater::LLDockableFloater(LLDockControl* dockControl, bool uniqueDocking, const LLSD& key, const Params& params) : LLFloater(key, params), mDockControl(dockControl), mUniqueDocking(uniqueDocking) +{ + init(this); + mUseTongue = true; +} + +LLDockableFloater::LLDockableFloater(LLDockControl* dockControl, bool uniqueDocking, + bool useTongue, const LLSD& key, const Params& params) : + LLFloater(key, params), mDockControl(dockControl), mUseTongue(useTongue), mUniqueDocking(uniqueDocking) { init(this); } diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h index ae4f99e205..2b1ce99ae2 100644 --- a/indra/llui/lldockablefloater.h +++ b/indra/llui/lldockablefloater.h @@ -62,6 +62,20 @@ public: */ LLDockableFloater(LLDockControl* dockControl, bool uniqueDocking, const LLSD& key, const Params& params = getDefaultParams()); + + /** + * Constructor. + * @param dockControl a pointer to the doc control instance + * @param uniqueDocking - a flag defines is docking should work as tab(at one + * moment only one docked floater can be shown). + * @praram useTongue - a flag defines is dock tongue should be used. + * @params key a floater key. + * @params params a floater parameters + */ + LLDockableFloater(LLDockControl* dockControl, bool uniqueDocking, + bool useTongue, const LLSD& key, + const Params& params = getDefaultParams()); + virtual ~LLDockableFloater(); static LLHandle getInstanceHandle() { return sInstanceHandle; } @@ -104,6 +118,7 @@ public: virtual void setOverlapsScreenChannel(bool overlaps) { mOverlapsScreenChannel = overlaps; } bool getUniqueDocking() { return mUniqueDocking; } + bool getUseTongue() { return mUseTongue; } private: /** * Provides unique of dockable floater. @@ -125,6 +140,8 @@ private: */ bool mUniqueDocking; + bool mUseTongue; + bool mOverlapsScreenChannel; }; diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp index 1c3c8449c5..0d8e54aa48 100644 --- a/indra/llui/lldockcontrol.cpp +++ b/indra/llui/lldockcontrol.cpp @@ -182,12 +182,12 @@ void LLDockControl::moveDockable() LLRect rootRect; mGetAllowedRectCallback(rootRect); - bool unique_docking = false; + bool use_tongue = false; LLDockableFloater* dockable_floater = dynamic_cast (mDockableFloater); if (dockable_floater != NULL) { - unique_docking = dockable_floater->getUniqueDocking(); + use_tongue = dockable_floater->getUseTongue(); } LLRect dockableRect = mDockableFloater->calcScreenRect(); @@ -218,7 +218,7 @@ void LLDockControl::moveDockable() x = dockRect.getCenterX() - dockableRect.getWidth() / 2; y = dockRect.mTop + dockableRect.getHeight(); // unique docking used with dock tongue, so add tongue height o the Y coordinate - if (unique_docking) + if (use_tongue) { y += mDockTongue->getHeight(); } @@ -287,15 +287,15 @@ void LLDockControl::forceRecalculatePosition() void LLDockControl::drawToungue() { - bool unique_docking = false; + bool use_tongue = false; LLDockableFloater* dockable_floater = dynamic_cast (mDockableFloater); if (dockable_floater != NULL) { - unique_docking = dockable_floater->getUniqueDocking(); + use_tongue = dockable_floater->getUseTongue(); } - if (mEnabled && unique_docking) + if (mEnabled && use_tongue) { mDockTongue->draw(mDockTongueX, mDockTongueY); } diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 2ad82d3e8e..649c414569 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -63,7 +63,7 @@ static const S32 RESIZE_BAR_THICKNESS = 3; LLNearbyChat::LLNearbyChat(const LLSD& key) - : LLDockableFloater(NULL, false, key) + : LLDockableFloater(NULL, false, false, key) ,mChatHistory(NULL) { -- cgit v1.2.3 From 9c68f8d05f1d5eaedd54d093b1f8acfa8d137add Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Mon, 4 Jan 2010 17:11:46 +0200 Subject: Removing a workaround for EXT-3599 (No chiclets in the IM Well Window) in favor of a proper fix. --HG-- branch : product-engine --- indra/newview/llsyswellwindow.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index a46ca1f8ac..2114b1c9d7 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -349,7 +349,6 @@ LLIMWellWindow::RowPanel::RowPanel(const LLSysWellWindow* parent, const LLUUID& } // Initialize chiclet. - mChiclet->setRect(LLRect(5, 28, 30, 3)); // *HACK: workaround for (EXT-3599) mChiclet->setChicletSizeChangedCallback(boost::bind(&LLIMWellWindow::RowPanel::onChicletSizeChanged, this, mChiclet, _2)); mChiclet->enableCounterControl(true); mChiclet->setCounter(chicletCounter); -- cgit v1.2.3 From 607dbf60f5cc6454c0e2941bc1fb55e65c37b63b Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Mon, 4 Jan 2010 17:12:23 +0200 Subject: =?UTF-8?q?fixed=20EXT-3374=20=E2=80=9C[BSI]=20Notifications=20and?= =?UTF-8?q?=20dialogs=20are=20semi-transparent=20(not=20opaque)=20even=20w?= =?UTF-8?q?hen=20in=20focus=E2=80=9D,=20made=20toast=20opaque=20when=20bec?= =?UTF-8?q?ame=20hovered;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/lltoast.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 96d1624cd4..110d158e2d 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -266,6 +266,8 @@ void LLToast::onMouseEnter(S32 x, S32 y, MASK mask) { mOnToastHoverSignal(this, MOUSE_ENTER); + setBackgroundOpaque(TRUE); + //toasts fading is management by Screen Channel sendChildToFront(mHideBtn); -- cgit v1.2.3 From 3c5976981dd06ccca45d9d2b9024a6c72fd7ea49 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Mon, 4 Jan 2010 18:08:26 +0200 Subject: Fixed low bug (EXT-3768) Teleport & Map buttons are enabled when nothing is selected in the Teleport History panel. - Added reseting selection upon closing accordion tab to disable "Teleport" and "Map" buttons for hidden item. --HG-- branch : product-engine --- indra/newview/llpanelteleporthistory.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 245f694ac6..65a3d9d41b 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -1045,4 +1045,11 @@ void LLTeleportHistoryPanel::onAccordionExpand(LLUICtrl* ctrl, const LLSD& param bool expanded = param.asBoolean(); // Save accordion tab state to restore it in refresh() setAccordionCollapsedByUser(ctrl, !expanded); + + // Reset selection upon accordion being collapsed + // to disable "Teleport" and "Map" buttons for hidden item. + if (!expanded && mLastSelectedFlatlList) + { + mLastSelectedFlatlList->resetSelection(); + } } -- cgit v1.2.3 From ba9a4f80b5bd97ca3b6bd1fa01ddf1c23698a569 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 4 Jan 2010 12:04:24 -0800 Subject: EXT-3779 About Secondlife window opens unexpectedly scrolled to bottom Added explicit call to startOfDoc() to scroll to top. Took some carriage returns out of text. Moved compiler version to bottom down with static library versions, as this isn't relevant to most users. Reviewed with Kelly --- indra/newview/llfloaterabout.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index e80499688e..aa343b2f69 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -167,20 +167,21 @@ BOOL LLFloaterAbout::postBuild() // Now build the various pieces support << getString("AboutHeader", args); - if (info.has("COMPILER")) - { - support << "\n\n" << getString("AboutCompiler", args); - } if (info.has("REGION")) { support << "\n\n" << getString("AboutPosition", args); } support << "\n\n" << getString("AboutSystem", args); + support << "\n"; if (info.has("GRAPHICS_DRIVER_VERSION")) { - support << "\n\n" << getString("AboutDriver", args); + support << "\n" << getString("AboutDriver", args); + } + support << "\n" << getString("AboutLibs", args); + if (info.has("COMPILER")) + { + support << "\n" << getString("AboutCompiler", args); } - support << "\n\n" << getString("AboutLibs", args); if (info.has("PACKETS_IN")) { support << '\n' << getString("AboutTraffic", args); @@ -193,11 +194,11 @@ BOOL LLFloaterAbout::postBuild() support_widget->blockUndo(); // Fix views - support_widget->setCursorPos(0); support_widget->setEnabled(FALSE); + support_widget->startOfDoc(); - credits_widget->setCursorPos(0); credits_widget->setEnabled(FALSE); + credits_widget->startOfDoc(); return TRUE; } -- cgit v1.2.3 From 6157187e5bdff889613673f11852d9c25f96bf92 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 4 Jan 2010 15:33:07 -0500 Subject: EXT-3849 remove "show attachments in previews" removing the checkbox in the appearance floater, as we don't have time to implement this. reviewed by Seraph --- indra/newview/skins/default/xui/en/floater_customize.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_customize.xml b/indra/newview/skins/default/xui/en/floater_customize.xml index 94686f0bb0..0dc7d62b19 100644 --- a/indra/newview/skins/default/xui/en/floater_customize.xml +++ b/indra/newview/skins/default/xui/en/floater_customize.xml @@ -12,16 +12,6 @@ title="APPEARANCE" top_delta="-185" width="524"> - Date: Mon, 4 Jan 2010 13:05:25 -0800 Subject: EXT-3876 - Fast Timers crashes viewer avoid divide by zero reviewed by Mani --- indra/newview/llfasttimerview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index effa57b1ef..7d8bb6e104 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -323,7 +323,9 @@ void LLFastTimerView::draw() S32 xleft = margin; S32 ytop = margin; - mAverageCyclesPerTimer = llround(lerp((F32)mAverageCyclesPerTimer, (F32)(LLFastTimer::sTimerCycles / (U64)LLFastTimer::sTimerCalls), 0.1f)); + mAverageCyclesPerTimer = LLFastTimer::sTimerCalls == 0 + ? 0 + : llround(lerp((F32)mAverageCyclesPerTimer, (F32)(LLFastTimer::sTimerCycles / (U64)LLFastTimer::sTimerCalls), 0.1f)); LLFastTimer::sTimerCycles = 0; LLFastTimer::sTimerCalls = 0; -- cgit v1.2.3 From 5f851718505fdba77b1f7a6e47e4007e73747236 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 4 Jan 2010 13:58:42 -0800 Subject: EXT-3648 New message indicator on IM chiclets should be orange --- .../skins/default/textures/bottomtray/Unread_Chiclet.png | Bin 0 -> 250 bytes indra/newview/skins/default/textures/textures.xml | 3 ++- .../skins/default/xui/en/widgets/chiclet_im_adhoc.xml | 2 +- .../skins/default/xui/en/widgets/chiclet_im_group.xml | 2 +- .../skins/default/xui/en/widgets/chiclet_im_p2p.xml | 2 +- .../skins/default/xui/en/widgets/chiclet_offer.xml | 2 +- .../skins/default/xui/en/widgets/chiclet_script.xml | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 indra/newview/skins/default/textures/bottomtray/Unread_Chiclet.png diff --git a/indra/newview/skins/default/textures/bottomtray/Unread_Chiclet.png b/indra/newview/skins/default/textures/bottomtray/Unread_Chiclet.png new file mode 100644 index 0000000000..447e0af0be Binary files /dev/null and b/indra/newview/skins/default/textures/bottomtray/Unread_Chiclet.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 857936fbae..897a107c0f 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -602,8 +602,9 @@ with the same filename but different name - + + diff --git a/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml b/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml index 7cb973f4c8..af0d338256 100644 --- a/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml +++ b/indra/newview/skins/default/xui/en/widgets/chiclet_im_adhoc.xml @@ -33,7 +33,7 @@ Date: Mon, 4 Jan 2010 14:03:02 -0800 Subject: EXT-3318 LLConsole keeps all logged text in memory when console is not being drawn. --- indra/llui/llconsole.cpp | 6 ++++++ indra/newview/llstartup.cpp | 1 + 2 files changed, 7 insertions(+) diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index fa0abd55d0..c9090d388d 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -392,4 +392,10 @@ void LLConsole::addLine(const LLWString& wline, F32 size, const LLColor4 &color) Paragraph paragraph(wline, color, mTimer.getElapsedTimeF32(), mFont, (F32)getRect().getWidth() ); mParagraphs.push_back ( paragraph ); + + // remove old paragraphs which can't possibly be visible any more. ::draw() will do something similar but more conservative - we do this here because ::draw() isn't guaranteed to ever be called! (i.e. the console isn't visible) + while ((S32)mParagraphs.size() > llmax((S32)0, (S32)(mMaxLines))) + { + mParagraphs.pop_front(); + } } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index eb2275bff0..99fa271b78 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1309,6 +1309,7 @@ bool idle_startup() // Move the progress view in front of the UI gViewerWindow->moveProgressViewToFront(); + // direct logging to the debug console's line buffer LLError::logToFixedBuffer(gDebugView->mDebugConsolep); // set initial visibility of debug console -- cgit v1.2.3 From 0d14e65c2deb7b99d1459a75ee080f786850ceb0 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 4 Jan 2010 14:03:04 -0800 Subject: EXT-3721 SNAPSHOT PREVIEW can be dragged over the top menus --- indra/newview/skins/default/xui/en/main_view.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml index 65a545d2ed..ed06b91b18 100644 --- a/indra/newview/skins/default/xui/en/main_view.xml +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -121,6 +121,16 @@ tab_stop="false" top="0" width="1024"/> + - Date: Mon, 4 Jan 2010 14:04:20 -0800 Subject: EXT-2481 [BSI] Add "Zoom in" to 3D Object context menu and inspector Gear menu EXT-3388 [BSI] "Teleport" option missing dropdown when right clicking on friends list --- indra/newview/llviewermenu.cpp | 23 +++++++++++++++++++++- .../skins/default/xui/en/menu_avatar_other.xml | 6 ++++++ indra/newview/skins/default/xui/en/menu_object.xml | 6 ++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 2a9c738c97..a28aef6ddd 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3017,6 +3017,26 @@ bool callback_eject(const LLSD& notification, const LLSD& response) return false; } +void handle_avatar_teleport(const LLSD& avatar_id) +{ + // Use avatar_id if available, otherwise default to right-click avatar + LLVOAvatar* avatar = NULL; + if (avatar_id.asUUID().notNull()) + { + avatar = find_avatar_from_object(avatar_id.asUUID()); + } + else + { + avatar = find_avatar_from_object( + LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); + } + + if( avatar ) + { + LLAvatarActions::offerTeleport(avatar->getID()); + } +} + void handle_avatar_eject(const LLSD& avatar_id) { // Use avatar_id if available, otherwise default to right-click avatar @@ -7913,6 +7933,7 @@ void initialize_menus() view_listener_t::addMenu(new LLAvatarInviteToGroup(), "Avatar.InviteToGroup"); view_listener_t::addMenu(new LLAvatarGiveCard(), "Avatar.GiveCard"); commit.add("Avatar.Eject", boost::bind(&handle_avatar_eject, LLSD())); + commit.add("Avatar.Teleport", boost::bind(&handle_avatar_teleport, LLSD())); view_listener_t::addMenu(new LLAvatarSendIM(), "Avatar.SendIM"); view_listener_t::addMenu(new LLAvatarCall(), "Avatar.Call"); view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse"); @@ -7952,8 +7973,8 @@ void initialize_menus() enable.add("Avatar.EnableMute", boost::bind(&enable_object_mute)); enable.add("Object.EnableMute", boost::bind(&enable_object_mute)); - enable.add("Object.EnableBuy", boost::bind(&enable_buy_object)); + commit.add("Object.ZoomIn", boost::bind(&handle_look_at_selection, "zoom")); // Attachment pie menu enable.add("Attachment.Label", boost::bind(&onEnableAttachmentLabel, _1, _2)); diff --git a/indra/newview/skins/default/xui/en/menu_avatar_other.xml b/indra/newview/skins/default/xui/en/menu_avatar_other.xml index 0ad41546d2..78f057a7d7 100644 --- a/indra/newview/skins/default/xui/en/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_other.xml @@ -93,4 +93,10 @@ + + + diff --git a/indra/newview/skins/default/xui/en/menu_object.xml b/indra/newview/skins/default/xui/en/menu_object.xml index 62500c5116..35518cd13b 100644 --- a/indra/newview/skins/default/xui/en/menu_object.xml +++ b/indra/newview/skins/default/xui/en/menu_object.xml @@ -57,6 +57,12 @@ + + + Date: Mon, 4 Jan 2010 17:28:31 -0500 Subject: EXT-3717 : Reset Filters in My Inventory doesn't work Simple XML change; function call string was incorrect. --- indra/newview/skins/default/xui/en/panel_main_inventory.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index 4353b306cd..58437cd4d2 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -208,7 +208,7 @@ halign="center" layout="topleft" name="Reset Current"> + function="Inventory.ResetFilters" /> Date: Mon, 4 Jan 2010 14:36:04 -0800 Subject: moving this menu item to the right place EXT-3388 [BSI] "Teleport" option missing dropdown when right clicking on friends list --- indra/newview/llviewermenu.cpp | 21 --------------------- .../skins/default/xui/en/menu_avatar_other.xml | 6 ------ .../skins/default/xui/en/menu_people_nearby.xml | 6 ++++++ 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a28aef6ddd..b56af3c345 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3017,26 +3017,6 @@ bool callback_eject(const LLSD& notification, const LLSD& response) return false; } -void handle_avatar_teleport(const LLSD& avatar_id) -{ - // Use avatar_id if available, otherwise default to right-click avatar - LLVOAvatar* avatar = NULL; - if (avatar_id.asUUID().notNull()) - { - avatar = find_avatar_from_object(avatar_id.asUUID()); - } - else - { - avatar = find_avatar_from_object( - LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); - } - - if( avatar ) - { - LLAvatarActions::offerTeleport(avatar->getID()); - } -} - void handle_avatar_eject(const LLSD& avatar_id) { // Use avatar_id if available, otherwise default to right-click avatar @@ -7933,7 +7913,6 @@ void initialize_menus() view_listener_t::addMenu(new LLAvatarInviteToGroup(), "Avatar.InviteToGroup"); view_listener_t::addMenu(new LLAvatarGiveCard(), "Avatar.GiveCard"); commit.add("Avatar.Eject", boost::bind(&handle_avatar_eject, LLSD())); - commit.add("Avatar.Teleport", boost::bind(&handle_avatar_teleport, LLSD())); view_listener_t::addMenu(new LLAvatarSendIM(), "Avatar.SendIM"); view_listener_t::addMenu(new LLAvatarCall(), "Avatar.Call"); view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse"); diff --git a/indra/newview/skins/default/xui/en/menu_avatar_other.xml b/indra/newview/skins/default/xui/en/menu_avatar_other.xml index 78f057a7d7..0ad41546d2 100644 --- a/indra/newview/skins/default/xui/en/menu_avatar_other.xml +++ b/indra/newview/skins/default/xui/en/menu_avatar_other.xml @@ -93,10 +93,4 @@ - - - diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml index 5f2e6e0f6c..c4da1df017 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml @@ -63,4 +63,10 @@ function="Avatar.EnableItem" parameter="can_block" /> + + + -- cgit v1.2.3 From 6064d8a22645596f0bf5e944200f314f0c03e8d8 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 4 Jan 2010 15:02:24 -0800 Subject: Backed out changeset: 9edc40cf0ac6 --- indra/newview/skins/default/xui/en/main_view.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml index ed06b91b18..65a545d2ed 100644 --- a/indra/newview/skins/default/xui/en/main_view.xml +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -121,16 +121,6 @@ tab_stop="false" top="0" width="1024"/> - + Date: Mon, 4 Jan 2010 15:11:23 -0800 Subject: DEV-44732 avoidable false-positives on automatic URL finding in chat --- indra/llui/llurlentry.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 983f0a2d49..99eb992ddd 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -201,8 +201,11 @@ std::string LLUrlEntryHTTPLabel::getUrl(const std::string &string) // LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol() { - mPattern = boost::regex("(\\bwww\\.\\S+\\.\\S+|\\b[^ \t\n\r\f\v:/]+.com\\S*|\\b[^ \t\n\r\f\v:/]+.net\\S*|\\b[^ \t\n\r\f\v:/]+.edu\\S*|\\b[^ \t\n\r\f\v:/]+.org\\S*)", - boost::regex::perl|boost::regex::icase); + mPattern = boost::regex("(" + "\\bwww\\.\\S+\\.\\S+" // www.FOO.BAR + "|\\b[^ \t\n\r\f\v:/]+.(?:com|net|edu|org)[^[:space:][:alnum:]]*$" // FOO.net + ")", + boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_http.xml"; mTooltip = LLTrans::getString("TooltipHttpUrl"); } -- cgit v1.2.3 From b2e8c1b3647a56ab5396f2f13a38ab2386b100d3 Mon Sep 17 00:00:00 2001 From: Erica Date: Mon, 4 Jan 2010 15:24:18 -0800 Subject: EXT-3927 Replace background texture for payment info enabled Buy L$ floater --- .../textures/widgets/Linden_Dollar_Background.png | Bin 9506 -> 56298 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/indra/newview/skins/default/textures/widgets/Linden_Dollar_Background.png b/indra/newview/skins/default/textures/widgets/Linden_Dollar_Background.png index a1d602f6f0..61f9b076ce 100644 Binary files a/indra/newview/skins/default/textures/widgets/Linden_Dollar_Background.png and b/indra/newview/skins/default/textures/widgets/Linden_Dollar_Background.png differ -- cgit v1.2.3 From 989207faf74b98928b6b3d6c4fe09b7b7973c627 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 4 Jan 2010 18:36:30 -0500 Subject: EXT-2974 Alpha mask textures not applied immediately Eyelashes were causing the avatar's head to disappear on a non-cached outfit if you created an alpha mask object through the appearance editor even though you didn't select the head to be invisible. This would not affect the baked texture, only the local composite. No clue exactly why the symptom was what it was, but the way we were using eyelashes was the source of the problem. Moving the special-case eyelashes to an alpha mask layer fixes the issue. -Nyx --- indra/newview/character/avatar_lad.xml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index ae89eb4413..448e20b382 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -5608,9 +5608,7 @@ + height="512"> + + + @@ -6620,6 +6625,7 @@ render_pass="bump"> local_texture="head_tattoo" /> + -- cgit v1.2.3 From f446ae476752d2690422e60dc5419e59e3fd6b10 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 4 Jan 2010 16:25:05 -0800 Subject: DEV-44732 - a better fix. --- indra/llui/llurlentry.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 99eb992ddd..f7528bc62a 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -202,8 +202,9 @@ std::string LLUrlEntryHTTPLabel::getUrl(const std::string &string) LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol() { mPattern = boost::regex("(" - "\\bwww\\.\\S+\\.\\S+" // www.FOO.BAR - "|\\b[^ \t\n\r\f\v:/]+.(?:com|net|edu|org)[^[:space:][:alnum:]]*$" // FOO.net + "\\bwww\\.\\S+\\.\\S+" // i.e. www.FOO.BAR + "|" // or + "\\b[^ \\t\\n\\r\\f\\v:/]+\\.(?:com|net|edu|org)[^[:space:][:alnum:]]*\\>" // i.e. FOO.net ")", boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_http.xml"; -- cgit v1.2.3 From 3aa62d8f5ba51a42275b899f2bf8205011dd0ecc Mon Sep 17 00:00:00 2001 From: "Eric M. Tulla (BigPapi)" Date: Mon, 4 Jan 2010 19:26:55 -0500 Subject: EXT-3725 & EXT-2224 - Issue with permissions and for sale ui for certain items in side panel. We now completely hide those UI elements when they don't make sense. -Reviewed by seraph --- indra/newview/llsidepaneliteminfo.cpp | 102 ++++++++++++++++++++++++++-------- indra/newview/llsidepaneliteminfo.h | 6 +- 2 files changed, 83 insertions(+), 25 deletions(-) diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 814508daa9..94fe95d215 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -157,11 +157,12 @@ void LLSidepanelItemInfo::reset() void LLSidepanelItemInfo::refresh() { - LLInventoryItem* item = findItem(); + LLViewerInventoryItem* item = findItem(); if(item) { refreshFromItem(item); updateVerbs(); + return; } else { @@ -170,11 +171,8 @@ void LLSidepanelItemInfo::refresh() setIsEditing(FALSE); } } - - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); - bool is_editable = item && (item->getUUID() != trash_id) && !gInventory.isObjectDescendentOf(item->getUUID(), trash_id); - if (!getIsEditing() || !is_editable) + if (!getIsEditing()) { const std::string no_item_names[]={ "LabelItemName", @@ -212,7 +210,7 @@ void LLSidepanelItemInfo::refresh() } } - if (!is_editable) + if (!item) { const std::string no_edit_mode_names[]={ "BtnCreator", @@ -227,24 +225,26 @@ void LLSidepanelItemInfo::refresh() updateVerbs(); } -void LLSidepanelItemInfo::refreshFromItem(LLInventoryItem* item) +void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) { //////////////////////// // PERMISSIONS LOOKUP // //////////////////////// // do not enable the UI for incomplete items. - LLViewerInventoryItem* i = (LLViewerInventoryItem*)item; - BOOL is_complete = i->isComplete(); - const BOOL cannot_restrict_permissions = LLInventoryType::cannotRestrictPermissions(i->getInventoryType()); - const BOOL is_calling_card = (i->getInventoryType() == LLInventoryType::IT_CALLINGCARD); + BOOL is_complete = item->isComplete(); + const BOOL cannot_restrict_permissions = LLInventoryType::cannotRestrictPermissions(item->getInventoryType()); + const BOOL is_calling_card = (item->getInventoryType() == LLInventoryType::IT_CALLINGCARD); const LLPermissions& perm = item->getPermissions(); const BOOL can_agent_manipulate = gAgent.allowOperation(PERM_OWNER, perm, GP_OBJECT_MANIPULATE); const BOOL can_agent_sell = gAgent.allowOperation(PERM_OWNER, perm, GP_OBJECT_SET_SALE) && !cannot_restrict_permissions; - const BOOL is_link = i->getIsLinkType(); + const BOOL is_link = item->getIsLinkType(); + + const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); + bool not_in_trash = item && (item->getUUID() != trash_id) && !gInventory.isObjectDescendentOf(item->getUUID(), trash_id); // You need permission to modify the object to modify an inventory // item in it. @@ -261,7 +261,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLInventoryItem* item) ////////////////////// BOOL is_modifiable = gAgent.allowOperation(PERM_MODIFY, perm, GP_OBJECT_MANIPULATE) - && is_obj_modify && is_complete; + && is_obj_modify && is_complete && not_in_trash; childSetEnabled("LabelItemNameTitle",TRUE); childSetEnabled("LabelItemName",is_modifiable && !is_calling_card); // for now, don't allow rename of calling cards @@ -338,6 +338,64 @@ void LLSidepanelItemInfo::refreshFromItem(LLInventoryItem* item) LLStringUtil::format (timeStr, substitution); childSetText ("LabelAcquiredDate", timeStr); } + + ///////////////////////////////////// + // PERMISSIONS AND SALE ITEM HIDING + ///////////////////////////////////// + + const std::string perm_and_sale_items[]={ + "perms_inv", + "OwnerLabel", + "perm_modify", + "CheckOwnerModify", + "CheckOwnerCopy", + "CheckOwnerTransfer", + "GroupLabel", + "CheckShareWithGroup", + "AnyoneLabel", + "CheckEveryoneCopy", + "NextOwnerLabel", + "CheckNextOwnerModify", + "CheckNextOwnerCopy", + "CheckNextOwnerTransfer", + "CheckPurchase", + "SaleLabel", + "RadioSaleType", + "combobox sale copy", + "Edit Cost", + "TextPrice" + }; + + const std::string debug_items[]={ + "BaseMaskDebug", + "OwnerMaskDebug", + "GroupMaskDebug", + "EveryoneMaskDebug", + "NextMaskDebug" + }; + + // Hide permissions checkboxes and labels and for sale info if in the trash + // or ui elements don't apply to these objects and return from function + if (!not_in_trash || cannot_restrict_permissions) + { + for(size_t t=0; tgetCreatorUUID().isNull()) { @@ -552,7 +610,7 @@ void LLSidepanelItemInfo::onClickCreator() // static void LLSidepanelItemInfo::onClickOwner() { - LLInventoryItem* item = findItem(); + LLViewerInventoryItem* item = findItem(); if(!item) return; if(item->getPermissions().isGroupOwned()) { @@ -568,7 +626,7 @@ void LLSidepanelItemInfo::onClickOwner() void LLSidepanelItemInfo::onCommitName() { //llinfos << "LLSidepanelItemInfo::onCommitName()" << llendl; - LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem(); + LLViewerInventoryItem* item = findItem(); if(!item) { return; @@ -604,7 +662,7 @@ void LLSidepanelItemInfo::onCommitName() void LLSidepanelItemInfo::onCommitDescription() { //llinfos << "LLSidepanelItemInfo::onCommitDescription()" << llendl; - LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem(); + LLViewerInventoryItem* item = findItem(); if(!item) return; LLLineEditor* labelItemDesc = getChild("LabelItemDesc"); @@ -642,7 +700,7 @@ void LLSidepanelItemInfo::onCommitDescription() void LLSidepanelItemInfo::onCommitPermissions() { //llinfos << "LLSidepanelItemInfo::onCommitPermissions()" << llendl; - LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem(); + LLViewerInventoryItem* item = findItem(); if(!item) return; LLPermissions perm(item->getPermissions()); @@ -751,7 +809,7 @@ void LLSidepanelItemInfo::onCommitSaleType() void LLSidepanelItemInfo::updateSaleInfo() { - LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem(); + LLViewerInventoryItem* item = findItem(); if(!item) return; LLSaleInfo sale_info(item->getSaleInfo()); if(!gAgent.allowOperation(PERM_TRANSFER, item->getPermissions(), GP_OBJECT_SET_SALE)) @@ -851,9 +909,9 @@ void LLSidepanelItemInfo::updateSaleInfo() } } -LLInventoryItem* LLSidepanelItemInfo::findItem() const +LLViewerInventoryItem* LLSidepanelItemInfo::findItem() const { - LLInventoryItem* item = NULL; + LLViewerInventoryItem* item = NULL; if(mObjectID.isNull()) { // it is in agent inventory @@ -864,7 +922,7 @@ LLInventoryItem* LLSidepanelItemInfo::findItem() const LLViewerObject* object = gObjectList.findObject(mObjectID); if(object) { - item = (LLInventoryItem*)object->getInventoryObject(mItemID); + item = static_cast(object->getInventoryObject(mItemID)); } } return item; diff --git a/indra/newview/llsidepaneliteminfo.h b/indra/newview/llsidepaneliteminfo.h index 21002327bc..e6dbf400ee 100644 --- a/indra/newview/llsidepaneliteminfo.h +++ b/indra/newview/llsidepaneliteminfo.h @@ -41,7 +41,7 @@ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LLButton; -class LLInventoryItem; +class LLViewerInventoryItem; class LLItemPropertiesObserver; class LLViewerObject; class LLPermissions; @@ -63,10 +63,10 @@ protected: /*virtual*/ void refresh(); /*virtual*/ void save(); - LLInventoryItem* findItem() const; + LLViewerInventoryItem* findItem() const; LLViewerObject* findObject() const; - void refreshFromItem(LLInventoryItem* item); + void refreshFromItem(LLViewerInventoryItem* item); private: LLUUID mItemID; // inventory UUID for the inventory item. -- cgit v1.2.3 From ad6ff3a44c649779037182266b14649607c79fa4 Mon Sep 17 00:00:00 2001 From: James Cook Date: Mon, 4 Jan 2010 16:27:30 -0800 Subject: EXT-3840 Default map position is back to 128, 128, 0, removed dead code supporting X/Y/Z position spinners. Reviewed with Leyla --- indra/newview/llfloaterworldmap.cpp | 67 +++++++++++-------------------------- indra/newview/llfloaterworldmap.h | 5 ++- 2 files changed, 24 insertions(+), 48 deletions(-) diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 98f9171237..0781d8ed06 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -100,8 +100,6 @@ enum EPanDirection // Values in pixels per region static const F32 ZOOM_MAX = 128.f; -static const F32 SIM_COORD_DEFAULT = 128.f; - //--------------------------------------------------------------------------- // Globals //--------------------------------------------------------------------------- @@ -189,7 +187,8 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key) mInventory(NULL), mInventoryObserver(NULL), mFriendObserver(NULL), - mCompletingRegionName(""), + mCompletingRegionName(), + mCompletingRegionPos(), mWaitingForTracker(FALSE), mIsClosing(FALSE), mSetToUserPosition(TRUE), @@ -205,7 +204,6 @@ LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key) mCommitCallbackRegistrar.add("WMap.AvatarCombo", boost::bind(&LLFloaterWorldMap::onAvatarComboCommit, this)); mCommitCallbackRegistrar.add("WMap.Landmark", boost::bind(&LLFloaterWorldMap::onLandmarkComboCommit, this)); mCommitCallbackRegistrar.add("WMap.SearchResult", boost::bind(&LLFloaterWorldMap::onCommitSearchResult, this)); - mCommitCallbackRegistrar.add("WMap.CommitLocation", boost::bind(&LLFloaterWorldMap::onCommitLocation, this)); mCommitCallbackRegistrar.add("WMap.GoHome", boost::bind(&LLFloaterWorldMap::onGoHome, this)); mCommitCallbackRegistrar.add("WMap.Teleport", boost::bind(&LLFloaterWorldMap::onClickTeleportBtn, this)); mCommitCallbackRegistrar.add("WMap.ShowTarget", boost::bind(&LLFloaterWorldMap::onShowTargetBtn, this)); @@ -664,10 +662,6 @@ void LLFloaterWorldMap::updateLocation() S32 agent_y = llround( (F32)fmod( agentPos.mdV[VY], (F64)REGION_WIDTH_METERS ) ); S32 agent_z = llround( (F32)agentPos.mdV[VZ] ); - childSetValue("spin x", LLSD(agent_x) ); - childSetValue("spin y", LLSD(agent_y) ); - childSetValue("spin z", LLSD(agent_z) ); - // Set the current SLURL mSLURL = LLSLURL::buildSLURL(agent_sim_name, agent_x, agent_y, agent_z); } @@ -699,9 +693,6 @@ void LLFloaterWorldMap::updateLocation() F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); - childSetValue("spin x", LLSD(region_x) ); - childSetValue("spin y", LLSD(region_y) ); - childSetValue("spin z", LLSD((F32)pos_global.mdV[VZ]) ); // simNameFromPosGlobal can fail, so don't give the user an invalid SLURL if ( gotSimName ) @@ -733,9 +724,11 @@ void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S3 { // fill in UI based on URL gFloaterWorldMap->childSetValue("location", region_name); - childSetValue("spin x", LLSD((F32)x_coord)); - childSetValue("spin y", LLSD((F32)y_coord)); - childSetValue("spin z", LLSD((F32)z_coord)); + + // Save local coords to highlight position after region global + // position is returned. + gFloaterWorldMap->mCompletingRegionPos.set( + (F32)x_coord, (F32)y_coord, (F32)z_coord); // pass sim name to combo box gFloaterWorldMap->mCompletingRegionName = region_name; @@ -899,18 +892,6 @@ void LLFloaterWorldMap::clearLocationSelection(BOOL clear_ui) { list->operateOnAll(LLCtrlListInterface::OP_DELETE); } - if (!childHasKeyboardFocus("spin x")) - { - childSetValue("spin x", SIM_COORD_DEFAULT); - } - if (!childHasKeyboardFocus("spin y")) - { - childSetValue("spin y", SIM_COORD_DEFAULT); - } - if (!childHasKeyboardFocus("spin z")) - { - childSetValue("spin z", 0); - } LLWorldMap::getInstance()->cancelTracking(); mCompletingRegionName = ""; } @@ -1466,21 +1447,6 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) } } -void LLFloaterWorldMap::onCommitLocation() -{ - LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus(); - if ( LLTracker::TRACKING_LOCATION == tracking_status) - { - LLVector3d pos_global = LLTracker::getTrackedPositionGlobal(); - F64 local_x = childGetValue("spin x"); - F64 local_y = childGetValue("spin y"); - F64 local_z = childGetValue("spin z"); - pos_global.mdV[VX] += -fmod(pos_global.mdV[VX], 256.0) + local_x; - pos_global.mdV[VY] += -fmod(pos_global.mdV[VY], 256.0) + local_y; - pos_global.mdV[VZ] = local_z; - trackLocation(pos_global); - } -} void LLFloaterWorldMap::onCommitSearchResult() { @@ -1503,12 +1469,19 @@ void LLFloaterWorldMap::onCommitSearchResult() if (info->isName(sim_name)) { LLVector3d pos_global = info->getGlobalOrigin(); - F64 local_x = childGetValue("spin x"); - F64 local_y = childGetValue("spin y"); - F64 local_z = childGetValue("spin z"); - pos_global.mdV[VX] += local_x; - pos_global.mdV[VY] += local_y; - pos_global.mdV[VZ] = local_z; + + const F64 SIM_COORD_DEFAULT = 128.0; + LLVector3 pos_local(SIM_COORD_DEFAULT, SIM_COORD_DEFAULT, 0.0f); + + // Did this value come from a trackURL() request? + if (!mCompletingRegionPos.isExactlyZero()) + { + pos_local = mCompletingRegionPos; + mCompletingRegionPos.clear(); + } + pos_global.mdV[VX] += (F64)pos_local.mV[VX]; + pos_global.mdV[VY] += (F64)pos_local.mV[VY]; + pos_global.mdV[VZ] = (F64)pos_local.mV[VZ]; childSetValue("location", sim_name); trackLocation(pos_global); diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 7feebb583d..00f5e788fb 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -148,7 +148,6 @@ protected: void updateSearchEnabled(); void onLocationFocusChanged( LLFocusableElement* ctrl ); void onLocationCommit(); - void onCommitLocation(); void onCommitSearchResult(); void cacheLandmarkPosition(); @@ -170,6 +169,10 @@ private: LLFriendObserver* mFriendObserver; std::string mCompletingRegionName; + // Local position from trackURL() request, used to select final + // position once region lookup complete. + LLVector3 mCompletingRegionPos; + std::string mLastRegionName; BOOL mWaitingForTracker; -- cgit v1.2.3 From 60377f1ae358f4407d051022f391dbeeee00c574 Mon Sep 17 00:00:00 2001 From: Erica Date: Mon, 4 Jan 2010 16:39:59 -0800 Subject: EXT-3932 Pay Resident via Object - text overlaps edge --- .../skins/default/xui/en/floater_pay_object.xml | 31 +++++++++++----------- .../newview/skins/default/xui/en/floater_tools.xml | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_pay_object.xml b/indra/newview/skins/default/xui/en/floater_pay_object.xml index 1946920a9c..455018f467 100644 --- a/indra/newview/skins/default/xui/en/floater_pay_object.xml +++ b/indra/newview/skins/default/xui/en/floater_pay_object.xml @@ -30,25 +30,25 @@ type="string" length="1" follows="left|top" - font="SansSerif" height="16" layout="topleft" left_pad="7" + top_delta="3" name="payee_name" - width="210"> - [FIRST] [LAST] + width="184"> + Ericacita Moostopolison + width="180"> Via object: - ... + top_delta="3" + use_ellipses="true" + word_wrap="false" + width="188"> + My awesome object with a really damn long name @@ -71,22 +116,24 @@ auto_resize="false" user_resize="false" layout="topleft" - top="10" min_width="22" + top="0" + height="22" width="22"> @@ -96,10 +143,12 @@ auto_resize="false" user_resize="false" layout="topleft" - top="-2" + top="0" + height="22" min_width="22" width="22"> Proxy location - + + + -- cgit v1.2.3 From 6d27a9e28d0711c78066f3f4977cd92069090357 Mon Sep 17 00:00:00 2001 From: "Eric M. Tulla (BigPapi)" Date: Fri, 8 Jan 2010 19:28:23 -0500 Subject: EXT-4038: Typo fix & proper handling of autopopulation if library clothing already imported -Reviewed by vir --- indra/newview/llagentwearables.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 63e12bd468..10a2dd132a 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -2291,15 +2291,16 @@ class LLLibraryOutfitsCopyDone: public LLInventoryCallback { public: LLLibraryOutfitsCopyDone(LLLibraryOutfitsFetch * fetcher): - mFireCount(0), mLibraryOutftifsFetcher(fetcher) + mFireCount(0), mLibraryOutfitsFetcher(fetcher) { } virtual ~LLLibraryOutfitsCopyDone() { - if (mLibraryOutftifsFetcher) + if (mLibraryOutfitsFetcher) { - mLibraryOutftifsFetcher->importedFolderFetch(); + gInventory.addObserver(mLibraryOutfitsFetcher); + mLibraryOutfitsFetcher->done(); } } @@ -2309,17 +2310,16 @@ public: } private: U32 mFireCount; - LLLibraryOutfitsFetch * mLibraryOutftifsFetcher; + LLLibraryOutfitsFetch * mLibraryOutfitsFetcher; }; void LLLibraryOutfitsFetch::libraryDone(void) { - gInventory.removeObserver(this); // Copy the clothing folders from the library into the imported clothing folder if necessary. - LLPointer copy_waiter = new LLLibraryOutfitsCopyDone(this); - if (mImportedClothingID == LLUUID::null) { + gInventory.removeObserver(this); + LLPointer copy_waiter = new LLLibraryOutfitsCopyDone(this); mImportedClothingID = gInventory.createNewCategory(mClothingID, LLFolderType::FT_NONE, mImportedClothingName); @@ -2334,6 +2334,11 @@ void LLLibraryOutfitsFetch::libraryDone(void) LLAppearanceManager::getInstance()->shallowCopyCategory(iter->first, folder_id, copy_waiter); } } + else + { + // Skip straight to fetching the contents of the imported folder + importedFolderFetch(); + } } void LLLibraryOutfitsFetch::importedFolderFetch(void) @@ -2344,8 +2349,6 @@ void LLLibraryOutfitsFetch::importedFolderFetch(void) mCompleteFolders.clear(); - gInventory.addObserver(this); - fetchDescendents(folders); if (isEverythingComplete()) { -- cgit v1.2.3 From 0d09530d85772ee8072245da9259b73879c04530 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Fri, 8 Jan 2010 16:33:03 -0800 Subject: EXT-1847 Regression in the design spec: "You" should be replaced by your full avatar name in communication --- indra/newview/llchathistory.cpp | 4 ++-- indra/newview/llchatitemscontainerctrl.cpp | 5 +---- indra/newview/llimfloater.cpp | 2 +- indra/newview/lllogchat.cpp | 3 --- indra/newview/llnearbychat.cpp | 2 +- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index dac3280575..cda3e3a419 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -576,10 +576,10 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_ style_params.font.style = "ITALIC"; if (chat.mFromName.size() > 0) - mEditor->appendText(chat.mFromName + " ", TRUE, style_params); + mEditor->appendText(chat.mFromName, TRUE, style_params); // Ensure that message ends with NewLine, to avoid losing of new lines // while copy/paste from text chat. See EXT-3263. - mEditor->appendText(chat.mText.substr(4) + NEW_LINE, FALSE, style_params); + mEditor->appendText(chat.mText.substr(3) + NEW_LINE, FALSE, style_params); } else { diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index 60a37ac4af..9ce3f29853 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -170,10 +170,7 @@ void LLNearbyChatToastPanel::init(LLSD& notification) std::string str_sender; - if(gAgentID != mFromID) - str_sender = fromName; - else - str_sender = LLTrans::getString("You"); + str_sender = fromName; str_sender+=" "; diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index fdc5d14d97..b05568f353 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -595,7 +595,7 @@ void LLIMFloater::updateMessages() std::string time = msg["time"].asString(); LLUUID from_id = msg["from_id"].asUUID(); - std::string from = from_id != gAgentID ? msg["from"].asString() : LLTrans::getString("You"); + std::string from = msg["from"].asString(); std::string message = msg["message"].asString(); LLChat chat; diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index fc9654e9ad..92f19c9232 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -59,9 +59,6 @@ const static std::string NEW_LINE_SPACE_PREFIX("\n "); const static std::string TWO_SPACES(" "); const static std::string MULTI_LINE_PREFIX(" "); -//viewer 1.23 may have used "You" for Agent's entries -const static std::string YOU("You"); - /** * Chat log lines - timestamp and name are optional but message text is mandatory. * diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index e7043b2d00..fc0e51b76d 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -178,7 +178,7 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive) if (!chat.mMuted) { - tmp_chat.mFromName = chat.mFromID != gAgentID ? chat.mFromName : LLTrans::getString("You"); + tmp_chat.mFromName = chat.mFromName; if (chat.mChatStyle == CHAT_STYLE_IRC) { -- cgit v1.2.3 From eb228dcf3af8db371fd452e595396d8694c869fe Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 8 Jan 2010 16:41:39 -0800 Subject: fast timer performance tuning --- indra/llcharacter/llcharacter.cpp | 2 +- indra/llcommon/lldate.cpp | 2 +- indra/llcommon/llfasttimer.h | 205 ++++++++++++++-------------- indra/llcommon/llstring.cpp | 2 +- indra/llmessage/llpumpio.cpp | 2 +- indra/llmessage/lltemplatemessagereader.cpp | 2 +- indra/llrender/llfontgl.cpp | 2 +- indra/llui/llfloater.cpp | 2 +- indra/llui/llkeywords.cpp | 2 +- indra/llui/lllayoutstack.cpp | 2 +- indra/llui/llpanel.cpp | 8 +- indra/llui/lltextbase.cpp | 4 +- indra/llui/lltexteditor.cpp | 2 +- indra/llui/lluictrlfactory.cpp | 16 +-- indra/llui/lluictrlfactory.h | 6 +- indra/llui/lluistring.cpp | 2 +- indra/llui/llview.cpp | 2 +- indra/llvfs/llvfile.cpp | 2 +- indra/llwindow/llwindowwin32.cpp | 4 +- indra/llxuixml/lltrans.cpp | 2 +- indra/llxuixml/llxuiparser.cpp | 2 +- indra/newview/llappviewer.cpp | 58 ++++---- indra/newview/lldrawable.cpp | 2 +- indra/newview/lldrawpoolavatar.cpp | 2 +- indra/newview/lldrawpoolsimple.cpp | 4 +- indra/newview/lldrawpoolterrain.cpp | 2 +- indra/newview/lldrawpooltree.cpp | 2 +- indra/newview/llfasttimerview.cpp | 118 ++++++++-------- indra/newview/llfasttimerview.h | 6 +- indra/newview/llflexibleobject.cpp | 2 +- indra/newview/llfolderview.cpp | 10 +- indra/newview/llhudmanager.cpp | 2 +- indra/newview/llhudobject.cpp | 2 +- indra/newview/llinventorypanel.cpp | 2 +- indra/newview/llmetricperformancetester.cpp | 4 +- indra/newview/llspatialpartition.cpp | 8 +- indra/newview/llstartup.cpp | 2 +- indra/newview/llviewerdisplay.cpp | 12 +- indra/newview/llviewermenu.cpp | 2 +- indra/newview/llviewermessage.cpp | 2 +- indra/newview/llviewerobject.cpp | 2 +- indra/newview/llviewerobjectlist.cpp | 4 +- indra/newview/llviewerpartsim.cpp | 2 +- indra/newview/llviewertexture.cpp | 2 +- indra/newview/llviewertexturelist.cpp | 6 +- indra/newview/llviewerwindow.cpp | 2 +- indra/newview/llvoavatar.cpp | 10 +- indra/newview/llvoclouds.cpp | 2 +- indra/newview/llvograss.cpp | 2 +- indra/newview/llvopartgroup.cpp | 6 +- indra/newview/llvosky.cpp | 4 +- indra/newview/llvosurfacepatch.cpp | 4 +- indra/newview/llvotree.cpp | 2 +- indra/newview/llvovolume.cpp | 14 +- indra/newview/llvowater.cpp | 2 +- indra/newview/llvowlsky.cpp | 2 +- indra/newview/llwaterparammanager.cpp | 2 +- indra/newview/llwlparammanager.cpp | 2 +- indra/newview/pipeline.cpp | 94 ++++++------- indra/newview/pipeline.h | 38 +++--- 60 files changed, 361 insertions(+), 356 deletions(-) diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp index 528a7bb4a5..8d269a91a8 100644 --- a/indra/llcharacter/llcharacter.cpp +++ b/indra/llcharacter/llcharacter.cpp @@ -180,7 +180,7 @@ void LLCharacter::requestStopMotion( LLMotion* motion) //----------------------------------------------------------------------------- // updateMotions() //----------------------------------------------------------------------------- -static LLFastTimer::DeclareTimer FTM_UPDATE_ANIMATION("Update Animation"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_ANIMATION("Update Animation"); void LLCharacter::updateMotions(e_update_t update_type) { diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index ca7e471bf2..0db9bb50cd 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -94,7 +94,7 @@ std::string LLDate::asRFC1123() const return toHTTPDateString (std::string ("%A, %d %b %Y %H:%M:%S GMT")); } -LLFastTimer::DeclareTimer FT_DATE_FORMAT("Date Format"); +LLFastTimerUtil::DeclareTimer FT_DATE_FORMAT("Date Format"); std::string LLDate::toHTTPDateString (std::string fmt) const { diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index f5c90291b8..ff96bd7abc 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -39,40 +39,24 @@ #define TIME_FAST_TIMERS 0 #if LL_WINDOWS +#include +#define LL_INLINE __forceinline // shift off lower 8 bits for lower resolution but longer term timing // on 1Ghz machine, a 32-bit word will hold ~1000 seconds of timing inline U32 get_cpu_clock_count_32() { - U32 ret_val; - __asm - { - _emit 0x0f - _emit 0x31 - shr eax,8 - shl edx,24 - or eax, edx - mov dword ptr [ret_val], eax - } - return ret_val; + U64 time_stamp = __rdtsc(); + return (U32)(time_stamp >> 8); } // return full timer value, *not* shifted by 8 bits inline U64 get_cpu_clock_count_64() { - U64 ret_val; - __asm - { - _emit 0x0f - _emit 0x31 - mov eax,eax - mov edx,edx - mov dword ptr [ret_val+4], edx - mov dword ptr [ret_val], eax - } - return ret_val; + return __rdtsc(); } - +#else +#define LL_INLINE #endif // LL_WINDOWS #if (LL_LINUX || LL_SOLARIS || LL_DARWIN) && (defined(__i386__) || defined(__amd64__)) @@ -114,9 +98,25 @@ class LLMutex; #include "llsd.h" -class LL_COMMON_API LLFastTimer +class LL_COMMON_API LLFastTimerUtil { public: + + class NamedTimer; + + struct LL_COMMON_API FrameState + { + FrameState(NamedTimer* timerp); + + U32 mSelfTimeCounter; + U32 mCalls; + FrameState* mParent; // info for caller timer + FrameState* mLastCaller; // used to bootstrap tree construction + NamedTimer* mTimer; + U16 mActiveCount; // number of timers with this ID active on stack + bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame + }; + // stores a "named" timer instance to be reused via multiple LLFastTimer stack instances class LL_COMMON_API NamedTimer : public LLInstanceTracker @@ -149,26 +149,13 @@ public: static NamedTimer& getRootNamedTimer(); - struct FrameState - { - FrameState(NamedTimer* timerp); - - U32 mSelfTimeCounter; - U32 mCalls; - FrameState* mParent; // info for caller timer - FrameState* mLastCaller; // used to bootstrap tree construction - NamedTimer* mTimer; - U16 mActiveCount; // number of timers with this ID active on stack - bool mMoveUpTree; // needs to be moved up the tree of timers at the end of frame - }; - S32 getFrameStateIndex() const { return mFrameStateIndex; } FrameState& getFrameState() const; private: - friend class LLFastTimer; + friend class LLFastTimerUtil; friend class NamedTimerFactory; // @@ -214,51 +201,101 @@ public: class LL_COMMON_API DeclareTimer : public LLInstanceTracker { + friend class LLFastTimer; public: DeclareTimer(const std::string& name, bool open); DeclareTimer(const std::string& name); static void updateCachedPointers(); - // convertable to NamedTimer::FrameState for convenient usage of LLFastTimer(declared_timer) - operator NamedTimer::FrameState&() { return *mFrameState; } private: - NamedTimer& mTimer; - NamedTimer::FrameState* mFrameState; + NamedTimer& mTimer; + FrameState* mFrameState; }; public: - static LLMutex* sLogLock; + static LLMutex* sLogLock; static std::queue sLogQueue; - static BOOL sLog; - static BOOL sMetricLog; + static BOOL sLog; + static BOOL sMetricLog; + static bool sPauseHistory; + static bool sResetHistory; + static U64 sTimerCycles; + static U32 sTimerCalls; - typedef std::vector info_list_t; + typedef std::vector info_list_t; static info_list_t& getFrameStateList(); - enum RootTimerMarker { ROOT }; - LLFastTimer(RootTimerMarker); + + // call this once a frame to reset timers + static void nextFrame(); - LLFastTimer(NamedTimer::FrameState& timer) - : mFrameState(&timer) + // dumps current cumulative frame stats to log + // call nextFrame() to reset timers + static void dumpCurTimes(); + + // call this to reset timer hierarchy, averages, etc. + static void reset(); + + static U64 countsPerSecond(); + static S32 getLastFrameIndex() { return sLastFrameIndex; } + static S32 getCurFrameIndex() { return sCurFrameIndex; } + + static void writeLog(std::ostream& os); + static const NamedTimer* getTimerByName(const std::string& name); + + struct CurTimerData + { + LLFastTimer* mCurTimer; + FrameState* mFrameState; + U32 mChildTime; + }; + static CurTimerData sCurTimerData; + +private: + static S32 sCurFrameIndex; + static S32 sLastFrameIndex; + static U64 sLastFrameTime; + static info_list_t* sTimerInfos; +}; + +class LLFastTimer +{ + friend LLFastTimerUtil::NamedTimer; +public: + LLFastTimer(LLFastTimerUtil::FrameState* state) + : mFrameState(state) + { + U32 start_time = get_cpu_clock_count_32(); + mStartTime = start_time; + mFrameState->mActiveCount++; + LLFastTimerUtil::sCurTimerData.mCurTimer = this; + LLFastTimerUtil::sCurTimerData.mFrameState = mFrameState; + LLFastTimerUtil::sCurTimerData.mChildTime = 0; + mLastTimerData = LLFastTimerUtil::sCurTimerData; + } + + LL_INLINE LLFastTimer(LLFastTimerUtil::DeclareTimer& timer) + : mFrameState(timer.mFrameState) { #if TIME_FAST_TIMERS U64 timer_start = get_cpu_clock_count_64(); #endif #if FAST_TIMER_ON - NamedTimer::FrameState* frame_state = &timer; - U32 cur_time = get_cpu_clock_count_32(); - mStartSelfTime = cur_time; - mStartTotalTime = cur_time; + LLFastTimerUtil::FrameState* frame_state = mFrameState; + mStartTime = get_cpu_clock_count_32(); frame_state->mActiveCount++; frame_state->mCalls++; // keep current parent as long as it is active when we are frame_state->mMoveUpTree |= (frame_state->mParent->mActiveCount == 0); - mLastTimer = sCurTimer; - sCurTimer = this; + LLFastTimerUtil::CurTimerData* cur_timer_data = &LLFastTimerUtil::sCurTimerData; + mLastTimerData = *cur_timer_data; + cur_timer_data->mCurTimer = this; + cur_timer_data->mFrameState = frame_state; + cur_timer_data->mChildTime = 0; #endif #if TIME_FAST_TIMERS U64 timer_end = get_cpu_clock_count_64(); @@ -266,26 +303,26 @@ public: #endif } - ~LLFastTimer() + LL_INLINE ~LLFastTimer() { #if TIME_FAST_TIMERS U64 timer_start = get_cpu_clock_count_64(); #endif #if FAST_TIMER_ON - NamedTimer::FrameState* frame_state = mFrameState; - U32 cur_time = get_cpu_clock_count_32(); - frame_state->mSelfTimeCounter += cur_time - mStartSelfTime; + LLFastTimerUtil::FrameState* frame_state = mFrameState; + U32 total_time = get_cpu_clock_count_32() - mStartTime; + frame_state->mSelfTimeCounter += total_time - LLFastTimerUtil::sCurTimerData.mChildTime; frame_state->mActiveCount--; - LLFastTimer* last_timer = mLastTimer; - sCurTimer = last_timer; // store last caller to bootstrap tree creation - frame_state->mLastCaller = last_timer->mFrameState; + // do this in the destructor in case of recursion to get topmost caller + frame_state->mLastCaller = mLastTimerData.mFrameState; // we are only tracking self time, so subtract our total time delta from parents - U32 total_time = cur_time - mStartTotalTime; - last_timer->mStartSelfTime += total_time; + mLastTimerData.mChildTime += total_time; + + LLFastTimerUtil::sCurTimerData = mLastTimerData; #endif #if TIME_FAST_TIMERS U64 timer_end = get_cpu_clock_count_64(); @@ -293,42 +330,10 @@ public: sTimerCalls++; #endif } - - - // call this once a frame to reset timers - static void nextFrame(); - - // dumps current cumulative frame stats to log - // call nextFrame() to reset timers - static void dumpCurTimes(); - - // call this to reset timer hierarchy, averages, etc. - static void reset(); - - static U64 countsPerSecond(); - static S32 getLastFrameIndex() { return sLastFrameIndex; } - static S32 getCurFrameIndex() { return sCurFrameIndex; } - - static void writeLog(std::ostream& os); - static const NamedTimer* getTimerByName(const std::string& name); - -public: - static bool sPauseHistory; - static bool sResetHistory; - static U64 sTimerCycles; - static U32 sTimerCalls; - private: - static LLFastTimer* sCurTimer; - static S32 sCurFrameIndex; - static S32 sLastFrameIndex; - static U64 sLastFrameTime; - static info_list_t* sTimerInfos; - - U32 mStartSelfTime; // start time + time of all child timers - U32 mStartTotalTime; // start time + time of all child timers - NamedTimer::FrameState* mFrameState; - LLFastTimer* mLastTimer; + U32 mStartTime; + LLFastTimerUtil::FrameState* mFrameState; + LLFastTimerUtil::CurTimerData mLastTimerData; }; #endif // LL_LLFASTTIMER_H diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 5f3d9d6582..d09741cfe9 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -42,7 +42,7 @@ #include // for WideCharToMultiByte #endif -LLFastTimer::DeclareTimer FT_STRING_FORMAT("String Format"); +LLFastTimerUtil::DeclareTimer FT_STRING_FORMAT("String Format"); std::string ll_safe_string(const char* in) diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp index 5e9dfd81fa..fb75ffa942 100644 --- a/indra/llmessage/llpumpio.cpp +++ b/indra/llmessage/llpumpio.cpp @@ -444,7 +444,7 @@ void LLPumpIO::pump() pump(DEFAULT_POLL_TIMEOUT); } -static LLFastTimer::DeclareTimer FTM_PUMP("Pump"); +static LLFastTimerUtil::DeclareTimer FTM_PUMP("Pump"); //timeout is in microseconds void LLPumpIO::pump(const S32& poll_timeout) diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp index 6682575ca5..3c67cbf3d5 100644 --- a/indra/llmessage/lltemplatemessagereader.cpp +++ b/indra/llmessage/lltemplatemessagereader.cpp @@ -531,7 +531,7 @@ void LLTemplateMessageReader::logRanOffEndOfPacket( const LLHost& host, const S3 gMessageSystem->callExceptionFunc(MX_RAN_OFF_END_OF_PACKET); } -static LLFastTimer::DeclareTimer FTM_PROCESS_MESSAGES("Process Messages"); +static LLFastTimerUtil::DeclareTimer FTM_PROCESS_MESSAGES("Process Messages"); // decode a given message BOOL LLTemplateMessageReader::decodeData(const U8* buffer, const LLHost& sender ) diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 1de1d6ded4..0f38785d52 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -116,7 +116,7 @@ BOOL LLFontGL::loadFace(const std::string& filename, F32 point_size, F32 vert_dp return mFontFreetype->loadFace(filename, point_size, vert_dpi, horz_dpi, components, is_fallback); } -static LLFastTimer::DeclareTimer FTM_RENDER_FONTS("Fonts"); +static LLFastTimerUtil::DeclareTimer FTM_RENDER_FONTS("Fonts"); S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, const LLColor4 &color, HAlign halign, VAlign valign, U8 style, ShadowType shadow, S32 max_chars, S32 max_pixels, F32* right_x, BOOL use_ellipses) const diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 845203b420..406e672efd 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2692,7 +2692,7 @@ void LLFloater::initFromParams(const LLFloater::Params& p) } } -LLFastTimer::DeclareTimer POST_BUILD("Floater Post Build"); +LLFastTimerUtil::DeclareTimer POST_BUILD("Floater Post Build"); bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node) { diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index ede32084d0..a1ef9ff340 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -231,7 +231,7 @@ LLColor3 LLKeywords::readColor( const std::string& s ) return LLColor3( r, g, b ); } -LLFastTimer::DeclareTimer FTM_SYNTAX_COLORING("Syntax Coloring"); +LLFastTimerUtil::DeclareTimer FTM_SYNTAX_COLORING("Syntax Coloring"); // Walk through a string, applying the rules specified by the keyword token list and // create a list of color segments. diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 1aaba88c49..825cafb80d 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -437,7 +437,7 @@ bool LLLayoutStack::getPanelMinSize(const std::string& panel_name, S32* min_widt return NULL != panel; } -static LLFastTimer::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks"); void LLLayoutStack::updateLayout(BOOL force_resize) { LLFastTimer ft(FTM_UPDATE_LAYOUT); diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index db32882438..24f6a89da1 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -369,7 +369,7 @@ void LLPanel::setBorderVisible(BOOL b) } } -LLFastTimer::DeclareTimer FTM_PANEL_CONSTRUCTION("Panel Construction"); +LLFastTimerUtil::DeclareTimer FTM_PANEL_CONSTRUCTION("Panel Construction"); LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_node) { @@ -476,9 +476,9 @@ void LLPanel::initFromParams(const LLPanel::Params& p) mBgAlphaImage = p.bg_alpha_image(); } -static LLFastTimer::DeclareTimer FTM_PANEL_SETUP("Panel Setup"); -static LLFastTimer::DeclareTimer FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference"); -static LLFastTimer::DeclareTimer FTM_PANEL_POSTBUILD("Panel PostBuild"); +static LLFastTimerUtil::DeclareTimer FTM_PANEL_SETUP("Panel Setup"); +static LLFastTimerUtil::DeclareTimer FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference"); +static LLFastTimerUtil::DeclareTimer FTM_PANEL_POSTBUILD("Panel PostBuild"); BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node) { diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 5ebf49c488..400e627d84 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1065,7 +1065,7 @@ S32 LLTextBase::getLeftOffset(S32 width) } -static LLFastTimer::DeclareTimer FTM_TEXT_REFLOW ("Text Reflow"); +static LLFastTimerUtil::DeclareTimer FTM_TEXT_REFLOW ("Text Reflow"); void LLTextBase::reflow(S32 start_index) { LLFastTimer ft(FTM_TEXT_REFLOW); @@ -1377,7 +1377,7 @@ void LLTextBase::removeDocumentChild(LLView* view) } -static LLFastTimer::DeclareTimer FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_TEXT_SEGMENTS("Update Text Segments"); void LLTextBase::updateSegments() { LLFastTimer ft(FTM_UPDATE_TEXT_SEGMENTS); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index e8fc9475a5..a4c2770e20 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2498,7 +2498,7 @@ BOOL LLTextEditor::tryToRevertToPristineState() } -static LLFastTimer::DeclareTimer FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting"); +static LLFastTimerUtil::DeclareTimer FTM_SYNTAX_HIGHLIGHTING("Syntax Highlighting"); void LLTextEditor::loadKeywords(const std::string& filename, const std::vector& funcs, const std::vector& tooltips, diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 27237800d4..c5d3de576c 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -50,9 +50,9 @@ // this library includes #include "llfloater.h" -LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION("Widget Construction"); -LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS("Widget InitFromParams"); -LLFastTimer::DeclareTimer FTM_WIDGET_SETUP("Widget Setup"); +LLFastTimerUtil::DeclareTimer FTM_WIDGET_CONSTRUCTION("Widget Construction"); +LLFastTimerUtil::DeclareTimer FTM_INIT_FROM_PARAMS("Widget InitFromParams"); +LLFastTimerUtil::DeclareTimer FTM_WIDGET_SETUP("Widget Setup"); //----------------------------------------------------------------------------- @@ -105,7 +105,7 @@ void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitPa } } -static LLFastTimer::DeclareTimer FTM_CREATE_CHILDREN("Create XUI Children"); +static LLFastTimerUtil::DeclareTimer FTM_CREATE_CHILDREN("Create XUI Children"); //static void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const widget_registry_t& registry, LLXMLNodePtr output_node) @@ -147,7 +147,7 @@ void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const wid } -static LLFastTimer::DeclareTimer FTM_XML_PARSE("XML Reading/Parsing"); +static LLFastTimerUtil::DeclareTimer FTM_XML_PARSE("XML Reading/Parsing"); //----------------------------------------------------------------------------- // getLayeredXMLNode() //----------------------------------------------------------------------------- @@ -175,7 +175,7 @@ bool LLUICtrlFactory::getLocalizedXMLNode(const std::string &xui_filename, LLXML } } -static LLFastTimer::DeclareTimer FTM_BUILD_FLOATERS("Build Floaters"); +static LLFastTimerUtil::DeclareTimer FTM_BUILD_FLOATERS("Build Floaters"); //----------------------------------------------------------------------------- // buildFloater() @@ -247,7 +247,7 @@ S32 LLUICtrlFactory::saveToXML(LLView* viewp, const std::string& filename) return 0; } -static LLFastTimer::DeclareTimer FTM_BUILD_PANELS("Build Panels"); +static LLFastTimerUtil::DeclareTimer FTM_BUILD_PANELS("Build Panels"); //----------------------------------------------------------------------------- // buildPanel() @@ -313,7 +313,7 @@ BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const std::string& filename, L //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -static LLFastTimer::DeclareTimer FTM_CREATE_FROM_XML("Create child widget"); +static LLFastTimerUtil::DeclareTimer FTM_CREATE_FROM_XML("Create child widget"); LLView *LLUICtrlFactory::createFromXML(LLXMLNodePtr node, LLView* parent, const std::string& filename, const widget_registry_t& registry, LLXMLNodePtr output_node) { diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index b1fa6add67..80e82b784c 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -104,9 +104,9 @@ class LLDefaultWidgetRegistry //: public LLRegistrySingleton //{}; -extern LLFastTimer::DeclareTimer FTM_WIDGET_SETUP; -extern LLFastTimer::DeclareTimer FTM_WIDGET_CONSTRUCTION; -extern LLFastTimer::DeclareTimer FTM_INIT_FROM_PARAMS; +extern LLFastTimerUtil::DeclareTimer FTM_WIDGET_SETUP; +extern LLFastTimerUtil::DeclareTimer FTM_WIDGET_CONSTRUCTION; +extern LLFastTimerUtil::DeclareTimer FTM_INIT_FROM_PARAMS; // Build time optimization, generate this once in .cpp file #ifndef LLUICTRLFACTORY_CPP diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp index f7a53e87de..e15dc9eb85 100644 --- a/indra/llui/lluistring.cpp +++ b/indra/llui/lluistring.cpp @@ -35,7 +35,7 @@ #include "llsd.h" #include "lltrans.h" -LLFastTimer::DeclareTimer FTM_UI_STRING("UI String"); +LLFastTimerUtil::DeclareTimer FTM_UI_STRING("UI String"); LLUIString::LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index f1b08c380b..9da25b0308 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1707,7 +1707,7 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse) const return child; } -static LLFastTimer::DeclareTimer FTM_FIND_VIEWS("Find Widgets"); +static LLFastTimerUtil::DeclareTimer FTM_FIND_VIEWS("Find Widgets"); LLView* LLView::findChildView(const std::string& name, BOOL recurse) const { diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp index 5fdf41188d..d9437ddd4c 100644 --- a/indra/llvfs/llvfile.cpp +++ b/indra/llvfs/llvfile.cpp @@ -44,7 +44,7 @@ const S32 LLVFile::WRITE = 0x00000002; const S32 LLVFile::READ_WRITE = 0x00000003; // LLVFile::READ & LLVFile::WRITE const S32 LLVFile::APPEND = 0x00000006; // 0x00000004 & LLVFile::WRITE -static LLFastTimer::DeclareTimer FTM_VFILE_WAIT("VFile Wait"); +static LLFastTimerUtil::DeclareTimer FTM_VFILE_WAIT("VFile Wait"); //---------------------------------------------------------------------------- LLVFSThread* LLVFile::sVFSThread = NULL; diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index b591111b75..5064c176e0 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -1642,8 +1642,8 @@ void LLWindowWin32::gatherInput() mMousePositionModified = FALSE; } -static LLFastTimer::DeclareTimer FTM_KEYHANDLER("Handle Keyboard"); -static LLFastTimer::DeclareTimer FTM_MOUSEHANDLER("Handle Mouse"); +static LLFastTimerUtil::DeclareTimer FTM_KEYHANDLER("Handle Keyboard"); +static LLFastTimerUtil::DeclareTimer FTM_MOUSEHANDLER("Handle Mouse"); LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_param, LPARAM l_param) { diff --git a/indra/llxuixml/lltrans.cpp b/indra/llxuixml/lltrans.cpp index d6f17dbb08..2141cc40eb 100644 --- a/indra/llxuixml/lltrans.cpp +++ b/indra/llxuixml/lltrans.cpp @@ -137,7 +137,7 @@ bool LLTrans::parseLanguageStrings(LLXMLNodePtr &root) -static LLFastTimer::DeclareTimer FTM_GET_TRANS("Translate string"); +static LLFastTimerUtil::DeclareTimer FTM_GET_TRANS("Translate string"); //static std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& msg_args) diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp index 17399865e5..8ea1890d15 100644 --- a/indra/llxuixml/llxuiparser.cpp +++ b/indra/llxuixml/llxuiparser.cpp @@ -400,7 +400,7 @@ LLXUIParser::LLXUIParser() boost::bind(&LLXUIParser::writeSDValue, this, _1, _2)); } -static LLFastTimer::DeclareTimer FTM_PARSE_XUI("XUI Parsing"); +static LLFastTimerUtil::DeclareTimer FTM_PARSE_XUI("XUI Parsing"); void LLXUIParser::readXUI(LLXMLNodePtr node, LLInitParam::BaseBlock& block, const std::string& filename, bool silent) { diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e0356bc091..8ac2f0966f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -480,11 +480,11 @@ public: LLFastTimerLogThread() : LLThread("fast timer log") { - if(LLFastTimer::sLog) + if(LLFastTimerUtil::sLog) { mFile = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "performance.slp"); } - if(LLFastTimer::sMetricLog) + if(LLFastTimerUtil::sMetricLog) { mFile = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "metric.slp"); } @@ -496,7 +496,7 @@ public: while (!LLAppViewer::instance()->isQuitting()) { - LLFastTimer::writeLog(os); + LLFastTimerUtil::writeLog(os); os.flush(); ms_sleep(32); } @@ -606,7 +606,7 @@ bool LLAppViewer::init() // into the log files during normal startup until AFTER // we run the "program crashed last time" error handler below. // - LLFastTimer::reset(); + LLFastTimerUtil::reset(); // Need to do this initialization before we do anything else, since anything // that touches files should really go through the lldir API @@ -911,15 +911,15 @@ bool LLAppViewer::init() return true; } -static LLFastTimer::DeclareTimer FTM_MESSAGES("System Messages"); -static LLFastTimer::DeclareTimer FTM_SLEEP("Sleep"); -static LLFastTimer::DeclareTimer FTM_TEXTURE_CACHE("Texture Cache"); -static LLFastTimer::DeclareTimer FTM_DECODE("Image Decode"); -static LLFastTimer::DeclareTimer FTM_VFS("VFS Thread"); -static LLFastTimer::DeclareTimer FTM_LFS("LFS Thread"); -static LLFastTimer::DeclareTimer FTM_PAUSE_THREADS("Pause Threads"); -static LLFastTimer::DeclareTimer FTM_IDLE("Idle"); -static LLFastTimer::DeclareTimer FTM_PUMP("Pump"); +static LLFastTimerUtil::DeclareTimer FTM_MESSAGES("System Messages"); +static LLFastTimerUtil::DeclareTimer FTM_SLEEP("Sleep"); +static LLFastTimerUtil::DeclareTimer FTM_TEXTURE_CACHE("Texture Cache"); +static LLFastTimerUtil::DeclareTimer FTM_DECODE("Image Decode"); +static LLFastTimerUtil::DeclareTimer FTM_VFS("VFS Thread"); +static LLFastTimerUtil::DeclareTimer FTM_LFS("LFS Thread"); +static LLFastTimerUtil::DeclareTimer FTM_PAUSE_THREADS("Pause Threads"); +static LLFastTimerUtil::DeclareTimer FTM_IDLE("Idle"); +static LLFastTimerUtil::DeclareTimer FTM_PUMP("Pump"); bool LLAppViewer::mainLoop() { @@ -956,7 +956,7 @@ bool LLAppViewer::mainLoop() // Handle messages while (!LLApp::isExiting()) { - LLFastTimer::nextFrame(); // Should be outside of any timer instances + LLFastTimerUtil::nextFrame(); // Should be outside of any timer instances try { @@ -1551,14 +1551,14 @@ bool LLAppViewer::cleanup() { llinfos << "Analyzing performance" << llendl; - if(LLFastTimer::sLog) + if(LLFastTimerUtil::sLog) { LLFastTimerView::doAnalysis( gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "performance_baseline.slp"), gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "performance.slp"), gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "performance_report.csv")); } - if(LLFastTimer::sMetricLog) + if(LLFastTimerUtil::sMetricLog) { LLFastTimerView::doAnalysis( gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "metric_baseline.slp"), @@ -1678,9 +1678,9 @@ bool LLAppViewer::initThreads() LLAppViewer::sTextureFetch = new LLTextureFetch(LLAppViewer::getTextureCache(), sImageDecodeThread, enable_threads && false); LLImage::initClass(); - if (LLFastTimer::sLog || LLFastTimer::sMetricLog) + if (LLFastTimerUtil::sLog || LLFastTimerUtil::sMetricLog) { - LLFastTimer::sLogLock = new LLMutex(NULL); + LLFastTimerUtil::sLogLock = new LLMutex(NULL); mFastTimerLogThread = new LLFastTimerLogThread(); mFastTimerLogThread->start(); } @@ -2031,12 +2031,12 @@ bool LLAppViewer::initConfiguration() if (clp.hasOption("logperformance")) { - LLFastTimer::sLog = TRUE; + LLFastTimerUtil::sLog = TRUE; } if(clp.hasOption("logmetrics")) { - LLFastTimer::sMetricLog = TRUE ; + LLFastTimerUtil::sMetricLog = TRUE ; } if (clp.hasOption("graphicslevel")) @@ -3370,14 +3370,14 @@ public: } }; -static LLFastTimer::DeclareTimer FTM_AUDIO_UPDATE("Update Audio"); -static LLFastTimer::DeclareTimer FTM_CLEANUP("Cleanup"); -static LLFastTimer::DeclareTimer FTM_IDLE_CB("Idle Callbacks"); -static LLFastTimer::DeclareTimer FTM_LOD_UPDATE("Update LOD"); -static LLFastTimer::DeclareTimer FTM_OBJECTLIST_UPDATE("Update Objectlist"); -static LLFastTimer::DeclareTimer FTM_REGION_UPDATE("Update Region"); -static LLFastTimer::DeclareTimer FTM_WORLD_UPDATE("Update World"); -static LLFastTimer::DeclareTimer FTM_NETWORK("Network"); +static LLFastTimerUtil::DeclareTimer FTM_AUDIO_UPDATE("Update Audio"); +static LLFastTimerUtil::DeclareTimer FTM_CLEANUP("Cleanup"); +static LLFastTimerUtil::DeclareTimer FTM_IDLE_CB("Idle Callbacks"); +static LLFastTimerUtil::DeclareTimer FTM_LOD_UPDATE("Update LOD"); +static LLFastTimerUtil::DeclareTimer FTM_OBJECTLIST_UPDATE("Update Objectlist"); +static LLFastTimerUtil::DeclareTimer FTM_REGION_UPDATE("Update Region"); +static LLFastTimerUtil::DeclareTimer FTM_WORLD_UPDATE("Update World"); +static LLFastTimerUtil::DeclareTimer FTM_NETWORK("Network"); /////////////////////////////////////////////////////// // idle() @@ -3882,7 +3882,7 @@ void LLAppViewer::sendLogoutRequest() static F32 CheckMessagesMaxTime = CHECK_MESSAGES_DEFAULT_MAX_TIME; #endif -static LLFastTimer::DeclareTimer FTM_IDLE_NETWORK("Network"); +static LLFastTimerUtil::DeclareTimer FTM_IDLE_NETWORK("Network"); void LLAppViewer::idleNetwork() { diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index d60330024a..02e5f9c653 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -60,7 +60,7 @@ const F32 MAX_INTERPOLATE_DISTANCE_SQUARED = 10.f * 10.f; const F32 OBJECT_DAMPING_TIME_CONSTANT = 0.06f; const F32 MIN_SHADOW_CASTER_RADIUS = 2.0f; -static LLFastTimer::DeclareTimer FTM_CULL_REBOUND("Cull Rebound"); +static LLFastTimerUtil::DeclareTimer FTM_CULL_REBOUND("Cull Rebound"); //////////////////////// diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 546b60f286..605095f24a 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -94,7 +94,7 @@ S32 normal_channel = -1; S32 specular_channel = -1; S32 diffuse_channel = -1; -static LLFastTimer::DeclareTimer FTM_SHADOW_AVATAR("Avatar Shadow"); +static LLFastTimerUtil::DeclareTimer FTM_SHADOW_AVATAR("Avatar Shadow"); LLDrawPoolAvatar::LLDrawPoolAvatar() : LLFacePool(POOL_AVATAR) diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index ca7a1b47c2..04f411e345 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -47,8 +47,8 @@ static LLGLSLShader* simple_shader = NULL; static LLGLSLShader* fullbright_shader = NULL; -static LLFastTimer::DeclareTimer FTM_RENDER_SIMPLE_DEFERRED("Deferred Simple"); -static LLFastTimer::DeclareTimer FTM_RENDER_GRASS_DEFERRED("Deferred Grass"); +static LLFastTimerUtil::DeclareTimer FTM_RENDER_SIMPLE_DEFERRED("Deferred Simple"); +static LLFastTimerUtil::DeclareTimer FTM_RENDER_GRASS_DEFERRED("Deferred Grass"); void LLDrawPoolGlow::render(S32 pass) { diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index 9dc22cddcd..0e36e9e6d2 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -61,7 +61,7 @@ int DebugDetailMap = 0; S32 LLDrawPoolTerrain::sDetailMode = 1; F32 LLDrawPoolTerrain::sDetailScale = DETAIL_SCALE; static LLGLSLShader* sShader = NULL; -static LLFastTimer::DeclareTimer FTM_SHADOW_TERRAIN("Terrain Shadow"); +static LLFastTimerUtil::DeclareTimer FTM_SHADOW_TERRAIN("Terrain Shadow"); LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) : diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 5521fb05a8..192b0a13d3 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -46,7 +46,7 @@ S32 LLDrawPoolTree::sDiffTex = 0; static LLGLSLShader* shader = NULL; -static LLFastTimer::DeclareTimer FTM_SHADOW_TREE("Tree Shadow"); +static LLFastTimerUtil::DeclareTimer FTM_SHADOW_TREE("Tree Shadow"); LLDrawPoolTree::LLDrawPoolTree(LLViewerTexture *texturep) : LLFacePool(POOL_TREE), diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 7d8bb6e104..b36909f3ac 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -63,17 +63,17 @@ static const S32 LINE_GRAPH_HEIGHT = 240; static S32 FTV_NUM_TIMERS; const S32 FTV_MAX_DEPTH = 8; -std::vector ft_display_idx; // line of table entry for display purposes (for collapse) +std::vector ft_display_idx; // line of table entry for display purposes (for collapse) -typedef LLTreeDFSIter timer_tree_iterator_t; +typedef LLTreeDFSIter timer_tree_iterator_t; BOOL LLFastTimerView::sAnalyzePerformance = FALSE; -static timer_tree_iterator_t begin_timer_tree(LLFastTimer::NamedTimer& id) +static timer_tree_iterator_t begin_timer_tree(LLFastTimerUtil::NamedTimer& id) { return timer_tree_iterator_t(&id, - boost::bind(boost::mem_fn(&LLFastTimer::NamedTimer::beginChildren), _1), - boost::bind(boost::mem_fn(&LLFastTimer::NamedTimer::endChildren), _1)); + boost::bind(boost::mem_fn(&LLFastTimerUtil::NamedTimer::beginChildren), _1), + boost::bind(boost::mem_fn(&LLFastTimerUtil::NamedTimer::endChildren), _1)); } static timer_tree_iterator_t end_timer_tree() @@ -96,7 +96,7 @@ LLFastTimerView::LLFastTimerView(const LLRect& rect) mScrollIndex = 0; mHoverID = NULL; mHoverBarIndex = -1; - FTV_NUM_TIMERS = LLFastTimer::NamedTimer::instanceCount(); + FTV_NUM_TIMERS = LLFastTimerUtil::NamedTimer::instanceCount(); mPrintStats = -1; mAverageCyclesPerTimer = 0; } @@ -125,7 +125,7 @@ BOOL LLFastTimerView::handleRightMouseDown(S32 x, S32 y, MASK mask) return FALSE; } -LLFastTimer::NamedTimer* LLFastTimerView::getLegendID(S32 y) +LLFastTimerUtil::NamedTimer* LLFastTimerView::getLegendID(S32 y) { S32 idx = (getRect().getHeight() - y) / ((S32) LLFontGL::getFontMonospace()->getLineHeight()+2) - 5; @@ -141,7 +141,7 @@ BOOL LLFastTimerView::handleMouseDown(S32 x, S32 y, MASK mask) { if (x < mBarRect.mLeft) { - LLFastTimer::NamedTimer* idp = getLegendID(y); + LLFastTimerUtil::NamedTimer* idp = getLegendID(y); if (idp) { idp->setCollapsed(!idp->getCollapsed()); @@ -175,9 +175,9 @@ BOOL LLFastTimerView::handleMouseDown(S32 x, S32 y, MASK mask) else { // pause/unpause - LLFastTimer::sPauseHistory = !LLFastTimer::sPauseHistory; + LLFastTimerUtil::sPauseHistory = !LLFastTimerUtil::sPauseHistory; // reset scroll to bottom when unpausing - if (!LLFastTimer::sPauseHistory) + if (!LLFastTimerUtil::sPauseHistory) { mScrollIndex = 0; } @@ -196,9 +196,9 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) mHoverTimer = NULL; mHoverID = NULL; - if(LLFastTimer::sPauseHistory && mBarRect.pointInRect(x, y)) + if(LLFastTimerUtil::sPauseHistory && mBarRect.pointInRect(x, y)) { - mHoverBarIndex = llmin(LLFastTimer::getCurFrameIndex() - 1, + mHoverBarIndex = llmin(LLFastTimerUtil::getCurFrameIndex() - 1, MAX_VISIBLE_HISTORY - ((y - mBarRect.mBottom) * (MAX_VISIBLE_HISTORY + 2) / mBarRect.getHeight())); if (mHoverBarIndex == 0) { @@ -210,7 +210,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) } S32 i = 0; - for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimerUtil::NamedTimer::getRootNamedTimer()); it != end_timer_tree(); ++it, ++i) { @@ -234,7 +234,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) } else if (x < mBarRect.mLeft) { - LLFastTimer::NamedTimer* timer_id = getLegendID(y); + LLFastTimerUtil::NamedTimer* timer_id = getLegendID(y); if (timer_id) { mHoverID = timer_id; @@ -247,7 +247,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask) { - if(LLFastTimer::sPauseHistory && mBarRect.pointInRect(x, y)) + if(LLFastTimerUtil::sPauseHistory && mBarRect.pointInRect(x, y)) { // tooltips for timer bars if (mHoverTimer) @@ -256,7 +256,7 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask) localRectToScreen(mToolTipRect, &screen_rect); LLToolTipMgr::instance().show(LLToolTip::Params() - .message(mHoverTimer->getToolTip(LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex - mHoverBarIndex)) + .message(mHoverTimer->getToolTip(LLFastTimerUtil::NamedTimer::HISTORY_NUM - mScrollIndex - mHoverBarIndex)) .sticky_rect(screen_rect) .delay_time(0.f)); @@ -268,7 +268,7 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask) // tooltips for timer legend if (x < mBarRect.mLeft) { - LLFastTimer::NamedTimer* idp = getLegendID(y); + LLFastTimerUtil::NamedTimer* idp = getLegendID(y); if (idp) { LLToolTipMgr::instance().show(idp->getToolTip()); @@ -283,16 +283,16 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask) BOOL LLFastTimerView::handleScrollWheel(S32 x, S32 y, S32 clicks) { - LLFastTimer::sPauseHistory = TRUE; + LLFastTimerUtil::sPauseHistory = TRUE; mScrollIndex = llclamp(mScrollIndex - clicks, 0, - llmin(LLFastTimer::getLastFrameIndex(), (S32)LLFastTimer::NamedTimer::HISTORY_NUM - MAX_VISIBLE_HISTORY)); + llmin(LLFastTimerUtil::getLastFrameIndex(), (S32)LLFastTimerUtil::NamedTimer::HISTORY_NUM - MAX_VISIBLE_HISTORY)); return TRUE; } -static LLFastTimer::DeclareTimer FTM_RENDER_TIMER("Timers", true); +static LLFastTimerUtil::DeclareTimer FTM_RENDER_TIMER("Timers", true); -static std::map sTimerColors; +static std::map sTimerColors; void LLFastTimerView::draw() { @@ -300,7 +300,7 @@ void LLFastTimerView::draw() std::string tdesc; - F64 clock_freq = (F64)LLFastTimer::countsPerSecond(); + F64 clock_freq = (F64)LLFastTimerUtil::countsPerSecond(); F64 iclock_freq = 1000.0 / clock_freq; S32 margin = 10; @@ -367,7 +367,7 @@ void LLFastTimerView::draw() y -= (texth + 2); } - S32 histmax = llmin(LLFastTimer::getLastFrameIndex()+1, MAX_VISIBLE_HISTORY); + S32 histmax = llmin(LLFastTimerUtil::getLastFrameIndex()+1, MAX_VISIBLE_HISTORY); // Draw the legend xleft = margin; @@ -375,15 +375,15 @@ void LLFastTimerView::draw() y -= (texth + 2); - sTimerColors[&LLFastTimer::NamedTimer::getRootNamedTimer()] = LLColor4::grey; + sTimerColors[&LLFastTimerUtil::NamedTimer::getRootNamedTimer()] = LLColor4::grey; F32 hue = 0.f; - for (timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + for (timer_tree_iterator_t it = begin_timer_tree(LLFastTimerUtil::NamedTimer::getRootNamedTimer()); it != timer_tree_iterator_t(); ++it) { - LLFastTimer::NamedTimer* idp = (*it); + LLFastTimerUtil::NamedTimer* idp = (*it); const F32 HUE_INCREMENT = 0.23f; hue = fmodf(hue + HUE_INCREMENT, 1.f); @@ -403,12 +403,12 @@ void LLFastTimerView::draw() LLLocalClipRect clip(LLRect(margin, y, LEGEND_WIDTH, margin)); S32 cur_line = 0; ft_display_idx.clear(); - std::map display_line; - for (timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + std::map display_line; + for (timer_tree_iterator_t it = begin_timer_tree(LLFastTimerUtil::NamedTimer::getRootNamedTimer()); it != timer_tree_iterator_t(); ++it) { - LLFastTimer::NamedTimer* idp = (*it); + LLFastTimerUtil::NamedTimer* idp = (*it); display_line[idp] = cur_line; ft_display_idx.push_back(idp); cur_line++; @@ -428,7 +428,7 @@ void LLFastTimerView::draw() S32 calls = 0; if (mHoverBarIndex > 0 && mHoverID) { - S32 hidx = LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex - mHoverBarIndex; + S32 hidx = LLFastTimerUtil::NamedTimer::HISTORY_NUM - mScrollIndex - mHoverBarIndex; U64 ticks = idp->getHistoricalCount(hidx); ms = (F32)((F64)ticks * iclock_freq); calls = (S32)idp->getHistoricalCalls(hidx); @@ -466,7 +466,7 @@ void LLFastTimerView::draw() x += dx; BOOL is_child_of_hover_item = (idp == mHoverID); - LLFastTimer::NamedTimer* next_parent = idp->getParent(); + LLFastTimerUtil::NamedTimer* next_parent = idp->getParent(); while(!is_child_of_hover_item && next_parent) { is_child_of_hover_item = (mHoverID == next_parent); @@ -507,18 +507,18 @@ void LLFastTimerView::draw() barw = width - xleft - margin; // Draw the history bars - if (LLFastTimer::getLastFrameIndex() >= 0) + if (LLFastTimerUtil::getLastFrameIndex() >= 0) { LLLocalClipRect clip(LLRect(xleft, ytop, getRect().getWidth() - margin, margin)); U64 totalticks; - if (!LLFastTimer::sPauseHistory) + if (!LLFastTimerUtil::sPauseHistory) { - U64 ticks = LLFastTimer::NamedTimer::getRootNamedTimer().getHistoricalCount(mScrollIndex); + U64 ticks = LLFastTimerUtil::NamedTimer::getRootNamedTimer().getHistoricalCount(mScrollIndex); - if (LLFastTimer::getCurFrameIndex() >= 10) + if (LLFastTimerUtil::getCurFrameIndex() >= 10) { - U64 framec = LLFastTimer::getCurFrameIndex(); + U64 framec = LLFastTimerUtil::getCurFrameIndex(); U64 avg = (U64)mAvgCountTotal; mAvgCountTotal = (avg*framec + ticks) / (framec + 1); if (ticks > mMaxCountTotal) @@ -529,10 +529,10 @@ void LLFastTimerView::draw() if (ticks < mAvgCountTotal/100 || ticks > mAvgCountTotal*100) { - LLFastTimer::sResetHistory = true; + LLFastTimerUtil::sResetHistory = true; } - if (LLFastTimer::getCurFrameIndex() < 10 || LLFastTimer::sResetHistory) + if (LLFastTimerUtil::getCurFrameIndex() < 10 || LLFastTimerUtil::sResetHistory) { mAvgCountTotal = ticks; mMaxCountTotal = ticks; @@ -553,7 +553,7 @@ void LLFastTimerView::draw() totalticks = 0; for (S32 j=0; j totalticks) totalticks = ticks; @@ -643,7 +643,7 @@ void LLFastTimerView::draw() S32 tidx; if (j >= 0) { - tidx = LLFastTimer::NamedTimer::HISTORY_NUM - j - 1 - mScrollIndex; + tidx = LLFastTimerUtil::NamedTimer::HISTORY_NUM - j - 1 - mScrollIndex; } else { @@ -657,14 +657,14 @@ void LLFastTimerView::draw() std::vector deltax; xpos.push_back(xleft); - LLFastTimer::NamedTimer* prev_id = NULL; + LLFastTimerUtil::NamedTimer* prev_id = NULL; S32 i = 0; - for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimerUtil::NamedTimer::getRootNamedTimer()); it != end_timer_tree(); ++it, ++i) { - LLFastTimer::NamedTimer* idp = (*it); + LLFastTimerUtil::NamedTimer* idp = (*it); F32 frac = tidx == -1 ? (F32)idp->getCountAverage() / (F32)totalticks : (F32)idp->getHistoricalCount(tidx) / (F32)totalticks; @@ -691,7 +691,7 @@ void LLFastTimerView::draw() { U64 sublevelticks = 0; - for (LLFastTimer::NamedTimer::child_const_iter it = prev_id->beginChildren(); + for (LLFastTimerUtil::NamedTimer::child_const_iter it = prev_id->beginChildren(); it != prev_id->endChildren(); ++it) { @@ -733,7 +733,7 @@ void LLFastTimerView::draw() S32 scale_offset = 0; BOOL is_child_of_hover_item = (idp == mHoverID); - LLFastTimer::NamedTimer* next_parent = idp->getParent(); + LLFastTimerUtil::NamedTimer* next_parent = idp->getParent(); while(!is_child_of_hover_item && next_parent) { is_child_of_hover_item = (mHoverID == next_parent); @@ -797,10 +797,10 @@ void LLFastTimerView::draw() //highlight visible range { - S32 first_frame = LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex; + S32 first_frame = LLFastTimerUtil::NamedTimer::HISTORY_NUM - mScrollIndex; S32 last_frame = first_frame - MAX_VISIBLE_HISTORY; - F32 frame_delta = ((F32) (graph_rect.getWidth()))/(LLFastTimer::NamedTimer::HISTORY_NUM-1); + F32 frame_delta = ((F32) (graph_rect.getWidth()))/(LLFastTimerUtil::NamedTimer::HISTORY_NUM-1); F32 right = (F32) graph_rect.mLeft + frame_delta*first_frame; F32 left = (F32) graph_rect.mLeft + frame_delta*last_frame; @@ -823,11 +823,11 @@ void LLFastTimerView::draw() } U64 cur_max = 0; - for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimerUtil::NamedTimer::getRootNamedTimer()); it != end_timer_tree(); ++it) { - LLFastTimer::NamedTimer* idp = (*it); + LLFastTimerUtil::NamedTimer* idp = (*it); //fatten highlighted timer if (mHoverID == idp) @@ -851,7 +851,7 @@ void LLFastTimerView::draw() gGL.color4f(col[0], col[1], col[2], alpha); gGL.begin(LLRender::LINE_STRIP); - for (U32 j = 0; j < LLFastTimer::NamedTimer::HISTORY_NUM; j++) + for (U32 j = 0; j < LLFastTimerUtil::NamedTimer::HISTORY_NUM; j++) { U64 ticks = idp->getHistoricalCount(j); @@ -871,7 +871,7 @@ void LLFastTimerView::draw() //normalize to highlighted timer cur_max = llmax(cur_max, ticks); } - F32 x = graph_rect.mLeft + ((F32) (graph_rect.getWidth()))/(LLFastTimer::NamedTimer::HISTORY_NUM-1)*j; + F32 x = graph_rect.mLeft + ((F32) (graph_rect.getWidth()))/(LLFastTimerUtil::NamedTimer::HISTORY_NUM-1)*j; F32 y = graph_rect.mBottom + (F32) graph_rect.getHeight()/max_ticks*ticks; gGL.vertex2f(x,y); } @@ -919,11 +919,11 @@ void LLFastTimerView::draw() { std::string legend_stat; bool first = true; - for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimerUtil::NamedTimer::getRootNamedTimer()); it != end_timer_tree(); ++it) { - LLFastTimer::NamedTimer* idp = (*it); + LLFastTimerUtil::NamedTimer* idp = (*it); if (!first) { @@ -941,11 +941,11 @@ void LLFastTimerView::draw() std::string timer_stat; first = true; - for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer()); + for(timer_tree_iterator_t it = begin_timer_tree(LLFastTimerUtil::NamedTimer::getRootNamedTimer()); it != end_timer_tree(); ++it) { - LLFastTimer::NamedTimer* idp = (*it); + LLFastTimerUtil::NamedTimer* idp = (*it); if (!first) { @@ -984,10 +984,10 @@ void LLFastTimerView::draw() F64 LLFastTimerView::getTime(const std::string& name) { - const LLFastTimer::NamedTimer* timerp = LLFastTimer::getTimerByName(name); + const LLFastTimerUtil::NamedTimer* timerp = LLFastTimerUtil::getTimerByName(name); if (timerp) { - return (F64)timerp->getCountAverage() / (F64)LLFastTimer::countsPerSecond(); + return (F64)timerp->getCountAverage() / (F64)LLFastTimerUtil::countsPerSecond(); } return 0.0; } @@ -1179,13 +1179,13 @@ void LLFastTimerView::doAnalysisMetrics(std::string baseline, std::string target //static void LLFastTimerView::doAnalysis(std::string baseline, std::string target, std::string output) { - if(LLFastTimer::sLog) + if(LLFastTimerUtil::sLog) { doAnalysisDefault(baseline, target, output) ; return ; } - if(LLFastTimer::sMetricLog) + if(LLFastTimerUtil::sMetricLog) { doAnalysisMetrics(baseline, target, output) ; return ; diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index f5c8f23818..d03d83576e 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -61,7 +61,7 @@ public: virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); virtual void draw(); - LLFastTimer::NamedTimer* getLegendID(S32 y); + LLFastTimerUtil::NamedTimer* getLegendID(S32 y); F64 getTime(const std::string& name); private: @@ -85,8 +85,8 @@ private: U64 mMaxCountTotal; LLRect mBarRect; S32 mScrollIndex; - LLFastTimer::NamedTimer* mHoverID; - LLFastTimer::NamedTimer* mHoverTimer; + LLFastTimerUtil::NamedTimer* mHoverID; + LLFastTimerUtil::NamedTimer* mHoverTimer; LLRect mToolTipRect; S32 mHoverBarIndex; LLFrameTimer mHighlightTimer; diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index fc8790c172..769bc2e9e1 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -261,7 +261,7 @@ void LLVolumeImplFlexible::onSetVolume(const LLVolumeParams &volume_params, cons // updated every time step. In the future, perhaps there could be an // optimization similar to what Havok does for objects that are stationary. //--------------------------------------------------------------------------------- -static LLFastTimer::DeclareTimer FTM_FLEXIBLE_UPDATE("Update Flexies"); +static LLFastTimerUtil::DeclareTimer FTM_FLEXIBLE_UPDATE("Update Flexies"); BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { if (mVO->mDrawable.isNull()) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 41f4d1a663..26cf88a840 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -295,7 +295,7 @@ void LLFolderView::checkTreeResortForModelChanged() } } -static LLFastTimer::DeclareTimer FTM_SORT("Sort Inventory"); +static LLFastTimerUtil::DeclareTimer FTM_SORT("Sort Inventory"); void LLFolderView::setSortOrder(U32 order) { @@ -377,7 +377,7 @@ void LLFolderView::setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse mIsOpen = TRUE; } -static LLFastTimer::DeclareTimer FTM_ARRANGE("Arrange"); +static LLFastTimerUtil::DeclareTimer FTM_ARRANGE("Arrange"); // This view grows and shinks to enclose all of its children items and folders. S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_generation ) @@ -477,7 +477,7 @@ const std::string LLFolderView::getFilterSubString(BOOL trim) return mFilter->getFilterSubString(trim); } -static LLFastTimer::DeclareTimer FTM_FILTER("Filter Inventory"); +static LLFastTimerUtil::DeclareTimer FTM_FILTER("Filter Inventory"); void LLFolderView::filter( LLInventoryFilter& filter ) { @@ -2056,8 +2056,8 @@ bool LLFolderView::doToSelected(LLInventoryModel* model, const LLSD& userdata) return true; } -static LLFastTimer::DeclareTimer FTM_AUTO_SELECT("Open and Select"); -static LLFastTimer::DeclareTimer FTM_INVENTORY("Inventory"); +static LLFastTimerUtil::DeclareTimer FTM_AUTO_SELECT("Open and Select"); +static LLFastTimerUtil::DeclareTimer FTM_INVENTORY("Inventory"); // Main idle routine void LLFolderView::doIdle() diff --git a/indra/newview/llhudmanager.cpp b/indra/newview/llhudmanager.cpp index bdb8dadfb4..8251c2ad8d 100644 --- a/indra/newview/llhudmanager.cpp +++ b/indra/newview/llhudmanager.cpp @@ -62,7 +62,7 @@ LLHUDManager::~LLHUDManager() { } -static LLFastTimer::DeclareTimer FTM_HUD_EFFECTS("Hud Effects"); +static LLFastTimerUtil::DeclareTimer FTM_HUD_EFFECTS("Hud Effects"); void LLHUDManager::updateEffects() { diff --git a/indra/newview/llhudobject.cpp b/indra/newview/llhudobject.cpp index dc55aba0db..4008719bd4 100644 --- a/indra/newview/llhudobject.cpp +++ b/indra/newview/llhudobject.cpp @@ -254,7 +254,7 @@ LLHUDEffect *LLHUDObject::addHUDEffect(const U8 type) return hud_objectp; } -static LLFastTimer::DeclareTimer FTM_HUD_UPDATE("Update Hud"); +static LLFastTimerUtil::DeclareTimer FTM_HUD_UPDATE("Update Hud"); // static void LLHUDObject::updateAll() diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 498a29728c..eb2dc630b0 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -258,7 +258,7 @@ LLInventoryFilter::EFolderShow LLInventoryPanel::getShowFolderState() void LLInventoryPanel::modelChanged(U32 mask) { - static LLFastTimer::DeclareTimer FTM_REFRESH("Inventory Refresh"); + static LLFastTimerUtil::DeclareTimer FTM_REFRESH("Inventory Refresh"); LLFastTimer t2(FTM_REFRESH); bool handled = false; diff --git a/indra/newview/llmetricperformancetester.cpp b/indra/newview/llmetricperformancetester.cpp index 93288c98d7..f3cdafa795 100644 --- a/indra/newview/llmetricperformancetester.cpp +++ b/indra/newview/llmetricperformancetester.cpp @@ -131,8 +131,8 @@ void LLMetricPerformanceTester::preOutputTestResults(LLSD* sd) } void LLMetricPerformanceTester::postOutputTestResults(LLSD* sd) { - LLMutexLock lock(LLFastTimer::sLogLock); - LLFastTimer::sLogQueue.push((*sd)); + LLMutexLock lock(LLFastTimerUtil::sLogLock); + LLFastTimerUtil::sLogQueue.push((*sd)); } void LLMetricPerformanceTester::outputTestResults() diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 6ca6734598..d33578ba1c 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -49,8 +49,8 @@ #include "llvoavatar.h" #include "lltextureatlas.h" -static LLFastTimer::DeclareTimer FTM_FRUSTUM_CULL("Frustum Culling"); -static LLFastTimer::DeclareTimer FTM_CULL_REBOUND("Cull Rebound"); +static LLFastTimerUtil::DeclareTimer FTM_FRUSTUM_CULL("Frustum Culling"); +static LLFastTimerUtil::DeclareTimer FTM_CULL_REBOUND("Cull Rebound"); const F32 SG_OCCLUSION_FUDGE = 0.25f; #define SG_DISCARD_TOLERANCE 0.01f @@ -641,7 +641,7 @@ void LLSpatialGroup::rebuildMesh() } } -static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); +static LLFastTimerUtil::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); void LLSpatialPartition::rebuildGeom(LLSpatialGroup* group) { @@ -1508,7 +1508,7 @@ BOOL LLSpatialGroup::rebound() return TRUE; } -static LLFastTimer::DeclareTimer FTM_OCCLUSION_READBACK("Readback Occlusion"); +static LLFastTimerUtil::DeclareTimer FTM_OCCLUSION_READBACK("Readback Occlusion"); void LLSpatialGroup::checkOcclusion() { if (LLPipeline::sUseOcclusion > 1) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 99fa271b78..2c456d7df0 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2087,7 +2087,7 @@ bool idle_startup() LLAppViewer::instance()->handleLoginComplete(); // reset timers now that we are running "logged in" logic - LLFastTimer::reset(); + LLFastTimerUtil::reset(); LLAgentPicksInfo::getInstance()->requestNumberOfPicks(); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 3dac0ee452..352de5be7e 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -212,11 +212,11 @@ void display_stats() } } -static LLFastTimer::DeclareTimer FTM_PICK("Picking"); -static LLFastTimer::DeclareTimer FTM_RENDER("Render", true); -static LLFastTimer::DeclareTimer FTM_UPDATE_SKY("Update Sky"); -static LLFastTimer::DeclareTimer FTM_UPDATE_TEXTURES("Update Textures"); -static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE("Update Images"); +static LLFastTimerUtil::DeclareTimer FTM_PICK("Picking"); +static LLFastTimerUtil::DeclareTimer FTM_RENDER("Render", true); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_SKY("Update Sky"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_TEXTURES("Update Textures"); +static LLFastTimerUtil::DeclareTimer FTM_IMAGE_UPDATE("Update Images"); // Paint the display! void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) @@ -1098,7 +1098,7 @@ BOOL setup_hud_matrices(const LLRect& screen_region) return TRUE; } -static LLFastTimer::DeclareTimer FTM_SWAP("Swap"); +static LLFastTimerUtil::DeclareTimer FTM_SWAP("Swap"); void render_ui(F32 zoom_factor, int subfield) { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1bff04352c..ff0d4c511a 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6841,7 +6841,7 @@ void handle_dump_avatar_local_textures(void*) void handle_dump_timers() { - LLFastTimer::dumpCurTimes(); + LLFastTimerUtil::dumpCurTimes(); } void handle_debug_avatar_textures(void*) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3362142807..594c910d1b 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3485,7 +3485,7 @@ void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_ gObjectList.processCompressedObjectUpdate(mesgsys, user_data, OUT_TERSE_IMPROVED); } -static LLFastTimer::DeclareTimer FTM_PROCESS_OBJECTS("Process Objects"); +static LLFastTimerUtil::DeclareTimer FTM_PROCESS_OBJECTS("Process Objects"); void process_kill_object(LLMessageSystem *mesgsys, void **user_data) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 3c79045cc5..4479b991c7 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -117,7 +117,7 @@ S32 LLViewerObject::sAxisArrowLength(50); BOOL LLViewerObject::sPulseEnabled(FALSE); BOOL LLViewerObject::sUseSharedDrawables(FALSE); // TRUE -static LLFastTimer::DeclareTimer FTM_CREATE_OBJECT("Create Object"); +static LLFastTimerUtil::DeclareTimer FTM_CREATE_OBJECT("Create Object"); // static LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 96828ee1b6..71c42f1649 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -278,7 +278,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, } } -static LLFastTimer::DeclareTimer FTM_PROCESS_OBJECTS("Process Objects"); +static LLFastTimerUtil::DeclareTimer FTM_PROCESS_OBJECTS("Process Objects"); void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, void **user_data, @@ -1357,7 +1357,7 @@ LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLVi } -static LLFastTimer::DeclareTimer FTM_CREATE_OBJECT("Create Object"); +static LLFastTimerUtil::DeclareTimer FTM_CREATE_OBJECT("Create Object"); LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRegion *regionp, const LLUUID &uuid, const U32 local_id, const LLHost &sender) diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 841a7ccc5e..2454ccaa48 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -633,7 +633,7 @@ void LLViewerPartSim::shift(const LLVector3 &offset) } } -static LLFastTimer::DeclareTimer FTM_SIMULATE_PARTICLES("Simulate Particles"); +static LLFastTimerUtil::DeclareTimer FTM_SIMULATE_PARTICLES("Simulate Particles"); void LLViewerPartSim::updateSimulation() { diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index f825eaa8ab..0997359de1 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -305,7 +305,7 @@ void LLViewerTextureManager::init() LLViewerTexture::initClass() ; - if(LLFastTimer::sMetricLog) + if(LLFastTimerUtil::sMetricLog) { LLViewerTextureManager::sTesterp = new LLTexturePipelineTester() ; } diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 8252b7df00..a5b2bfb781 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -80,7 +80,7 @@ LLStat LLViewerTextureList::sRawMemStat(32, TRUE); LLStat LLViewerTextureList::sFormattedMemStat(32, TRUE); LLViewerTextureList gTextureList; -static LLFastTimer::DeclareTimer FTM_PROCESS_IMAGES("Process Images"); +static LLFastTimerUtil::DeclareTimer FTM_PROCESS_IMAGES("Process Images"); /////////////////////////////////////////////////////////////////////////////// @@ -570,7 +570,7 @@ void LLViewerTextureList::dirtyImage(LLViewerFetchedTexture *image) } //////////////////////////////////////////////////////////////////////////// -static LLFastTimer::DeclareTimer FTM_IMAGE_MARK_DIRTY("Dirty Images"); +static LLFastTimerUtil::DeclareTimer FTM_IMAGE_MARK_DIRTY("Dirty Images"); void LLViewerTextureList::updateImages(F32 max_time) { @@ -735,7 +735,7 @@ void LLViewerTextureList::updateImagesDecodePriorities() return type_from_host; } */ -static LLFastTimer::DeclareTimer FTM_IMAGE_CREATE("Create Images"); +static LLFastTimerUtil::DeclareTimer FTM_IMAGE_CREATE("Create Images"); F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time) { diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 83cbc8a1f9..d2827ee537 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2844,7 +2844,7 @@ void LLViewerWindow::updateKeyboardFocus() LLSideTray::getInstance()->highlightFocused(); } -static LLFastTimer::DeclareTimer FTM_UPDATE_WORLD_VIEW("Update World View"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_WORLD_VIEW("Update World View"); void LLViewerWindow::updateWorldViewRect(bool use_full_window) { LLFastTimer ft(FTM_UPDATE_WORLD_VIEW); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6e93bf1bf2..7e73bf4133 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2110,8 +2110,8 @@ S32 LLVOAvatar::setTETexture(const U8 te, const LLUUID& uuid) } } -static LLFastTimer::DeclareTimer FTM_AVATAR_UPDATE("Update Avatar"); -static LLFastTimer::DeclareTimer FTM_JOINT_UPDATE("Update Joints"); +static LLFastTimerUtil::DeclareTimer FTM_AVATAR_UPDATE("Update Avatar"); +static LLFastTimerUtil::DeclareTimer FTM_JOINT_UPDATE("Update Joints"); //------------------------------------------------------------------------ // idleUpdate() @@ -2304,7 +2304,7 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled) }//if ( voiceEnabled ) } -static LLFastTimer::DeclareTimer FTM_ATTACHMENT_UPDATE("Update Attachments"); +static LLFastTimerUtil::DeclareTimer FTM_ATTACHMENT_UPDATE("Update Attachments"); void LLVOAvatar::idleUpdateMisc(bool detailed_update) { @@ -4675,7 +4675,7 @@ void LLVOAvatar::requestStopMotion( LLMotion* motion ) //----------------------------------------------------------------------------- // loadAvatar() //----------------------------------------------------------------------------- -static LLFastTimer::DeclareTimer FTM_LOAD_AVATAR("Load Avatar"); +static LLFastTimerUtil::DeclareTimer FTM_LOAD_AVATAR("Load Avatar"); BOOL LLVOAvatar::loadAvatar() { @@ -5263,7 +5263,7 @@ void LLVOAvatar::updateGL() //----------------------------------------------------------------------------- // updateGeometry() //----------------------------------------------------------------------------- -static LLFastTimer::DeclareTimer FTM_UPDATE_AVATAR("Update Avatar"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_AVATAR("Update Avatar"); BOOL LLVOAvatar::updateGeometry(LLDrawable *drawable) { LLFastTimer ftm(FTM_UPDATE_AVATAR); diff --git a/indra/newview/llvoclouds.cpp b/indra/newview/llvoclouds.cpp index 177cb16c50..5d01163e08 100644 --- a/indra/newview/llvoclouds.cpp +++ b/indra/newview/llvoclouds.cpp @@ -115,7 +115,7 @@ LLDrawable* LLVOClouds::createDrawable(LLPipeline *pipeline) return mDrawable; } -static LLFastTimer::DeclareTimer FTM_UPDATE_CLOUDS("Update Clouds"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_CLOUDS("Update Clouds"); BOOL LLVOClouds::updateGeometry(LLDrawable *drawable) { diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index e311f07912..9b0be69a7e 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -382,7 +382,7 @@ LLDrawable* LLVOGrass::createDrawable(LLPipeline *pipeline) return mDrawable; } -static LLFastTimer::DeclareTimer FTM_UPDATE_GRASS("Update Grass"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_GRASS("Update Grass"); BOOL LLVOGrass::updateGeometry(LLDrawable *drawable) { diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 139d2fbd88..ac6030ccae 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -139,7 +139,7 @@ LLVector3 LLVOPartGroup::getCameraPosition() const return gAgent.getCameraPositionAgent(); } -static LLFastTimer::DeclareTimer FTM_UPDATE_PARTICLES("Update Particles"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_PARTICLES("Update Particles"); BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) { LLFastTimer ftm(FTM_UPDATE_PARTICLES); @@ -428,8 +428,8 @@ void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_co } } -static LLFastTimer::DeclareTimer FTM_REBUILD_GRASS_VB("Grass VB"); -static LLFastTimer::DeclareTimer FTM_REBUILD_PARTICLE_VB("Particle VB"); +static LLFastTimerUtil::DeclareTimer FTM_REBUILD_GRASS_VB("Grass VB"); +static LLFastTimerUtil::DeclareTimer FTM_REBUILD_PARTICLE_VB("Particle VB"); void LLParticlePartition::getGeometry(LLSpatialGroup* group) { diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 5ff8f0d267..a489142cf9 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -1231,7 +1231,7 @@ void LLVOSky::createDummyVertexBuffer() } } -static LLFastTimer::DeclareTimer FTM_RENDER_FAKE_VBO_UPDATE("Fake VBO Update"); +static LLFastTimerUtil::DeclareTimer FTM_RENDER_FAKE_VBO_UPDATE("Fake VBO Update"); void LLVOSky::updateDummyVertexBuffer() { @@ -1257,7 +1257,7 @@ void LLVOSky::updateDummyVertexBuffer() //---------------------------------- //end of fake vertex buffer updating //---------------------------------- -static LLFastTimer::DeclareTimer FTM_GEO_SKY("Sky Geometry"); +static LLFastTimerUtil::DeclareTimer FTM_GEO_SKY("Sky Geometry"); BOOL LLVOSky::updateGeometry(LLDrawable *drawable) { diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp index ef7b161003..52ed8328b8 100644 --- a/indra/newview/llvosurfacepatch.cpp +++ b/indra/newview/llvosurfacepatch.cpp @@ -176,7 +176,7 @@ LLDrawable *LLVOSurfacePatch::createDrawable(LLPipeline *pipeline) return mDrawable; } -static LLFastTimer::DeclareTimer FTM_UPDATE_TERRAIN("Update Terrain"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_TERRAIN("Update Terrain"); void LLVOSurfacePatch::updateGL() { @@ -1035,7 +1035,7 @@ LLVertexBuffer* LLTerrainPartition::createVertexBuffer(U32 type_mask, U32 usage) return new LLVertexBufferTerrain(); } -static LLFastTimer::DeclareTimer FTM_REBUILD_TERRAIN_VB("Terrain VB"); +static LLFastTimerUtil::DeclareTimer FTM_REBUILD_TERRAIN_VB("Terrain VB"); void LLTerrainPartition::getGeometry(LLSpatialGroup* group) { LLFastTimer ftm(FTM_REBUILD_TERRAIN_VB); diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 24f1c4bd24..98e12ad6ea 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -500,7 +500,7 @@ LLDrawable* LLVOTree::createDrawable(LLPipeline *pipeline) const S32 LEAF_INDICES = 24; const S32 LEAF_VERTICES = 16; -static LLFastTimer::DeclareTimer FTM_UPDATE_TREE("Update Tree"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_TREE("Update Tree"); BOOL LLVOTree::updateGeometry(LLDrawable *drawable) { diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 55609621b3..6973633581 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -86,8 +86,8 @@ S32 LLVOVolume::sNumLODChanges = 0; LLPointer LLVOVolume::sObjectMediaClient = NULL; LLPointer LLVOVolume::sObjectMediaNavigateClient = NULL; -static LLFastTimer::DeclareTimer FTM_GEN_TRIANGLES("Generate Triangles"); -static LLFastTimer::DeclareTimer FTM_GEN_VOLUME("Generate Volumes"); +static LLFastTimerUtil::DeclareTimer FTM_GEN_TRIANGLES("Generate Triangles"); +static LLFastTimerUtil::DeclareTimer FTM_GEN_VOLUME("Generate Volumes"); // Implementation class of LLMediaDataClientObject. See llmediadataclient.h class LLMediaDataClientObjectImpl : public LLMediaDataClientObject @@ -1339,8 +1339,8 @@ void LLVOVolume::updateRelativeXform() } } -static LLFastTimer::DeclareTimer FTM_GEN_FLEX("Generate Flexies"); -static LLFastTimer::DeclareTimer FTM_UPDATE_PRIMITIVES("Update Primitives"); +static LLFastTimerUtil::DeclareTimer FTM_GEN_FLEX("Generate Flexies"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_PRIMITIVES("Update Primitives"); BOOL LLVOVolume::updateGeometry(LLDrawable *drawable) { @@ -3190,8 +3190,8 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) } -static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); -static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); +static LLFastTimerUtil::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); +static LLFastTimerUtil::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { @@ -3423,7 +3423,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) mFaceList.clear(); } -static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry"); +static LLFastTimerUtil::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry"); void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) { llpushcallstacks ; diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index a8c4625f6e..86cdde3f2e 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -136,7 +136,7 @@ LLDrawable *LLVOWater::createDrawable(LLPipeline *pipeline) return mDrawable; } -static LLFastTimer::DeclareTimer FTM_UPDATE_WATER("Update Water"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_WATER("Update Water"); BOOL LLVOWater::updateGeometry(LLDrawable *drawable) { diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp index d3238f16a8..77b07e0ccf 100644 --- a/indra/newview/llvowlsky.cpp +++ b/indra/newview/llvowlsky.cpp @@ -307,7 +307,7 @@ void LLVOWLSky::restoreGL() gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); } -static LLFastTimer::DeclareTimer FTM_GEO_SKY("Sky Geometry"); +static LLFastTimerUtil::DeclareTimer FTM_GEO_SKY("Sky Geometry"); BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable) { diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp index 8be8f494da..5d03596a44 100644 --- a/indra/newview/llwaterparammanager.cpp +++ b/indra/newview/llwaterparammanager.cpp @@ -261,7 +261,7 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader) } } -static LLFastTimer::DeclareTimer FTM_UPDATE_WLPARAM("Update Windlight Params"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_WLPARAM("Update Windlight Params"); void LLWaterParamManager::update(LLViewerCamera * cam) { diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp index 7cac564619..9a0b2dfba8 100644 --- a/indra/newview/llwlparammanager.cpp +++ b/indra/newview/llwlparammanager.cpp @@ -58,7 +58,7 @@ #include "curl/curl.h" LLWLParamManager * LLWLParamManager::sInstance = NULL; -static LLFastTimer::DeclareTimer FTM_UPDATE_WLPARAM("Update Windlight Params"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_WLPARAM("Update Windlight Params"); LLWLParamManager::LLWLParamManager() : diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 4f4fc83819..f361767f68 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -140,34 +140,34 @@ BOOL gDebugPipeline = FALSE; LLPipeline gPipeline; const LLMatrix4* gGLLastMatrix = NULL; -LLFastTimer::DeclareTimer FTM_RENDER_GEOMETRY("Geometry"); -LLFastTimer::DeclareTimer FTM_RENDER_GRASS("Grass"); -LLFastTimer::DeclareTimer FTM_RENDER_INVISIBLE("Invisible"); -LLFastTimer::DeclareTimer FTM_RENDER_OCCLUSION("Occlusion"); -LLFastTimer::DeclareTimer FTM_RENDER_SHINY("Shiny"); -LLFastTimer::DeclareTimer FTM_RENDER_SIMPLE("Simple"); -LLFastTimer::DeclareTimer FTM_RENDER_TERRAIN("Terrain"); -LLFastTimer::DeclareTimer FTM_RENDER_TREES("Trees"); -LLFastTimer::DeclareTimer FTM_RENDER_UI("UI"); -LLFastTimer::DeclareTimer FTM_RENDER_WATER("Water"); -LLFastTimer::DeclareTimer FTM_RENDER_WL_SKY("Windlight Sky"); -LLFastTimer::DeclareTimer FTM_RENDER_ALPHA("Alpha Objects"); -LLFastTimer::DeclareTimer FTM_RENDER_CHARACTERS("Avatars"); -LLFastTimer::DeclareTimer FTM_RENDER_BUMP("Bump"); -LLFastTimer::DeclareTimer FTM_RENDER_FULLBRIGHT("Fullbright"); -LLFastTimer::DeclareTimer FTM_RENDER_GLOW("Glow"); -LLFastTimer::DeclareTimer FTM_GEO_UPDATE("Geo Update"); -LLFastTimer::DeclareTimer FTM_POOLRENDER("RenderPool"); -LLFastTimer::DeclareTimer FTM_POOLS("Pools"); -LLFastTimer::DeclareTimer FTM_RENDER_BLOOM_FBO("First FBO"); -LLFastTimer::DeclareTimer FTM_STATESORT("Sort Draw State"); -LLFastTimer::DeclareTimer FTM_PIPELINE("Pipeline"); -LLFastTimer::DeclareTimer FTM_CLIENT_COPY("Client Copy"); -LLFastTimer::DeclareTimer FTM_RENDER_DEFERRED("Deferred Shading"); - - -static LLFastTimer::DeclareTimer FTM_STATESORT_DRAWABLE("Sort Drawables"); -static LLFastTimer::DeclareTimer FTM_STATESORT_POSTSORT("Post Sort"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_GEOMETRY("Geometry"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_GRASS("Grass"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_INVISIBLE("Invisible"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_OCCLUSION("Occlusion"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_SHINY("Shiny"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_SIMPLE("Simple"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_TERRAIN("Terrain"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_TREES("Trees"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_UI("UI"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_WATER("Water"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_WL_SKY("Windlight Sky"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_ALPHA("Alpha Objects"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_CHARACTERS("Avatars"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_BUMP("Bump"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_FULLBRIGHT("Fullbright"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_GLOW("Glow"); +LLFastTimerUtil::DeclareTimer FTM_GEO_UPDATE("Geo Update"); +LLFastTimerUtil::DeclareTimer FTM_POOLRENDER("RenderPool"); +LLFastTimerUtil::DeclareTimer FTM_POOLS("Pools"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_BLOOM_FBO("First FBO"); +LLFastTimerUtil::DeclareTimer FTM_STATESORT("Sort Draw State"); +LLFastTimerUtil::DeclareTimer FTM_PIPELINE("Pipeline"); +LLFastTimerUtil::DeclareTimer FTM_CLIENT_COPY("Client Copy"); +LLFastTimerUtil::DeclareTimer FTM_RENDER_DEFERRED("Deferred Shading"); + + +static LLFastTimerUtil::DeclareTimer FTM_STATESORT_DRAWABLE("Sort Drawables"); +static LLFastTimerUtil::DeclareTimer FTM_STATESORT_POSTSORT("Post Sort"); //---------------------------------------- std::string gPoolNames[] = @@ -508,7 +508,7 @@ void LLPipeline::destroyGL() } } -static LLFastTimer::DeclareTimer FTM_RESIZE_SCREEN_TEXTURE("Resize Screen Texture"); +static LLFastTimerUtil::DeclareTimer FTM_RESIZE_SCREEN_TEXTURE("Resize Screen Texture"); void LLPipeline::resizeScreenTexture() { LLFastTimer ft(FTM_RESIZE_SCREEN_TEXTURE); @@ -1396,8 +1396,8 @@ void LLPipeline::updateMovedList(LLDrawable::drawable_vector_t& moved_list) } } -static LLFastTimer::DeclareTimer FTM_OCTREE_BALANCE("Balance Octree"); -static LLFastTimer::DeclareTimer FTM_UPDATE_MOVE("Update Move"); +static LLFastTimerUtil::DeclareTimer FTM_OCTREE_BALANCE("Balance Octree"); +static LLFastTimerUtil::DeclareTimer FTM_UPDATE_MOVE("Update Move"); void LLPipeline::updateMove() { @@ -1557,7 +1557,7 @@ BOOL LLPipeline::getVisibleExtents(LLCamera& camera, LLVector3& min, LLVector3& return res; } -static LLFastTimer::DeclareTimer FTM_CULL("Object Culling"); +static LLFastTimerUtil::DeclareTimer FTM_CULL("Object Culling"); void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_clip) { @@ -2188,7 +2188,7 @@ void LLPipeline::markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags f } } -static LLFastTimer::DeclareTimer FTM_RESET_DRAWORDER("Reset Draw Order"); +static LLFastTimerUtil::DeclareTimer FTM_RESET_DRAWORDER("Reset Draw Order"); void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) { @@ -5519,7 +5519,7 @@ void LLPipeline::bindScreenToTexture() } -static LLFastTimer::DeclareTimer FTM_RENDER_BLOOM("Bloom"); +static LLFastTimerUtil::DeclareTimer FTM_RENDER_BLOOM("Bloom"); void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) { LLMemType mt_ru(LLMemType::MTYPE_PIPELINE_RENDER_BLOOM); @@ -6227,16 +6227,16 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, U32 light_index, LLRen } } -static LLFastTimer::DeclareTimer FTM_GI_TRACE("Trace"); -static LLFastTimer::DeclareTimer FTM_GI_GATHER("Gather"); -static LLFastTimer::DeclareTimer FTM_SUN_SHADOW("Shadow Map"); -static LLFastTimer::DeclareTimer FTM_SOFTEN_SHADOW("Shadow Soften"); -static LLFastTimer::DeclareTimer FTM_EDGE_DETECTION("Find Edges"); -static LLFastTimer::DeclareTimer FTM_LOCAL_LIGHTS("Local Lights"); -static LLFastTimer::DeclareTimer FTM_ATMOSPHERICS("Atmospherics"); -static LLFastTimer::DeclareTimer FTM_FULLSCREEN_LIGHTS("Fullscreen Lights"); -static LLFastTimer::DeclareTimer FTM_PROJECTORS("Projectors"); -static LLFastTimer::DeclareTimer FTM_POST("Post"); +static LLFastTimerUtil::DeclareTimer FTM_GI_TRACE("Trace"); +static LLFastTimerUtil::DeclareTimer FTM_GI_GATHER("Gather"); +static LLFastTimerUtil::DeclareTimer FTM_SUN_SHADOW("Shadow Map"); +static LLFastTimerUtil::DeclareTimer FTM_SOFTEN_SHADOW("Shadow Soften"); +static LLFastTimerUtil::DeclareTimer FTM_EDGE_DETECTION("Find Edges"); +static LLFastTimerUtil::DeclareTimer FTM_LOCAL_LIGHTS("Local Lights"); +static LLFastTimerUtil::DeclareTimer FTM_ATMOSPHERICS("Atmospherics"); +static LLFastTimerUtil::DeclareTimer FTM_FULLSCREEN_LIGHTS("Fullscreen Lights"); +static LLFastTimerUtil::DeclareTimer FTM_PROJECTORS("Projectors"); +static LLFastTimerUtil::DeclareTimer FTM_POST("Post"); void LLPipeline::renderDeferredLighting() @@ -7433,9 +7433,9 @@ glh::matrix4f scale_translate_to_fit(const LLVector3 min, const LLVector3 max) return ret; } -static LLFastTimer::DeclareTimer FTM_SHADOW_RENDER("Render Shadows"); -static LLFastTimer::DeclareTimer FTM_SHADOW_ALPHA("Alpha Shadow"); -static LLFastTimer::DeclareTimer FTM_SHADOW_SIMPLE("Simple Shadow"); +static LLFastTimerUtil::DeclareTimer FTM_SHADOW_RENDER("Render Shadows"); +static LLFastTimerUtil::DeclareTimer FTM_SHADOW_ALPHA("Alpha Shadow"); +static LLFastTimerUtil::DeclareTimer FTM_SHADOW_SIMPLE("Simple Shadow"); void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera& shadow_cam, LLCullResult &result, BOOL use_shader, BOOL use_occlusion) { diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 67004a5f2d..13b6270bd6 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -78,25 +78,25 @@ glh::matrix4f gl_ortho(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, glh::matrix4f gl_perspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar); glh::matrix4f gl_lookat(LLVector3 eye, LLVector3 center, LLVector3 up); -extern LLFastTimer::DeclareTimer FTM_RENDER_GEOMETRY; -extern LLFastTimer::DeclareTimer FTM_RENDER_GRASS; -extern LLFastTimer::DeclareTimer FTM_RENDER_INVISIBLE; -extern LLFastTimer::DeclareTimer FTM_RENDER_OCCLUSION; -extern LLFastTimer::DeclareTimer FTM_RENDER_SHINY; -extern LLFastTimer::DeclareTimer FTM_RENDER_SIMPLE; -extern LLFastTimer::DeclareTimer FTM_RENDER_TERRAIN; -extern LLFastTimer::DeclareTimer FTM_RENDER_TREES; -extern LLFastTimer::DeclareTimer FTM_RENDER_UI; -extern LLFastTimer::DeclareTimer FTM_RENDER_WATER; -extern LLFastTimer::DeclareTimer FTM_RENDER_WL_SKY; -extern LLFastTimer::DeclareTimer FTM_RENDER_ALPHA; -extern LLFastTimer::DeclareTimer FTM_RENDER_CHARACTERS; -extern LLFastTimer::DeclareTimer FTM_RENDER_BUMP; -extern LLFastTimer::DeclareTimer FTM_RENDER_FULLBRIGHT; -extern LLFastTimer::DeclareTimer FTM_RENDER_GLOW; -extern LLFastTimer::DeclareTimer FTM_STATESORT; -extern LLFastTimer::DeclareTimer FTM_PIPELINE; -extern LLFastTimer::DeclareTimer FTM_CLIENT_COPY; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_GEOMETRY; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_GRASS; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_INVISIBLE; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_OCCLUSION; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_SHINY; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_SIMPLE; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_TERRAIN; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_TREES; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_UI; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_WATER; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_WL_SKY; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_ALPHA; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_CHARACTERS; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_BUMP; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_FULLBRIGHT; +extern LLFastTimerUtil::DeclareTimer FTM_RENDER_GLOW; +extern LLFastTimerUtil::DeclareTimer FTM_STATESORT; +extern LLFastTimerUtil::DeclareTimer FTM_PIPELINE; +extern LLFastTimerUtil::DeclareTimer FTM_CLIENT_COPY; class LLPipeline -- cgit v1.2.3 From 9ffaacc47e8d6d48158adb1b99728c876a6da2ee Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 8 Jan 2010 17:26:47 -0800 Subject: First pass expose inventory item settings in XML (folder_view_item.xml) Optimized LLFolderViewItem constructor by passing param block as const ref to avoid copies. Removed per-item arrow and background images, use defaults. Removed unneeded static image pointers. Removed hard-coded rounded_square.tga, replaced with Rounded_Square Ditto for folder_arrow.tga Reviewed with Richard. --- indra/llui/llconsole.cpp | 2 +- indra/llui/llmultislider.cpp | 2 +- indra/llui/llscrolllistcell.cpp | 2 +- indra/newview/app_settings/settings.xml | 11 ---- indra/newview/llfasttimerview.cpp | 2 +- indra/newview/llfolderview.cpp | 10 +-- indra/newview/llfolderviewitem.cpp | 73 +++++++++++----------- indra/newview/llfolderviewitem.h | 14 ++--- indra/newview/llhudtext.cpp | 2 +- indra/newview/llmanip.cpp | 2 +- indra/newview/skins/default/textures/textures.xml | 3 +- .../default/xui/en/panel_preferences_graphics1.xml | 8 +-- .../skins/default/xui/en/panel_progress.xml | 2 +- .../default/xui/en/widgets/folder_view_item.xml | 8 +++ 14 files changed, 71 insertions(+), 70 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/widgets/folder_view_item.xml diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index e08d93b232..59499f987b 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -180,7 +180,7 @@ void LLConsole::draw() // draw remaining lines F32 y_pos = 0.f; - LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga"); + LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square"); // F32 console_opacity = llclamp(gSavedSettings.getF32("ConsoleBackgroundOpacity"), 0.f, 1.f); F32 console_opacity = llclamp(LLUI::sSettingGroups["config"]->getF32("ConsoleBackgroundOpacity"), 0.f, 1.f); diff --git a/indra/llui/llmultislider.cpp b/indra/llui/llmultislider.cpp index aea7c5f87c..27a727fdf5 100644 --- a/indra/llui/llmultislider.cpp +++ b/indra/llui/llmultislider.cpp @@ -490,7 +490,7 @@ void LLMultiSlider::draw() F32 opacity = getEnabled() ? 1.f : 0.3f; // Track - LLUIImagePtr thumb_imagep = LLUI::getUIImage("rounded_square.tga"); + LLUIImagePtr thumb_imagep = LLUI::getUIImage("Rounded_Square"); static LLUICachedControl multi_track_height ("UIMultiTrackHeight", 0); S32 height_offset = (getRect().getHeight() - multi_track_height) / 2; diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp index 7238d903a3..3cc92baa8d 100644 --- a/indra/llui/llscrolllistcell.cpp +++ b/indra/llui/llscrolllistcell.cpp @@ -188,7 +188,7 @@ LLScrollListText::LLScrollListText(const LLScrollListCell::Params& p) // initialize rounded rect image if (!mRoundedRectImage) { - mRoundedRectImage = LLUI::getUIImage("rounded_square.tga"); + mRoundedRectImage = LLUI::getUIImage("Rounded_Square"); } } diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7d98a4b6ce..382793a497 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3257,17 +3257,6 @@ Value 0.75 - FolderIndentation - - Comment - Number of pixels to indent subfolders in inventory - Persist - 1 - Type - S32 - Value - 8 - FolderLoadingMessageWaitTime Comment diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 7d8bb6e104..4fa97e789b 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -314,7 +314,7 @@ void LLFastTimerView::draw() S32 left, top, right, bottom; S32 x, y, barw, barh, dx, dy; S32 texth, textw; - LLPointer box_imagep = LLUI::getUIImage("rounded_square.tga"); + LLPointer box_imagep = LLUI::getUIImage("Rounded_Square"); // Draw the window background gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 41f4d1a663..1ab111a41d 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -206,7 +206,9 @@ LLFolderView::LLFolderView(const Params& p) mAutoOpenCandidate = NULL; mAutoOpenTimer.stop(); mKeyboardSelection = FALSE; - static LLUICachedControl indentation("FolderIndentation", 0); + const LLFolderViewItem::Params& item_params = + LLUICtrlFactory::getDefaultParams(); + S32 indentation = item_params.folder_indentation(); mIndentation = -indentation; // children start at indentation 0 gIdleCallbacks.addFunction(idle, this); @@ -395,7 +397,7 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen getRoot()->getFilter()->getShowFolderState(); S32 total_width = LEFT_PAD; - S32 running_height = mDebugFilters ? llceil(sSmallFont->getLineHeight()) : 0; + S32 running_height = mDebugFilters ? llceil(LLFontGL::getFontMonospace()->getLineHeight()) : 0; S32 target_height = running_height; S32 parent_item_height = getRect().getHeight(); @@ -866,8 +868,8 @@ void LLFolderView::draw() { std::string current_filter_string = llformat("Current Filter: %d, Least Filter: %d, Auto-accept Filter: %d", mFilter->getCurrentGeneration(), mFilter->getMinRequiredGeneration(), mFilter->getMustPassGeneration()); - sSmallFont->renderUTF8(current_filter_string, 0, 2, - getRect().getHeight() - sSmallFont->getLineHeight(), LLColor4(0.5f, 0.5f, 0.8f, 1.f), + LLFontGL::getFontMonospace()->renderUTF8(current_filter_string, 0, 2, + getRect().getHeight() - LLFontGL::getFontMonospace()->getLineHeight(), LLColor4(0.5f, 0.5f, 0.8f, 1.f), LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 9d54aafd67..41ceb5972e 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -51,11 +51,10 @@ /// Class LLFolderViewItem ///---------------------------------------------------------------------------- +static LLDefaultChildRegistry::Register r("folder_view_item"); + // statics std::map LLFolderViewItem::sFonts; // map of styles to fonts -const LLFontGL* LLFolderViewItem::sSmallFont = NULL; -LLUIImagePtr LLFolderViewItem::sArrowImage; -LLUIImagePtr LLFolderViewItem::sBoxImage; // only integers can be initialized in header const F32 LLFolderViewItem::FOLDER_CLOSE_TIME_CONSTANT = 0.02f; @@ -84,33 +83,34 @@ LLFontGL* LLFolderViewItem::getLabelFontForStyle(U8 style) //static void LLFolderViewItem::initClass() { - sSmallFont = LLFontGL::getFontMonospace(); - sArrowImage = LLUI::getUIImage("folder_arrow.tga"); - sBoxImage = LLUI::getUIImage("rounded_square.tga"); } //static void LLFolderViewItem::cleanupClass() { sFonts.clear(); - sArrowImage = NULL; - sBoxImage = NULL; } // NOTE: Optimize this, we call it a *lot* when opening a large inventory LLFolderViewItem::Params::Params() -: icon("icon"), - folder_arrow_image("folder_arrow_image", LLUI::getUIImage("folder_arrow.tga")), - selection_image("selection_image", LLUI::getUIImage("rounded_square.tga")) +: icon(), + icon_open(), + root(), + listener(), + folder_arrow_image("folder_arrow_image"), + folder_indentation("folder_indentation"), + selection_image("selection_image"), + font("font"), + item_height("item_height"), + creation_date() { mouse_opaque(true); follows.flags(FOLLOWS_LEFT|FOLLOWS_TOP|FOLLOWS_RIGHT); - // JAMESDEBUG tab_stop(false); } // Default constructor -LLFolderViewItem::LLFolderViewItem(LLFolderViewItem::Params p) +LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) : LLView(p), mLabelWidth(0), mLabelWidthDirty(false), @@ -121,6 +121,7 @@ LLFolderViewItem::LLFolderViewItem(LLFolderViewItem::Params p) mLabelStyle( LLFontGL::NORMAL ), mHasVisibleChildren(FALSE), mIndentation(0), + mItemHeight(p.item_height), mNumDescendantsSelected(0), mPassedFilter(FALSE), mLastFilterGeneration(-1), @@ -134,8 +135,6 @@ LLFolderViewItem::LLFolderViewItem(LLFolderViewItem::Params p) mIcon(p.icon), mIconOpen(p.icon_open), mListener(p.listener), - mArrowImage(p.folder_arrow_image), - mBoxImage(p.selection_image), mHidden(false), mShowLoadStatus(false) { @@ -392,10 +391,11 @@ BOOL LLFolderViewItem::addToFolder(LLFolderViewFolder* folder, LLFolderView* roo // makes sure that this view and it's children are the right size. S32 LLFolderViewItem::arrange( S32* width, S32* height, S32 filter_generation) { - static LLUICachedControl indentation("FolderIndentation", 0); + const Params& p = LLUICtrlFactory::getDefaultParams(); + S32 indentation = p.folder_indentation(); + // Only indent deeper items in hierarchy mIndentation = (getParentFolder() - && getParentFolder()->getParentFolder() - && getParentFolder()->getParentFolder()->getParentFolder()) + && getParentFolder()->getParentFolder() ) ? mParentFolder->getIndentation() + indentation : 0; if (mLabelWidthDirty) @@ -421,9 +421,10 @@ S32 LLFolderViewItem::getItemHeight() { if (mHidden) return 0; - S32 icon_height = mIcon->getHeight(); - S32 label_height = llround(getLabelFontForStyle(mLabelStyle)->getLineHeight()); - return llmax( icon_height, label_height ) + ICON_PAD; + //S32 icon_height = mIcon->getHeight(); + //S32 label_height = llround(getLabelFontForStyle(mLabelStyle)->getLineHeight()); + //return llmax( icon_height, label_height ) + ICON_PAD; + return mItemHeight; } void LLFolderViewItem::filter( LLInventoryFilter& filter) @@ -834,6 +835,8 @@ void LLFolderViewItem::draw() static LLUIColor sSuffixColor = LLUIColorTable::instance().getColor("InventoryItemSuffixColor", DEFAULT_WHITE); static LLUIColor sSearchStatusColor = LLUIColorTable::instance().getColor("InventorySearchStatusColor", DEFAULT_WHITE); + const Params& default_params = LLUICtrlFactory::getDefaultParams(); + bool possibly_has_children = false; bool up_to_date = mListener && mListener->isUpToDate(); if((up_to_date && hasVisibleChildren() ) || // we fetched our children and some of them have passed the filter... @@ -843,11 +846,9 @@ void LLFolderViewItem::draw() } if(/*mControlLabel[0] != '\0' && */possibly_has_children) { - if (sArrowImage) - { - gl_draw_scaled_rotated_image(mIndentation, getRect().getHeight() - ARROW_SIZE - TEXT_PAD, - ARROW_SIZE, ARROW_SIZE, mControlLabelRotation, sArrowImage->getImage(), sFgColor); - } + LLUIImage* arrow_image = default_params.folder_arrow_image; + gl_draw_scaled_rotated_image(mIndentation, getRect().getHeight() - ARROW_SIZE - TEXT_PAD, + ARROW_SIZE, ARROW_SIZE, mControlLabelRotation, arrow_image->getImage(), sFgColor); } F32 text_left = (F32)(ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + mIndentation); @@ -885,7 +886,7 @@ void LLFolderViewItem::draw() 0, getRect().getHeight(), getRect().getWidth() - 2, - llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD), + llfloor(getRect().getHeight() - mItemHeight), bg_color, filled); if (mIsCurSelection) { @@ -893,14 +894,14 @@ void LLFolderViewItem::draw() 0, getRect().getHeight(), getRect().getWidth() - 2, - llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD), + llfloor(getRect().getHeight() - mItemHeight), sHighlightFgColor, FALSE); } - if (getRect().getHeight() > llround(font->getLineHeight()) + ICON_PAD + 4) + if (getRect().getHeight() > mItemHeight + 4) { gl_rect_2d( 0, - llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD) - 4, + llfloor(getRect().getHeight() - mItemHeight) - 4, getRect().getWidth() - 2, 2, sHighlightFgColor, FALSE); @@ -908,7 +909,7 @@ void LLFolderViewItem::draw() { gl_rect_2d( 0, - llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD) - 4, + llfloor(getRect().getHeight() - mItemHeight) - 4, getRect().getWidth() - 2, 2, sHighlightBgColor, TRUE); @@ -963,7 +964,8 @@ void LLFolderViewItem::draw() } LLColor4 filter_color = mLastFilterGeneration >= getRoot()->getFilter()->getCurrentGeneration() ? LLColor4(0.5f, 0.8f, 0.5f, 1.f) : LLColor4(0.8f, 0.5f, 0.5f, 1.f); - sSmallFont->renderUTF8(mStatusText, 0, text_left, y, filter_color, + LLFontGL::getFontMonospace()->renderUTF8( + mStatusText, 0, text_left, y, filter_color, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, &right_x, FALSE ); text_left = right_x; @@ -1004,7 +1006,7 @@ void LLFolderViewItem::draw() S32_MAX, S32_MAX, &right_x, FALSE ); } - if (sBoxImage.notNull() && mStringMatchOffset != std::string::npos) + if (mStringMatchOffset != std::string::npos) { // don't draw backgrounds for zero-length strings S32 filter_string_length = getRoot()->getFilterSubString().size(); @@ -1015,9 +1017,10 @@ void LLFolderViewItem::draw() S32 right = left + font->getWidth(combined_string, mStringMatchOffset, filter_string_length) + 2; S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3); S32 top = getRect().getHeight(); - + + LLUIImage* box_image = default_params.selection_image; LLRect box_rect(left, top, right, bottom); - sBoxImage->draw(box_rect, sFilterBGColor); + box_image->draw(box_rect, sFilterBGColor); F32 match_string_left = text_left + font->getWidthF32(combined_string, 0, mStringMatchOffset); F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD; font->renderUTF8( combined_string, mStringMatchOffset, match_string_left, y, diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index 6f8c738a59..9e35f75c96 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -101,7 +101,10 @@ public: Optional listener; Optional folder_arrow_image; + Optional folder_indentation; // pixels Optional selection_image; + Optional font; + Optional item_height; // pixels Optional creation_date; //UTC seconds @@ -110,7 +113,7 @@ public: // layout constants static const S32 LEFT_PAD = 5; - // LEFT_INDENTATION is set via settings.xml FolderIndentation + // LEFT_INDENTATION is set via folder_indentation above static const S32 ICON_PAD = 2; static const S32 ICON_WIDTH = 16; static const S32 TEXT_PAD = 1; @@ -127,11 +130,7 @@ protected: friend class LLUICtrlFactory; friend class LLFolderViewEventListener; - LLFolderViewItem(Params p = LLFolderViewItem::Params()); - - static const LLFontGL* sSmallFont; - static LLUIImagePtr sArrowImage; - static LLUIImagePtr sBoxImage; + LLFolderViewItem(const Params& p); std::string mLabel; std::string mSearchableLabel; @@ -150,6 +149,7 @@ protected: LLUIImagePtr mIconOpen; BOOL mHasVisibleChildren; S32 mIndentation; + S32 mItemHeight; S32 mNumDescendantsSelected; BOOL mPassedFilter; S32 mLastFilterGeneration; @@ -157,8 +157,6 @@ protected: F32 mControlLabelRotation; LLFolderView* mRoot; BOOL mDragAndDropTarget; - LLUIImagePtr mArrowImage; - LLUIImagePtr mBoxImage; BOOL mIsLoading; LLTimer mTimeSinceRequestStart; bool mHidden; diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 08cf86df4a..8ad94b957d 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -287,7 +287,7 @@ void LLHUDText::renderText(BOOL for_select) mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f)); // *TODO: cache this image - LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga"); + LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square"); // *TODO: make this a per-text setting LLColor4 bg_color = LLUIColorTable::instance().getColor("BackgroundChatColor"); diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index f30821cacf..a96240e31c 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -436,7 +436,7 @@ void LLManip::renderXYZ(const LLVector3 &vec) glPushMatrix(); { - LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga"); + LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square"); gViewerWindow->setup2DRender(); const LLVector2& display_scale = gViewerWindow->getDisplayScale(); glScalef(display_scale.mV[VX], display_scale.mV[VY], 1.f); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 75424e71f5..dab11149b9 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -167,6 +167,7 @@ with the same filename but different name + @@ -439,6 +440,7 @@ with the same filename but different name + @@ -676,7 +678,6 @@ with the same filename but different name - diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index f97ccafecc..cc00abf5a0 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -76,7 +76,7 @@ + -- cgit v1.2.3 From b88563b23bed940f44f863814ad12dac13f823da Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 8 Jan 2010 17:33:44 -0800 Subject: Made AudioStreamingMedia setting control loading of prim media as well as parcel media. Moved the media first-run dialog code from llviewerparcelmedia.cpp to llviewermedia.cpp, and made it come up for both prim and parcel media. --- indra/newview/llviewermedia.cpp | 73 +++++++++++++++++++++++++++++++++++ indra/newview/llviewermedia.h | 6 +++ indra/newview/llviewerparcelmedia.cpp | 40 +------------------ 3 files changed, 81 insertions(+), 38 deletions(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 7e8c8eb92e..f91d126073 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -54,6 +54,7 @@ #include "lluuid.h" #include "llkeyboard.h" #include "llmutelist.h" +#include "llfirstuse.h" #include // for SkinFolder listener #include @@ -708,6 +709,8 @@ void LLViewerMedia::updateMedia(void *dummy_arg) std::vector proximity_order; + bool inworld_media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia"); + bool needs_first_run = LLViewerMedia::needsMediaFirstRun(); U32 max_instances = gSavedSettings.getU32("PluginInstancesTotal"); U32 max_normal = gSavedSettings.getU32("PluginInstancesNormal"); U32 max_low = gSavedSettings.getU32("PluginInstancesLow"); @@ -822,6 +825,21 @@ void LLViewerMedia::updateMedia(void *dummy_arg) new_priority = LLPluginClassMedia::PRIORITY_LOW; } + if(!inworld_media_enabled) + { + // If inworld media is locked out, force all inworld media to stay unloaded. + if(!pimpl->getUsedInUI()) + { + new_priority = LLPluginClassMedia::PRIORITY_UNLOADED; + if(needs_first_run) + { + // Don't do this more than once in this loop. + needs_first_run = false; + LLViewerMedia::displayMediaFirstRun(); + } + } + } + pimpl->setPriority(new_priority); if(pimpl->getUsedInUI()) @@ -888,6 +906,61 @@ void LLViewerMedia::cleanupClass() gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL); } + +////////////////////////////////////////////////////////////////////////////////////////// +// static +bool LLViewerParcelMedia::needsMediaFirstRun() +{ + return gWarningSettings.getBOOL("FirstStreamingMedia"); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerParcelMedia::displayMediaFirstRun() +{ + gWarningSettings.setBOOL("FirstStreamingMedia", FALSE); + + LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(), + boost::bind(firstRunCallback, _1, _2)); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +bool LLViewerParcelMedia::firstRunCallback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + // user has elected to automatically play media. + gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE); + gSavedSettings.setBOOL("AudioStreamingVideo", TRUE); + gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); + gSavedSettings.setBOOL("AudioStreamingMedia", TRUE); + + LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + + if (parcel) + { + // play media right now, if available + LLViewerParcelMedia::play(parcel); + + // play music right now, if available + std::string music_url = parcel->getMusicURL(); + if (gAudiop && !music_url.empty()) + gAudiop->startInternetStream(music_url); + } + } + else + { + gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, FALSE); + gSavedSettings.setBOOL("AudioStreamingMedia", FALSE); + gSavedSettings.setBOOL("AudioStreamingVideo", FALSE); + gSavedSettings.setBOOL("AudioStreamingMusic", FALSE); + } + return false; +} + + ////////////////////////////////////////////////////////////////////////////////////////// // LLViewerMediaImpl ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index b103c48bd8..3ce9f1887c 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -115,6 +115,12 @@ class LLViewerMedia // This is the comparitor used to sort the list. static bool priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2); + + // For displaying the media first-run dialog. + static bool needsMediaFirstRun(); + static void displayMediaFirstRun(); + static bool firstRunCallback(const LLSD& notification, const LLSD& response); + }; // Implementation functions not exported into header file diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 0f7903a7a5..56dee6b34c 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -56,10 +56,6 @@ LLUUID LLViewerParcelMedia::sMediaRegionID; viewer_media_t LLViewerParcelMedia::sMediaImpl; -// Local functions -bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel); - - // static void LLViewerParcelMedia::initClass() { @@ -112,12 +108,10 @@ void LLViewerParcelMedia::update(LLParcel* parcel) // First use warning if( (!mediaUrl.empty() || !parcel->getMusicURL().empty()) - && gWarningSettings.getBOOL("FirstStreamingMedia") ) + && LLViewerMedia::needsMediaFirstRun()) { - LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(), - boost::bind(callback_play_media, _1, _2, parcel)); + LLViewerMedia::displayMediaFirstRun(); return; - } // if we have a current (link sharing) url, use it instead @@ -591,36 +585,6 @@ void LLViewerParcelMedia::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent }; } -bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0) - { - // user has elected to automatically play media. - gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE); - gSavedSettings.setBOOL("AudioStreamingVideo", TRUE); - gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); - if(!gSavedSettings.getBOOL("AudioStreamingMedia")) - gSavedSettings.setBOOL("AudioStreamingMedia", TRUE); - // play media right now, if available - LLViewerParcelMedia::play(parcel); - // play music right now, if available - if (parcel) - { - std::string music_url = parcel->getMusicURL(); - if (gAudiop && !music_url.empty()) - gAudiop->startInternetStream(music_url); - } - } - else - { - gSavedSettings.setBOOL("AudioStreamingVideo", FALSE); - gSavedSettings.setBOOL("AudioStreamingMusic", FALSE); - } - gWarningSettings.setBOOL("FirstStreamingMedia", FALSE); - return false; -} - // TODO: observer /* void LLViewerParcelMediaNavigationObserver::onNavigateComplete( const EventType& event_in ) -- cgit v1.2.3 From 47dd146c43064a3637641d26db36ea58d26d8a43 Mon Sep 17 00:00:00 2001 From: Kent Quirk Date: Sun, 10 Jan 2010 15:28:09 -0500 Subject: Reverting change that broke the build so we can get a working build for QA --- indra/newview/llviewermedia.cpp | 73 ----------------------------------- indra/newview/llviewermedia.h | 6 --- indra/newview/llviewerparcelmedia.cpp | 40 ++++++++++++++++++- 3 files changed, 38 insertions(+), 81 deletions(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index f91d126073..7e8c8eb92e 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -54,7 +54,6 @@ #include "lluuid.h" #include "llkeyboard.h" #include "llmutelist.h" -#include "llfirstuse.h" #include // for SkinFolder listener #include @@ -709,8 +708,6 @@ void LLViewerMedia::updateMedia(void *dummy_arg) std::vector proximity_order; - bool inworld_media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia"); - bool needs_first_run = LLViewerMedia::needsMediaFirstRun(); U32 max_instances = gSavedSettings.getU32("PluginInstancesTotal"); U32 max_normal = gSavedSettings.getU32("PluginInstancesNormal"); U32 max_low = gSavedSettings.getU32("PluginInstancesLow"); @@ -825,21 +822,6 @@ void LLViewerMedia::updateMedia(void *dummy_arg) new_priority = LLPluginClassMedia::PRIORITY_LOW; } - if(!inworld_media_enabled) - { - // If inworld media is locked out, force all inworld media to stay unloaded. - if(!pimpl->getUsedInUI()) - { - new_priority = LLPluginClassMedia::PRIORITY_UNLOADED; - if(needs_first_run) - { - // Don't do this more than once in this loop. - needs_first_run = false; - LLViewerMedia::displayMediaFirstRun(); - } - } - } - pimpl->setPriority(new_priority); if(pimpl->getUsedInUI()) @@ -906,61 +888,6 @@ void LLViewerMedia::cleanupClass() gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL); } - -////////////////////////////////////////////////////////////////////////////////////////// -// static -bool LLViewerParcelMedia::needsMediaFirstRun() -{ - return gWarningSettings.getBOOL("FirstStreamingMedia"); -} - -////////////////////////////////////////////////////////////////////////////////////////// -// static -void LLViewerParcelMedia::displayMediaFirstRun() -{ - gWarningSettings.setBOOL("FirstStreamingMedia", FALSE); - - LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(), - boost::bind(firstRunCallback, _1, _2)); -} - -////////////////////////////////////////////////////////////////////////////////////////// -// static -bool LLViewerParcelMedia::firstRunCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0) - { - // user has elected to automatically play media. - gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE); - gSavedSettings.setBOOL("AudioStreamingVideo", TRUE); - gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); - gSavedSettings.setBOOL("AudioStreamingMedia", TRUE); - - LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - - if (parcel) - { - // play media right now, if available - LLViewerParcelMedia::play(parcel); - - // play music right now, if available - std::string music_url = parcel->getMusicURL(); - if (gAudiop && !music_url.empty()) - gAudiop->startInternetStream(music_url); - } - } - else - { - gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, FALSE); - gSavedSettings.setBOOL("AudioStreamingMedia", FALSE); - gSavedSettings.setBOOL("AudioStreamingVideo", FALSE); - gSavedSettings.setBOOL("AudioStreamingMusic", FALSE); - } - return false; -} - - ////////////////////////////////////////////////////////////////////////////////////////// // LLViewerMediaImpl ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 3ce9f1887c..b103c48bd8 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -115,12 +115,6 @@ class LLViewerMedia // This is the comparitor used to sort the list. static bool priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2); - - // For displaying the media first-run dialog. - static bool needsMediaFirstRun(); - static void displayMediaFirstRun(); - static bool firstRunCallback(const LLSD& notification, const LLSD& response); - }; // Implementation functions not exported into header file diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 56dee6b34c..0f7903a7a5 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -56,6 +56,10 @@ LLUUID LLViewerParcelMedia::sMediaRegionID; viewer_media_t LLViewerParcelMedia::sMediaImpl; +// Local functions +bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel); + + // static void LLViewerParcelMedia::initClass() { @@ -108,10 +112,12 @@ void LLViewerParcelMedia::update(LLParcel* parcel) // First use warning if( (!mediaUrl.empty() || !parcel->getMusicURL().empty()) - && LLViewerMedia::needsMediaFirstRun()) + && gWarningSettings.getBOOL("FirstStreamingMedia") ) { - LLViewerMedia::displayMediaFirstRun(); + LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(), + boost::bind(callback_play_media, _1, _2, parcel)); return; + } // if we have a current (link sharing) url, use it instead @@ -585,6 +591,36 @@ void LLViewerParcelMedia::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent }; } +bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + // user has elected to automatically play media. + gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE); + gSavedSettings.setBOOL("AudioStreamingVideo", TRUE); + gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); + if(!gSavedSettings.getBOOL("AudioStreamingMedia")) + gSavedSettings.setBOOL("AudioStreamingMedia", TRUE); + // play media right now, if available + LLViewerParcelMedia::play(parcel); + // play music right now, if available + if (parcel) + { + std::string music_url = parcel->getMusicURL(); + if (gAudiop && !music_url.empty()) + gAudiop->startInternetStream(music_url); + } + } + else + { + gSavedSettings.setBOOL("AudioStreamingVideo", FALSE); + gSavedSettings.setBOOL("AudioStreamingMusic", FALSE); + } + gWarningSettings.setBOOL("FirstStreamingMedia", FALSE); + return false; +} + // TODO: observer /* void LLViewerParcelMediaNavigationObserver::onNavigateComplete( const EventType& event_in ) -- cgit v1.2.3 From 779bbe76d8829bb37d8e59f887ccfafafbfe4b3d Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Mon, 11 Jan 2010 09:13:59 +0000 Subject: EXT-3911 EXT-3846: Added help ID for Blocked Residents & Objects. --- indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml index 970a2e6a8a..003e1baa7e 100644 --- a/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_block_list_sidetray.xml @@ -5,6 +5,7 @@ height="305" layout="topleft" name="block_list_panel" + help_topic="blocked_list" min_height="350" min_width="240" width="280"> -- cgit v1.2.3 From 6f978d732b56948b1da4b29b043287b68cecc72f Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Mon, 11 Jan 2010 09:20:39 +0000 Subject: EXT-3902: Make all Choose Resident tabs use the same help ID. --- indra/newview/skins/default/xui/en/floater_avatar_picker.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml index 953bd08dd4..f59badfcb4 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml @@ -47,7 +47,7 @@ label="Search" layout="topleft" left="6" - help_topic="avatarpicker_search_tab" + help_topic="avatarpicker" name="SearchPanel" top="150" width="132"> @@ -98,7 +98,7 @@ label="Friends" layout="topleft" left="6" - help_topic="avatarpicker_friends_tab" + help_topic="avatarpicker" name="FriendsPanel" top="150" width="132"> @@ -144,7 +144,7 @@ label="Near Me" layout="topleft" left="6" - help_topic="avatarpicker_near_me_tab" + help_topic="avatarpicker" name="NearMePanel" top="150" width="132"> -- cgit v1.2.3 From df08485cf840e21e2ec8d14664a45714e0a3ca96 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Mon, 11 Jan 2010 09:32:21 +0000 Subject: EXT-3715: Added a help button to the speaker controls floater. --- indra/newview/skins/default/xui/en/floater_voice_controls.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/floater_voice_controls.xml b/indra/newview/skins/default/xui/en/floater_voice_controls.xml index a4ef807f06..b9649e9c57 100644 --- a/indra/newview/skins/default/xui/en/floater_voice_controls.xml +++ b/indra/newview/skins/default/xui/en/floater_voice_controls.xml @@ -8,6 +8,7 @@ min_height="122" min_width="190" name="floater_voice_controls" + help_topic="floater_voice_controls" title="Voice Controls" save_visibility="true" single_instance="true" -- cgit v1.2.3 From a4baeed12f241f29c3f2e856b386eecf4ab46db6 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Mon, 11 Jan 2010 10:05:37 +0000 Subject: EXT-3929: Moved LLAccordionCtrl to llui. Both LLAccordionCtrl and LLAccordionCtrlTab should live in llui, not newview. I need to make this happen in order to fix EXT-3929. No code change was necessary (other than to change #include for predefined headers) as these classes did not rely on any newview code. --- indra/llui/CMakeLists.txt | 4 + indra/llui/llaccordionctrl.cpp | 578 ++++++++++++++++++++++++++++++++++++ indra/llui/llaccordionctrl.h | 123 ++++++++ indra/llui/llaccordionctrltab.cpp | 599 ++++++++++++++++++++++++++++++++++++++ indra/llui/llaccordionctrltab.h | 191 ++++++++++++ indra/newview/CMakeLists.txt | 4 - 6 files changed, 1495 insertions(+), 4 deletions(-) create mode 100644 indra/llui/llaccordionctrl.cpp create mode 100644 indra/llui/llaccordionctrl.h create mode 100644 indra/llui/llaccordionctrltab.cpp create mode 100644 indra/llui/llaccordionctrltab.h diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 82ec02d2eb..ce068618e2 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -26,6 +26,8 @@ include_directories( ) set(llui_SOURCE_FILES + llaccordionctrl.cpp + llaccordionctrltab.cpp llbutton.cpp llcheckboxctrl.cpp llclipboard.cpp @@ -111,6 +113,8 @@ set(llui_SOURCE_FILES set(llui_HEADER_FILES CMakeLists.txt + llaccordionctrl.h + llaccordionctrltab.h llbutton.h llcallbackmap.h llcheckboxctrl.h diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp new file mode 100644 index 0000000000..b5e870228a --- /dev/null +++ b/indra/llui/llaccordionctrl.cpp @@ -0,0 +1,578 @@ +/** + * @file llaccordionctrl.cpp + * @brief Accordion panel implementation + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ +#include "linden_common.h" + +#include "llaccordionctrl.h" +#include "llaccordionctrltab.h" + +#include "lluictrlfactory.h" // builds floaters from XML + +#include "llwindow.h" +#include "llfocusmgr.h" +#include "lllocalcliprect.h" + +#include "boost/bind.hpp" + +static const S32 DRAGGER_BAR_MARGIN = 4; +static const S32 DRAGGER_BAR_HEIGHT = 5; +static const S32 BORDER_MARGIN = 2; +static const S32 PARENT_BORDER_MARGIN = 5; + +static const S32 panel_delta = DRAGGER_BAR_MARGIN; // Distanse between two panels + +static const S32 HORIZONTAL_MULTIPLE = 8; +static const S32 VERTICAL_MULTIPLE = 16; +static const F32 MIN_AUTO_SCROLL_RATE = 120.f; +static const F32 MAX_AUTO_SCROLL_RATE = 500.f; +static const F32 AUTO_SCROLL_RATE_ACCEL = 120.f; + + +// LLAccordionCtrl =================================================================| + +static LLDefaultChildRegistry::Register t2("accordion"); + + +LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params) + , mFitParent(params.fit_parent) +{ + mSingleExpansion = params.single_expansion; + if(mFitParent && !mSingleExpansion) + { + llinfos << "fit_parent works best when combined with single_expansion" << llendl; + } +} + +LLAccordionCtrl::LLAccordionCtrl() : LLPanel() +{ + mSingleExpansion = false; + mFitParent = false; + LLUICtrlFactory::getInstance()->buildPanel(this, "accordion_parent.xml"); +} + +//--------------------------------------------------------------------------------- +void LLAccordionCtrl::draw() +{ + LLRect local_rect(0, getRect().getHeight(), getRect().getWidth(), 0); + + LLLocalClipRect clip(local_rect); + + LLPanel::draw(); +} + + +//--------------------------------------------------------------------------------- +BOOL LLAccordionCtrl::postBuild() +{ + static LLUICachedControl scrollbar_size ("UIScrollbarSize", 0); + + LLRect scroll_rect; + scroll_rect.setOriginAndSize( + getRect().getWidth() - scrollbar_size, + 1, + scrollbar_size, + getRect().getHeight() - 1); + + + LLScrollbar::Params sbparams; + sbparams.name("scrollable vertical"); + sbparams.rect(scroll_rect); + sbparams.orientation(LLScrollbar::VERTICAL); + sbparams.doc_size(mInnerRect.getHeight()); + sbparams.doc_pos(0); + sbparams.page_size(mInnerRect.getHeight()); + sbparams.step_size(VERTICAL_MULTIPLE); + sbparams.follows.flags(FOLLOWS_RIGHT | FOLLOWS_TOP | FOLLOWS_BOTTOM); + sbparams.change_callback(boost::bind(&LLAccordionCtrl::onScrollPosChangeCallback, this, _1, _2)); + + mScrollbar = LLUICtrlFactory::create (sbparams); + LLView::addChild( mScrollbar ); + mScrollbar->setVisible( false ); + mScrollbar->setFollowsRight(); + mScrollbar->setFollowsTop(); + mScrollbar->setFollowsBottom(); + + //if it was created from xml... + std::vector accordion_tabs; + for(child_list_const_iter_t it = getChildList()->begin(); + getChildList()->end() != it; ++it) + { + LLAccordionCtrlTab* accordion_tab = dynamic_cast(*it); + if(accordion_tab == NULL) + continue; + if(std::find(mAccordionTabs.begin(),mAccordionTabs.end(),accordion_tab) == mAccordionTabs.end()) + { + accordion_tabs.push_back(accordion_tab); + } + } + + for(std::vector::reverse_iterator it = accordion_tabs.rbegin();it!=accordion_tabs.rend();++it) + addCollapsibleCtrl(*it); + + arrange (); + + if(mSingleExpansion) + { + if(!mAccordionTabs[0]->getDisplayChildren()) + mAccordionTabs[0]->setDisplayChildren(true); + for(size_t i=1;igetDisplayChildren()) + mAccordionTabs[i]->setDisplayChildren(false); + } + } + + return TRUE; +} + + +//--------------------------------------------------------------------------------- +LLAccordionCtrl::~LLAccordionCtrl() +{ + mAccordionTabs.clear(); +} + +//--------------------------------------------------------------------------------- + +void LLAccordionCtrl::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + // adjust our rectangle + LLRect rcLocal = getRect(); + rcLocal.mRight = rcLocal.mLeft + width; + rcLocal.mTop = rcLocal.mBottom + height; + + setRect(rcLocal); + + arrange(); +} + +//--------------------------------------------------------------------------------- +BOOL LLAccordionCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + return LLPanel::handleRightMouseDown(x, y, mask); +} + +//--------------------------------------------------------------------------------- +void LLAccordionCtrl::shiftAccordionTabs(S16 panel_num, S32 delta) +{ + for(size_t i = panel_num; i < mAccordionTabs.size(); i++ ) + { + ctrlShiftVertical(mAccordionTabs[i],delta); + } +} + + +//--------------------------------------------------------------------------------- +void LLAccordionCtrl::onCollapseCtrlCloseOpen(S16 panel_num) +{ + if(mSingleExpansion) + { + for(size_t i=0;igetDisplayChildren()) + mAccordionTabs[i]->setDisplayChildren(false); + } + + } + arrange(); +} + +void LLAccordionCtrl::show_hide_scrollbar(S32 width, S32 height) +{ + calcRecuiredHeight(); + if(getRecuiredHeight() > height ) + showScrollbar(width,height); + else + hideScrollbar(width,height); +} + +void LLAccordionCtrl::showScrollbar(S32 width, S32 height) +{ + bool was_visible = mScrollbar->getVisible(); + + mScrollbar->setVisible(true); + + static LLUICachedControl scrollbar_size ("UIScrollbarSize", 0); + + ctrlSetLeftTopAndSize(mScrollbar + ,width-scrollbar_size - PARENT_BORDER_MARGIN/2 + ,height-PARENT_BORDER_MARGIN + ,scrollbar_size + ,height-2*PARENT_BORDER_MARGIN); + + mScrollbar->setPageSize(height); + mScrollbar->setDocParams(mInnerRect.getHeight(),mScrollbar->getDocPos()); + + if(was_visible) + { + S32 scroll_pos = llmin(mScrollbar->getDocPos(), getRecuiredHeight() - height - 1); + mScrollbar->setDocPos(scroll_pos); + } +} + +void LLAccordionCtrl::hideScrollbar( S32 width, S32 height ) +{ + if(mScrollbar->getVisible() == false) + return; + mScrollbar->setVisible(false); + + static LLUICachedControl scrollbar_size ("UIScrollbarSize", 0); + + S32 panel_width = width - 2*BORDER_MARGIN; + + //reshape all accordeons and shift all draggers + for(size_t i=0;igetRect(); + ctrlSetLeftTopAndSize(mAccordionTabs[i],panel_rect.mLeft,panel_rect.mTop,panel_width,panel_rect.getHeight()); + } + + mScrollbar->setDocPos(0); + + if(mAccordionTabs.size()>0) + { + S32 panel_top = height - BORDER_MARGIN; // Top coordinate of the first panel + S32 diff = panel_top - mAccordionTabs[0]->getRect().mTop; + shiftAccordionTabs(0,diff); + } +} + + +//--------------------------------------------------------------------------------- +S32 LLAccordionCtrl::calcRecuiredHeight() +{ + S32 rec_height = 0; + + std::vector::iterator panel; + for(panel=mAccordionTabs.begin(); panel!=mAccordionTabs.end(); ++panel) + { + LLAccordionCtrlTab* accordion_tab = dynamic_cast(*panel); + if(accordion_tab && accordion_tab->getVisible()) + { + rec_height += accordion_tab->getRect().getHeight(); + } + } + + mInnerRect.setLeftTopAndSize(0,rec_height + BORDER_MARGIN*2,getRect().getWidth(),rec_height + BORDER_MARGIN); + + return mInnerRect.getHeight(); +} + +//--------------------------------------------------------------------------------- +void LLAccordionCtrl::ctrlSetLeftTopAndSize(LLView* panel, S32 left, S32 top, S32 width, S32 height) +{ + if(!panel) + return; + LLRect panel_rect = panel->getRect(); + panel_rect.setLeftTopAndSize( left, top, width, height); + panel->reshape( width, height, 1); + panel->setRect(panel_rect); +} + +void LLAccordionCtrl::ctrlShiftVertical(LLView* panel,S32 delta) +{ + if(!panel) + return; + panel->translate(0,delta); +} + +//--------------------------------------------------------------------------------- + +void LLAccordionCtrl::addCollapsibleCtrl(LLView* view) +{ + LLAccordionCtrlTab* accordion_tab = dynamic_cast(view); + if(!accordion_tab) + return; + if(std::find(getChildList()->begin(),getChildList()->end(),accordion_tab) == getChildList()->end()) + addChild(accordion_tab); + mAccordionTabs.push_back(accordion_tab); + + accordion_tab->setDropDownStateChangedCallback( boost::bind(&LLAccordionCtrl::onCollapseCtrlCloseOpen, this, mAccordionTabs.size() - 1) ); + +} + + +void LLAccordionCtrl::arrange() +{ + if( mAccordionTabs.size() == 0) + { + //We do not arrange if we do not have what should be arranged + return; + } + + //Calculate params + S32 panel_left = BORDER_MARGIN; // Margin from left side of Splitter + S32 panel_top = getRect().getHeight() - BORDER_MARGIN; // Top coordinate of the first panel + S32 panel_width = getRect().getWidth() - 4; // Top coordinate of the first panel + + + if(mAccordionTabs.size() == 1) + { + LLAccordionCtrlTab* accordion_tab = dynamic_cast(mAccordionTabs[0]); + + LLRect panel_rect = accordion_tab->getRect(); + + S32 panel_height = getRect().getHeight() - 2*BORDER_MARGIN; + + ctrlSetLeftTopAndSize(accordion_tab,panel_rect.mLeft,panel_top,panel_width,panel_height); + + show_hide_scrollbar(getRect().getWidth(),getRect().getHeight()); + return; + + } + + for(size_t i = 0; i < mAccordionTabs.size(); i++ ) + { + LLAccordionCtrlTab* accordion_tab = dynamic_cast(mAccordionTabs[i]); + + if(accordion_tab->getVisible() == false) //skip hidden accordion tabs + continue; + + if(!accordion_tab->isExpanded() ) + { + ctrlSetLeftTopAndSize(mAccordionTabs[i], panel_left, panel_top, panel_width, accordion_tab->getRect().getHeight()); + panel_top-=mAccordionTabs[i]->getRect().getHeight(); + } + else + { + S32 panel_height = accordion_tab->getRect().getHeight(); + + if(mFitParent) + { + // all expanded tabs will have equal height + panel_height = calcExpandedTabHeight(i, panel_top); + ctrlSetLeftTopAndSize(accordion_tab, panel_left, panel_top, panel_width, panel_height); + + // try to make accordion tab fit accordion view height. + // Accordion View should implement getRequiredRect() and provide valid height + S32 optimal_height = accordion_tab->getAccordionView()->getRequiredRect().getHeight(); + optimal_height += accordion_tab->getHeaderHeight() + 2 * BORDER_MARGIN; + if(optimal_height < panel_height) + { + panel_height = optimal_height; + } + + // minimum tab height is equal to header height + if(mAccordionTabs[i]->getHeaderHeight() > panel_height) + { + panel_height = mAccordionTabs[i]->getHeaderHeight(); + } + } + + ctrlSetLeftTopAndSize(mAccordionTabs[i], panel_left, panel_top, panel_width, panel_height); + panel_top-=panel_height; + + } + } + + show_hide_scrollbar(getRect().getWidth(),getRect().getHeight()); + + updateLayout(getRect().getWidth(),getRect().getHeight()); + +} + +//--------------------------------------------------------------------------------- + +BOOL LLAccordionCtrl::handleScrollWheel ( S32 x, S32 y, S32 clicks ) +{ + if(LLPanel::handleScrollWheel(x,y,clicks)) + return TRUE; + if( mScrollbar->getVisible() && mScrollbar->handleScrollWheel( 0, 0, clicks ) ) + return TRUE; + return false; + +} + +BOOL LLAccordionCtrl::handleKeyHere (KEY key, MASK mask) +{ + if( mScrollbar->getVisible() && mScrollbar->handleKeyHere( key,mask ) ) + return TRUE; + return LLPanel::handleKeyHere(key,mask); +} + +void LLAccordionCtrl::updateLayout (S32 width, S32 height) +{ + S32 panel_top = height - BORDER_MARGIN ; + if(mScrollbar->getVisible()) + panel_top+=mScrollbar->getDocPos(); + + S32 panel_width = width - 2*BORDER_MARGIN; + + static LLUICachedControl scrollbar_size ("UIScrollbarSize", 0); + if(mScrollbar->getVisible()) + panel_width-=scrollbar_size; + + //set sizes for first panels and dragbars + for(size_t i=0;igetVisible()) + continue; + LLRect panel_rect = mAccordionTabs[i]->getRect(); + ctrlSetLeftTopAndSize(mAccordionTabs[i],panel_rect.mLeft,panel_top,panel_width,panel_rect.getHeight()); + panel_top-=panel_rect.getHeight(); + } +} + +void LLAccordionCtrl::onScrollPosChangeCallback(S32, LLScrollbar*) +{ + updateLayout(getRect().getWidth(),getRect().getHeight()); +} +void LLAccordionCtrl::onOpen (const LLSD& key) +{ + for(size_t i=0;i(mAccordionTabs[i]); + LLPanel* panel = dynamic_cast(accordion_tab->getAccordionView()); + if(panel!=NULL) + { + panel->onOpen(key); + } + } +} +S32 LLAccordionCtrl::notifyParent(const LLSD& info) +{ + if(info.has("action")) + { + std::string str_action = info["action"]; + if(str_action == "size_changes") + { + // + arrange(); + return 1; + } + else if(str_action == "select_next") + { + for(size_t i=0;i(mAccordionTabs[i]); + if(accordion_tab->hasFocus()) + { + while(++igetVisible()) + break; + } + if(i(mAccordionTabs[i]); + accordion_tab->notify(LLSD().with("action","select_first")); + return 1; + } + break; + } + } + return 0; + } + else if(str_action == "select_prev") + { + for(size_t i=0;i(mAccordionTabs[i]); + if(accordion_tab->hasFocus() && i>0) + { + while(i>0) + { + if(mAccordionTabs[--i]->getVisible()) + break; + } + + accordion_tab = dynamic_cast(mAccordionTabs[i]); + accordion_tab->notify(LLSD().with("action","select_last")); + return 1; + } + } + return 0; + } + } + else if (info.has("scrollToShowRect")) + { + LLRect screen_rc, local_rc; + screen_rc.setValue(info["scrollToShowRect"]); + screenRectToLocal(screen_rc, &local_rc); + + // Translate to parent coordinatess to check if we are in visible rectangle + local_rc.translate( getRect().mLeft, getRect().mBottom ); + + if ( !getRect().contains (local_rc) ) + { + // Back to local coords and calculate position for scroller + S32 bottom = mScrollbar->getDocPos() - local_rc.mBottom + getRect().mBottom; + S32 top = mScrollbar->getDocPos() - local_rc.mTop + getRect().mTop; + + S32 scroll_pos = llclamp(mScrollbar->getDocPos(), + bottom, // min vertical scroll + top); // max vertical scroll + + mScrollbar->setDocPos( scroll_pos ); + } + return 1; + } + return LLPanel::notifyParent(info); +} +void LLAccordionCtrl::reset () +{ + if(mScrollbar) + mScrollbar->setDocPos(0); +} + +S32 LLAccordionCtrl::calcExpandedTabHeight(S32 tab_index /* = 0 */, S32 available_height /* = 0 */) +{ + if(tab_index < 0) + { + return available_height; + } + + S32 collapsed_tabs_height = 0; + S32 num_expanded = 0; + + for(size_t n = tab_index; n < mAccordionTabs.size(); ++n) + { + if(!mAccordionTabs[n]->isExpanded()) + { + collapsed_tabs_height += mAccordionTabs[n]->getHeaderHeight(); + } + else + { + ++num_expanded; + } + } + + if(0 == num_expanded) + { + return available_height; + } + + S32 expanded_tab_height = available_height - collapsed_tabs_height - BORDER_MARGIN; // top BORDER_MARGIN is added in arrange(), here we add bottom BORDER_MARGIN + expanded_tab_height /= num_expanded; + return expanded_tab_height; +} diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h new file mode 100644 index 0000000000..4cb0f38281 --- /dev/null +++ b/indra/llui/llaccordionctrl.h @@ -0,0 +1,123 @@ +/** + * @file LLAccordionCtrl.h + * @brief Accordion Panel implementation + * + * $LicenseInfo:firstyear=2004&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_ACCORDIONCTRL_H +#define LL_ACCORDIONCTRL_H + +#include "llpanel.h" +#include "llscrollbar.h" + +#include +#include +#include + +class LLAccordionCtrlTab; + +class LLAccordionCtrl: public LLPanel +{ +private: + + std::vector mAccordionTabs; + + void ctrlSetLeftTopAndSize(LLView* panel, S32 left, S32 top, S32 width, S32 height); + void ctrlShiftVertical(LLView* panel,S32 delta); + + void onCollapseCtrlCloseOpen(S16 panel_num); + void shiftAccordionTabs(S16 panel_num, S32 delta); + + +public: + struct Params + : public LLInitParam::Block + { + Optional single_expansion, + fit_parent; /* Accordion will fit its parent size, controls that are placed into + accordion tabs are responsible for scrolling their content. + *NOTE fit_parent works best when combined with single_expansion. + Accordion view should implement getRequiredRect() and provide valid height*/ + + Params() + : single_expansion("single_expansion",false) + , fit_parent("fit_parent", false) + {}; + }; + + LLAccordionCtrl(const Params& params); + + LLAccordionCtrl(); + virtual ~LLAccordionCtrl(); + + virtual BOOL postBuild(); + + virtual BOOL handleRightMouseDown ( S32 x, S32 y, MASK mask); + virtual BOOL handleScrollWheel ( S32 x, S32 y, S32 clicks ); + virtual BOOL handleKeyHere (KEY key, MASK mask); + // + + // Call reshape after changing splitter's size + virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + + void addCollapsibleCtrl(LLView* view); + void arrange(); + + + void draw(); + + void onScrollPosChangeCallback(S32, LLScrollbar*); + + void onOpen (const LLSD& key); + S32 notifyParent(const LLSD& info); + + void reset (); + +private: + // Calc Splitter's height that is necessary to display all child content + S32 calcRecuiredHeight(); + S32 getRecuiredHeight() const { return mInnerRect.getHeight(); } + S32 calcExpandedTabHeight(S32 tab_index = 0, S32 available_height = 0); + + void updateLayout (S32 width, S32 height); + + void show_hide_scrollbar (S32 width, S32 height); + + void showScrollbar (S32 width, S32 height); + void hideScrollbar (S32 width, S32 height); + +private: + LLRect mInnerRect; + LLScrollbar* mScrollbar; + bool mSingleExpansion; + bool mFitParent; +}; + + +#endif // LL_LLSPLITTER_H diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp new file mode 100644 index 0000000000..9d6ba57c29 --- /dev/null +++ b/indra/llui/llaccordionctrltab.cpp @@ -0,0 +1,599 @@ +/** + * @file LLAccordionCtrlTab.cpp + * @brief Collapsible control implementation + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "linden_common.h" + +#include "lluictrl.h" + +#include "llaccordionctrltab.h" + +#include "lltextbox.h" + +static const std::string DD_BUTTON_NAME = "dd_button"; +static const std::string DD_TEXTBOX_NAME = "dd_textbox"; +static const std::string DD_HEADER_NAME = "dd_header"; + +static const S32 HEADER_HEIGHT = 20; +static const S32 HEADER_IMAGE_LEFT_OFFSET = 5; +static const S32 HEADER_TEXT_LEFT_OFFSET = 30; + +static LLDefaultChildRegistry::Register t1("accordion_tab"); + +class LLAccordionCtrlTab::LLAccordionCtrlTabHeader : public LLUICtrl +{ +public: + friend class LLUICtrlFactory; + + struct Params : public LLInitParam::Block + { + Params(); + }; + + LLAccordionCtrlTabHeader(const LLAccordionCtrlTabHeader::Params& p); + + virtual ~LLAccordionCtrlTabHeader(); + + virtual void draw(); + + virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + + virtual BOOL postBuild(); + + void setTitle(const std::string& title); + + virtual void onMouseEnter(S32 x, S32 y, MASK mask); + virtual void onMouseLeave(S32 x, S32 y, MASK mask); + virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); +private: + + LLTextBox* mHeaderTextbox; + + // Overlay images (arrows) + LLPointer mImageCollapsed; + LLPointer mImageExpanded; + LLPointer mImageCollapsedPressed; + LLPointer mImageExpandedPressed; + + // Background images + LLPointer mImageHeader; + LLPointer mImageHeaderOver; + LLPointer mImageHeaderPressed; + LLPointer mImageHeaderFocused; + + LLUIColor mHeaderBGColor; + + bool mNeedsHighlight; +}; + +LLAccordionCtrlTab::LLAccordionCtrlTabHeader::Params::Params() +{ +} + +LLAccordionCtrlTab::LLAccordionCtrlTabHeader::LLAccordionCtrlTabHeader( + const LLAccordionCtrlTabHeader::Params& p) +: LLUICtrl(p) +, mHeaderBGColor(p.header_bg_color()) +,mNeedsHighlight(false), + mImageCollapsed(p.header_collapse_img), + mImageCollapsedPressed(p.header_collapse_img_pressed), + mImageExpanded(p.header_expand_img), + mImageExpandedPressed(p.header_expand_img_pressed), + mImageHeader(p.header_image), + mImageHeaderOver(p.header_image_over), + mImageHeaderPressed(p.header_image_pressed), + mImageHeaderFocused(p.header_image_focused) +{ + LLTextBox::Params textboxParams; + textboxParams.name(DD_TEXTBOX_NAME); + textboxParams.initial_value(p.title()); + textboxParams.text_color(p.header_text_color()); + textboxParams.follows.flags(FOLLOWS_NONE); + textboxParams.font( p.font() ); + textboxParams.font_shadow(LLFontGL::NO_SHADOW); + textboxParams.use_ellipses = true; + textboxParams.bg_visible = false; + textboxParams.mouse_opaque = false; + mHeaderTextbox = LLUICtrlFactory::create(textboxParams); + addChild(mHeaderTextbox); +} + +LLAccordionCtrlTab::LLAccordionCtrlTabHeader::~LLAccordionCtrlTabHeader() +{ +} + +BOOL LLAccordionCtrlTab::LLAccordionCtrlTabHeader::postBuild() +{ + return TRUE; +} + +void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::setTitle(const std::string& title) +{ + if(mHeaderTextbox) + mHeaderTextbox->setText(title); +} + +void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::draw() +{ + S32 width = getRect().getWidth(); + S32 height = getRect().getHeight(); + + gl_rect_2d(0,0,width - 1 ,height - 1,mHeaderBGColor.get(),true); + + LLAccordionCtrlTab* parent = dynamic_cast(getParent()); + bool collapsible = (parent && parent->getCollapsible()); + bool expanded = (parent && parent->getDisplayChildren()); + + // Handle overlay images, if needed + // Only show green "focus" background image if the accordion is open, + // because the user's mental model of focus is that it goes away after + // the accordion is closed. + if (getParent()->hasFocus() + && !(collapsible && !expanded)) + { + mImageHeaderFocused->draw(0,0,width,height); + } + else + { + mImageHeader->draw(0,0,width,height); + } + + if(mNeedsHighlight) + { + mImageHeaderOver->draw(0,0,width,height); + } + + + if(collapsible) + { + LLPointer overlay_image; + if(expanded) + { + overlay_image = mImageExpanded; + } + else + { + overlay_image = mImageCollapsed; + } + overlay_image->draw(HEADER_IMAGE_LEFT_OFFSET, + (height - overlay_image->getHeight()) / 2); + } + + LLUICtrl::draw(); +} + +void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::reshape(S32 width, S32 height, BOOL called_from_parent /* = TRUE */) +{ + S32 header_height = mHeaderTextbox->getTextPixelHeight(); + + LLRect textboxRect(HEADER_TEXT_LEFT_OFFSET,(height+header_height)/2 ,width,(height-header_height)/2); + mHeaderTextbox->reshape(textboxRect.getWidth(), textboxRect.getHeight()); + mHeaderTextbox->setRect(textboxRect); +} + +void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::onMouseEnter(S32 x, S32 y, MASK mask) +{ + LLUICtrl::onMouseEnter(x, y, mask); + mNeedsHighlight = true; +} +void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::onMouseLeave(S32 x, S32 y, MASK mask) +{ + LLUICtrl::onMouseLeave(x, y, mask); + mNeedsHighlight = false; +} +BOOL LLAccordionCtrlTab::LLAccordionCtrlTabHeader::handleKey(KEY key, MASK mask, BOOL called_from_parent) +{ + if ( ( key == KEY_LEFT || key == KEY_RIGHT) && mask == MASK_NONE) + { + return getParent()->handleKey(key, mask, called_from_parent); + } + return LLUICtrl::handleKey(key, mask, called_from_parent); +} + + +LLAccordionCtrlTab::Params::Params() + : title("title") + ,display_children("expanded", true) + ,header_height("header_height", HEADER_HEIGHT), + min_width("min_width", 0), + min_height("min_height", 0) + ,collapsible("collapsible", true) + ,header_bg_color("header_bg_color") + ,dropdown_bg_color("dropdown_bg_color") + ,header_visible("header_visible",true) + ,padding_left("padding_left",2) + ,padding_right("padding_right",2) + ,padding_top("padding_top",2) + ,padding_bottom("padding_bottom",2) + ,header_expand_img("header_expand_img") + ,header_expand_img_pressed("header_expand_img_pressed") + ,header_collapse_img("header_collapse_img") + ,header_collapse_img_pressed("header_collapse_img_pressed") + ,header_image("header_image") + ,header_image_over("header_image_over") + ,header_image_pressed("header_image_pressed") + ,header_image_focused("header_image_focused") + ,header_text_color("header_text_color") +{ + mouse_opaque(false); +} + +LLAccordionCtrlTab::LLAccordionCtrlTab(const LLAccordionCtrlTab::Params&p) + : LLUICtrl(p) + ,mDisplayChildren(p.display_children) + ,mCollapsible(p.collapsible) + ,mExpandedHeight(0) + ,mDropdownBGColor(p.dropdown_bg_color()) + ,mHeaderVisible(p.header_visible) + ,mPaddingLeft(p.padding_left) + ,mPaddingRight(p.padding_right) + ,mPaddingTop(p.padding_top) + ,mPaddingBottom(p.padding_bottom) + ,mCanOpenClose(true) +{ + mStoredOpenCloseState = false; + mWasStateStored = false; + + mDropdownBGColor = LLColor4::white; + LLAccordionCtrlTabHeader::Params headerParams; + headerParams.name(DD_HEADER_NAME); + headerParams.title(p.title); + mHeader = LLUICtrlFactory::create(headerParams); + addChild(mHeader, 1); + + reshape(100, 200,FALSE); +} + +LLAccordionCtrlTab::~LLAccordionCtrlTab() +{ +} + + +void LLAccordionCtrlTab::setDisplayChildren(bool display) +{ + mDisplayChildren = display; + LLRect rect = getRect(); + + rect.mBottom = rect.mTop - (getDisplayChildren() ? + mExpandedHeight : HEADER_HEIGHT); + setRect(rect); + + for(child_list_const_iter_t it = getChildList()->begin(); + getChildList()->end() != it; ++it) + { + LLView* child = *it; + if(DD_HEADER_NAME == child->getName()) + continue; + + child->setVisible(getDisplayChildren()); + } +} + +void LLAccordionCtrlTab::reshape(S32 width, S32 height, BOOL called_from_parent /* = TRUE */) +{ + LLRect headerRect; + + LLUICtrl::reshape(width, height, TRUE); + + headerRect.setLeftTopAndSize( + 0,height,width,HEADER_HEIGHT); + mHeader->setRect(headerRect); + mHeader->reshape(headerRect.getWidth(), headerRect.getHeight()); + + for(child_list_const_iter_t it = getChildList()->begin(); + getChildList()->end() != it; ++it) + { + LLView* child = *it; + if(DD_HEADER_NAME == child->getName()) + continue; + if(!child->getVisible()) + continue; + + LLRect childRect = child->getRect(); + S32 childWidth = width - getPaddingLeft() - getPaddingRight(); + S32 childHeight = height - getHeaderHeight() - getPaddingTop() - getPaddingBottom(); + + child->reshape(childWidth,childHeight); + + childRect.setLeftTopAndSize( + getPaddingLeft(), + childHeight + getPaddingBottom(), + childWidth, + childHeight); + + child->setRect(childRect); + + break;//suppose that there is only one panel + } + +} + +void LLAccordionCtrlTab::changeOpenClose(bool is_open) +{ + if(is_open) + mExpandedHeight = getRect().getHeight(); + + setDisplayChildren(!is_open); + reshape(getRect().getWidth(), getRect().getHeight(), FALSE); + if (mCommitSignal) + { + (*mCommitSignal)(this, getDisplayChildren()); + } +} + +BOOL LLAccordionCtrlTab::handleMouseDown(S32 x, S32 y, MASK mask) +{ + if(mCollapsible && mHeaderVisible && mCanOpenClose) + { + if(y >= (getRect().getHeight() - HEADER_HEIGHT) ) + { + LLAccordionCtrlTabHeader* header = getChild(DD_HEADER_NAME); + header->setFocus(true); + changeOpenClose(getDisplayChildren()); + + //reset stored state + mWasStateStored = false; + return TRUE; + } + } + return LLUICtrl::handleMouseDown(x,y,mask); +} + +BOOL LLAccordionCtrlTab::handleMouseUp(S32 x, S32 y, MASK mask) +{ + return LLUICtrl::handleMouseUp(x,y,mask); +} + +boost::signals2::connection LLAccordionCtrlTab::setDropDownStateChangedCallback(commit_callback_t cb) +{ + return setCommitCallback(cb); +} + +bool LLAccordionCtrlTab::addChild(LLView* child, S32 tab_group) +{ + if(DD_HEADER_NAME != child->getName()) + { + reshape(child->getRect().getWidth() , child->getRect().getHeight() + HEADER_HEIGHT ); + mExpandedHeight = getRect().getHeight(); + } + + bool res = LLUICtrl::addChild(child, tab_group); + + if(DD_HEADER_NAME != child->getName()) + { + if(!mCollapsible) + setDisplayChildren(true); + else + setDisplayChildren(getDisplayChildren()); + } + + return res; +} + +void LLAccordionCtrlTab::setAccordionView(LLView* panel) +{ + addChild(panel,0); +} + + +LLView* LLAccordionCtrlTab::getAccordionView() +{ + for(child_list_const_iter_t it = getChildList()->begin(); + getChildList()->end() != it; ++it) + { + LLView* child = *it; + if(DD_HEADER_NAME == child->getName()) + continue; + if(!child->getVisible()) + continue; + return child; + } + return NULL; +} + + +S32 LLAccordionCtrlTab::getHeaderHeight() +{ + return mHeaderVisible?HEADER_HEIGHT:0; +} + +void LLAccordionCtrlTab::setHeaderVisible(bool value) +{ + if(mHeaderVisible == value) + return; + mHeaderVisible = value; + if(mHeader) + mHeader->setVisible(value); + reshape(getRect().getWidth(), getRect().getHeight(), FALSE); +}; + +//vurtual +BOOL LLAccordionCtrlTab::postBuild() +{ + mHeader->setVisible(mHeaderVisible); + return LLUICtrl::postBuild(); +} +bool LLAccordionCtrlTab::notifyChildren (const LLSD& info) +{ + if(info.has("action")) + { + std::string str_action = info["action"]; + if(str_action == "store_state") + { + storeOpenCloseState(); + return true; + } + if(str_action == "restore_state") + { + restoreOpenCloseState(); + return true; + } + } + return LLUICtrl::notifyChildren(info); +} + +S32 LLAccordionCtrlTab::notifyParent(const LLSD& info) +{ + if(info.has("action")) + { + std::string str_action = info["action"]; + if(str_action == "size_changes") + { + // + S32 height = info["height"]; + height = llmax(height,10) + HEADER_HEIGHT + getPaddingTop() + getPaddingBottom(); + + mExpandedHeight = height; + + if(isExpanded()) + { + LLRect panel_rect = getRect(); + panel_rect.setLeftTopAndSize( panel_rect.mLeft, panel_rect.mTop, panel_rect.getWidth(), height); + reshape(getRect().getWidth(),height); + setRect(panel_rect); + } + + //LLAccordionCtrl should rearrange accodion tab if one of accordion change its size + getParent()->notifyParent(info); + return 1; + } + else if(str_action == "select_prev") + { + showAndFocusHeader(); + return 1; + } + } + return LLUICtrl::notifyParent(info); +} + +S32 LLAccordionCtrlTab::notify(const LLSD& info) +{ + if(info.has("action")) + { + std::string str_action = info["action"]; + if(str_action == "select_first") + { + showAndFocusHeader(); + return 1; + } + else if( str_action == "select_last" ) + { + if(getDisplayChildren() == false) + { + showAndFocusHeader(); + } + else + { + LLView* view = getAccordionView(); + if(view) + view->notify(LLSD().with("action","select_last")); + } + } + } + return 0; +} + +BOOL LLAccordionCtrlTab::handleKey(KEY key, MASK mask, BOOL called_from_parent) +{ + LLAccordionCtrlTabHeader* header = getChild(DD_HEADER_NAME); + if( !header->hasFocus() ) + return LLUICtrl::handleKey(key, mask, called_from_parent); + + if ( (key == KEY_ADD || key == KEY_RIGHT)&& mask == MASK_NONE) + { + if(getDisplayChildren() == false) + { + changeOpenClose(getDisplayChildren()); + return TRUE; + } + } + if ( (key == KEY_SUBTRACT || key == KEY_LEFT)&& mask == MASK_NONE) + { + if(getDisplayChildren() == true) + { + changeOpenClose(getDisplayChildren()); + return TRUE; + } + } + + if ( key == KEY_DOWN && mask == MASK_NONE) + { + //if collapsed go to the next accordion + if(getDisplayChildren() == false) + //we processing notifyParent so let call parent directly + getParent()->notifyParent(LLSD().with("action","select_next")); + else + { + getAccordionView()->notify(LLSD().with("action","select_first")); + } + return TRUE; + } + + if ( key == KEY_UP && mask == MASK_NONE) + { + //go to the previous accordion + + //we processing notifyParent so let call parent directly + getParent()->notifyParent(LLSD().with("action","select_prev")); + return TRUE; + } + + return LLUICtrl::handleKey(key, mask, called_from_parent); +} + +void LLAccordionCtrlTab::showAndFocusHeader() +{ + LLAccordionCtrlTabHeader* header = getChild(DD_HEADER_NAME); + header->setFocus(true); + + LLRect screen_rc; + LLRect selected_rc = header->getRect(); + localRectToScreen(selected_rc, &screen_rc); + notifyParent(LLSD().with("scrollToShowRect",screen_rc.getValue())); + +} +void LLAccordionCtrlTab::storeOpenCloseState() +{ + if(mWasStateStored) + return; + mStoredOpenCloseState = getDisplayChildren(); + mWasStateStored = true; +} +void LLAccordionCtrlTab::restoreOpenCloseState() +{ + if(!mWasStateStored) + return; + if(getDisplayChildren() != mStoredOpenCloseState) + { + changeOpenClose(getDisplayChildren()); + } + mWasStateStored = false; +} diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h new file mode 100644 index 0000000000..b200d43438 --- /dev/null +++ b/indra/llui/llaccordionctrltab.h @@ -0,0 +1,191 @@ +/** + * @file LLAccordionCtrlTab.h + * @brief Collapsible box control implementation + * + * $LicenseInfo:firstyear=2004&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_ACCORDIONCTRLTAB_H_ +#define LL_ACCORDIONCTRLTAB_H_ + +#include +#include "llrect.h" + +class LLUICtrl; +class LLUICtrlFactory; +class LLUIImage; +class LLButton; +class LLTextBox; + + + +// LLAccordionCtrlTab is a container for other controls. +// It has a Header, by clicking on which hosted controls are shown or hidden. +// When hosted controls are show - LLAccordionCtrlTab is expanded. +// When hosted controls are hidden - LLAccordionCtrlTab is collapsed. + +class LLAccordionCtrlTab : public LLUICtrl +{ +// Interface +public: + + struct Params + : public LLInitParam::Block + { + Optional display_children, //expanded or collapsed after initialization + collapsible; + + Optional title; + + Optional header_height, + min_width, + min_height; + + // Overlay images (arrows on the left) + Mandatory header_expand_img, + header_expand_img_pressed, + header_collapse_img, + header_collapse_img_pressed; + + // Background images for the accordion tabs + Mandatory header_image, + header_image_over, + header_image_pressed, + header_image_focused; + + Optional header_bg_color, + header_text_color, + dropdown_bg_color; + + Optional header_visible; + + Optional padding_left; + Optional padding_right; + Optional padding_top; + Optional padding_bottom; + + Params(); + }; + + typedef LLDefaultChildRegistry child_registry_t; + + virtual ~LLAccordionCtrlTab(); + + // Registers callback for expand/collapse events. + boost::signals2::connection setDropDownStateChangedCallback(commit_callback_t cb); + + // Changes expand/collapse state + virtual void setDisplayChildren(bool display); + + // Returns expand/collapse state + virtual bool getDisplayChildren() const {return mDisplayChildren;}; + + //set LLAccordionCtrlTab panel + void setAccordionView(LLView* panel); + LLView* getAccordionView(); + + bool getCollapsible() {return mCollapsible;}; + + void setCollapsible(bool collapsible) {mCollapsible = collapsible;}; + void changeOpenClose(bool is_open); + + void canOpenClose(bool can_open_close) { mCanOpenClose = can_open_close;}; + + virtual BOOL postBuild(); + + S32 notifyParent(const LLSD& info); + S32 notify(const LLSD& info); + bool notifyChildren(const LLSD& info); + + void storeOpenCloseState (); + void restoreOpenCloseState (); + +protected: + LLAccordionCtrlTab(const LLAccordionCtrlTab::Params&); + friend class LLUICtrlFactory; + +// Overrides +public: + + // Call reshape after changing size + virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); + + // Changes expand/collapse state and triggers expand/collapse callbacks + virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + + virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); + + virtual bool addChild(LLView* child, S32 tab_group); + + bool isExpanded() { return mDisplayChildren; } + + S32 getHeaderHeight(); + + // Min size functions + + void setHeaderVisible(bool value); + + bool getHeaderVisible() { return mHeaderVisible;} + + S32 mExpandedHeight; // Height of expanded ctrl. + // Used to restore height after expand. + + S32 getPaddingLeft() const { return mPaddingLeft;} + S32 getPaddingRight() const { return mPaddingRight;} + S32 getPaddingTop() const { return mPaddingTop;} + S32 getPaddingBottom() const { return mPaddingBottom;} + + void showAndFocusHeader(); + +private: + + + + class LLAccordionCtrlTabHeader; + LLAccordionCtrlTabHeader* mHeader; //Header + + bool mDisplayChildren; //Expanded/collapsed + bool mCollapsible; + bool mHeaderVisible; + + bool mCanOpenClose; + + S32 mPaddingLeft; + S32 mPaddingRight; + S32 mPaddingTop; + S32 mPaddingBottom; + + bool mStoredOpenCloseState; + bool mWasStateStored; + + + LLUIColor mDropdownBGColor; +}; + +#endif diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 8918fc3018..62cb8380c0 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -63,8 +63,6 @@ include_directories( ) set(viewer_SOURCE_FILES - llaccordionctrl.cpp - llaccordionctrltab.cpp llagent.cpp llagentaccess.cpp llagentdata.cpp @@ -569,8 +567,6 @@ endif (LINUX) set(viewer_HEADER_FILES CMakeLists.txt ViewerInstall.cmake - llaccordionctrl.h - llaccordionctrltab.h llagent.h llagentaccess.h llagentdata.h -- cgit v1.2.3 From d24cd96ef83263a0fe1f5853d6e5cd67f59ed16a Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Mon, 11 Jan 2010 10:41:01 +0000 Subject: EXT-3929: Also look in accordion tabs for help topic. When the user clicks on the help "?" button, we try to find the currently active tab and see if there is a help topic for that tab. In addition, we now also look for a currently-visible accordion tab. --- indra/llui/llpanel.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index db32882438..143f19eea6 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -43,6 +43,7 @@ #include "llerror.h" #include "lltimer.h" +#include "llaccordionctrltab.h" #include "llbutton.h" #include "llmenugl.h" //#include "llstatusbar.h" @@ -851,14 +852,26 @@ static LLPanel *childGetVisibleTabWithHelp(LLView *parent) // look through immediate children first for an active tab with help for (child = parent->getFirstChild(); child; child = parent->findNextSibling(child)) { + LLPanel *curTabPanel = NULL; + + // do we have a tab container? LLTabContainer *tab = dynamic_cast(child); if (tab && tab->getVisible()) { - LLPanel *curTabPanel = tab->getCurrentPanel(); - if (curTabPanel && !curTabPanel->getHelpTopic().empty()) - { - return curTabPanel; - } + curTabPanel = tab->getCurrentPanel(); + } + + // do we have an accordion tab? + LLAccordionCtrlTab* accordion = dynamic_cast(child); + if (accordion && accordion->getDisplayChildren()) + { + curTabPanel = dynamic_cast(accordion->getAccordionView()); + } + + // if we found a valid tab, does it have a help topic? + if (curTabPanel && !curTabPanel->getHelpTopic().empty()) + { + return curTabPanel; } } -- cgit v1.2.3 From 07aa9421e68163432a1c3022617675fc9065f180 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Mon, 11 Jan 2010 11:39:37 +0000 Subject: EXT-4145: Added a secondlife:///app/search SLapp Displays the search floater and performs a search. You can specify an optional category and an optional search string. See the wiki docs for usage details: https://wiki.lindenlab.com/wiki/Viewer_2.0_SLapps --- indra/newview/llfloatersearch.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index c6d9fee630..a7401fdb6f 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -32,6 +32,9 @@ */ #include "llviewerprecompiledheaders.h" + +#include "llcommandhandler.h" +#include "llfloaterreg.h" #include "llfloatersearch.h" #include "llmediactrl.h" #include "lllogininstance.h" @@ -41,6 +44,42 @@ #include "llviewercontrol.h" #include "llweb.h" +// support secondlife:///app/search/{CATEGORY}/{QUERY} SLapps +class LLSearchHandler : public LLCommandHandler +{ +public: + // requires trusted browser to trigger + LLSearchHandler() : LLCommandHandler("search", UNTRUSTED_THROTTLE) { } + bool handle(const LLSD& tokens, const LLSD& query_map, LLMediaCtrl* web) + { + const size_t parts = tokens.size(); + + // get the (optional) category for the search + std::string category; + if (parts > 0) + { + category = tokens[0].asString(); + } + + // get the (optional) search string + std::string search_text; + if (parts > 1) + { + search_text = tokens[1].asString(); + } + + // create the LLSD arguments for the search floater + LLSD args; + args["category"] = category; + args["id"] = LLURI::unescape(search_text); + + // open the search floater and perform the requested search + LLFloaterReg::showInstance("search", args); + return true; + } +}; +LLSearchHandler gSearchHandler; + LLFloaterSearch::LLFloaterSearch(const LLSD& key) : LLFloater(key), LLViewerMediaObserver(), -- cgit v1.2.3 From 86b78d84bc95017fe3060bc1cca994858159ca7a Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Mon, 11 Jan 2010 13:59:32 +0200 Subject: added no_group_text string to the profile panel; --HG-- branch : product-engine --- indra/newview/llpanelavatar.cpp | 2 +- indra/newview/skins/default/xui/en/panel_profile.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index d14bdc5ab5..a55979bb89 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -596,7 +596,7 @@ void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_g std::string group_url= it->second.notNull() ? "[secondlife:///app/group/" + it->second.asString() + "/about " + it->first + "]" - : getString("no_partner_text"); + : getString("no_group_text"); groups += group_url; } diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index 43947262ec..59400663b8 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -27,6 +27,9 @@ + [REG_DATE] ([AGE]) -- cgit v1.2.3 From 1d9591afbe5946f0e3a75aea917097f6a08d8ce5 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Mon, 11 Jan 2010 12:05:39 +0000 Subject: DEV-44732: Added some unit tests for URLs with no protocols. --- indra/llui/tests/llurlentry_test.cpp | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp index 128cd134c1..38cf7124ce 100644 --- a/indra/llui/tests/llurlentry_test.cpp +++ b/indra/llui/tests/llurlentry_test.cpp @@ -545,4 +545,50 @@ namespace tut "XXX [secondlife:///app/teleport/Ahern/50/50/50/ Teleport to Ahern] YYY", "[secondlife:///app/teleport/Ahern/50/50/50/ Teleport to Ahern]"); } + + template<> template<> + void object::test<11>() + { + // + // test LLUrlEntryHTTPNoProtocol - general URLs without a protocol + // + LLUrlEntryHTTPNoProtocol url; + boost::regex r = url.getPattern(); + + testRegex("naked .com URL", r, + "see google.com", + "google.com"); + + testRegex("naked .org URL", r, + "see en.wikipedia.org for details", + "en.wikipedia.org"); + + testRegex("naked .net URL", r, + "example.net", + "example.net"); + + testRegex("naked .edu URL (2 instances)", r, + "MIT web site is at web.mit.edu and also www.mit.edu", + "web.mit.edu"); + + testRegex("invalid .com URL [1]", r, + "..com", + ""); + + testRegex("invalid .com URL [2]", r, + "you.come", + ""); + + testRegex("invalid .com URL [3]", r, + "recommended", + ""); + + testRegex("invalid .edu URL", r, + "hi there scheduled maitenance has begun", + ""); + + testRegex("invalid .net URL", r, + "foo.netty", + ""); + } } -- cgit v1.2.3 From d0c029c6094bf23ad9a016d9029b830d674a566a Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Mon, 11 Jan 2010 14:12:03 +0200 Subject: Fixed normal bug EXT-3764 - Notifications should not stack when selected from the Well. --HG-- branch : product-engine --- indra/newview/llscreenchannel.cpp | 14 +++++++++++++- indra/newview/llscreenchannel.h | 2 ++ indra/newview/llsyswellwindow.cpp | 4 ++++ indra/newview/llsyswellwindow.h | 3 +++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index da3f1543dd..d0b537cdfc 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -357,7 +357,6 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id) toast->setIsHidden(false); toast->resetTimer(); mToastList.push_back((*it)); - mStoredToastList.erase(it); redrawToasts(); } @@ -778,6 +777,19 @@ void LLScreenChannel::hideToastsFromScreen() (*it).toast->setVisible(FALSE); } +//-------------------------------------------------------------------------- +void LLScreenChannel::hideToast(const LLUUID& notification_id) +{ + std::vector::iterator it = find(mToastList.begin(), mToastList.end(), notification_id); + if(mToastList.end() != it) + { + ToastElem te = *it; + te.toast->setVisible(FALSE); + te.toast->stopTimer(); + mToastList.erase(it); + } +} + //-------------------------------------------------------------------------- void LLScreenChannel::removeToastsFromChannel() { diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index 38f27f756b..661b9e4e60 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -176,6 +176,8 @@ public: void modifyToastByNotificationID(LLUUID id, LLPanel* panel); // hide all toasts from screen, but not remove them from a channel void hideToastsFromScreen(); + // hide toast by notification id + void hideToast(const LLUUID& notification_id); // removes all toasts from a channel void removeToastsFromChannel(); // show all toasts in a channel diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 44cf82540a..b5884e8364 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -701,7 +701,11 @@ void LLNotificationWellWindow::onItemClick(LLSysWellItem* item) { LLUUID id = item->getID(); if(mChannel) + { + mChannel->hideToast(mLoadedToastId); mChannel->loadStoredToastByNotificationIDToChannel(id); + mLoadedToastId = id; + } } void LLNotificationWellWindow::onItemClose(LLSysWellItem* item) diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index ded3abcbf4..0c81d1f369 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -162,6 +162,9 @@ private: void onItemClick(LLSysWellItem* item); void onItemClose(LLSysWellItem* item); + // ID of a toast loaded by user (by clicking notification well item) + LLUUID mLoadedToastId; + }; /** -- cgit v1.2.3 From 4a902dd76ae1bbf2e080632ebb51896ed6f007b3 Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Mon, 11 Jan 2010 15:07:44 +0200 Subject: fix normal EXT-3987 [BSI] *Save* button in group profile should be greyed out when there are no changes to save "save" btn will not be visible for groups where you are not a member. fixed enabled/disabled state --HG-- branch : product-engine --- indra/newview/llpanelgroup.cpp | 18 +++++++++++++----- indra/newview/llpanelgroupgeneral.cpp | 11 ++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 94de17c17d..50f92ef116 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -423,6 +423,9 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) getChild("group_name")->setVisible(true); getChild("group_name_editor")->setVisible(false); + + if(button_apply) + button_apply->setVisible(is_member); } reposButtons(); @@ -471,12 +474,17 @@ void LLPanelGroup::draw() childEnable("btn_refresh"); } - bool enable = false; - std::string mesg; - for(std::vector::iterator it = mTabs.begin();it!=mTabs.end();++it) - enable = enable || (*it)->needsApply(mesg); + LLButton* button_apply = findChild("btn_apply"); + + if(button_apply && button_apply->getVisible()) + { + bool enable = false; + std::string mesg; + for(std::vector::iterator it = mTabs.begin();it!=mTabs.end();++it) + enable = enable || (*it)->needsApply(mesg); - childSetEnabled("btn_apply", enable); + childSetEnabled("btn_apply", enable); + } } void LLPanelGroup::refreshData() diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 31dfdde887..21b253223f 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -580,7 +580,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) } } - mComboActiveTitle->resetDirty(); } // If this was just a titles update, we are done. @@ -595,8 +594,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) { mCtrlShowInGroupList->set(gdatap->mShowInList); mCtrlShowInGroupList->setEnabled(mAllowEdit && can_change_ident); - mCtrlShowInGroupList->resetDirty(); - } if (mComboMature) { @@ -610,19 +607,16 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) } mComboMature->setEnabled(mAllowEdit && can_change_ident); mComboMature->setVisible( !gAgent.isTeen() ); - mComboMature->resetDirty(); } if (mCtrlOpenEnrollment) { mCtrlOpenEnrollment->set(gdatap->mOpenEnrollment); mCtrlOpenEnrollment->setEnabled(mAllowEdit && can_change_member_opts); - mCtrlOpenEnrollment->resetDirty(); } if (mCtrlEnrollmentFee) { mCtrlEnrollmentFee->set(gdatap->mMembershipFee > 0); mCtrlEnrollmentFee->setEnabled(mAllowEdit && can_change_member_opts); - mCtrlEnrollmentFee->resetDirty(); } if (mSpinEnrollmentFee) @@ -632,7 +626,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) mSpinEnrollmentFee->setEnabled( mAllowEdit && (fee > 0) && can_change_member_opts); - mSpinEnrollmentFee->resetDirty(); } if (mCtrlReceiveNotices) { @@ -641,7 +634,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) { mCtrlReceiveNotices->setEnabled(mAllowEdit); } - mCtrlReceiveNotices->resetDirty(); } @@ -665,7 +657,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) if (mEditCharter) { mEditCharter->setText(gdatap->mCharter); - mEditCharter->resetDirty(); } if (mListVisibleMembers) @@ -693,6 +684,8 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) mListVisibleMembers->addElement(row); } } + + resetDirty(); } void LLPanelGroupGeneral::updateMembers() -- cgit v1.2.3 From 92b569a6079f55009dd9c291e9d7c56a00baf247 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Mon, 11 Jan 2010 15:05:01 +0000 Subject: EXT-3928: Escape group names in the profile panel URLs. --- indra/llui/llurlentry.cpp | 2 +- indra/newview/llpanelavatar.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index f7528bc62a..1b6dd1b264 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -101,7 +101,7 @@ std::string LLUrlEntryBase::getLabelFromWikiLink(const std::string &url) { start++; } - return url.substr(start, url.size()-start-1); + return unescapeUrl(url.substr(start, url.size()-start-1)); } std::string LLUrlEntryBase::getUrlFromWikiLink(const std::string &string) diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index f3d6dbbb46..fb898f7cdf 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -594,8 +594,8 @@ void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_g if (it != mGroups.begin()) groups += ", "; - - std::string group_url="[secondlife:///app/group/" + it->second.asString() + "/about " + it->first + "]"; + std::string group_name = LLURI::escape(it->first); + std::string group_url="[secondlife:///app/group/" + it->second.asString() + "/about " + group_name + "]"; groups += group_url; } -- cgit v1.2.3 From 35f1b788f9d6b0d850598c43d998abcebb095509 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Mon, 11 Jan 2010 17:42:22 +0200 Subject: Fixed normal bug EXT - 3786 ("View profile" arrow widget in People/Friends list needs tooltip) --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_avatar_list_item.xml | 1 + indra/newview/skins/default/xui/en/panel_group_list_item.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml index 45f9d9c7b6..4342318c22 100644 --- a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml @@ -98,6 +98,7 @@ left_pad="5" right="-3" name="profile_btn" + tool_tip="View profile" top_delta="-2" width="20" /> diff --git a/indra/newview/skins/default/xui/en/panel_group_list_item.xml b/indra/newview/skins/default/xui/en/panel_group_list_item.xml index 5f6b911620..c243d08b97 100644 --- a/indra/newview/skins/default/xui/en/panel_group_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_group_list_item.xml @@ -65,6 +65,7 @@ left_pad="5" right="-3" name="profile_btn" + tool_tip="View profile" top_delta="-2" width="20" /> -- cgit v1.2.3 From ab36981b3b02dd3dec9ed21b8c2220c8b97057ee Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Mon, 11 Jan 2010 17:45:46 +0200 Subject: Fix for normal bug EXT-3888 - [BSI] double click does not fetch/open attachment on group notice. --HG-- branch : product-engine --- indra/newview/llviewermessage.cpp | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3362142807..8d7718c5dc 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1098,28 +1098,6 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,_4,this)); } - // *NOTE dzaporozhan - // Restored from viewer-1-23 to fix EXT-3520 - // Saves Group Notice Attachments to inventory. - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_ImprovedInstantMessage); - msg->nextBlockFast(_PREHASH_AgentData); - msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); - msg->nextBlockFast(_PREHASH_MessageBlock); - msg->addBOOLFast(_PREHASH_FromGroup, FALSE); - msg->addUUIDFast(_PREHASH_ToAgentID, mFromID); - msg->addU8Fast(_PREHASH_Offline, IM_ONLINE); - msg->addUUIDFast(_PREHASH_ID, mTransactionID); - msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary - std::string name; - LLAgentUI::buildFullname(name); - msg->addStringFast(_PREHASH_FromAgentName, name); - msg->addStringFast(_PREHASH_Message, ""); - msg->addU32Fast(_PREHASH_ParentEstateID, 0); - msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null); - msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent()); - std::string from_string; // Used in the pop-up. std::string chatHistory_string; // Used in chat history. @@ -1155,8 +1133,10 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& } } break; - case IM_TASK_INVENTORY_OFFERED: case IM_GROUP_NOTICE: + send_auto_receive_response(); + break; + case IM_TASK_INVENTORY_OFFERED: case IM_GROUP_NOTICE_REQUESTED: // This is an offer from a task or group. // We don't use a new instance of an opener @@ -1171,10 +1151,6 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // end switch (mIM) case IOR_ACCEPT: - msg->addU8Fast(_PREHASH_Dialog, (U8)(mIM + 1)); - msg->addBinaryDataFast(_PREHASH_BinaryBucket, &(mFolderID.mData), sizeof(mFolderID.mData)); - msg->sendReliable(mHost); - //don't spam them if they are getting flooded if (check_offer_throttle(mFromName, true)) { -- cgit v1.2.3 From d258883b0c635ae10d9698217024dc5b7b168d96 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 11 Jan 2010 10:57:26 -0500 Subject: EXT-3952 save outfit button should be enabled on the wearing tab Enabled the button on the wearing tab of the appearance sidepanel and set its functionality to switch to the my outfits tab before the auto-rename happens. Reviewed by Seraph --- indra/newview/llpaneloutfitsinventory.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index a1c12412b5..550fee71bf 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -181,6 +181,10 @@ void LLPanelOutfitsInventory::onNew() { const std::string& outfit_name = LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_OUTFIT); LLUUID outfit_folder = gAgentWearables.makeNewOutfitLinks(outfit_name); + if (mAppearanceTabs) + { + mAppearanceTabs->selectTabByName("outfitslist_tab"); + } } void LLPanelOutfitsInventory::onSelectionChange(const std::deque &items, BOOL user_action) @@ -412,8 +416,7 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) return (getCorrectListenerForAction() != NULL) && hasItemsSelected(); } - if (command_name == "wear" || - command_name == "make_outfit") + if (command_name == "wear") { const BOOL is_my_outfits = (mActivePanel->getName() == "outfitslist_tab"); if (!is_my_outfits) @@ -421,6 +424,10 @@ BOOL LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata) return FALSE; } } + if (command_name == "make_outfit") + { + return TRUE; + } if (command_name == "edit" || command_name == "add" -- cgit v1.2.3 From 8be80d14c199773001a1a22bce89f55bdf22af54 Mon Sep 17 00:00:00 2001 From: Eugene Mutavchi Date: Mon, 11 Jan 2010 19:12:19 +0200 Subject: Fixed normal bug EXT-3988 ([BSI] superfluous bottom bar buttons shown in mouse look after pressing enter) --HG-- branch : product-engine --- indra/newview/llbottomtray.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 976b312509..8c90fffa0a 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -251,14 +251,24 @@ void LLBottomTray::setVisible(BOOL visible) { LLView* viewp = *child_it; std::string name = viewp->getName(); - - if ("chat_bar" == name || "movement_panel" == name || "cam_panel" == name || "snapshot_panel" == name || "gesture_panel" == name) + + // Chat bar is always shown. But the move, camera, gesture and snapshot buttons shouldn't be displayed when we are in mouselook mode. See EXT-3988. + if ("chat_bar" == name || (visibility && ("movement_panel" == name || "cam_panel" == name || "snapshot_panel" == name || "gesture_panel" == name))) continue; else { viewp->setVisible(visibility); } } + + // Apply the saved settings when we are not in mouselook mode, see EXT-3988. + if (visibility) + { + showCameraButton(gSavedSettings.getBOOL("ShowCameraButton")); + showSnapshotButton(gSavedSettings.getBOOL("ShowSnapshotButton")); + showMoveButton(gSavedSettings.getBOOL("ShowMoveButton")); + showGestureButton(gSavedSettings.getBOOL("ShowGestureButton")); + } } } -- cgit v1.2.3 From 1bdae78926d11389ac6f4ca8daae3bf50ba7ceda Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 11 Jan 2010 18:39:15 +0200 Subject: Work on low task EXT-3456 (Code Improvements: Improve LLAvatarListItem to show/hide its buttons properly) Initial implementation: * implemented common functionality to update Avatar List Item children positions & size (for name) depend on children visibility * added its usage whereve visibility of child view is changed * removed direct changing of "info button" visibility in Avatar List when Avatar List Item is added --HG-- branch : product-engine --- indra/newview/llavatarlist.cpp | 2 - indra/newview/llavatarlistitem.cpp | 173 +++++++++++++++++---- indra/newview/llavatarlistitem.h | 49 +++++- .../default/xui/en/panel_avatar_list_item.xml | 6 +- 4 files changed, 194 insertions(+), 36 deletions(-) diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 5df73a994e..13daa79528 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -323,14 +323,12 @@ boost::signals2::connection LLAvatarList::setRefreshCompleteCallback(const commi void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { LLAvatarListItem* item = new LLAvatarListItem(); - item->showInfoBtn(true); item->showSpeakingIndicator(true); item->setName(name); item->setAvatarId(id, mIgnoreOnlineStatus); item->setOnline(mIgnoreOnlineStatus ? true : is_online); item->showLastInteractionTime(mShowLastInteractionTime); - item->childSetVisible("info_btn", false); item->setAvatarIconVisible(mShowIcons); item->setShowInfoBtn(mShowInfoBtn); item->setShowProfileBtn(mShowProfileBtn); diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 6945ac6932..aa5a575464 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -48,6 +48,10 @@ S32 LLAvatarListItem::sIconWidth = 0; S32 LLAvatarListItem::sInfoBtnWidth = 0; S32 LLAvatarListItem::sProfileBtnWidth = 0; S32 LLAvatarListItem::sSpeakingIndicatorWidth = 0; +S32 LLAvatarListItem::sLeftPadding = 0; +S32 LLAvatarListItem::sRightNamePadding = 0; +S32 LLAvatarListItem::sChildrenWidths[LLAvatarListItem::ALIC_COUNT]; + LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) : LLPanel(), @@ -95,10 +99,7 @@ BOOL LLAvatarListItem::postBuild() // so that we can hide and show the icon again later. if (!sStaticInitialized) { - sIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft; - sInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight; - sProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight; - sSpeakingIndicatorWidth = mSpeakingIndicator->getRect().mRight - mAvatarName->getRect().mRight; + initChildrenWidths(this); sStaticInitialized = true; } @@ -137,6 +138,8 @@ void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) mProfileBtn->setVisible(mShowProfileBtn); LLPanel::onMouseEnter(x, y, mask); + + updateChildren(); } void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask) @@ -146,6 +149,8 @@ void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask) mProfileBtn->setVisible(false); LLPanel::onMouseLeave(x, y, mask); + + updateChildren(); } // virtual, called by LLAvatarTracker @@ -215,12 +220,8 @@ void LLAvatarListItem::showLastInteractionTime(bool show) if (show) return; - LLRect name_rect = mAvatarName->getRect(); - LLRect time_rect = mLastInteractionTime->getRect(); - mLastInteractionTime->setVisible(false); - name_rect.mRight += (time_rect.mRight - name_rect.mRight); - mAvatarName->setRect(name_rect); + updateChildren(); } void LLAvatarListItem::setLastInteractionTime(U32 secs_since) @@ -234,12 +235,6 @@ void LLAvatarListItem::setShowInfoBtn(bool show) if(mShowInfoBtn == show) return; mShowInfoBtn = show; - S32 width_delta = show ? - sInfoBtnWidth : sInfoBtnWidth; - - //Translating speaking indicator - mSpeakingIndicator->translate(width_delta, 0); - //Reshaping avatar name - mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight()); } void LLAvatarListItem::setShowProfileBtn(bool show) @@ -248,12 +243,6 @@ void LLAvatarListItem::setShowProfileBtn(bool show) if(mShowProfileBtn == show) return; mShowProfileBtn = show; - S32 width_delta = show ? - sProfileBtnWidth : sProfileBtnWidth; - - //Translating speaking indicator - mSpeakingIndicator->translate(width_delta, 0); - //Reshaping avatar name - mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight()); } void LLAvatarListItem::setSpeakingIndicatorVisible(bool visible) @@ -262,10 +251,7 @@ void LLAvatarListItem::setSpeakingIndicatorVisible(bool visible) if (mSpeakingIndicator->getVisible() == (BOOL)visible) return; mSpeakingIndicator->setVisible(visible); - S32 width_delta = visible ? - sSpeakingIndicatorWidth : sSpeakingIndicatorWidth; - - //Reshaping avatar name - mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight()); + updateChildren(); } void LLAvatarListItem::setAvatarIconVisible(bool visible) @@ -276,11 +262,7 @@ void LLAvatarListItem::setAvatarIconVisible(bool visible) // Show/hide avatar icon. mAvatarIcon->setVisible(visible); - - // Move the avatar name horizontally by icon size + its distance from the avatar name. - LLRect name_rect = mAvatarName->getRect(); - name_rect.mLeft += visible ? sIconWidth : -sIconWidth; - mAvatarName->setRect(name_rect); + updateChildren(); } void LLAvatarListItem::onInfoBtnClick() @@ -346,6 +328,7 @@ void LLAvatarListItem::onNameCache(const std::string& first_name, const std::str void LLAvatarListItem::reshapeAvatarName() { +/* S32 width_delta = 0; width_delta += mShowProfileBtn ? sProfileBtnWidth : 0; width_delta += mSpeakingIndicator->getVisible() ? sSpeakingIndicatorWidth : 0; @@ -357,6 +340,7 @@ void LLAvatarListItem::reshapeAvatarName() S32 width = getRect().getWidth() - width_delta; mAvatarName->reshape(width, height); +*/ } // Convert given number of seconds to a string like "23 minutes", "15 hours" or "3 years", @@ -492,4 +476,133 @@ LLAvatarListItem::icon_color_map_t& LLAvatarListItem::getItemIconColorMap() return item_icon_color_map; } +// static +void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item) +{ + //profile btn width + padding + S32 profile_btn_width = avatar_item->getRect().getWidth() - avatar_item->mProfileBtn->getRect().mLeft; + + //info btn width + padding + S32 info_btn_width = avatar_item->mProfileBtn->getRect().mLeft - avatar_item->mInfoBtn->getRect().mLeft; + + //speaking indicator width + padding + S32 speaking_indicator_width = avatar_item->mInfoBtn->getRect().mLeft - avatar_item->mSpeakingIndicator->getRect().mLeft; + + // last interaction time textbox width + padding + S32 last_interaction_time_width = avatar_item->mSpeakingIndicator->getRect().mLeft - avatar_item->mLastInteractionTime->getRect().mLeft; + + // icon width + padding + S32 icon_width = avatar_item->mAvatarName->getRect().mLeft - avatar_item->mAvatarIcon->getRect().mLeft; + + sLeftPadding = avatar_item->mAvatarIcon->getRect().mLeft; + sRightNamePadding = avatar_item->mLastInteractionTime->getRect().mLeft - avatar_item->mAvatarName->getRect().mRight; + + S32 index = ALIC_COUNT; + sChildrenWidths[--index] = icon_width; + sChildrenWidths[--index] = 0; // for avatar name we don't need its width, it will be calculated as "left available space" + sChildrenWidths[--index] = last_interaction_time_width; + sChildrenWidths[--index] = speaking_indicator_width; + sChildrenWidths[--index] = info_btn_width; + sChildrenWidths[--index] = profile_btn_width; +} + +void LLAvatarListItem::updateChildren() +{ + LL_DEBUGS("AvatarItemReshape") << LL_ENDL; + LL_DEBUGS("AvatarItemReshape") << "Updating for: " << getAvatarName() << LL_ENDL; + + S32 name_new_width = getRect().getWidth(); + S32 ctrl_new_left = name_new_width; + S32 name_new_left = sLeftPadding; + + // iterate through all children and set them into correct position depend on each child visibility + // assume that child indexes are in back order: the first in Enum is the last (right) in the item + // iterate & set child views starting from right to left + for (S32 i = 0; i < ALIC_COUNT; ++i) + { + // skip "name" textbox, it will be processed out of loop later + if (ALIC_NAME == i) continue; + + LLView* control = getItemChildView((EAvatarListItemChildIndex)i); + + LL_DEBUGS("AvatarItemReshape") << "Processing control: " << control->getName() << LL_ENDL; + // skip invisible views + if (!control->getVisible()) continue; + + S32 ctrl_width = sChildrenWidths[i]; // including space between current & left controls + + // decrease available for + name_new_width -= ctrl_width; + LL_DEBUGS("AvatarItemReshape") << "width: " << ctrl_width << ", name_new_width: " << name_new_width << LL_ENDL; + + LLRect control_rect = control->getRect(); + LL_DEBUGS("AvatarItemReshape") << "rect before: " << control_rect << LL_ENDL; + + if (ALIC_ICON == i) + { + // assume that this is the last iteration, + // so it is not necessary to save "ctrl_new_left" value calculated on previous iterations + ctrl_new_left = sLeftPadding;//control_rect.mLeft; + name_new_left = ctrl_new_left + ctrl_width; + } + else + { + ctrl_new_left -= ctrl_width; + } + + LL_DEBUGS("AvatarItemReshape") << "ctrl_new_left: " << ctrl_new_left << LL_ENDL; + + control_rect.setLeftTopAndSize( + ctrl_new_left, + control_rect.mTop, + control_rect.getWidth(), + control_rect.getHeight()); + + LL_DEBUGS("AvatarItemReshape") << "rect after: " << control_rect << LL_ENDL; + control->setShape(control_rect); + } + + // set size and position of the "name" child + LLView* name_view = getItemChildView(ALIC_NAME); + LLRect name_view_rect = name_view->getRect(); + LL_DEBUGS("AvatarItemReshape") << "name rect before: " << name_view_rect << LL_ENDL; + + // apply paddings + name_new_width -= sLeftPadding; + name_new_width -= sRightNamePadding; + + name_view_rect.setLeftTopAndSize( + name_new_left, + name_view_rect.mTop, + name_new_width, + name_view_rect.getHeight()); + + name_view->setShape(name_view_rect); + + LL_DEBUGS("AvatarItemReshape") << "name rect after: " << name_view_rect << LL_ENDL; +} + +LLView* LLAvatarListItem::getItemChildView(EAvatarListItemChildIndex child_view_index) +{ + LLView* child_view = mAvatarName; + if (child_view_index < 0 || ALIC_COUNT <= child_view_index) + { + LL_WARNS("AvatarItemReshape") << "Child view index is out of range: " << child_view_index << LL_ENDL; + return child_view; + } + switch (child_view_index) + { + case ALIC_ICON: child_view = mAvatarIcon; break; + case ALIC_NAME: child_view = mAvatarName; break; + case ALIC_INTERACTION_TIME: child_view = mLastInteractionTime; break; + case ALIC_SPEAKER_INDICATOR: child_view = mSpeakingIndicator; break; + case ALIC_INFO_BUTTON: child_view = mInfoBtn; break; + case ALIC_PROFILE_BUTTON: child_view = mProfileBtn; break; + default: + LL_WARNS("AvatarItemReshape") << "Unexpected child view index is passed: " << child_view_index << LL_ENDL; + } + + return child_view; +} + // EOF diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 96097bc9b5..688197810e 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -98,7 +98,6 @@ public: void onProfileBtnClick(); void showSpeakingIndicator(bool show) { mSpeakingIndicator->setVisible(show); } - void showInfoBtn(bool show_info_btn) {mInfoBtn->setVisible(show_info_btn); } void showLastInteractionTime(bool show); /** @@ -124,6 +123,23 @@ private: E_UNKNOWN, } EOnlineStatus; + /** + * Enumeration of item elements in order from right to left. + * + * updateChildren() assumes that indexes are in the such order to process avatar icon easier. + * + * @see updateChildren() + */ + typedef enum e_avatar_item_child { + ALIC_PROFILE_BUTTON, + ALIC_INFO_BUTTON, + ALIC_SPEAKER_INDICATOR, + ALIC_INTERACTION_TIME, + ALIC_NAME, + ALIC_ICON, + ALIC_COUNT, + } EAvatarListItemChildIndex; + void setNameInternal(const std::string& name, const std::string& highlight); void onNameCache(const std::string& first_name, const std::string& last_name); @@ -135,6 +151,26 @@ private: typedef std::map icon_color_map_t; static icon_color_map_t& getItemIconColorMap(); + /** + * Initializes widths of all children to use them while changing visibility of any of them. + * + * @see updateChildren() + */ + static void initChildrenWidths(LLAvatarListItem* self); + + /** + * Updates position and rectangle of visible children to fit all available item's width. + */ + void updateChildren(); + + /** + * Gets child view specified by index. + * + * This method implemented via switch by all EAvatarListItemChildIndex values. + * It is used to not store children in array or vector to avoid of increasing memory usage. + */ + LLView* getItemChildView(EAvatarListItemChildIndex child_index); + LLTextBox* mAvatarName; LLTextBox* mLastInteractionTime; LLStyle::Params mAvatarNameStyle; @@ -155,6 +191,17 @@ private: static S32 sInfoBtnWidth; //info btn width + padding static S32 sProfileBtnWidth; //profile btn width + padding static S32 sSpeakingIndicatorWidth; //speaking indicator width + padding + static S32 sLeftPadding; // padding to first left visible child (icon or name) + static S32 sRightNamePadding; // right padding from name to next visible child + + /** + * Contains widths of each child specified by EAvatarListItemChildIndex + * including padding to the next right one. + * + * @see initChildrenWidths() + */ + static S32 sChildrenWidths[ALIC_COUNT]; + }; #endif //LL_LLAVATARLISTITEM_H diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml index 4342318c22..615ade99a2 100644 --- a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml @@ -58,13 +58,13 @@ top="6" use_ellipses="true" value="Unknown" - width="182" /> + width="180" /> Date: Mon, 11 Jan 2010 18:50:19 +0200 Subject: Work on low task EXT-3456 (Code Improvements: Improve LLAvatarListItem to show/hide its buttons properly) Code improved: * removed direct changing of "speaker indicator" visibility in Avatar List when Avatar List Item is added --HG-- branch : product-engine --- indra/newview/llavatarlist.cpp | 5 ++--- indra/newview/llavatarlistitem.cpp | 2 +- indra/newview/llavatarlistitem.h | 6 ++---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 13daa79528..19e9e52ddf 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -82,7 +82,7 @@ void LLAvatarList::setSpeakingIndicatorsVisible(bool visible) getItems(items); for( std::vector::const_iterator it = items.begin(); it != items.end(); it++) { - static_cast(*it)->setSpeakingIndicatorVisible(mShowSpeakingIndicator); + static_cast(*it)->showSpeakingIndicator(mShowSpeakingIndicator); } } @@ -323,7 +323,6 @@ boost::signals2::connection LLAvatarList::setRefreshCompleteCallback(const commi void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { LLAvatarListItem* item = new LLAvatarListItem(); - item->showSpeakingIndicator(true); item->setName(name); item->setAvatarId(id, mIgnoreOnlineStatus); item->setOnline(mIgnoreOnlineStatus ? true : is_online); @@ -332,7 +331,7 @@ void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is item->setAvatarIconVisible(mShowIcons); item->setShowInfoBtn(mShowInfoBtn); item->setShowProfileBtn(mShowProfileBtn); - item->setSpeakingIndicatorVisible(mShowSpeakingIndicator); + item->showSpeakingIndicator(mShowSpeakingIndicator); addItem(item, id, pos); } diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index aa5a575464..56ac168c1d 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -245,7 +245,7 @@ void LLAvatarListItem::setShowProfileBtn(bool show) mShowProfileBtn = show; } -void LLAvatarListItem::setSpeakingIndicatorVisible(bool visible) +void LLAvatarListItem::showSpeakingIndicator(bool visible) { // Already done? Then do nothing. if (mSpeakingIndicator->getVisible() == (BOOL)visible) diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 688197810e..64b480c21b 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -88,7 +88,8 @@ public: //Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly void setShowProfileBtn(bool show); void setShowInfoBtn(bool show); - void setSpeakingIndicatorVisible(bool visible); + void showSpeakingIndicator(bool show); + void showLastInteractionTime(bool show); void setAvatarIconVisible(bool visible); const LLUUID& getAvatarId() const; @@ -97,9 +98,6 @@ public: void onInfoBtnClick(); void onProfileBtnClick(); - void showSpeakingIndicator(bool show) { mSpeakingIndicator->setVisible(show); } - void showLastInteractionTime(bool show); - /** * This method was added to fix EXT-2364 (Items in group/ad-hoc IM participant list (avatar names) should be reshaped when adding/removing the "(Moderator)" label) * But this is a *HACK. The real reason of it was in incorrect logic while hiding profile/info/speaker buttons -- cgit v1.2.3 From a2c08d8e86a46fe37006a8086c56866445e57bf3 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Mon, 11 Jan 2010 16:59:28 +0000 Subject: EXT-3429: Don't display inspect slider when inappropriate. The avatar inspector has a volume slider and mute button. We make these widgets invisible when it does not makes sense to interact with them. That is, when the inspector is for your own avatar, or when voice is not active. --- indra/newview/llinspectavatar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 72994a4371..a2b3a54f51 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -278,7 +278,7 @@ void LLInspectAvatar::onOpen(const LLSD& data) getChild("gear_self_btn")->setVisible(self); getChild("gear_btn")->setVisible(!self); - + // Position the inspector relative to the mouse cursor // Similar to how tooltips are positioned // See LLToolTipMgr::createToolTip @@ -518,13 +518,17 @@ void LLInspectAvatar::updateVolumeSlider() bool is_muted = LLMuteList::getInstance()-> isMuted(mAvatarID, LLMute::flagVoiceChat); bool voice_enabled = gVoiceClient->getVoiceEnabled(mAvatarID); + bool is_self = (mAvatarID == gAgent.getID()); LLUICtrl* mute_btn = getChild("mute_btn"); mute_btn->setEnabled( voice_enabled ); mute_btn->setValue( is_muted ); + mute_btn->setVisible( voice_enabled && !is_self ); LLUICtrl* volume_slider = getChild("volume_slider"); volume_slider->setEnabled( voice_enabled && !is_muted ); + volume_slider->setVisible( voice_enabled && !is_self ); + const F32 DEFAULT_VOLUME = 0.5f; F32 volume; if (is_muted) -- cgit v1.2.3 From 2a00a16f57daf7c3f99b0374901c03644a5b5f1b Mon Sep 17 00:00:00 2001 From: Runitai <> Date: Mon, 11 Jan 2010 11:21:52 -0600 Subject: EXT-3784 Fix for first menu item going blank when highlighted on ATI cards. --- indra/llrender/llgl.cpp | 37 ++++++++++++++++++++++++++++++++++++ indra/llrender/llglstates.h | 2 ++ indra/llrender/llrender.cpp | 2 ++ indra/llui/llmenugl.cpp | 2 ++ indra/newview/llspatialpartition.cpp | 1 - 5 files changed, 43 insertions(+), 1 deletion(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 3400a72385..187a9a984e 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1919,6 +1919,16 @@ LLGLDepthTest::LLGLDepthTest(GLboolean depth_enabled, GLboolean write_enabled, G : mPrevDepthEnabled(sDepthEnabled), mPrevDepthFunc(sDepthFunc), mPrevWriteEnabled(sWriteEnabled) { stop_glerror(); + + checkState(); + + if (!depth_enabled) + { // always disable depth writes if depth testing is disabled + // GL spec defines this as a requirement, but some implementations allow depth writes with testing disabled + // The proper way to write to depth buffer with testing disabled is to enable testing and use a depth_func of GL_ALWAYS + write_enabled = FALSE; + } + if (depth_enabled != sDepthEnabled) { gGL.flush(); @@ -1942,6 +1952,7 @@ LLGLDepthTest::LLGLDepthTest(GLboolean depth_enabled, GLboolean write_enabled, G LLGLDepthTest::~LLGLDepthTest() { + checkState(); if (sDepthEnabled != mPrevDepthEnabled ) { gGL.flush(); @@ -1963,6 +1974,32 @@ LLGLDepthTest::~LLGLDepthTest() } } +void LLGLDepthTest::checkState() +{ + if (gDebugGL) + { + GLint func = 0; + GLboolean mask = FALSE; + + glGetIntegerv(GL_DEPTH_FUNC, &func); + glGetBooleanv(GL_DEPTH_WRITEMASK, &mask); + + if (glIsEnabled(GL_DEPTH_TEST) != sDepthEnabled || + sWriteEnabled != mask || + sDepthFunc != func) + { + if (gDebugSession) + { + gFailLog << "Unexpected depth testing state." << std::endl; + } + else + { + LL_GL_ERRS << "Unexpected depth testing state." << LL_ENDL; + } + } + } +} + LLGLClampToFarClip::LLGLClampToFarClip(glh::matrix4f P) { for (U32 i = 0; i < 4; i++) diff --git a/indra/llrender/llglstates.h b/indra/llrender/llglstates.h index 4a51cac438..968a37cab0 100644 --- a/indra/llrender/llglstates.h +++ b/indra/llrender/llglstates.h @@ -46,6 +46,8 @@ public: ~LLGLDepthTest(); + void checkState(); + GLboolean mPrevDepthEnabled; GLenum mPrevDepthFunc; GLboolean mPrevWriteEnabled; diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index fc45df8153..f97d81126e 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -162,6 +162,8 @@ void LLTexUnit::enable(eTextureType type) disable(); // Force a disable of a previous texture type if it's enabled. } mCurrTexType = type; + + gGL.flush(); glEnable(sGLTextureType[type]); } } diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 527c0a1b87..bd67949c2a 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -46,6 +46,7 @@ #include "llmenugl.h" +#include "llgl.h" #include "llmath.h" #include "llrender.h" #include "llfocusmgr.h" @@ -477,6 +478,7 @@ void LLMenuItemGL::draw( void ) if (dynamic_cast(this)) debug_count++; gGL.color4fv( mHighlightBackground.get().mV ); + gl_rect_2d( 0, getRect().getHeight(), getRect().getWidth(), 0 ); } diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 6ca6734598..514d8facb4 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2460,7 +2460,6 @@ void renderOctree(LLSpatialGroup* group) gGL.color4fv(col.mV); drawBox(group->mObjectBounds[0], group->mObjectBounds[1]*1.01f+LLVector3(0.001f, 0.001f, 0.001f)); - glDepthMask(GL_TRUE); gGL.setSceneBlendType(LLRender::BT_ALPHA); if (group->mBuilt <= 0.f) -- cgit v1.2.3 From 66f8c49bd6c1ddfe58cec9dc4d7dd83ae4e86063 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 11 Jan 2010 19:34:32 +0200 Subject: Work on low task EXT-3456 (Code Improvements: Improve LLAvatarListItem to show/hide its buttons properly) Code improved: * removed disabled method LLAvatarListItem::reshapeAvatarName * added refreshing chat participant list immediately after moderator rights are changed (for EXT-2364) --HG-- branch : product-engine --- indra/newview/llavatarlistitem.cpp | 17 ----------------- indra/newview/llavatarlistitem.h | 7 ------- indra/newview/llparticipantlist.cpp | 5 +++-- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 56ac168c1d..5efdbaceb7 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -326,23 +326,6 @@ void LLAvatarListItem::onNameCache(const std::string& first_name, const std::str setName(name); } -void LLAvatarListItem::reshapeAvatarName() -{ -/* - S32 width_delta = 0; - width_delta += mShowProfileBtn ? sProfileBtnWidth : 0; - width_delta += mSpeakingIndicator->getVisible() ? sSpeakingIndicatorWidth : 0; - width_delta += mAvatarIcon->getVisible() ? sIconWidth : 0; - width_delta += mShowInfoBtn ? sInfoBtnWidth : 0; - width_delta += mLastInteractionTime->getVisible() ? mLastInteractionTime->getRect().getWidth() : 0; - - S32 height = mAvatarName->getRect().getHeight(); - S32 width = getRect().getWidth() - width_delta; - - mAvatarName->reshape(width, height); -*/ -} - // Convert given number of seconds to a string like "23 minutes", "15 hours" or "3 years", // taking i18n into account. The format string to use is taken from the panel XML. std::string LLAvatarListItem::formatSeconds(U32 secs) diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 64b480c21b..5c8cc87b7b 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -98,13 +98,6 @@ public: void onInfoBtnClick(); void onProfileBtnClick(); - /** - * This method was added to fix EXT-2364 (Items in group/ad-hoc IM participant list (avatar names) should be reshaped when adding/removing the "(Moderator)" label) - * But this is a *HACK. The real reason of it was in incorrect logic while hiding profile/info/speaker buttons - * *TODO: new reshape method should be provided in lieu of this one to be called when visibility if those buttons is changed - */ - void reshapeAvatarName(); - protected: /** * Contains indicator to show voice activity. diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 362454ee3c..b6f78d08f1 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -166,7 +166,6 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param) { name.erase(found, moderator_indicator_len); item->setName(name); - item->reshapeAvatarName(); } } } @@ -188,7 +187,6 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param) name += " "; name += moderator_indicator; item->setName(name); - item->reshapeAvatarName(); } } } @@ -279,6 +277,9 @@ bool LLParticipantList::onModeratorUpdateEvent(LLPointer e mModeratorList.erase(id); } } + + // apply changes immediately + onAvatarListRefreshed(mAvatarList, LLSD()); } } return true; -- cgit v1.2.3 From b8774e9f6bb235c390854f706aab2f8391991b6a Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 11 Jan 2010 19:42:07 +0200 Subject: Work on low task EXT-3456 (Code Improvements: Improve LLAvatarListItem to show/hide its buttons properly) Code cleanup: * removed unused static members --HG-- branch : product-engine --- indra/newview/llavatarlistitem.cpp | 6 +----- indra/newview/llavatarlistitem.h | 4 ---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 5efdbaceb7..a2e17db3d8 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -44,10 +44,6 @@ #include "llbutton.h" bool LLAvatarListItem::sStaticInitialized = false; -S32 LLAvatarListItem::sIconWidth = 0; -S32 LLAvatarListItem::sInfoBtnWidth = 0; -S32 LLAvatarListItem::sProfileBtnWidth = 0; -S32 LLAvatarListItem::sSpeakingIndicatorWidth = 0; S32 LLAvatarListItem::sLeftPadding = 0; S32 LLAvatarListItem::sRightNamePadding = 0; S32 LLAvatarListItem::sChildrenWidths[LLAvatarListItem::ALIC_COUNT]; @@ -525,7 +521,7 @@ void LLAvatarListItem::updateChildren() { // assume that this is the last iteration, // so it is not necessary to save "ctrl_new_left" value calculated on previous iterations - ctrl_new_left = sLeftPadding;//control_rect.mLeft; + ctrl_new_left = sLeftPadding; name_new_left = ctrl_new_left + ctrl_width; } else diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 5c8cc87b7b..868ee546d4 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -178,10 +178,6 @@ private: bool mShowProfileBtn; static bool sStaticInitialized; // this variable is introduced to improve code readability - static S32 sIconWidth; // icon width + padding - static S32 sInfoBtnWidth; //info btn width + padding - static S32 sProfileBtnWidth; //profile btn width + padding - static S32 sSpeakingIndicatorWidth; //speaking indicator width + padding static S32 sLeftPadding; // padding to first left visible child (icon or name) static S32 sRightNamePadding; // right padding from name to next visible child -- cgit v1.2.3 From 0b63977570221ae7ca0ad46c9f844603ff91eeb4 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 11 Jan 2010 09:53:24 -0800 Subject: Fix build issue with ba93e704bd4f --- indra/newview/llviewermedia.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index f91d126073..9671b9e5dc 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -48,6 +48,8 @@ #include "llviewerwindow.h" #include "llfocusmgr.h" #include "llcallbacklist.h" +#include "llparcel.h" +#include "llaudioengine.h" // for gAudiop #include "llevent.h" // LLSimpleListener #include "llnotificationsutil.h" @@ -909,14 +911,14 @@ void LLViewerMedia::cleanupClass() ////////////////////////////////////////////////////////////////////////////////////////// // static -bool LLViewerParcelMedia::needsMediaFirstRun() +bool LLViewerMedia::needsMediaFirstRun() { return gWarningSettings.getBOOL("FirstStreamingMedia"); } ////////////////////////////////////////////////////////////////////////////////////////// // static -void LLViewerParcelMedia::displayMediaFirstRun() +void LLViewerMedia::displayMediaFirstRun() { gWarningSettings.setBOOL("FirstStreamingMedia", FALSE); @@ -926,7 +928,7 @@ void LLViewerParcelMedia::displayMediaFirstRun() ////////////////////////////////////////////////////////////////////////////////////////// // static -bool LLViewerParcelMedia::firstRunCallback(const LLSD& notification, const LLSD& response) +bool LLViewerMedia::firstRunCallback(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if (option == 0) -- cgit v1.2.3 From dd861135677b54a797305bb92199ac614cae5070 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 11 Jan 2010 10:03:00 -0800 Subject: Backed out changeset b6030bb6ff40 --- indra/newview/llviewermedia.cpp | 73 +++++++++++++++++++++++++++++++++++ indra/newview/llviewermedia.h | 6 +++ indra/newview/llviewerparcelmedia.cpp | 40 +------------------ 3 files changed, 81 insertions(+), 38 deletions(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 7e8c8eb92e..f91d126073 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -54,6 +54,7 @@ #include "lluuid.h" #include "llkeyboard.h" #include "llmutelist.h" +#include "llfirstuse.h" #include // for SkinFolder listener #include @@ -708,6 +709,8 @@ void LLViewerMedia::updateMedia(void *dummy_arg) std::vector proximity_order; + bool inworld_media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia"); + bool needs_first_run = LLViewerMedia::needsMediaFirstRun(); U32 max_instances = gSavedSettings.getU32("PluginInstancesTotal"); U32 max_normal = gSavedSettings.getU32("PluginInstancesNormal"); U32 max_low = gSavedSettings.getU32("PluginInstancesLow"); @@ -822,6 +825,21 @@ void LLViewerMedia::updateMedia(void *dummy_arg) new_priority = LLPluginClassMedia::PRIORITY_LOW; } + if(!inworld_media_enabled) + { + // If inworld media is locked out, force all inworld media to stay unloaded. + if(!pimpl->getUsedInUI()) + { + new_priority = LLPluginClassMedia::PRIORITY_UNLOADED; + if(needs_first_run) + { + // Don't do this more than once in this loop. + needs_first_run = false; + LLViewerMedia::displayMediaFirstRun(); + } + } + } + pimpl->setPriority(new_priority); if(pimpl->getUsedInUI()) @@ -888,6 +906,61 @@ void LLViewerMedia::cleanupClass() gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL); } + +////////////////////////////////////////////////////////////////////////////////////////// +// static +bool LLViewerParcelMedia::needsMediaFirstRun() +{ + return gWarningSettings.getBOOL("FirstStreamingMedia"); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerParcelMedia::displayMediaFirstRun() +{ + gWarningSettings.setBOOL("FirstStreamingMedia", FALSE); + + LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(), + boost::bind(firstRunCallback, _1, _2)); +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +bool LLViewerParcelMedia::firstRunCallback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option == 0) + { + // user has elected to automatically play media. + gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE); + gSavedSettings.setBOOL("AudioStreamingVideo", TRUE); + gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); + gSavedSettings.setBOOL("AudioStreamingMedia", TRUE); + + LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + + if (parcel) + { + // play media right now, if available + LLViewerParcelMedia::play(parcel); + + // play music right now, if available + std::string music_url = parcel->getMusicURL(); + if (gAudiop && !music_url.empty()) + gAudiop->startInternetStream(music_url); + } + } + else + { + gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, FALSE); + gSavedSettings.setBOOL("AudioStreamingMedia", FALSE); + gSavedSettings.setBOOL("AudioStreamingVideo", FALSE); + gSavedSettings.setBOOL("AudioStreamingMusic", FALSE); + } + return false; +} + + ////////////////////////////////////////////////////////////////////////////////////////// // LLViewerMediaImpl ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index b103c48bd8..3ce9f1887c 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -115,6 +115,12 @@ class LLViewerMedia // This is the comparitor used to sort the list. static bool priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2); + + // For displaying the media first-run dialog. + static bool needsMediaFirstRun(); + static void displayMediaFirstRun(); + static bool firstRunCallback(const LLSD& notification, const LLSD& response); + }; // Implementation functions not exported into header file diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 0f7903a7a5..56dee6b34c 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -56,10 +56,6 @@ LLUUID LLViewerParcelMedia::sMediaRegionID; viewer_media_t LLViewerParcelMedia::sMediaImpl; -// Local functions -bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel); - - // static void LLViewerParcelMedia::initClass() { @@ -112,12 +108,10 @@ void LLViewerParcelMedia::update(LLParcel* parcel) // First use warning if( (!mediaUrl.empty() || !parcel->getMusicURL().empty()) - && gWarningSettings.getBOOL("FirstStreamingMedia") ) + && LLViewerMedia::needsMediaFirstRun()) { - LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(), - boost::bind(callback_play_media, _1, _2, parcel)); + LLViewerMedia::displayMediaFirstRun(); return; - } // if we have a current (link sharing) url, use it instead @@ -591,36 +585,6 @@ void LLViewerParcelMedia::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent }; } -bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if (option == 0) - { - // user has elected to automatically play media. - gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE); - gSavedSettings.setBOOL("AudioStreamingVideo", TRUE); - gSavedSettings.setBOOL("AudioStreamingMusic", TRUE); - if(!gSavedSettings.getBOOL("AudioStreamingMedia")) - gSavedSettings.setBOOL("AudioStreamingMedia", TRUE); - // play media right now, if available - LLViewerParcelMedia::play(parcel); - // play music right now, if available - if (parcel) - { - std::string music_url = parcel->getMusicURL(); - if (gAudiop && !music_url.empty()) - gAudiop->startInternetStream(music_url); - } - } - else - { - gSavedSettings.setBOOL("AudioStreamingVideo", FALSE); - gSavedSettings.setBOOL("AudioStreamingMusic", FALSE); - } - gWarningSettings.setBOOL("FirstStreamingMedia", FALSE); - return false; -} - // TODO: observer /* void LLViewerParcelMediaNavigationObserver::onNavigateComplete( const EventType& event_in ) -- cgit v1.2.3 From a452a4a6429bfc4404b07ea7e4ca33f336ec2546 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Mon, 11 Jan 2010 20:51:54 +0200 Subject: Fixed normal bug EXT-3984 (Bottom bar layout issues) * All buttons and controls need to move down 1 px (except chiclets, which are already vertically centered) * Left-hand controls need to shift left about 2 px (there should be 5 px of padding between the chat entry field and the edge of the window) * Right-hand controls (IM and notification buttons) also shift left so there is 5 px of padding against the right edge --HG-- branch : product-engine --- .../skins/default/xui/en/panel_bottomtray.xml | 39 ++++++++-------------- .../skins/default/xui/en/panel_nearby_chat_bar.xml | 4 +-- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index aeaa049f1f..ca547a79e2 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -33,10 +33,10 @@ height="10" image_name="spacer24.tga" layout="topleft" - min_width="4" + min_width="2" left="0" top="0" - width="4" /> + width="2" /> @@ -338,7 +338,7 @@ as for parent layout_panel (chiclet_list_panel) to resize bottom tray properly. layout="topleft" left="0" name="im_well" - top="4" + top="5" width="35"> + + + + + + -- cgit v1.2.3 From 2aaa7971945823f53f0a01028036c37361bcfa17 Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 11 Jan 2010 15:36:02 -0800 Subject: ext-4050 - nearby chat title bar missing background art --- indra/newview/skins/default/xui/en/floater_nearby_chat.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml index 920f0c909a..ae686d9ab7 100644 --- a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml @@ -4,8 +4,8 @@ border_drop_shadow_visible="false" drop_shadow_visible="false" border="false" - bg_opaque_image="Inspector_Background" - bg_alpha_image="Toast_Background" + bg_opaque_image="Window_Foreground" + bg_alpha_image="Window_Background" bg_alpha_color="0 0 0 0" legacy_header_height="18" can_minimize="true" -- cgit v1.2.3 From 1dd4feee4fa8579fe4546d2bbad97a79b29d7060 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 11 Jan 2010 15:38:17 -0800 Subject: Avoid an assertion failure in texture baking. Reviewed by Nyx. Deemed 'tiny'... --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6e93bf1bf2..d0acb0bd39 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6822,7 +6822,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) local_tex_iter != baked_dict->mLocalTextures.end(); ++local_tex_iter) { - setBakedReady(*local_tex_iter, TRUE); + if (isSelf()) setBakedReady(*local_tex_iter, TRUE); } // ! BACKWARDS COMPATIBILITY ! -- cgit v1.2.3 From e4b7deae75734f8961e5f04d5f278966b623afb8 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 11 Jan 2010 15:38:26 -0800 Subject: FIX EXT-3972: Don't put up the "multiple media" dialog just because the user doesn't have the "Select Face" tool selected. --- indra/newview/llfloatertools.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 9cae6f0ebd..1287e14961 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -1269,18 +1269,15 @@ void LLFloaterTools::getMediaState() // called when a user wants to add media to a prim or prim face void LLFloaterTools::onClickBtnAddMedia() { - // check for the edit tool and now many faces are selected - LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); - if((tool != LLToolFace::getInstance()) || LLSelectMgr::getInstance()->getSelection()->isMultipleTESelected()) + // check if multiple faces are selected + if(LLSelectMgr::getInstance()->getSelection()->isMultipleTESelected()) { - LLNotificationsUtil::add("MultipleFacesSelected",LLSD(), LLSD(), multipleFacesSelectedConfirm); - + LLNotificationsUtil::add("MultipleFacesSelected", LLSD(), LLSD(), multipleFacesSelectedConfirm); } else { onClickBtnEditMedia(); } - } // static -- cgit v1.2.3 From b98a4756567aedbc771f72d4a4a32b7a59a5c33e Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 11 Jan 2010 15:58:17 -0800 Subject: EXT-3629 About Land > Covenant contains incorrect information reviewed by Richard --- indra/newview/llfloaterland.cpp | 7 +------ indra/newview/llfloaterland.h | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 598a13de15..42c961a956 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -276,6 +276,7 @@ void LLFloaterLand::refresh() mPanelAudio->refresh(); mPanelMedia->refresh(); mPanelAccess->refresh(); + mPanelCovenant->refresh(); } @@ -2795,12 +2796,6 @@ LLPanelLandCovenant::~LLPanelLandCovenant() { } -BOOL LLPanelLandCovenant::postBuild() -{ - refresh(); - return TRUE; -} - // virtual void LLPanelLandCovenant::refresh() { diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index d7d02ba1a3..a4785e8f5b 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -391,7 +391,6 @@ class LLPanelLandCovenant public: LLPanelLandCovenant(LLSafeHandle& parcelp); virtual ~LLPanelLandCovenant(); - virtual BOOL postBuild(); void refresh(); static void updateCovenantText(const std::string& string); static void updateEstateName(const std::string& name); -- cgit v1.2.3 From c1f4dc33c3c1a173cab1083af3f0a60767d09933 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 11 Jan 2010 15:59:53 -0800 Subject: EXT-2373 Viewer crashes if open Region/Estate floater after logging out reviewed by Richard --- indra/newview/llfloaterregioninfo.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index c4b87c1b2d..0402ba20e2 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -406,6 +406,11 @@ LLPanelEstateCovenant* LLFloaterRegionInfo::getPanelCovenant() void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region) { + if (!region) + { + return; + } + // call refresh from region on all panels std::for_each( mInfoPanels.begin(), -- cgit v1.2.3 From 8440d99e4498882dfc61459a91eba746ad717000 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 11 Jan 2010 16:02:57 -0800 Subject: EXT-4077 Clicking motd link opens two web browser windows Fixed click handling weirdness. On mouse up, mTopCtrl was being passed the mouse click, and then again the mRootView regardless of whether the first handled it. Also if mRootView didn't handle a mouse up, it was traversed again to handle the mouse up. reviewed by Richard --- indra/newview/llviewerwindow.cpp | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 83cbc8a1f9..ddaf4a221c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -604,7 +604,6 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK { const char* buttonname = ""; const char* buttonstatestr = ""; - BOOL handled = FALSE; S32 x = pos.mX; S32 y = pos.mY; x = llround((F32)x / mDisplayScale.mV[VX]); @@ -699,7 +698,10 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK } else { - handled = top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleMouseUp(local_x, local_y, mask); + if (top_ctrl->pointInView(local_x, local_y) && top_ctrl->handleMouseUp(local_x, local_y, mask)) + { + return TRUE; + } } } @@ -717,34 +719,12 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK llinfos << buttonname << " Mouse " << buttonstatestr << " not handled by view" << llendl; } - if (down) + // Do not allow tool manager to handle mouseclicks if we have disconnected + if(!gDisconnected && LLToolMgr::getInstance()->getCurrentTool()->handleAnyMouseClick( x, y, mask, clicktype, down ) ) { - if (gDisconnected) - { - return FALSE; - } - - if(LLToolMgr::getInstance()->getCurrentTool()->handleAnyMouseClick( x, y, mask, clicktype, down ) ) - { - return TRUE; - } + return TRUE; } - else - { - if( !handled ) - { - handled = mRootView->handleAnyMouseClick(x, y, mask, clicktype, down); - } - if( !handled ) - { - LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); - if (tool) - { - handled = tool->handleAnyMouseClick(x, y, mask, clicktype, down); - } - } - } // If we got this far on a down-click, it wasn't handled. // Up-clicks, though, are always handled as far as the OS is concerned. -- cgit v1.2.3 From 2aa67af38ebc122dfc6757d9bc2b9e0eabc10323 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 11 Jan 2010 16:23:14 -0800 Subject: fix for EXT-4164: llrender/llimagegl.cpp(1111): ASSERT(mCurrentDiscardLevel>=0) --- indra/newview/lldrawpoolbump.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 5f845c3721..03a8b108e2 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -1149,14 +1149,14 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI if (!LLPipeline::sRenderDeferred) { bump->setExplicitFormat(GL_ALPHA8, GL_ALPHA); - bump->createGLTexture(bump->getDiscardLevel(), dst_image); + bump->createGLTexture(0, dst_image); } else { LLPointer nrm_image = new LLImageRaw(src->getWidth(), src->getHeight(), 4); generateNormalMapFromAlpha(src, nrm_image); bump->setExplicitFormat(GL_RGBA, GL_RGBA); - bump->createGLTexture(bump->getDiscardLevel(), nrm_image); + bump->createGLTexture(0, nrm_image); } -- cgit v1.2.3 From b446f673ffa16ec3055d6f76c003d6ad6e439822 Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 11 Jan 2010 16:28:09 -0800 Subject: EXT-4066 - zooming while holding a hud in edit mode does not scale properly EXT-4040 - Hud starts automoving when clicked reviewed by Mani --- indra/newview/llviewerdisplay.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 3dac0ee452..4d559e2ca7 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1011,7 +1011,7 @@ void render_hud_attachments() LLRect get_whole_screen_region() { - LLRect whole_screen = gViewerWindow->getWindowRectScaled(); + LLRect whole_screen = gViewerWindow->getWorldViewRectScaled(); // apply camera zoom transform (for high res screenshots) F32 zoom_factor = LLViewerCamera::getInstance()->getZoomFactor(); @@ -1019,13 +1019,13 @@ LLRect get_whole_screen_region() if (zoom_factor > 1.f) { S32 num_horizontal_tiles = llceil(zoom_factor); - S32 tile_width = llround((F32)gViewerWindow->getWindowWidthScaled() / zoom_factor); - S32 tile_height = llround((F32)gViewerWindow->getWindowHeightScaled() / zoom_factor); + S32 tile_width = llround((F32)gViewerWindow->getWorldViewWidthScaled() / zoom_factor); + S32 tile_height = llround((F32)gViewerWindow->getWorldViewHeightScaled() / zoom_factor); int tile_y = sub_region / num_horizontal_tiles; int tile_x = sub_region - (tile_y * num_horizontal_tiles); glh::matrix4f mat; - whole_screen.setLeftTopAndSize(tile_x * tile_width, gViewerWindow->getWindowHeightScaled() - (tile_y * tile_height), tile_width, tile_height); + whole_screen.setLeftTopAndSize(tile_x * tile_width, gViewerWindow->getWorldViewHeightScaled() - (tile_y * tile_height), tile_width, tile_height); } return whole_screen; } @@ -1045,12 +1045,12 @@ bool get_hud_matrices(const LLRect& screen_region, glh::matrix4f &proj, glh::mat F32 aspect_ratio = LLViewerCamera::getInstance()->getAspect(); glh::matrix4f mat; - F32 scale_x = (F32)gViewerWindow->getWindowWidthScaled() / (F32)screen_region.getWidth(); - F32 scale_y = (F32)gViewerWindow->getWindowHeightScaled() / (F32)screen_region.getHeight(); + F32 scale_x = (F32)gViewerWindow->getWorldViewWidthScaled() / (F32)screen_region.getWidth(); + F32 scale_y = (F32)gViewerWindow->getWorldViewHeightScaled() / (F32)screen_region.getHeight(); mat.set_scale(glh::vec3f(scale_x, scale_y, 1.f)); mat.set_translate( - glh::vec3f(clamp_rescale((F32)screen_region.getCenterX(), 0.f, (F32)gViewerWindow->getWindowWidthScaled(), 0.5f * scale_x * aspect_ratio, -0.5f * scale_x * aspect_ratio), - clamp_rescale((F32)screen_region.getCenterY(), 0.f, (F32)gViewerWindow->getWindowHeightScaled(), 0.5f * scale_y, -0.5f * scale_y), + glh::vec3f(clamp_rescale((F32)screen_region.getCenterX(), 0.f, (F32)gViewerWindow->getWorldViewWidthScaled(), 0.5f * scale_x * aspect_ratio, -0.5f * scale_x * aspect_ratio), + clamp_rescale((F32)screen_region.getCenterY(), 0.f, (F32)gViewerWindow->getWorldViewHeightScaled(), 0.5f * scale_y, -0.5f * scale_y), 0.f)); proj *= mat; @@ -1300,8 +1300,8 @@ void render_ui_2d() if (gAgent.getAvatarObject() && gAgent.mHUDCurZoom < 0.98f) { glPushMatrix(); - S32 half_width = (gViewerWindow->getWindowWidthScaled() / 2); - S32 half_height = (gViewerWindow->getWindowHeightScaled() / 2); + S32 half_width = (gViewerWindow->getWorldViewWidthScaled() / 2); + S32 half_height = (gViewerWindow->getWorldViewHeightScaled() / 2); glScalef(LLUI::sGLScaleFactor.mV[0], LLUI::sGLScaleFactor.mV[1], 1.f); glTranslatef((F32)half_width, (F32)half_height, 0.f); F32 zoom = gAgent.mHUDCurZoom; -- cgit v1.2.3 From a94b6b26e9681775b4ba247fba4950e0ffd990c0 Mon Sep 17 00:00:00 2001 From: Erica Date: Mon, 11 Jan 2010 17:19:41 -0800 Subject: Removing old art assets --- indra/newview/skins/default/textures/textures.xml | 8 +---- indra/newview/skins/default/xui/en/menu_viewer.xml | 36 +--------------------- .../skins/default/xui/en/panel_status_bar.xml | 1 + 3 files changed, 3 insertions(+), 42 deletions(-) diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index dab11149b9..83121e73c8 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -224,7 +224,7 @@ with the same filename but different name scale.left="4" scale.top="28" scale.right="60" scale.bottom="4" /> - + @@ -676,8 +676,6 @@ with the same filename but different name - - @@ -715,10 +713,6 @@ with the same filename but different name - - - - diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index fa7e3e86a3..45100eb1ff 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -198,40 +198,6 @@ function="Floater.Toggle" parameter="nearby_media" /> - - - - - - - - - diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index 00f54feabd..bbde47d2e1 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -42,6 +42,7 @@