aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewerwindow.cpp58
1 files changed, 35 insertions, 23 deletions
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp
index eb8977c..f7713c2 100644
--- a/linden/indra/newview/llviewerwindow.cpp
+++ b/linden/indra/newview/llviewerwindow.cpp
@@ -54,7 +54,7 @@
54// 54//
55 55
56// linden library includes 56// linden library includes
57#include "audioengine.h" // mute on minimize 57#include "llaudioengine.h" // mute on minimize
58#include "indra_constants.h" 58#include "indra_constants.h"
59#include "llassetstorage.h" 59#include "llassetstorage.h"
60#include "llfontgl.h" 60#include "llfontgl.h"
@@ -156,7 +156,6 @@
156#include "lltoolselectland.h" 156#include "lltoolselectland.h"
157#include "lltoolview.h" 157#include "lltoolview.h"
158#include "lluictrlfactory.h" 158#include "lluictrlfactory.h"
159#include "lluploaddialog.h"
160#include "llurldispatcher.h" // SLURL from other app instance 159#include "llurldispatcher.h" // SLURL from other app instance
161#include "llvieweraudio.h" 160#include "llvieweraudio.h"
162#include "llviewercamera.h" 161#include "llviewercamera.h"
@@ -164,6 +163,8 @@
164#include "llviewerimagelist.h" 163#include "llviewerimagelist.h"
165#include "llviewerinventory.h" 164#include "llviewerinventory.h"
166#include "llviewerkeyboard.h" 165#include "llviewerkeyboard.h"
166#include "llviewermedia.h"
167#include "llviewermediafocus.h"
167#include "llviewermenu.h" 168#include "llviewermenu.h"
168#include "llviewermessage.h" 169#include "llviewermessage.h"
169#include "llviewerobjectlist.h" 170#include "llviewerobjectlist.h"
@@ -310,7 +311,9 @@ public:
310 S32 hours = (S32)(time / (60*60)); 311 S32 hours = (S32)(time / (60*60));
311 S32 mins = (S32)((time - hours*(60*60)) / 60); 312 S32 mins = (S32)((time - hours*(60*60)) / 60);
312 S32 secs = (S32)((time - hours*(60*60) - mins*60)); 313 S32 secs = (S32)((time - hours*(60*60) - mins*60));
313 addText(xpos, ypos, llformat(" Debug %d: %d:%02d:%02d", idx, hours,mins,secs)); ypos += y_inc2; 314 std::string label = gDebugTimerLabel[idx];
315 if (label.empty()) label = llformat("Debug: %d", idx);
316 addText(xpos, ypos, llformat(" %s: %d:%02d:%02d", label.c_str(), hours,mins,secs)); ypos += y_inc2;
314 } 317 }
315 318
316 F32 time = gFrameTimeSeconds; 319 F32 time = gFrameTimeSeconds;
@@ -795,6 +798,7 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK
795 if (handle) 798 if (handle)
796 return handle; 799 return handle;
797 800
801
798 // *HACK: this should be rolled into the composite tool logic, not 802 // *HACK: this should be rolled into the composite tool logic, not
799 // hardcoded at the top level. 803 // hardcoded at the top level.
800 if (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode() && LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance()) 804 if (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode() && LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance())
@@ -1141,7 +1145,7 @@ void LLViewerWindow::handleDataCopy(LLWindow *window, S32 data_type, void *data)
1141 case SLURL_MESSAGE_TYPE: 1145 case SLURL_MESSAGE_TYPE:
1142 // received URL 1146 // received URL
1143 std::string url = (const char*)data; 1147 std::string url = (const char*)data;
1144 LLWebBrowserCtrl* web = NULL; 1148 LLMediaCtrl* web = NULL;
1145 const bool trusted_browser = false; 1149 const bool trusted_browser = false;
1146 if (LLURLDispatcher::dispatch(url, web, trusted_browser)) 1150 if (LLURLDispatcher::dispatch(url, web, trusted_browser))
1147 { 1151 {
@@ -1736,6 +1740,19 @@ void LLViewerWindow::initWorldUI()
1736 // menu holder appears on top to get first pass at all mouse events 1740 // menu holder appears on top to get first pass at all mouse events
1737 1741
1738 mRootView->sendChildToFront(gMenuHolder); 1742 mRootView->sendChildToFront(gMenuHolder);
1743
1744 if ( gHUDView == NULL )
1745 {
1746 LLRect hud_rect = full_window;
1747 hud_rect.mBottom += 50;
1748 if (gMenuBarView)
1749 {
1750 hud_rect.mTop -= gMenuBarView->getRect().getHeight();
1751 }
1752 gHUDView = new LLHUDView(hud_rect);
1753 // put behind everything else in the UI
1754 mRootView->addChildAtEnd(gHUDView);
1755 }
1739} 1756}
1740 1757
1741// Destroy the UI 1758// Destroy the UI
@@ -2180,7 +2197,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
2180 if (key < 0x80) 2197 if (key < 0x80)
2181 { 2198 {
2182 // Not a special key, so likely (we hope) to generate a character. Let it fall through to character handler first. 2199 // Not a special key, so likely (we hope) to generate a character. Let it fall through to character handler first.
2183 return gFocusMgr.childHasKeyboardFocus(mRootView); 2200 return (gFocusMgr.getKeyboardFocus() != NULL);
2184 } 2201 }
2185 } 2202 }
2186 2203
@@ -2243,7 +2260,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
2243 } 2260 }
2244 2261
2245 // Traverses up the hierarchy 2262 // Traverses up the hierarchy
2246 LLUICtrl* keyboard_focus = gFocusMgr.getKeyboardFocus(); 2263 LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
2247 if( keyboard_focus ) 2264 if( keyboard_focus )
2248 { 2265 {
2249 // arrow keys move avatar while chatting hack 2266 // arrow keys move avatar while chatting hack
@@ -2377,7 +2394,7 @@ BOOL LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask)
2377 } 2394 }
2378 2395
2379 // Traverses up the hierarchy 2396 // Traverses up the hierarchy
2380 LLView* keyboard_focus = gFocusMgr.getKeyboardFocus(); 2397 LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
2381 if( keyboard_focus ) 2398 if( keyboard_focus )
2382 { 2399 {
2383 if (keyboard_focus->handleUnicodeChar(uni_char, FALSE)) 2400 if (keyboard_focus->handleUnicodeChar(uni_char, FALSE))
@@ -2530,7 +2547,7 @@ BOOL LLViewerWindow::handlePerFrameHover()
2530 } 2547 }
2531 2548
2532 // clean up current focus 2549 // clean up current focus
2533 LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); 2550 LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus());
2534 if (cur_focus) 2551 if (cur_focus)
2535 { 2552 {
2536 if (!cur_focus->isInVisibleChain() || !cur_focus->isInEnabledChain()) 2553 if (!cur_focus->isInVisibleChain() || !cur_focus->isInEnabledChain())
@@ -2910,12 +2927,18 @@ BOOL LLViewerWindow::handlePerFrameHover()
2910 { 2927 {
2911 do_pick = FALSE; 2928 do_pick = FALSE;
2912 } 2929 }
2930
2931 if(LLViewerMediaFocus::getInstance()->getFocus())
2932 {
2933 // When in-world media is in focus, pick every frame so that browser mouse-overs, dragging scrollbars, etc. work properly.
2934 do_pick = TRUE;
2935 }
2913 2936
2914 if (do_pick) 2937 if (do_pick)
2915 { 2938 {
2916 mouse_moved_since_pick = FALSE; 2939 mouse_moved_since_pick = FALSE;
2917 mPickTimer.reset(); 2940 mPickTimer.reset();
2918 pickAsync(getCurrentMouseX(), getCurrentMouseY(), mask, hoverPickCallback, TRUE); 2941 pickAsync(getCurrentMouseX(), getCurrentMouseY(), mask, hoverPickCallback, TRUE, TRUE);
2919 } 2942 }
2920 2943
2921 previous_x = x; 2944 previous_x = x;
@@ -4694,7 +4717,7 @@ BOOL LLViewerWindow::changeDisplaySettings(BOOL fullscreen, LLCoordScreen size,
4694 BOOL result_first_try = FALSE; 4717 BOOL result_first_try = FALSE;
4695 BOOL result_second_try = FALSE; 4718 BOOL result_second_try = FALSE;
4696 4719
4697 LLUICtrl* keyboard_focus = gFocusMgr.getKeyboardFocus(); 4720 LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
4698 send_agent_pause(); 4721 send_agent_pause();
4699 llinfos << "Stopping GL during changeDisplaySettings" << llendl; 4722 llinfos << "Stopping GL during changeDisplaySettings" << llendl;
4700 stopGL(); 4723 stopGL();
@@ -4923,7 +4946,6 @@ LLBottomPanel::LLBottomPanel(const LLRect &rect) :
4923 4946
4924 mFactoryMap["toolbar"] = LLCallbackMap(createToolBar, NULL); 4947 mFactoryMap["toolbar"] = LLCallbackMap(createToolBar, NULL);
4925 mFactoryMap["overlay"] = LLCallbackMap(createOverlayBar, NULL); 4948 mFactoryMap["overlay"] = LLCallbackMap(createOverlayBar, NULL);
4926 mFactoryMap["hud"] = LLCallbackMap(createHUD, NULL);
4927 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_bars.xml", &getFactoryMap()); 4949 LLUICtrlFactory::getInstance()->buildPanel(this, "panel_bars.xml", &getFactoryMap());
4928 4950
4929 setOrigin(rect.mLeft, rect.mBottom); 4951 setOrigin(rect.mLeft, rect.mBottom);
@@ -4946,12 +4968,6 @@ void LLBottomPanel::draw()
4946 LLPanel::draw(); 4968 LLPanel::draw();
4947} 4969}
4948 4970
4949void* LLBottomPanel::createHUD(void* data)
4950{
4951 gHUDView = new LLHUDView();
4952 return gHUDView;
4953}
4954
4955 4971
4956void* LLBottomPanel::createOverlayBar(void* data) 4972void* LLBottomPanel::createOverlayBar(void* data)
4957{ 4973{
@@ -5164,12 +5180,8 @@ void LLPickInfo::updateXYCoords()
5164 LLPointer<LLViewerImage> imagep = gImageList.getImage(tep->getID()); 5180 LLPointer<LLViewerImage> imagep = gImageList.getImage(tep->getID());
5165 if(mUVCoords.mV[VX] >= 0.f && mUVCoords.mV[VY] >= 0.f && imagep.notNull()) 5181 if(mUVCoords.mV[VX] >= 0.f && mUVCoords.mV[VY] >= 0.f && imagep.notNull())
5166 { 5182 {
5167 LLCoordGL coords; 5183 mXYCoords.mX = llround(mUVCoords.mV[VX] * (F32)imagep->getWidth());
5168 5184 mXYCoords.mY = llround((1.f - mUVCoords.mV[VY]) * (F32)imagep->getHeight());
5169 coords.mX = llround(mUVCoords.mV[VX] * (F32)imagep->getWidth());
5170 coords.mY = llround(mUVCoords.mV[VY] * (F32)imagep->getHeight());
5171
5172 gViewerWindow->getWindow()->convertCoords(coords, &mXYCoords);
5173 } 5185 }
5174 } 5186 }
5175} 5187}