diff options
Diffstat (limited to 'indra/newview')
149 files changed, 1580 insertions, 1216 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 649d86aaa6..13c381edae 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -185,7 +185,7 @@ set(viewer_SOURCE_FILES llfloatermediasettings.cpp llfloatermemleak.cpp llfloaternamedesc.cpp - llfloaternearbymedia.cpp + llfloaternearbymedia.cpp llfloaternotificationsconsole.cpp llfloateropenobject.cpp llfloaterparcel.cpp @@ -681,7 +681,7 @@ set(viewer_HEADER_FILES llfloatermediasettings.h llfloatermemleak.h llfloaternamedesc.h - llfloaternearbymedia.h + llfloaternearbymedia.h llfloaternotificationsconsole.h llfloateropenobject.h llfloaterparcel.h @@ -1168,7 +1168,7 @@ if (WINDOWS) if (NOT STANDALONE) list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES}) - endif (NOT STANDALONE) + endif (NOT STANDALONE) find_library(DINPUT_LIBRARY dinput8 ${DIRECTX_LIBRARY_DIR}) find_library(DXGUID_LIBRARY dxguid ${DIRECTX_LIBRARY_DIR}) @@ -1350,7 +1350,7 @@ file(GLOB EVENT_HOST_SCRIPT_GLOB_LIST ${CMAKE_CURRENT_SOURCE_DIR}/../viewer_components/*.py) list(APPEND EVENT_HOST_SCRIPTS ${EVENT_HOST_SCRIPT_GLOB_LIST}) -set(PACKAGE OFF CACHE BOOL +set(PACKAGE ON CACHE BOOL "Add a package target that builds an installer package.") if (WINDOWS) @@ -1379,7 +1379,7 @@ if (WINDOWS) ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.sln --workingdir ${VIEWER_BINARY_NAME} - ${CMAKE_CURRENT_SOURCE_DIR} + "./${CMAKE_CFG_INTDIR}" COMMENT "Setting the ${VIEWER_BINARY_NAME} working directory for debugging." ) endif (NOT UNATTENDED) @@ -1396,85 +1396,87 @@ if (WINDOWS) ) add_custom_command( - TARGET ${VIEWER_BINARY_NAME} PRE_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS - -E - copy_if_different - ${CMAKE_CURRENT_SOURCE_DIR}/../../etc/message.xml - ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/app_settings/message.xml - COMMENT "Copying message.xml to the runtime folder." - ) + TARGET ${VIEWER_BINARY_NAME} PRE_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS + -E + copy_if_different + ${CMAKE_CURRENT_SOURCE_DIR}/../../etc/message.xml + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/app_settings/message.xml + COMMENT "Copying message.xml to the runtime folder." + ) - if(WINDOWS) - # Copy Win Libs... - # This happens at build time, not config time. We can't glob files in this cmake. - # *FIX:Mani Write a sub script to glob the files... - # *FIX:Mani Use actually dependencies rather than bulk copy. - add_custom_command( - TARGET ${VIEWER_BINARY_NAME} PRE_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS - -E - copy_directory - ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR} - ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} - COMMENT "Copying staged dlls." - ) + add_custom_command( + TARGET ${VIEWER_BINARY_NAME} POST_BUILD + COMMAND ${PYTHON_EXECUTABLE} + ARGS + ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + --actions=copy + --artwork=${ARTWORK_DIR} + --build=${CMAKE_CURRENT_BINARY_DIR} + --configuration=${CMAKE_CFG_INTDIR} + --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} + --grid=${GRID} + --source=${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + COMMENT "Performing viewer_manifest copy" + ) - add_dependencies(${VIEWER_BINARY_NAME} stage_third_party_libs llcommon) - if(LLKDU_LIBRARY) - # kdu may not exist! - add_dependencies(${VIEWER_BINARY_NAME} llkdu) - endif(LLKDU_LIBRARY) - endif(WINDOWS) + add_dependencies(${VIEWER_BINARY_NAME} stage_third_party_libs llcommon) + + if(LLKDU_LIBRARY) + # kdu may not exist! + add_dependencies(${VIEWER_BINARY_NAME} llkdu) + endif(LLKDU_LIBRARY) if (EXISTS ${CMAKE_SOURCE_DIR}/copy_win_scripts) add_dependencies(${VIEWER_BINARY_NAME} copy_win_scripts) endif (EXISTS ${CMAKE_SOURCE_DIR}/copy_win_scripts) - add_custom_command( + add_dependencies(${VIEWER_BINARY_NAME} + SLPlugin + media_plugin_quicktime + media_plugin_webkit + windows-updater + windows-crash-logger + ) + + if (PACKAGE) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2 + COMMAND ${PYTHON_EXECUTABLE} + ARGS + ${CMAKE_CURRENT_SOURCE_DIR}/event_host_manifest.py + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CFG_INTDIR} + DEPENDS + lleventhost + ${EVENT_HOST_SCRIPTS} + ${CMAKE_CURRENT_SOURCE_DIR}/event_host_manifest.py + ) + + add_custom_command( OUTPUT ${CMAKE_CFG_INTDIR}/touched.bat COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - --configuration=${CMAKE_CFG_INTDIR} + --artwork=${ARTWORK_DIR} + --build=${CMAKE_CURRENT_BINARY_DIR} --channel=${VIEWER_CHANNEL} - --login_channel=${VIEWER_LOGIN_CHANNEL} + --configuration=${CMAKE_CFG_INTDIR} + --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} --grid=${GRID} + --login_channel=${VIEWER_LOGIN_CHANNEL} --source=${CMAKE_CURRENT_SOURCE_DIR} - --artwork=${ARTWORK_DIR} - --build=${CMAKE_CURRENT_BINARY_DIR} - --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} - --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/touched.bat + --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/touched.bat DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) - add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit) - - if (PACKAGE) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2 - COMMAND ${PYTHON_EXECUTABLE} - ARGS - ${CMAKE_CURRENT_SOURCE_DIR}/event_host_manifest.py - ${CMAKE_CURRENT_SOURCE_DIR}/.. - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CFG_INTDIR} - - DEPENDS - lleventhost - ${EVENT_HOST_SCRIPTS} - ${CMAKE_CURRENT_SOURCE_DIR}/event_host_manifest.py) - - add_custom_target(package ALL - DEPENDS - ${CMAKE_CFG_INTDIR}/touched.bat) - # temporarily disable packaging of event_host until hg subrepos get - # sorted out on the parabuild cluster... - #${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2) - add_dependencies(package windows-updater windows-crash-logger) - + add_custom_target(package ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat) + # temporarily disable packaging of event_host until hg subrepos get + # sorted out on the parabuild cluster... + #${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/event_host.tar.bz2) endif (PACKAGE) endif (WINDOWS) @@ -1537,15 +1539,16 @@ if (LINUX) COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - --grid=${GRID} - --channel=${VIEWER_CHANNEL} - --login_channel=${VIEWER_LOGIN_CHANNEL} - --installer_name=${product} --arch=${ARCH} - --source=${CMAKE_CURRENT_SOURCE_DIR} --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} + --channel=${VIEWER_CHANNEL} + --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged + --grid=${GRID} + --installer_name=${product} + --login_channel=${VIEWER_LOGIN_CHANNEL} + --source=${CMAKE_CURRENT_SOURCE_DIR} --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched DEPENDS secondlife-stripped ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) @@ -1580,13 +1583,13 @@ if (DARWIN) COMMAND ${PYTHON_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py - --grid=${GRID} --actions=copy - --configuration=${CMAKE_CFG_INTDIR} - --source=${CMAKE_CURRENT_SOURCE_DIR} --artwork=${ARTWORK_DIR} --build=${CMAKE_CURRENT_BINARY_DIR} + --configuration=${CMAKE_CFG_INTDIR} --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app + --grid=${GRID} + --source=${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${VIEWER_BINARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 55ff255c38..15c9499bbc 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5327,6 +5327,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>PluginAttachDebuggerToPlugins</key> + <map> + <key>Comment</key> + <string>If true, attach a debugger session to each plugin process as it's launched.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>PluginInstancesCPULimit</key> <map> <key>Comment</key> diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 24bdf66c2a..d2c8558f0b 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2619,9 +2619,9 @@ void LLAgent::updateLookAt(const S32 mouse_x, const S32 mouse_y) { // range from -.5 to .5 F32 x_from_center = - ((F32) mouse_x / (F32) gViewerWindow->getWindowWidth() ) - 0.5f; + ((F32) mouse_x / (F32) gViewerWindow->getWindowWidthScaled() ) - 0.5f; F32 y_from_center = - ((F32) mouse_y / (F32) gViewerWindow->getWindowHeight() ) - 0.5f; + ((F32) mouse_y / (F32) gViewerWindow->getWindowHeightScaled() ) - 0.5f; frameCamera.yaw( - x_from_center * gSavedSettings.getF32("YawFromMousePosition") * DEG_TO_RAD); frameCamera.pitch( - y_from_center * gSavedSettings.getF32("PitchFromMousePosition") * DEG_TO_RAD); @@ -3436,11 +3436,11 @@ F32 LLAgent::calcCustomizeAvatarUIOffset( const LLVector3d& camera_pos_global ) const LLRect& rect = gFloaterCustomize->getRect(); // Move the camera so that the avatar isn't covered up by this floater. - F32 fraction_of_fov = 0.5f - (0.5f * (1.f - llmin(1.f, ((F32)rect.getWidth() / (F32)gViewerWindow->getWindowWidth())))); + F32 fraction_of_fov = 0.5f - (0.5f * (1.f - llmin(1.f, ((F32)rect.getWidth() / (F32)gViewerWindow->getWindowWidthScaled())))); F32 apparent_angle = fraction_of_fov * LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect(); // radians F32 offset = tan(apparent_angle); - if( rect.mLeft < (gViewerWindow->getWindowWidth() - rect.mRight) ) + if( rect.mLeft < (gViewerWindow->getWindowWidthScaled() - rect.mRight) ) { // Move the avatar to the right (camera to the left) ui_offset = offset; diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index 0f00078b33..3da6a4e3f4 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -22,12 +22,20 @@ #include "llviewerregion.h" LLAgentListener::LLAgentListener(LLAgent &agent) - : LLDispatchListener("LLAgent", "op"), + : LLEventAPI("LLAgent", + "LLAgent listener to (e.g.) teleport, sit, stand, etc."), mAgent(agent) { - add("requestTeleport", &LLAgentListener::requestTeleport); - add("requestSit", &LLAgentListener::requestSit); - add("requestStand", &LLAgentListener::requestStand); + add("requestTeleport", + "Teleport: [\"regionname\"], [\"x\"], [\"y\"], [\"z\"]\n" + "If [\"skip_confirmation\"] is true, use LLURLDispatcher rather than LLCommandDispatcher.", + &LLAgentListener::requestTeleport); + add("requestSit", + "Ask to sit on the object specified in [\"obj_uuid\"]", + &LLAgentListener::requestSit); + add("requestStand", + "Ask to stand up", + &LLAgentListener::requestStand); } void LLAgentListener::requestTeleport(LLSD const & event_data) const diff --git a/indra/newview/llagentlistener.h b/indra/newview/llagentlistener.h index 6f0b5a54c5..eed6922b3e 100644 --- a/indra/newview/llagentlistener.h +++ b/indra/newview/llagentlistener.h @@ -13,12 +13,12 @@ #ifndef LL_LLAGENTLISTENER_H #define LL_LLAGENTLISTENER_H -#include "lleventdispatcher.h" +#include "lleventapi.h" class LLAgent; class LLSD; -class LLAgentListener : public LLDispatchListener +class LLAgentListener : public LLEventAPI { public: LLAgentListener(LLAgent &agent); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 8e6d6b885d..845a264327 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -207,7 +207,7 @@ #pragma warning (disable:4702) #endif -static LLAppViewerListener sAppViewerListener("LLAppViewer", LLAppViewer::instance); +static LLAppViewerListener sAppViewerListener(LLAppViewer::instance); ////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor // @@ -3282,7 +3282,7 @@ void LLAppViewer::saveFinalSnapshot() snap_filename += gDirUtilp->getDirDelimiter(); snap_filename += SCREEN_LAST_FILENAME; // use full pixel dimensions of viewer window (not post-scale dimensions) - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight(), FALSE, TRUE); + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, TRUE); mSavedFinalSnapshot = TRUE; } } diff --git a/indra/newview/llappviewerlistener.cpp b/indra/newview/llappviewerlistener.cpp index 3259309eee..adb5f43c1a 100644 --- a/indra/newview/llappviewerlistener.cpp +++ b/indra/newview/llappviewerlistener.cpp @@ -19,14 +19,18 @@ // other Linden headers #include "llappviewer.h" -LLAppViewerListener::LLAppViewerListener(const std::string& pumpname, - const LLAppViewerGetter& getter): - LLDispatchListener(pumpname, "op"), +LLAppViewerListener::LLAppViewerListener(const LLAppViewerGetter& getter): + LLEventAPI("LLAppViewer", + "LLAppViewer listener to (e.g.) request shutdown"), mAppViewerGetter(getter) { // add() every method we want to be able to invoke via this event API. - add("requestQuit", &LLAppViewerListener::requestQuit); - add("forceQuit", &LLAppViewerListener::forceQuit); + add("requestQuit", + "Ask to quit nicely", + &LLAppViewerListener::requestQuit); + add("forceQuit", + "Quit abruptly", + &LLAppViewerListener::forceQuit); } void LLAppViewerListener::requestQuit(const LLSD& event) diff --git a/indra/newview/llappviewerlistener.h b/indra/newview/llappviewerlistener.h index 73227cb95a..deedcbc179 100644 --- a/indra/newview/llappviewerlistener.h +++ b/indra/newview/llappviewerlistener.h @@ -12,20 +12,19 @@ #if ! defined(LL_LLAPPVIEWERLISTENER_H) #define LL_LLAPPVIEWERLISTENER_H -#include "lleventdispatcher.h" +#include "lleventapi.h" #include <boost/function.hpp> class LLAppViewer; class LLSD; /// Listen on an LLEventPump with specified name for LLAppViewer request events. -class LLAppViewerListener: public LLDispatchListener +class LLAppViewerListener: public LLEventAPI { public: typedef boost::function<LLAppViewer*(void)> LLAppViewerGetter; - /// Specify the pump name on which to listen, and bind the LLAppViewer - /// instance to use (e.g. LLAppViewer::instance()). - LLAppViewerListener(const std::string& pumpname, const LLAppViewerGetter& getter); + /// Bind the LLAppViewer instance to use (e.g. LLAppViewer::instance()). + LLAppViewerListener(const LLAppViewerGetter& getter); private: void requestQuit(const LLSD& event); diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 1087e1e6d3..f631978565 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -59,7 +59,10 @@ #include "llviewermessage.h" // for handle_lure #include "llviewerregion.h" #include "llimfloater.h" +#include "lltrans.h" +// callback connection to auto-call when the IM floater initializes +boost::signals2::connection gAdhocAutoCall; // static void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name) @@ -207,6 +210,39 @@ void LLAvatarActions::startCall(const LLUUID& id) } // static +void LLAvatarActions::startAdhocCall(const std::vector<LLUUID>& ids) +{ + if (ids.size() == 0) + { + return; + } + + // convert vector into LLDynamicArray for addSession + LLDynamicArray<LLUUID> id_array; + for (std::vector<LLUUID>::const_iterator it = ids.begin(); it != ids.end(); ++it) + { + id_array.push_back(*it); + } + + // create the new ad hoc voice session + const std::string title = LLTrans::getString("conference-title"); + LLUUID session_id = gIMMgr->addSession(title, IM_SESSION_CONFERENCE_START, + ids[0], id_array); + if (session_id == LLUUID::null) + { + return; + } + + // always open IM window when connecting to voice + LLIMFloater::show(session_id); + + // start the call once the floater has fully initialized + gAdhocAutoCall = LLIMModel::getInstance()->addSessionInitializedCallback(callbackAutoStartCall); + + make_ui_sound("UISndStartIM"); +} + +// static bool LLAvatarActions::isCalling(const LLUUID &id) { if (id.isNull()) @@ -227,7 +263,8 @@ void LLAvatarActions::startConference(const std::vector<LLUUID>& ids) { id_array.push_back(*it); } - LLUUID session_id = gIMMgr->addSession(LLTrans::getString("IM_adhoc_title"), IM_SESSION_CONFERENCE_START, ids[0], id_array); + const std::string title = LLTrans::getString("conference-title"); + LLUUID session_id = gIMMgr->addSession(title, IM_SESSION_CONFERENCE_START, ids[0], id_array); if (session_id != LLUUID::null) { LLIMFloater::show(session_id); @@ -395,6 +432,17 @@ bool LLAvatarActions::callbackAddFriend(const LLSD& notification, const LLSD& re } // static +void LLAvatarActions::callbackAutoStartCall(const LLSD& data) +{ + // start the adhoc voice call now the IM panel has initialized + LLUUID session_id = data["session_id"].asUUID(); + gIMMgr->startCall(session_id); + + // and deschedule this callback as its work is done now + gAdhocAutoCall.disconnect(); +} + +// static void LLAvatarActions::requestFriendship(const LLUUID& target_id, const std::string& target_name, const std::string& message) { const LLUUID calling_card_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD); diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 0ec20ae357..66ea6880db 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -33,6 +33,13 @@ #ifndef LL_LLAVATARACTIONS_H #define LL_LLAVATARACTIONS_H +#include "lldarray.h" +#include "llsd.h" +#include "lluuid.h" + +#include <string> +#include <vector> + /** * Friend-related actions (add, remove, offer teleport, etc) */ @@ -72,6 +79,11 @@ public: static void startCall(const LLUUID& id); /** + * Start an ad-hoc conference voice call with multiple users + */ + static void startAdhocCall(const std::vector<LLUUID>& ids); + + /** * Start conference chat with the given avatars. */ static void startConference(const std::vector<LLUUID>& ids); @@ -117,6 +129,7 @@ private: static bool handleRemove(const LLSD& notification, const LLSD& response); static bool handlePay(const LLSD& notification, const LLSD& response, LLUUID avatar_id); static void callback_invite_to_group(LLUUID group_id, LLUUID id); + static void callbackAutoStartCall(const LLSD& data); // Just request friendship, no dialog. static void requestFriendship(const LLUUID& target_id, const std::string& target_name, const std::string& message); diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index cb05a2c279..204d7d23fa 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -72,7 +72,7 @@ LLBottomTray::LLBottomTray(const LLSD&) //this is to fix a crash that occurs because LLBottomTray is a singleton //and thus is deleted at the end of the viewers lifetime, but to be cleanly //destroyed LLBottomTray requires some subsystems that are long gone - LLUI::getRootView()->addChild(this); + //LLUI::getRootView()->addChild(this); initStateProcessedObjectMap(); diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index 6427422572..914435b640 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -127,7 +127,7 @@ void LLChannelManager::onLoginCompleted() gViewerWindow->getRootView()->addChild(mStartUpChannel); // init channel's position and size - S32 channel_right_bound = gViewerWindow->getWorldViewRect().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); + S32 channel_right_bound = gViewerWindow->getWorldViewRectRaw().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth"); mStartUpChannel->init(channel_right_bound - channel_width, channel_right_bound); mStartUpChannel->setMouseDownCallback(boost::bind(&LLSysWellWindow::onStartUpToastClick, LLFloaterReg::getTypedInstance<LLSysWellWindow>("syswell_window"), _2, _3, _4)); diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index a9b5436c5a..b919195fb2 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -822,6 +822,8 @@ LLChicletPanel::LLChicletPanel(const Params&p) LLChicletPanel::~LLChicletPanel() { + LLTransientFloaterMgr::getInstance()->removeControlView(mLeftScrollButton); + LLTransientFloaterMgr::getInstance()->removeControlView(mRightScrollButton); } diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp index 9057d84f63..20dc4440c2 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -55,12 +55,16 @@ LLDebugView* gDebugView = NULL; // // Methods // +static LLDefaultChildRegistry::Register<LLDebugView> r("debug_view"); LLDebugView::LLDebugView(const LLDebugView::Params& p) : LLView(p) +{} + +void LLDebugView::init() { LLRect r; - LLRect rect(p.rect); + LLRect rect = getLocalRect(); r.set(10, rect.getHeight() - 100, rect.getWidth()/2, 100); LLConsole::Params cp; @@ -75,16 +79,16 @@ LLDebugView::LLDebugView(const LLDebugView::Params& p) r.set(150 - 25, rect.getHeight() - 50, rect.getWidth()/2 - 25, rect.getHeight() - 450); - r.set(25, rect.getHeight() - 50, (S32) (gViewerWindow->getVirtualWindowRect().getWidth() * 0.75f), - (S32) (gViewerWindow->getVirtualWindowRect().getHeight() * 0.75f)); + r.set(25, rect.getHeight() - 50, (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.75f), + (S32) (gViewerWindow->getWindowRectScaled().getHeight() * 0.75f)); mFastTimerView = new LLFastTimerView(r); mFastTimerView->setFollowsTop(); mFastTimerView->setFollowsLeft(); mFastTimerView->setVisible(FALSE); // start invisible addChild(mFastTimerView); - r.set(25, rect.getHeight() - 50, (S32) (gViewerWindow->getVirtualWindowRect().getWidth() * 0.75f), - (S32) (gViewerWindow->getVirtualWindowRect().getHeight() * 0.75f)); + r.set(25, rect.getHeight() - 50, (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.75f), + (S32) (gViewerWindow->getWindowRectScaled().getHeight() * 0.75f)); LLMemoryView::Params mp; mp.name("memory"); mp.rect(r); diff --git a/indra/newview/lldebugview.h b/indra/newview/lldebugview.h index 9cf2a59a0a..b17cdb43cd 100644 --- a/indra/newview/lldebugview.h +++ b/indra/newview/lldebugview.h @@ -60,6 +60,8 @@ public: LLDebugView(const Params&); ~LLDebugView(); + void init(); + void setStatsVisible(BOOL visible); LLFastTimerView* mFastTimerView; diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 03a3f2b43d..d60330024a 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -89,7 +89,7 @@ LLDynamicArrayPtr<LLPointer<LLDrawable> > LLDrawable::sDeadList; void LLDrawable::incrementVisible() { sCurVisible++; - sCurPixelAngle = (F32) gViewerWindow->getWindowDisplayHeight()/LLViewerCamera::getInstance()->getView(); + sCurPixelAngle = (F32) gViewerWindow->getWindowHeightRaw()/LLViewerCamera::getInstance()->getView(); } void LLDrawable::init() { diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index e41c4104eb..9bc7221dc8 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -126,7 +126,7 @@ void LLViewerDynamicTexture::preRender(BOOL clear_depth) // force rendering to on-screen portion of frame buffer LLCoordScreen window_pos; gViewerWindow->getWindow()->getPosition( &window_pos ); - mOrigin.set(0, gViewerWindow->getWindowDisplayHeight() - mFullHeight); // top left corner + mOrigin.set(0, gViewerWindow->getWindowHeightRaw() - mFullHeight); // top left corner if (window_pos.mX < 0) { diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index c54b83d865..31f1462a12 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1403,7 +1403,7 @@ F32 LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) //the projection of the face partially overlaps with the screen F32 LLFace::adjustPartialOverlapPixelArea(F32 cos_angle_to_view_dir, F32 radius ) { - F32 screen_radius = (F32)llmax(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight()) ; + F32 screen_radius = (F32)llmax(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()) ; F32 center_angle = acosf(cos_angle_to_view_dir) ; F32 d = center_angle * LLDrawable::sCurPixelAngle ; diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 2ab17d6220..0b27001f10 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -256,7 +256,8 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask) LLToolTipMgr::instance().show(LLToolTip::Params() .message(mHoverTimer->getToolTip(LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex - mHoverBarIndex)) - .sticky_rect(screen_rect)); + .sticky_rect(screen_rect) + .delay_time(0.f)); return TRUE; } @@ -302,8 +303,8 @@ void LLFastTimerView::draw() F64 iclock_freq = 1000.0 / clock_freq; S32 margin = 10; - S32 height = (S32) (gViewerWindow->getVirtualWindowRect().getHeight()*0.75f); - S32 width = (S32) (gViewerWindow->getVirtualWindowRect().getWidth() * 0.75f); + S32 height = (S32) (gViewerWindow->getWindowRectScaled().getHeight()*0.75f); + S32 width = (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.75f); // HACK: casting away const. Should use setRect or some helper function instead. const_cast<LLRect&>(getRect()).setLeftTopAndSize(getRect().mLeft, getRect().mTop, width, height); diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index b01293d17c..80b0a430e0 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -64,7 +64,7 @@ #include "llwindow.h" #include "stringize.h" #include "llsdutil_math.h" -#include "lleventdispatcher.h" +#include "lleventapi.h" #if LL_WINDOWS #include "lldxhardware.h" @@ -302,13 +302,17 @@ static std::string get_viewer_release_notes_url() return LLWeb::escapeURL(url.str()); } -class LLFloaterAboutListener: public LLDispatchListener +class LLFloaterAboutListener: public LLEventAPI { public: LLFloaterAboutListener(): - LLDispatchListener("LLFloaterAbout", "op") + LLEventAPI("LLFloaterAbout", + "LLFloaterAbout listener to retrieve About box info") { - add("getInfo", &LLFloaterAboutListener::getInfo, LLSD().insert("reply", LLSD())); + add("getInfo", + "Request an LLSD::Map containing information used to populate About box", + &LLFloaterAboutListener::getInfo, + LLSD().insert("reply", LLSD())); } private: diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp index 262dc1804d..9ba61ba92f 100644 --- a/indra/newview/llfloaterauction.cpp +++ b/indra/newview/llfloaterauction.cpp @@ -188,8 +188,8 @@ void LLFloaterAuction::onClickSnapshot(void* data) gForceRenderLandFence = self->childGetValue("fence_check").asBoolean(); BOOL success = gViewerWindow->rawSnapshot(raw, - gViewerWindow->getWindowWidth(), - gViewerWindow->getWindowHeight(), + gViewerWindow->getWindowWidthScaled(), + gViewerWindow->getWindowHeightScaled(), TRUE, FALSE, FALSE, FALSE); gForceRenderLandFence = FALSE; diff --git a/indra/newview/llfloatermediasettings.cpp b/indra/newview/llfloatermediasettings.cpp index d941f24f49..44e68d7745 100644 --- a/indra/newview/llfloatermediasettings.cpp +++ b/indra/newview/llfloatermediasettings.cpp @@ -145,13 +145,18 @@ LLFloaterMediaSettings* LLFloaterMediaSettings::getInstance() //static void LLFloaterMediaSettings::apply() { - LLSD settings; + sInstance->mPanelMediaSettingsGeneral->preApply(); sInstance->mPanelMediaSettingsGeneral->getValues( settings ); - sInstance->mPanelMediaSettingsSecurity->getValues( settings ); + sInstance->mPanelMediaSettingsSecurity->preApply(); + sInstance->mPanelMediaSettingsSecurity->getValues( settings ); + sInstance->mPanelMediaSettingsPermissions->preApply(); sInstance->mPanelMediaSettingsPermissions->getValues( settings ); LLSelectMgr::getInstance()->selectionSetMedia( LLTextureEntry::MF_HAS_MEDIA ); LLSelectMgr::getInstance()->selectionSetMediaData(settings); + sInstance->mPanelMediaSettingsGeneral->postApply(); + sInstance->mPanelMediaSettingsSecurity->postApply(); + sInstance->mPanelMediaSettingsPermissions->postApply(); } //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 2af1313db4..4434a8013d 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -348,6 +348,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.AutoDetectAspect", boost::bind(&LLFloaterPreference::onCommitAutoDetectAspect, this)); mCommitCallbackRegistrar.add("Pref.onSelectAspectRatio", boost::bind(&LLFloaterPreference::onKeystrokeAspectRatio, this)); mCommitCallbackRegistrar.add("Pref.QualityPerformance", boost::bind(&LLFloaterPreference::onChangeQuality, this, _2)); + mCommitCallbackRegistrar.add("Pref.applyUIColor", boost::bind(&LLFloaterPreference::applyUIColor, this ,_1, _2)); + mCommitCallbackRegistrar.add("Pref.getUIColor", boost::bind(&LLFloaterPreference::getUIColor, this ,_1, _2)); sSkin = gSavedSettings.getString("SkinCurrent"); @@ -1332,8 +1334,8 @@ void LLFloaterPreference::initWindowSizeControls(LLPanel* panelp) // Look to see if current window size matches existing window sizes, if so then // just set the selection value... - const U32 height = gViewerWindow->getWindowDisplayHeight(); - const U32 width = gViewerWindow->getWindowDisplayWidth(); + const U32 height = gViewerWindow->getWindowHeightRaw(); + const U32 width = gViewerWindow->getWindowWidthRaw(); for (S32 i=0; i < ctrl_window_size->getItemCount(); i++) { U32 height_test = 0; @@ -1356,18 +1358,24 @@ void LLFloaterPreference::initWindowSizeControls(LLPanel* panelp) } +void LLFloaterPreference::applyUIColor(LLUICtrl* ctrl, const LLSD& param) +{ + LLUIColorTable::instance().setColor(param.asString(), LLColor4(ctrl->getValue())); +} + +void LLFloaterPreference::getUIColor(LLUICtrl* ctrl, const LLSD& param) +{ + LLColorSwatchCtrl* color_swatch = (LLColorSwatchCtrl*) ctrl; + color_swatch->setOriginal(LLUIColorTable::instance().getColor(param.asString())); +} + //---------------------------------------------------------------------------- static LLRegisterPanelClassWrapper<LLPanelPreference> t_places("panel_preference"); LLPanelPreference::LLPanelPreference() : LLPanel() { - mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2)); -} - -static void applyUIColor(const std::string& color_name, LLUICtrl* ctrl, const LLSD& param) -{ - LLUIColorTable::instance().setColor(color_name, LLColor4(param)); + mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2)); } //virtual @@ -1496,55 +1504,6 @@ BOOL LLPanelPreference::postBuild() refresh(); } - - if(hasChild("user") && hasChild("agent") && hasChild("im") - && hasChild("system") && hasChild("script_error") && hasChild("objects") - && hasChild("owner") && hasChild("background") && hasChild("links")) - { - LLColorSwatchCtrl* color_swatch = getChild<LLColorSwatchCtrl>("user"); - color_swatch->setCommitCallback(boost::bind(&applyUIColor, "UserChatColor", _1, _2)); - color_swatch->setOriginal(LLUIColorTable::instance().getColor("UserChatColor")); - - color_swatch = getChild<LLColorSwatchCtrl>("agent"); - color_swatch->setCommitCallback(boost::bind(&applyUIColor, "AgentChatColor", _1, _2)); - color_swatch->setOriginal(LLUIColorTable::instance().getColor("AgentChatColor")); - - color_swatch = getChild<LLColorSwatchCtrl>("im"); - color_swatch->setCommitCallback(boost::bind(&applyUIColor, "IMChatColor", _1, _2)); - color_swatch->setOriginal(LLUIColorTable::instance().getColor("IMChatColor")); - - color_swatch = getChild<LLColorSwatchCtrl>("system"); - color_swatch->setCommitCallback(boost::bind(&applyUIColor, "SystemChatColor", _1, _2)); - color_swatch->setOriginal(LLUIColorTable::instance().getColor("SystemChatColor")); - - color_swatch = getChild<LLColorSwatchCtrl>("script_error"); - color_swatch->setCommitCallback(boost::bind(&applyUIColor, "ScriptErrorColor", _1, _2)); - color_swatch->setOriginal(LLUIColorTable::instance().getColor("ScriptErrorColor")); - - color_swatch = getChild<LLColorSwatchCtrl>("objects"); - color_swatch->setCommitCallback(boost::bind(&applyUIColor, "ObjectChatColor", _1, _2)); - color_swatch->setOriginal(LLUIColorTable::instance().getColor("ObjectChatColor")); - - color_swatch = getChild<LLColorSwatchCtrl>("owner"); - color_swatch->setCommitCallback(boost::bind(&applyUIColor, "llOwnerSayChatColor", _1, _2)); - color_swatch->setOriginal(LLUIColorTable::instance().getColor("llOwnerSayChatColor")); - - color_swatch = getChild<LLColorSwatchCtrl>("background"); - color_swatch->setCommitCallback(boost::bind(&applyUIColor, "BackgroundChatColor", _1, _2)); - color_swatch->setOriginal(LLUIColorTable::instance().getColor("BackgroundChatColor")); - - color_swatch = getChild<LLColorSwatchCtrl>("links"); - color_swatch->setCommitCallback(boost::bind(&applyUIColor, "HTMLLinkColor", _1, _2)); - color_swatch->setOriginal(LLUIColorTable::instance().getColor("HTMLLinkColor")); - } - - if(hasChild("effect_color_swatch")) - { - LLColorSwatchCtrl* color_swatch = getChild<LLColorSwatchCtrl>("effect_color_swatch"); - color_swatch->setCommitCallback(boost::bind(&applyUIColor, "EffectColor", _1, _2)); - color_swatch->setOriginal(LLUIColorTable::instance().getColor("EffectColor")); - } - apply(); return true; } diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index b1ad0348c0..10f39e46f1 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -133,7 +133,9 @@ public: void onCommitAutoDetectAspect(); void applyResolution(); void applyWindowSize(); - + void applyUIColor(LLUICtrl* ctrl, const LLSD& param); + void getUIColor(LLUICtrl* ctrl, const LLSD& param); + static void initWindowSizeControls(LLPanel* panelp); static void buildLists(void* data); @@ -159,6 +161,7 @@ public: virtual void apply(); virtual void cancel(); void setControlFalse(const LLSD& user_data); + private: typedef std::map<LLControlVariable*, LLSD> control_values_map_t; control_values_map_t mSavedValues; diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index 4375787ea2..928126bff9 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -900,7 +900,7 @@ LLMultiProperties::LLMultiProperties() { // start with a small rect in the top-left corner ; will get resized LLRect rect; - rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeight(), 20, 20); + rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeightScaled(), 20, 20); setRect(rect); } setTitle(LLTrans::getString("MultiPropertiesTitle")); diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 97c573ddea..ca2cdffcf8 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -36,6 +36,7 @@ #include "llmediactrl.h" #include "lllogininstance.h" #include "lluri.h" +#include "llagent.h" LLFloaterSearch::LLFloaterSearch(const LLSD& key) : LLFloater(key), @@ -122,6 +123,12 @@ void LLFloaterSearch::search(const LLSD &key) LLSD search_token = LLLoginInstance::getInstance()->getResponse("search_token"); url += "&p=" + search_token.asString(); + // also append the user's preferred maturity (can be changed via prefs) + std::string maturity = "pg"; + if (gAgent.prefersMature()) maturity += ",mature"; + if (gAgent.prefersAdult()) maturity += ",adult"; + url += "&r=" + maturity; + // and load the URL in the web view mBrowser->navigateTo(url); } diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index fd2e7b3487..1cc7042c3a 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -101,6 +101,8 @@ S32 BORDER_WIDTH = 6; const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte const S32 MAX_TEXTURE_SIZE = 512 ; //max upload texture size 512 * 512 +static LLDefaultChildRegistry::Register<LLSnapshotFloaterView> r("snapshot_floater_view"); + ///---------------------------------------------------------------------------- /// Class LLSnapshotLivePreview ///---------------------------------------------------------------------------- @@ -243,10 +245,10 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLSnapshotLivePreview::Param // gIdleCallbacks.addFunction( &LLSnapshotLivePreview::onIdle, (void*)this ); sList.insert(this); setFollowsAll(); - mWidth[0] = gViewerWindow->getWindowDisplayWidth(); - mWidth[1] = gViewerWindow->getWindowDisplayWidth(); - mHeight[0] = gViewerWindow->getWindowDisplayHeight(); - mHeight[1] = gViewerWindow->getWindowDisplayHeight(); + mWidth[0] = gViewerWindow->getWindowWidthRaw(); + mWidth[1] = gViewerWindow->getWindowWidthRaw(); + mHeight[0] = gViewerWindow->getWindowHeightRaw(); + mHeight[1] = gViewerWindow->getWindowHeightRaw(); mImageScaled[0] = FALSE; mImageScaled[1] = FALSE; @@ -492,27 +494,27 @@ void LLSnapshotLivePreview::draw() LLLocalClipRect clip(getLocalRect()); { // draw diagonal stripe with gradient that passes over screen - S32 x1 = gViewerWindow->getWindowWidth() * llround((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f))); - S32 x2 = x1 + llround(gViewerWindow->getWindowWidth() * SHINE_WIDTH); - S32 x3 = x2 + llround(gViewerWindow->getWindowWidth() * SHINE_WIDTH); + S32 x1 = gViewerWindow->getWindowWidthScaled() * llround((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f))); + S32 x2 = x1 + llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH); + S32 x3 = x2 + llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH); S32 y1 = 0; - S32 y2 = gViewerWindow->getWindowHeight(); + S32 y2 = gViewerWindow->getWindowHeightScaled(); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.begin(LLRender::QUADS); { gGL.color4f(1.f, 1.f, 1.f, 0.f); gGL.vertex2i(x1, y1); - gGL.vertex2i(x1 + gViewerWindow->getWindowWidth(), y2); + gGL.vertex2i(x1 + gViewerWindow->getWindowWidthScaled(), y2); gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY); - gGL.vertex2i(x2 + gViewerWindow->getWindowWidth(), y2); + gGL.vertex2i(x2 + gViewerWindow->getWindowWidthScaled(), y2); gGL.vertex2i(x2, y1); gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY); gGL.vertex2i(x2, y1); - gGL.vertex2i(x2 + gViewerWindow->getWindowWidth(), y2); + gGL.vertex2i(x2 + gViewerWindow->getWindowWidthScaled(), y2); gGL.color4f(1.f, 1.f, 1.f, 0.f); - gGL.vertex2i(x3 + gViewerWindow->getWindowWidth(), y2); + gGL.vertex2i(x3 + gViewerWindow->getWindowWidthScaled(), y2); gGL.vertex2i(x3, y1); } gGL.end(); @@ -615,8 +617,8 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize() { return FALSE ; } - S32 window_width = gViewerWindow->getWindowDisplayWidth() ; - S32 window_height = gViewerWindow->getWindowDisplayHeight() ; + S32 window_width = gViewerWindow->getWindowWidthRaw() ; + S32 window_height = gViewerWindow->getWindowHeightRaw() ; F32 window_aspect_ratio = ((F32)window_width) / ((F32)window_height); @@ -1166,7 +1168,7 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) gSavedSettings.setS32("SnapshotLocalLastResolution", 0); LLSnapshotLivePreview* previewp = getPreviewView(floaterp); - previewp->setSize(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight()); + previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); } bool use_freeze_frame = floaterp->childGetValue("freeze_frame_check").asBoolean(); @@ -1691,7 +1693,7 @@ void LLFloaterSnapshot::Impl::updateResolution(LLUICtrl* ctrl, void* data, BOOL if (width == 0 || height == 0) { // take resolution from current window size - previewp->setSize(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight()); + previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); } else if (width == -1 || height == -1) { @@ -1844,13 +1846,13 @@ BOOL LLFloaterSnapshot::Impl::checkImageSize(LLSnapshotLivePreview* previewp, S3 #endif if(previewp && previewp->mKeepAspectRatio) { - if(gViewerWindow->getWindowDisplayWidth() < 1 || gViewerWindow->getWindowDisplayHeight() < 1) + if(gViewerWindow->getWindowWidthRaw() < 1 || gViewerWindow->getWindowHeightRaw() < 1) { return FALSE ; } //aspect ratio of the current window - F32 aspect_ratio = (F32)gViewerWindow->getWindowDisplayWidth() / gViewerWindow->getWindowDisplayHeight() ; + F32 aspect_ratio = (F32)gViewerWindow->getWindowWidthRaw() / gViewerWindow->getWindowHeightRaw() ; //change another value proportionally if(isWidthChanged) @@ -2042,10 +2044,12 @@ BOOL LLFloaterSnapshot::postBuild() LLSnapshotLivePreview::Params p; p.rect(full_screen_rect); LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p); - getRootView()->removeChild(gSnapshotFloaterView); + LLView* parent_view = gSnapshotFloaterView->getParent(); + + parent_view->removeChild(gSnapshotFloaterView); // make sure preview is below snapshot floater - getRootView()->addChild(previewp); - getRootView()->addChild(gSnapshotFloaterView); + parent_view->addChild(previewp); + parent_view->addChild(gSnapshotFloaterView); //move snapshot floater to special purpose snapshotfloaterview gFloaterView->removeChild(this); diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 3aef15a35c..3c3dfb760e 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -86,6 +86,7 @@ #include "llviewermenu.h" #include "llviewerparcelmgr.h" #include "llviewerwindow.h" +#include "llvovolume.h" #include "lluictrlfactory.h" // Globals @@ -1079,21 +1080,45 @@ void LLFloaterTools::getMediaState() } bool editable = (first_object->permModify() || selectedMediaEditable()); - + + // Check modify permissions and whether any selected objects are in + // the process of being fetched. If they are, then we're not editable + if (editable) + { + LLObjectSelection::iterator iter = selected_objects->begin(); + LLObjectSelection::iterator end = selected_objects->end(); + for ( ; iter != end; ++iter) + { + LLSelectNode* node = *iter; + LLVOVolume* object = dynamic_cast<LLVOVolume*>(node->getObject()); + if (NULL != object) + { + if (!object->permModify() || object->isMediaDataBeingFetched()) + { + editable = false; + break; + } + } + } + } + // Media settings - U8 has_media = (U8)0; - struct media_functor : public LLSelectedTEGetFunctor<U8> + bool bool_has_media = false; + struct media_functor : public LLSelectedTEGetFunctor<bool> { - U8 get(LLViewerObject* object, S32 face) + bool get(LLViewerObject* object, S32 face) { - return (object->getTE(face)->getMediaTexGen()); + LLTextureEntry *te = object->getTE(face); + if (te) + { + return te->hasMedia(); + } + return false; } } func; // check if all faces have media(or, all dont have media) - LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo = selected_objects->getSelectedTEValue( &func, has_media ); - bool bool_has_media = (has_media & LLTextureEntry::MF_HAS_MEDIA); - + LLFloaterMediaSettings::getInstance()->mIdenticalHasMediaInfo = selected_objects->getSelectedTEValue( &func, bool_has_media ); const LLMediaEntry default_media_data; diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 7863c373c6..21458f83cd 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2174,7 +2174,7 @@ void LLFolderView::updateRenamerPosition() screenPointToLocal( x, y, &x, &y ); mRenamer->setOrigin( x, y ); - LLRect scroller_rect(0, 0, gViewerWindow->getWindowWidth(), 0); + LLRect scroller_rect(0, 0, gViewerWindow->getWindowWidthScaled(), 0); if (mScrollContainer) { scroller_rect = mScrollContainer->getContentWindowRect(); diff --git a/indra/newview/llhudicon.cpp b/indra/newview/llhudicon.cpp index eda1d3fc55..040027c70d 100644 --- a/indra/newview/llhudicon.cpp +++ b/indra/newview/llhudicon.cpp @@ -145,8 +145,8 @@ void LLHUDIcon::renderIcon(BOOL for_select) } F32 image_aspect = (F32)mImagep->getFullWidth() / (F32)mImagep->getFullHeight() ; - LLVector3 x_scale = image_aspect * (F32)gViewerWindow->getWindowHeight() * mScale * scale_factor * x_pixel_vec; - LLVector3 y_scale = (F32)gViewerWindow->getWindowHeight() * mScale * scale_factor * y_pixel_vec; + LLVector3 x_scale = image_aspect * (F32)gViewerWindow->getWindowHeightScaled() * mScale * scale_factor * x_pixel_vec; + LLVector3 y_scale = (F32)gViewerWindow->getWindowHeightScaled() * mScale * scale_factor * y_pixel_vec; LLVector3 lower_left = icon_position - (x_scale * 0.5f); LLVector3 lower_right = icon_position + (x_scale * 0.5f); @@ -261,8 +261,8 @@ BOOL LLHUDIcon::lineSegmentIntersect(const LLVector3& start, const LLVector3& en } F32 image_aspect = (F32)mImagep->getFullWidth() / (F32)mImagep->getFullHeight() ; - LLVector3 x_scale = image_aspect * (F32)gViewerWindow->getWindowHeight() * mScale * scale_factor * x_pixel_vec; - LLVector3 y_scale = (F32)gViewerWindow->getWindowHeight() * mScale * scale_factor * y_pixel_vec; + LLVector3 x_scale = image_aspect * (F32)gViewerWindow->getWindowHeightScaled() * mScale * scale_factor * x_pixel_vec; + LLVector3 y_scale = (F32)gViewerWindow->getWindowHeightScaled() * mScale * scale_factor * y_pixel_vec; LLVector3 lower_left = icon_position - (x_scale * 0.5f); LLVector3 lower_right = icon_position + (x_scale * 0.5f); diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp index 886fe3da07..ab0be90def 100644 --- a/indra/newview/llhudrender.cpp +++ b/indra/newview/llhudrender.cpp @@ -77,8 +77,8 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, LLVector3 up_axis; if (orthographic) { - right_axis.setVec(0.f, -1.f / gViewerWindow->getWorldViewWidth(), 0.f); - up_axis.setVec(0.f, 0.f, 1.f / gViewerWindow->getWorldViewHeight()); + right_axis.setVec(0.f, -1.f / gViewerWindow->getWorldViewWidthRaw(), 0.f); + up_axis.setVec(0.f, 0.f, 1.f / gViewerWindow->getWorldViewHeightRaw()); } else { @@ -106,7 +106,7 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, //get the render_pos in screen space F64 winX, winY, winZ; - LLRect world_view_rect = gViewerWindow->getWorldViewRect(); + LLRect world_view_rect = gViewerWindow->getWorldViewRectRaw(); S32 viewport[4]; viewport[0] = world_view_rect.mLeft; viewport[1] = world_view_rect.mBottom; diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 55019f91f8..0b5da40be4 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -156,8 +156,8 @@ BOOL LLHUDText::lineSegmentIntersect(const LLVector3& start, const LLVector3& en if (mOnHUDAttachment) { - x_pixel_vec = LLVector3::y_axis / (F32)gViewerWindow->getWindowWidth(); - y_pixel_vec = LLVector3::z_axis / (F32)gViewerWindow->getWindowHeight(); + x_pixel_vec = LLVector3::y_axis / (F32)gViewerWindow->getWindowWidthScaled(); + y_pixel_vec = LLVector3::z_axis / (F32)gViewerWindow->getWindowHeightScaled(); } else { @@ -316,8 +316,8 @@ void LLHUDText::renderText(BOOL for_select) if (mOnHUDAttachment) { - x_pixel_vec = LLVector3::y_axis / (F32)gViewerWindow->getWorldViewWidth(); - y_pixel_vec = LLVector3::z_axis / (F32)gViewerWindow->getWorldViewHeight(); + x_pixel_vec = LLVector3::y_axis / (F32)gViewerWindow->getWorldViewWidthRaw(); + y_pixel_vec = LLVector3::z_axis / (F32)gViewerWindow->getWorldViewHeightRaw(); } else { @@ -351,8 +351,8 @@ void LLHUDText::renderText(BOOL for_select) //if (mOnHUD) //{ - // render_position.mV[VY] -= fmodf(render_position.mV[VY], 1.f / (F32)gViewerWindow->getWindowWidth()); - // render_position.mV[VZ] -= fmodf(render_position.mV[VZ], 1.f / (F32)gViewerWindow->getWindowHeight()); + // render_position.mV[VY] -= fmodf(render_position.mV[VY], 1.f / (F32)gViewerWindow->getWindowWidthScaled()); + // render_position.mV[VZ] -= fmodf(render_position.mV[VZ], 1.f / (F32)gViewerWindow->getWindowHeightScaled()); //} //else //{ @@ -800,7 +800,7 @@ LLVector2 LLHUDText::updateScreenPos(LLVector2 &offset) screen_pos_vec.setVec((F32)screen_pos.mX, (F32)screen_pos.mY); - LLRect world_rect = gViewerWindow->getVirtualWorldViewRect(); + LLRect world_rect = gViewerWindow->getWorldViewRectScaled(); S32 bottom = world_rect.mBottom + STATUS_BAR_HEIGHT; LLVector2 screen_center; @@ -897,7 +897,7 @@ void LLHUDText::updateAll() std::sort(sVisibleHUDTextObjects.begin(), sVisibleHUDTextObjects.end(), lltextobject_further_away()); // iterate from front to back, and set LOD based on current screen coverage - F32 screen_area = (F32)(gViewerWindow->getWindowWidth() * gViewerWindow->getWindowHeight()); + F32 screen_area = (F32)(gViewerWindow->getWindowWidthScaled() * gViewerWindow->getWindowHeightScaled()); F32 current_screen_area = 0.f; std::vector<LLPointer<LLHUDText> >::reverse_iterator r_it; for (r_it = sVisibleTextObjects.rbegin(); r_it != sVisibleTextObjects.rend(); ++r_it) diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index fd297986fc..54fc6f02fb 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -363,7 +363,7 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) void LLIMFloater::getAllowedRect(LLRect& rect) { - rect = gViewerWindow->getWorldViewRect(); + rect = gViewerWindow->getWorldViewRectRaw(); } void LLIMFloater::setDocked(bool docked, bool pop_on_undock) diff --git a/indra/newview/llimhandler.cpp b/indra/newview/llimhandler.cpp index 74971f3fd8..524a889f97 100644 --- a/indra/newview/llimhandler.cpp +++ b/indra/newview/llimhandler.cpp @@ -58,7 +58,7 @@ LLIMHandler::~LLIMHandler() //-------------------------------------------------------------------------- void LLIMHandler::initChannel() { - S32 channel_right_bound = gViewerWindow->getWorldViewRect().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); + S32 channel_right_bound = gViewerWindow->getWorldViewRectRaw().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth"); mChannel->init(channel_right_bound - channel_width, channel_right_bound); } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 60faaea2c5..be5fbdbbf8 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -853,7 +853,17 @@ bool LLIMModel::sendStartSession( return false; } - +// static +void LLIMModel::sendSessionInitialized(const LLUUID &session_id) +{ + LLIMSession* session = getInstance()->findIMSession(session_id); + if (session) + { + LLSD arg; + arg["session_id"] = session_id; + getInstance()->mSessionInitializedSignal(arg); + } +} // // Helper Functions diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index bd55bd2c30..c566b111ca 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -102,6 +102,7 @@ public: typedef boost::function<void(const LLSD&)> session_callback_t; session_signal_t mNewMsgSignal; session_signal_t mNoUnreadMsgsSignal; + session_signal_t mSessionInitializedSignal; /** * Find an IM Session corresponding to session_id @@ -116,6 +117,7 @@ public: boost::signals2::connection addNewMsgCallback( session_callback_t cb ) { return mNewMsgSignal.connect(cb); } boost::signals2::connection addNoUnreadMsgsCallback( session_callback_t cb ) { return mNoUnreadMsgsSignal.connect(cb); } + boost::signals2::connection addSessionInitializedCallback(session_callback_t cb ) { return mSessionInitializedSignal.connect(cb); } /** * Create new session object in a model @@ -189,6 +191,7 @@ public: static bool sendStartSession(const LLUUID& temp_session_id, const LLUUID& other_participant_id, const std::vector<LLUUID>& ids, EInstantMessage dialog); static void sendTypingState(LLUUID session_id, LLUUID other_participant_id, BOOL typing); + static void sendSessionInitialized(const LLUUID &session_id); static void sendMessage(const std::string& utf8_text, const LLUUID& im_session_id, const LLUUID& other_participant_id, EInstantMessage dialog); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 4b7e364cf9..e7d7eb19d0 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1271,8 +1271,11 @@ void LLInventoryModel::fetchInventoryResponder::error(U32 status, const std::str bool LLInventoryModel::fetchDescendentsOf(const LLUUID& folder_id) { - if(folder_id.isNull()) return false; - + if(folder_id.isNull()) + { + llwarns << "Calling fetch descendents on NULL folder id!" << llendl; + return false; + } LLViewerInventoryCategory* cat = getCategory(folder_id); if(!cat) { diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index e5f347ddc4..945294f3f2 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -73,9 +73,9 @@ LLLoginInstance::LLLoginInstance() : { mLoginModule->getEventPump().listen("lllogininstance", boost::bind(&LLLoginInstance::handleLoginEvent, this, _1)); - mDispatcher.add("fail.login", boost::bind(&LLLoginInstance::handleLoginFailure, this, _1)); - mDispatcher.add("connect", boost::bind(&LLLoginInstance::handleLoginSuccess, this, _1)); - mDispatcher.add("disconnect", boost::bind(&LLLoginInstance::handleDisconnect, this, _1)); + mDispatcher.add("fail.login", "", boost::bind(&LLLoginInstance::handleLoginFailure, this, _1)); + mDispatcher.add("connect", "", boost::bind(&LLLoginInstance::handleLoginSuccess, this, _1)); + mDispatcher.add("disconnect", "", boost::bind(&LLLoginInstance::handleDisconnect, this, _1)); } LLLoginInstance::~LLLoginInstance() diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index f62d7229a3..fa1dbe0603 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -265,8 +265,8 @@ BOOL LLManip::getMousePointOnPlaneGlobal(LLVector3d& point, S32 x, S32 y, LLVect if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { BOOL result = FALSE; - F32 mouse_x = ((F32)x / gViewerWindow->getWindowWidth() - 0.5f) * LLViewerCamera::getInstance()->getAspect() / gAgent.mHUDCurZoom; - F32 mouse_y = ((F32)y / gViewerWindow->getWindowHeight() - 0.5f) / gAgent.mHUDCurZoom; + F32 mouse_x = ((F32)x / gViewerWindow->getWindowWidthScaled() - 0.5f) * LLViewerCamera::getInstance()->getAspect() / gAgent.mHUDCurZoom; + F32 mouse_y = ((F32)y / gViewerWindow->getWindowHeightScaled() - 0.5f) / gAgent.mHUDCurZoom; LLVector3 origin_agent = gAgent.getPosAgentFromGlobal(origin); LLVector3 mouse_pos = LLVector3(0.f, -mouse_x, mouse_y); @@ -304,8 +304,8 @@ BOOL LLManip::nearestPointOnLineFromMouse( S32 x, S32 y, const LLVector3& b1, co if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { - F32 mouse_x = (((F32)x / gViewerWindow->getWindowWidth()) - 0.5f) * LLViewerCamera::getInstance()->getAspect() / gAgent.mHUDCurZoom; - F32 mouse_y = (((F32)y / gViewerWindow->getWindowHeight()) - 0.5f) / gAgent.mHUDCurZoom; + F32 mouse_x = (((F32)x / gViewerWindow->getWindowWidthScaled()) - 0.5f) * LLViewerCamera::getInstance()->getAspect() / gAgent.mHUDCurZoom; + F32 mouse_y = (((F32)y / gViewerWindow->getWindowHeightScaled()) - 0.5f) / gAgent.mHUDCurZoom; a1 = LLVector3(llmin(b1.mV[VX] - 0.1f, b2.mV[VX] - 0.1f, 0.f), -mouse_x, mouse_y); a2 = a1 + LLVector3(1.f, 0.f, 0.f); } @@ -429,9 +429,9 @@ void LLManip::renderXYZ(const LLVector3 &vec) const S32 PAD = 10; std::string feedback_string; LLVector3 camera_pos = LLViewerCamera::getInstance()->getOrigin() + LLViewerCamera::getInstance()->getAtAxis(); - S32 vertical_offset = gViewerWindow->getWindowHeight() / 2 - VERTICAL_OFFSET; - S32 window_center_x = gViewerWindow->getWindowWidth() / 2; - S32 window_center_y = gViewerWindow->getWindowHeight() / 2; + S32 vertical_offset = gViewerWindow->getWindowHeightScaled() / 2 - VERTICAL_OFFSET; + S32 window_center_x = gViewerWindow->getWindowWidthScaled() / 2; + S32 window_center_y = gViewerWindow->getWindowHeightScaled() / 2; glPushMatrix(); { diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index c99e67be3f..bcaebb6bbb 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -1107,8 +1107,8 @@ BOOL LLManipRotate::updateVisiblity() mCenterToProfilePlaneMag = mRadiusMeters * mRadiusMeters / mCenterToCamMag; mCenterToProfilePlane = -mCenterToProfilePlaneMag * mCenterToCamNorm; - mCenterScreen.set((S32)((0.5f - mRotationCenter.mdV[VY]) / gAgent.mHUDCurZoom * gViewerWindow->getWorldViewWidth()), - (S32)((mRotationCenter.mdV[VZ] + 0.5f) / gAgent.mHUDCurZoom * gViewerWindow->getWorldViewHeight())); + mCenterScreen.set((S32)((0.5f - mRotationCenter.mdV[VY]) / gAgent.mHUDCurZoom * gViewerWindow->getWorldViewWidthRaw()), + (S32)((mRotationCenter.mdV[VZ] + 0.5f) / gAgent.mHUDCurZoom * gViewerWindow->getWorldViewHeightRaw())); visible = TRUE; } else @@ -1624,8 +1624,8 @@ void LLManipRotate::mouseToRay( S32 x, S32 y, LLVector3* ray_pt, LLVector3* ray_ { if (LLSelectMgr::getInstance()->getSelection()->getSelectType() == SELECT_TYPE_HUD) { - F32 mouse_x = (((F32)x / gViewerWindow->getWorldViewWidth()) - 0.5f) / gAgent.mHUDCurZoom; - F32 mouse_y = ((((F32)y) / gViewerWindow->getWorldViewHeight()) - 0.5f) / gAgent.mHUDCurZoom; + F32 mouse_x = (((F32)x / gViewerWindow->getWorldViewWidthRaw()) - 0.5f) / gAgent.mHUDCurZoom; + F32 mouse_y = ((((F32)y) / gViewerWindow->getWorldViewHeightRaw()) - 0.5f) / gAgent.mHUDCurZoom; *ray_pt = LLVector3(-1.f, -mouse_x, mouse_y); *ray_dir = LLVector3(1.f, 0.f, 0.f); @@ -1699,7 +1699,7 @@ void LLManipRotate::highlightManipulators( S32 x, S32 y ) F32 dist_y = mouse_dir_y.normVec(); F32 dist_z = mouse_dir_z.normVec(); - F32 distance_threshold = (MAX_MANIP_SELECT_DISTANCE * mRadiusMeters) / gViewerWindow->getWorldViewHeight(); + F32 distance_threshold = (MAX_MANIP_SELECT_DISTANCE * mRadiusMeters) / gViewerWindow->getWorldViewHeightRaw(); if (llabs(dist_x - mRadiusMeters) * llmax(0.05f, proj_rot_x_axis) < distance_threshold) { diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 72596e850a..84a5eb7352 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -493,8 +493,9 @@ void LLManipScale::highlightManipulators(S32 x, S32 y) mProjectedManipulators.insert(projManipulator); } - F32 half_width = (F32)gViewerWindow->getWorldViewWidth() / 2.f; - F32 half_height = (F32)gViewerWindow->getWorldViewHeight() / 2.f; + LLRect world_view_rect = gViewerWindow->getWorldViewRectScaled(); + F32 half_width = (F32)world_view_rect.getWidth() / 2.f; + F32 half_height = (F32)world_view_rect.getHeight() / 2.f; LLVector2 manip2d; LLVector2 mousePos((F32)x - half_width, (F32)y - half_height); LLVector2 delta; @@ -1368,7 +1369,7 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) else { F32 object_distance = dist_vec(mScaleCenter, LLViewerCamera::getInstance()->getOrigin()); - mSnapRegimeOffset = (SNAP_GUIDE_SCREEN_OFFSET * gViewerWindow->getWorldViewWidth() * object_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio(); + mSnapRegimeOffset = (SNAP_GUIDE_SCREEN_OFFSET * gViewerWindow->getWorldViewWidthRaw() * object_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio(); } LLVector3 cam_at_axis; F32 snap_guide_length; @@ -1381,7 +1382,7 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) { cam_at_axis = LLViewerCamera::getInstance()->getAtAxis(); F32 manipulator_distance = dist_vec(box_corner_agent, LLViewerCamera::getInstance()->getOrigin()); - snap_guide_length = (SNAP_GUIDE_SCREEN_LENGTH * gViewerWindow->getWorldViewWidth() * manipulator_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio(); + snap_guide_length = (SNAP_GUIDE_SCREEN_LENGTH * gViewerWindow->getWorldViewWidthRaw() * manipulator_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio(); } mSnapGuideLength = snap_guide_length / llmax(0.1f, (llmin(mSnapGuideDir1 * cam_at_axis, mSnapGuideDir2 * cam_at_axis))); diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index f1b3a37677..932a3d8a83 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -413,8 +413,9 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) } // Handle auto-rotation if necessary. + LLRect world_rect = gViewerWindow->getWorldViewRectScaled(); const F32 ROTATE_ANGLE_PER_SECOND = 30.f * DEG_TO_RAD; - const S32 ROTATE_H_MARGIN = gViewerWindow->getWorldViewWidth() / 20; + const S32 ROTATE_H_MARGIN = world_rect.getWidth() / 20; const F32 rotate_angle = ROTATE_ANGLE_PER_SECOND / gFPSClamped; BOOL rotated = FALSE; @@ -426,7 +427,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) gAgent.cameraOrbitAround(rotate_angle); rotated = TRUE; } - else if (x > gViewerWindow->getWorldViewWidth() - ROTATE_H_MARGIN) + else if (x > world_rect.getWidth() - ROTATE_H_MARGIN) { gAgent.cameraOrbitAround(-rotate_angle); rotated = TRUE; @@ -960,8 +961,9 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y) LLVector2 manip_start_2d; LLVector2 manip_end_2d; LLVector2 manip_dir; - F32 half_width = gViewerWindow->getWorldViewWidth() / 2.f; - F32 half_height = gViewerWindow->getWorldViewHeight() / 2.f; + LLRect world_view_rect = gViewerWindow->getWorldViewRectScaled(); + F32 half_width = (F32)world_view_rect.getWidth() / 2.f; + F32 half_height = (F32)world_view_rect.getHeight() / 2.f; LLVector2 mousePos((F32)x - half_width, (F32)y - half_height); LLVector2 mouse_delta; @@ -1225,7 +1227,7 @@ void LLManipTranslate::renderSnapGuides() { LLVector3 cam_to_selection = getPivotPoint() - LLViewerCamera::getInstance()->getOrigin(); F32 current_range = cam_to_selection.normVec(); - guide_size_meters = SNAP_GUIDE_SCREEN_SIZE * gViewerWindow->getWorldViewHeight() * current_range / LLViewerCamera::getInstance()->getPixelMeterRatio(); + guide_size_meters = SNAP_GUIDE_SCREEN_SIZE * gViewerWindow->getWorldViewHeightRaw() * current_range / LLViewerCamera::getInstance()->getPixelMeterRatio(); F32 fraction_of_fov = mAxisArrowLength / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels(); F32 apparent_angle = fraction_of_fov * LLViewerCamera::getInstance()->getView(); // radians @@ -1800,7 +1802,7 @@ void LLManipTranslate::renderTranslationHandles() // Drag handles if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { - mArrowLengthMeters = mAxisArrowLength / gViewerWindow->getWorldViewHeight(); + mArrowLengthMeters = mAxisArrowLength / gViewerWindow->getWorldViewHeightRaw(); mArrowLengthMeters /= gAgent.mHUDCurZoom; } else diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 512104a2f4..986c14acff 100755 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -324,6 +324,22 @@ std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::PriorityQueue return s; } +// find the given object in the queue. +bool LLMediaDataClient::PriorityQueue::find(const LLMediaDataClientObject::ptr_t &obj) const +{ + std::vector<LLMediaDataClient::request_ptr_t>::const_iterator iter = c.begin(); + std::vector<LLMediaDataClient::request_ptr_t>::const_iterator end = c.end(); + while (iter < end) + { + if (obj->getID() == (*iter)->getObject()->getID()) + { + return true; + } + iter++; + } + return false; +} + ////////////////////////////////////////////////////////////////////////////////////// // // LLMediaDataClient::QueueTimer @@ -491,6 +507,11 @@ bool LLMediaDataClient::isEmpty() const return (NULL == pRequestQueue) ? true : pRequestQueue->empty(); } +bool LLMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object) const +{ + return (NULL == pRequestQueue) ? false : pRequestQueue->find(object); +} + ////////////////////////////////////////////////////////////////////////////////////// // // LLObjectMediaDataClient diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h index 9d0aa0981e..0d1450ffbe 100755 --- a/indra/newview/llmediadataclient.h +++ b/indra/newview/llmediadataclient.h @@ -89,7 +89,10 @@ public: F32 getRetryTimerDelay() const { return mRetryTimerDelay; } // Returns true iff the queue is empty - bool isEmpty() const; + bool isEmpty() const; + + // Returns true iff the given object is in the queue + bool isInQueue(const LLMediaDataClientObject::ptr_t &object) const; protected: // Destructor @@ -206,6 +209,9 @@ private: Comparator > { public: + // Return whether the given object is in the queue + bool find(const LLMediaDataClientObject::ptr_t &obj) const; + friend std::ostream& operator<<(std::ostream &s, const PriorityQueue &q); }; diff --git a/indra/newview/llmemoryview.cpp b/indra/newview/llmemoryview.cpp index b3aa67733b..cbe4cef12f 100644 --- a/indra/newview/llmemoryview.cpp +++ b/indra/newview/llmemoryview.cpp @@ -130,8 +130,8 @@ void LLMemoryView::draw() curUpdate++; // setup window properly - S32 height = (S32) (gViewerWindow->getVirtualWindowRect().getHeight()*0.75f); - S32 width = (S32) (gViewerWindow->getVirtualWindowRect().getWidth() * 0.9f); + S32 height = (S32) (gViewerWindow->getWindowRectScaled().getHeight()*0.75f); + S32 width = (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.9f); setRect(LLRect().setLeftTopAndSize(getRect().mLeft, getRect().mTop, width, height)); // setup window color diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 14da35594f..e3ba1b8e4a 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -598,14 +598,11 @@ BOOL LLPanelStandStopFlying::postBuild() void LLPanelStandStopFlying::setVisible(BOOL visible) { //we dont need to show the panel if these buttons are not activated - if (visible && !mStandButton->getVisible() && !mStopFlyingButton->getVisible()) visible = false; - if (gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK) visible = false; if (visible) { updatePosition(); - getParent()->sendChildToFront(this); } LLPanel::setVisible(visible); @@ -638,7 +635,7 @@ LLPanelStandStopFlying* LLPanelStandStopFlying::getStandStopFlyingPanel() LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_stand_stop_flying.xml"); panel->setVisible(FALSE); - LLUI::getRootView()->addChild(panel); + //LLUI::getRootView()->addChild(panel); llinfos << "Build LLPanelStandStopFlying panel" << llendl; @@ -680,7 +677,7 @@ void LLPanelStandStopFlying::updatePosition() //align centers of a button and a floater S32 x = movement_btn->calcScreenRect().getCenterX() - getRect().getWidth()/2; - S32 y = tray->getRect().getHeight(); + S32 y = 0; LLFloater *move_floater = LLFloaterReg::findInstance("moveview"); if (move_floater) diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 541db0ca6e..9439717fb8 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -323,8 +323,8 @@ void LLNameListCtrl::refreshAll(const LLUUID& id, const std::string& first, LLInstanceTracker<LLNameListCtrl>::instance_iter it; for (it = beginInstances(); it != endInstances(); ++it) { - LLNameListCtrl* ctrl = *it; - ctrl->refresh(id, first, last, is_group); + LLNameListCtrl& ctrl = *it; + ctrl.refresh(id, first, last, is_group); } } diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index d38cd28ce2..794d73a5ad 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -586,6 +586,8 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) // this is duplicated in 'else' section because it should be called BEFORE fb->reshape reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + // propagate size to parent container + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); fb->reshape(fbRect.getWidth(), fbRect.getHeight()); fb->setRect(fbRect); @@ -599,6 +601,7 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); } } else @@ -613,6 +616,7 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) // this is duplicated in 'else' section because it should be called BEFORE fb->reshape reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); fb->reshape(fbRect.getWidth(), fbRect.getHeight()); fb->setRect(fbRect); @@ -625,16 +629,12 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); } } childSetVisible("bg_icon", fpVisible); childSetVisible("bg_icon_no_fav", !fpVisible); - - if(LLSideTray::instanceCreated()) - { - LLSideTray::getInstance()->resetPanelRect(); - } } void LLNavigationBar::showFavoritesPanel(BOOL visible) @@ -669,6 +669,7 @@ void LLNavigationBar::showFavoritesPanel(BOOL visible) reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); fb->reshape(fbRect.getWidth(), fbRect.getHeight()); fb->setRect(fbRect); @@ -693,14 +694,11 @@ void LLNavigationBar::showFavoritesPanel(BOOL visible) reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); } childSetVisible("bg_icon", visible); childSetVisible("bg_icon_no_fav", !visible); fb->setVisible(visible); - if(LLSideTray::instanceCreated()) - { - LLSideTray::getInstance()->resetPanelRect(); - } } diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 974291a54e..ac806d7106 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -290,7 +290,7 @@ void LLNearbyChat::setRect (const LLRect &rect) void LLNearbyChat::getAllowedRect(LLRect& rect) { - rect = gViewerWindow->getWorldViewRect(); + rect = gViewerWindow->getWorldViewRectRaw(); } diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 8a8ad9d073..e10c506f08 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -122,8 +122,8 @@ protected: void LLNearbyChatScreenChannel::init(S32 channel_left, S32 channel_right) { - S32 channel_top = gViewerWindow->getWorldViewRect().getHeight(); - S32 channel_bottom = gViewerWindow->getWorldViewRect().mBottom; + S32 channel_top = gViewerWindow->getWorldViewRectRaw().getHeight(); + S32 channel_bottom = gViewerWindow->getWorldViewRectRaw().mBottom; setRect(LLRect(channel_left, channel_top, channel_right, channel_bottom)); setVisible(TRUE); } diff --git a/indra/newview/llnotificationalerthandler.cpp b/indra/newview/llnotificationalerthandler.cpp index 1be03cef0b..1f68c76bfc 100644 --- a/indra/newview/llnotificationalerthandler.cpp +++ b/indra/newview/llnotificationalerthandler.cpp @@ -66,7 +66,7 @@ LLAlertHandler::~LLAlertHandler() //-------------------------------------------------------------------------- void LLAlertHandler::initChannel() { - S32 channel_right_bound = gViewerWindow->getWorldViewRect().getWidth() / 2; + S32 channel_right_bound = gViewerWindow->getWorldViewRectRaw().getWidth() / 2; mChannel->init(channel_right_bound, channel_right_bound); } diff --git a/indra/newview/llnotificationgrouphandler.cpp b/indra/newview/llnotificationgrouphandler.cpp index ffa92b543c..fc6fb25644 100644 --- a/indra/newview/llnotificationgrouphandler.cpp +++ b/indra/newview/llnotificationgrouphandler.cpp @@ -57,7 +57,7 @@ LLGroupHandler::~LLGroupHandler() //-------------------------------------------------------------------------- void LLGroupHandler::initChannel() { - S32 channel_right_bound = gViewerWindow->getWorldViewRect().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); + S32 channel_right_bound = gViewerWindow->getWorldViewRectRaw().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth"); mChannel->init(channel_right_bound - channel_width, channel_right_bound); } diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 6305ca12aa..471dd28426 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -65,7 +65,7 @@ LLOfferHandler::~LLOfferHandler() //-------------------------------------------------------------------------- void LLOfferHandler::initChannel() { - S32 channel_right_bound = gViewerWindow->getWorldViewRect().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); + S32 channel_right_bound = gViewerWindow->getWorldViewRectRaw().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth"); mChannel->init(channel_right_bound - channel_width, channel_right_bound); } diff --git a/indra/newview/llnotificationscripthandler.cpp b/indra/newview/llnotificationscripthandler.cpp index dac7a4ca3a..70b86e8b97 100644 --- a/indra/newview/llnotificationscripthandler.cpp +++ b/indra/newview/llnotificationscripthandler.cpp @@ -64,7 +64,7 @@ LLScriptHandler::~LLScriptHandler() //-------------------------------------------------------------------------- void LLScriptHandler::initChannel() { - S32 channel_right_bound = gViewerWindow->getWorldViewRect().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); + S32 channel_right_bound = gViewerWindow->getWorldViewRectRaw().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth"); mChannel->init(channel_right_bound - channel_width, channel_right_bound); } diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index 543198c1d2..823c92a94e 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -60,7 +60,7 @@ LLTipHandler::~LLTipHandler() //-------------------------------------------------------------------------- void LLTipHandler::initChannel() { - S32 channel_right_bound = gViewerWindow->getWorldViewRect().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); + S32 channel_right_bound = gViewerWindow->getWorldViewRectRaw().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth"); mChannel->init(channel_right_bound - channel_width, channel_right_bound); } diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 32fc3b6519..1770138b3e 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -92,6 +92,14 @@ void LLPanelChatControlPanel::draw() && callback_enabled; childSetEnabled("call_btn", enable_connect); + // send a signal when the floater is fully initialized + // this lets LLAvatarActions::startAdhocCall() start the call + if (enable_connect && !mInitialized) + { + LLIMModel::sendSessionInitialized(mSessionId); + mInitialized = true; + } + LLPanel::draw(); } diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index a0d3420d23..923c5acbd2 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -43,7 +43,9 @@ class LLParticipantList; class LLPanelChatControlPanel : public LLPanel { public: - LLPanelChatControlPanel() {}; + LLPanelChatControlPanel() : + mSessionId(LLUUID()), + mInitialized(false) {}; ~LLPanelChatControlPanel() {}; virtual BOOL postBuild(); @@ -59,6 +61,7 @@ public: private: LLUUID mSessionId; + bool mInitialized; }; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 5d826f0a56..b3e14eb2fb 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -310,7 +310,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, void LLPanelLogin::reshapeBrowser() { LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("login_html"); - LLRect rect = gViewerWindow->getVirtualWindowRect(); + LLRect rect = gViewerWindow->getWindowRectScaled(); LLRect html_rect; #if USE_VIEWER_AUTH html_rect.setCenterAndSize( diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index 5186a5888b..2cf56d5571 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -366,21 +366,15 @@ void LLPanelMediaSettingsGeneral::onCommitHomeURL( LLUICtrl* ctrl, void *userdat void LLPanelMediaSettingsGeneral::onBtnResetCurrentUrl(LLUICtrl* ctrl, void *userdata) { LLPanelMediaSettingsGeneral* self =(LLPanelMediaSettingsGeneral *)userdata; - self->navigateHomeSelectedFace(); + self->navigateHomeSelectedFace(false); } //////////////////////////////////////////////////////////////////////////////// -// static -void LLPanelMediaSettingsGeneral::apply( void* userdata ) +// +void LLPanelMediaSettingsGeneral::preApply() { - LLPanelMediaSettingsGeneral *self =(LLPanelMediaSettingsGeneral *)userdata; - self->mHomeURL->onCommit(); - // build LLSD Fragment - LLSD media_data_general; - self->getValues(media_data_general); - - // this merges contents of LLSD passed in with what's there so this is ok - LLSelectMgr::getInstance()->selectionSetMediaData( media_data_general ); + // Make sure the home URL entry is committed + mHomeURL->onCommit(); } //////////////////////////////////////////////////////////////////////////////// @@ -392,7 +386,8 @@ void LLPanelMediaSettingsGeneral::getValues( LLSD &fill_me_in ) fill_me_in[LLMediaEntry::AUTO_SCALE_KEY] = mAutoScale->getValue(); fill_me_in[LLMediaEntry::AUTO_ZOOM_KEY] = mAutoZoom->getValue(); fill_me_in[LLMediaEntry::CONTROLS_KEY] = mControls->getCurrentIndex(); - fill_me_in[LLMediaEntry::CURRENT_URL_KEY] = mCurrentURL->getValue(); + //Don't fill in current URL: this is only supposed to get changed via navigate + // fill_me_in[LLMediaEntry::CURRENT_URL_KEY] = mCurrentURL->getValue(); fill_me_in[LLMediaEntry::HEIGHT_PIXELS_KEY] = mHeightPixels->getValue(); fill_me_in[LLMediaEntry::HOME_URL_KEY] = mHomeURL->getValue(); fill_me_in[LLMediaEntry::FIRST_CLICK_INTERACT_KEY] = mFirstClick->getValue(); @@ -400,39 +395,53 @@ void LLPanelMediaSettingsGeneral::getValues( LLSD &fill_me_in ) } //////////////////////////////////////////////////////////////////////////////// +// +void LLPanelMediaSettingsGeneral::postApply() +{ + // Make sure to navigate to the home URL if the current URL is empty and + // autoplay is on + navigateHomeSelectedFace(true); +} + + +//////////////////////////////////////////////////////////////////////////////// // void LLPanelMediaSettingsGeneral::setParent( LLFloaterMediaSettings* parent ) { mParent = parent; }; -bool LLPanelMediaSettingsGeneral::navigateHomeSelectedFace() +//////////////////////////////////////////////////////////////////////////////// +// +bool LLPanelMediaSettingsGeneral::navigateHomeSelectedFace(bool only_if_current_is_empty) { - // HACK: This is directly referencing an impl name. BAD! - // This can be removed when we have a truly generic media browser that only - // builds an impl based on the type of url it is passed. struct functor_navigate_media : public LLSelectedTEGetFunctor< bool> { + functor_navigate_media(bool flag) : only_if_current_is_empty(flag) {} bool get( LLViewerObject* object, S32 face ) { - if ( object ) - if ( object->getTE(face) ) - if ( object->getTE(face)->getMediaData() ) + if ( object && object->getTE(face) && object->permModify() ) + { + const LLMediaEntry *media_data = object->getTE(face)->getMediaData(); + if ( media_data ) + { + if (!only_if_current_is_empty || (media_data->getCurrentURL().empty() && media_data->getAutoPlay())) { - if(object->permModify()) + viewer_media_t media_impl = + LLViewerMedia::getMediaImplFromTextureID(object->getTE(face)->getMediaData()->getMediaID()); + if(media_impl) { - viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(object->getTE(face)->getMediaData()->getMediaID()); - if(media_impl) - { - media_impl->navigateHome(); - return true; - } - } + media_impl->navigateHome(); + return true; + } } - return false; - }; + } + } + return false; + }; + bool only_if_current_is_empty; - } functor_navigate_media; + } functor_navigate_media(only_if_current_is_empty); bool all_face_media_navigated = false; LLObjectSelectionHandle selected_objects =LLSelectMgr::getInstance()->getSelection(); diff --git a/indra/newview/llpanelmediasettingsgeneral.h b/indra/newview/llpanelmediasettingsgeneral.h index b48e081a1b..f8b8f0d224 100644 --- a/indra/newview/llpanelmediasettingsgeneral.h +++ b/indra/newview/llpanelmediasettingsgeneral.h @@ -47,21 +47,30 @@ class LLFloaterMediaSettings; class LLPanelMediaSettingsGeneral : public LLPanel { public: + LLPanelMediaSettingsGeneral(); + ~LLPanelMediaSettingsGeneral(); + + // XXX TODO: put these into a common parent class? + // Hook that the floater calls before applying changes from the panel + void preApply(); + // Function that asks the panel to fill in values associated with the panel + void getValues(LLSD &fill_me_in); + // Hook that the floater calls after applying changes to the panel + void postApply(); + BOOL postBuild(); /*virtual*/ void draw(); /*virtual*/ void onClose(bool app_quitting); - static void apply(void*); - void getValues(LLSD &fill_me_in); - - LLPanelMediaSettingsGeneral(); - ~LLPanelMediaSettingsGeneral(); - void setParent( LLFloaterMediaSettings* parent ); static void initValues( void* userdata, const LLSD& media_settings ,bool editable); static void clearValues( void* userdata, bool editable); - bool navigateHomeSelectedFace(); + // Navigates the current selected face to the Home URL. + // If 'only_if_current_is_empty' is "true", it only performs + // the operation if: 1) the current URL is empty, and 2) auto play is true. + bool navigateHomeSelectedFace(bool only_if_current_is_empty); + void updateMediaPreview(); const std::string getHomeUrl(); diff --git a/indra/newview/llpanelmediasettingspermissions.cpp b/indra/newview/llpanelmediasettingspermissions.cpp index 4d84874e7a..2f3f550e35 100644 --- a/indra/newview/llpanelmediasettingspermissions.cpp +++ b/indra/newview/llpanelmediasettingspermissions.cpp @@ -218,17 +218,10 @@ void LLPanelMediaSettingsPermissions::initValues( void* userdata, const LLSD& me } //////////////////////////////////////////////////////////////////////////////// -// static -void LLPanelMediaSettingsPermissions::apply( void* userdata ) +// +void LLPanelMediaSettingsPermissions::preApply() { - LLPanelMediaSettingsPermissions *self =(LLPanelMediaSettingsPermissions *)userdata; - - // build LLSD Fragment - LLSD media_data_permissions; - self->getValues(media_data_permissions); - - // this merges contents of LLSD passed in with what's there so this is ok - LLSelectMgr::getInstance()->selectionSetMediaData( media_data_permissions ); + // no-op } //////////////////////////////////////////////////////////////////////////////// @@ -254,3 +247,11 @@ void LLPanelMediaSettingsPermissions::getValues( LLSD &fill_me_in ) fill_me_in[LLMediaEntry::PERMS_CONTROL_KEY] = control; fill_me_in[LLMediaEntry::PERMS_INTERACT_KEY] = interact; } + + +//////////////////////////////////////////////////////////////////////////////// +// +void LLPanelMediaSettingsPermissions::postApply() +{ + // no-op +} diff --git a/indra/newview/llpanelmediasettingspermissions.h b/indra/newview/llpanelmediasettingspermissions.h index ecc50e3582..45a596c615 100644 --- a/indra/newview/llpanelmediasettingspermissions.h +++ b/indra/newview/llpanelmediasettingspermissions.h @@ -46,26 +46,32 @@ class LLNameBox; class LLPanelMediaSettingsPermissions : public LLPanel { - public: - BOOL postBuild(); - virtual void draw(); - static void apply(void*); - void getValues(LLSD &fill_me_in); - - LLPanelMediaSettingsPermissions(); - ~LLPanelMediaSettingsPermissions(); - - static void initValues( void* userdata, const LLSD& media_settings, bool editable ); - static void clearValues( void* userdata, bool editable); - - private: - LLCheckBoxCtrl* mPermsOwnerInteract; - LLCheckBoxCtrl* mPermsOwnerControl; - LLNameBox* mPermsGroupName; - LLCheckBoxCtrl* mPermsGroupInteract; - LLCheckBoxCtrl* mPermsGroupControl; - LLCheckBoxCtrl* mPermsWorldInteract; - LLCheckBoxCtrl* mPermsWorldControl; +public: + LLPanelMediaSettingsPermissions(); + ~LLPanelMediaSettingsPermissions(); + + BOOL postBuild(); + virtual void draw(); + + // XXX TODO: put these into a common parent class? + // Hook that the floater calls before applying changes from the panel + void preApply(); + // Function that asks the panel to fill in values associated with the panel + void getValues(LLSD &fill_me_in); + // Hook that the floater calls after applying changes to the panel + void postApply(); + + static void initValues( void* userdata, const LLSD& media_settings, bool editable ); + static void clearValues( void* userdata, bool editable); + +private: + LLCheckBoxCtrl* mPermsOwnerInteract; + LLCheckBoxCtrl* mPermsOwnerControl; + LLNameBox* mPermsGroupName; + LLCheckBoxCtrl* mPermsGroupInteract; + LLCheckBoxCtrl* mPermsGroupControl; + LLCheckBoxCtrl* mPermsWorldInteract; + LLCheckBoxCtrl* mPermsWorldControl; }; #endif // LL_LLPANELMEDIAMEDIASETTINGSPERMISSIONS_H diff --git a/indra/newview/llpanelmediasettingssecurity.cpp b/indra/newview/llpanelmediasettingssecurity.cpp index 3577f63340..bec2494eac 100644 --- a/indra/newview/llpanelmediasettingssecurity.cpp +++ b/indra/newview/llpanelmediasettingssecurity.cpp @@ -198,17 +198,12 @@ void LLPanelMediaSettingsSecurity::clearValues( void* userdata , bool editable) self->mEnableWhiteList->setEnabled(editable);
self->mWhiteListList->setEnabled(editable);
}
+
////////////////////////////////////////////////////////////////////////////////
-// static
-void LLPanelMediaSettingsSecurity::apply( void* userdata )
+//
+void LLPanelMediaSettingsSecurity::preApply()
{
- LLPanelMediaSettingsSecurity *self =(LLPanelMediaSettingsSecurity *)userdata;
-
- // build LLSD Fragment
- LLSD media_data_security;
- self->getValues(media_data_security);
- // this merges contents of LLSD passed in with what's there so this is ok
- LLSelectMgr::getInstance()->selectionSetMediaData( media_data_security );
+ // no-op
}
////////////////////////////////////////////////////////////////////////////////
@@ -220,7 +215,9 @@ void LLPanelMediaSettingsSecurity::getValues( LLSD &fill_me_in ) // iterate over white list and extract items
std::vector< LLScrollListItem* > white_list_items = mWhiteListList->getAllData();
std::vector< LLScrollListItem* >::iterator iter = white_list_items.begin();
- fill_me_in[LLMediaEntry::WHITELIST_KEY].clear();
+ // *NOTE: need actually set the key to be an emptyArray(), or the merge
+ // we do with this LLSD will think there's nothing to change.
+ fill_me_in[LLMediaEntry::WHITELIST_KEY] = LLSD::emptyArray();
while( iter != white_list_items.end() )
{
std::string white_list_url = (*iter)->getValue().asString();
@@ -229,23 +226,30 @@ void LLPanelMediaSettingsSecurity::getValues( LLSD &fill_me_in ) };
}
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLPanelMediaSettingsSecurity::postApply()
+{
+ // no-op
+}
+
///////////////////////////////////////////////////////////////////////////////
// Try to make a valid URL if a fragment (
// white list list box widget and build a list to test against. Can also
const std::string LLPanelMediaSettingsSecurity::makeValidUrl( const std::string& src_url )
{
// use LLURI to determine if we have a valid scheme
- LLURI candidate_url( src_url ); - if ( candidate_url.scheme().empty() ) - { + LLURI candidate_url( src_url );
+ if ( candidate_url.scheme().empty() )
+ {
// build a URL comprised of default scheme and the original fragment
const std::string default_scheme( "http://" );
return default_scheme + src_url;
- }; - - // we *could* test the "default scheme" + "original fragment" URL again - // using LLURI to see if it's valid but I think the outcome is the same - // in either case - our only option is to return the original URL + };
+
+ // we *could* test the "default scheme" + "original fragment" URL again
+ // using LLURI to see if it's valid but I think the outcome is the same
+ // in either case - our only option is to return the original URL
// we *think* the original url passed in was valid
return src_url;
@@ -332,10 +336,10 @@ void LLPanelMediaSettingsSecurity::onBtnDel( void* userdata ) self->mWhiteListList->deleteSelectedItems();
}
-//////////////////////////////////////////////////////////////////////////////// -// -void LLPanelMediaSettingsSecurity::setParent( LLFloaterMediaSettings* parent ) -{ - mParent = parent; -}; - +////////////////////////////////////////////////////////////////////////////////
+//
+void LLPanelMediaSettingsSecurity::setParent( LLFloaterMediaSettings* parent )
+{
+ mParent = parent;
+};
+
diff --git a/indra/newview/llpanelmediasettingssecurity.h b/indra/newview/llpanelmediasettingssecurity.h index 2555bb8dc8..638664e59d 100644 --- a/indra/newview/llpanelmediasettingssecurity.h +++ b/indra/newview/llpanelmediasettingssecurity.h @@ -41,31 +41,37 @@ class LLFloaterMediaSettings; class LLPanelMediaSettingsSecurity : public LLPanel { - public: - BOOL postBuild(); - virtual void draw(); - static void apply(void*); - void getValues(LLSD &fill_me_in); - - LLPanelMediaSettingsSecurity(); - ~LLPanelMediaSettingsSecurity(); - - static void initValues( void* userdata, const LLSD& media_settings,bool editable ); - static void clearValues( void* userdata, bool editable); - void addWhiteListItem(const std::string& url); - void setParent( LLFloaterMediaSettings* parent ); - const std::string makeValidUrl( const std::string& src_url ); - bool passesWhiteList( const std::string& added_url, const std::string& test_url ); - - protected: - LLFloaterMediaSettings* mParent; - - private: - LLCheckBoxCtrl* mEnableWhiteList; - LLScrollListCtrl* mWhiteListList; - - static void onBtnAdd(void*); - static void onBtnDel(void*); +public: + LLPanelMediaSettingsSecurity(); + ~LLPanelMediaSettingsSecurity(); + + BOOL postBuild(); + virtual void draw(); + + // XXX TODO: put these into a common parent class? + // Hook that the floater calls before applying changes from the panel + void preApply(); + // Function that asks the panel to fill in values associated with the panel + void getValues(LLSD &fill_me_in); + // Hook that the floater calls after applying changes to the panel + void postApply(); + + static void initValues( void* userdata, const LLSD& media_settings,bool editable ); + static void clearValues( void* userdata, bool editable); + void addWhiteListItem(const std::string& url); + void setParent( LLFloaterMediaSettings* parent ); + const std::string makeValidUrl( const std::string& src_url ); + bool passesWhiteList( const std::string& added_url, const std::string& test_url ); + +protected: + LLFloaterMediaSettings* mParent; + +private: + LLCheckBoxCtrl* mEnableWhiteList; + LLScrollListCtrl* mWhiteListList; + + static void onBtnAdd(void*); + static void onBtnDel(void*); }; #endif // LL_LLPANELMEDIAMEDIASETTINGSSECURITY_H diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 005a00df75..9ba94c8ca9 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -275,7 +275,8 @@ public: ~LLFriendListUpdater() { - delete mInvObserver; + // will be deleted by ~LLInventoryModel + //delete mInvObserver; LLVoiceClient::getInstance()->removeObserver(this); LLAvatarTracker::instance().removeObserver(this); } @@ -754,7 +755,7 @@ void LLPanelPeople::updateButtons() buttonSetEnabled("teleport_btn", friends_tab_active && item_selected && isFriendOnline(selected_uuids.front())); buttonSetEnabled("view_profile_btn", item_selected); buttonSetEnabled("im_btn", multiple_selected); // allow starting the friends conference for multiple selection - buttonSetEnabled("call_btn", item_selected); + buttonSetEnabled("call_btn", multiple_selected); buttonSetEnabled("share_btn", item_selected && false); // not implemented yet bool none_group_selected = item_selected && selected_id.isNull(); @@ -1192,11 +1193,12 @@ void LLPanelPeople::onCallButtonClicked() if (selected_uuids.size() == 1) { // initiate a P2P voice chat with the selected user - LLAvatarActions::startCall(getCurrentItemID()); + LLAvatarActions::startCall(selected_uuids[0]); } else if (selected_uuids.size() > 1) { - // *NOTE: ad-hoc voice chat not implemented yet + // initiate an ad-hoc voice chat with multiple users + LLAvatarActions::startAdhocCall(selected_uuids); } } diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index aaf6849fe9..7dea5eaf67 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -64,7 +64,6 @@ void ContextMenu::show(LLView* spawning_view, const std::vector<LLUUID>& uuids, if (parent) { parent->removeChild(mMenu); - mMenu->setParent(NULL); } delete mMenu; mMenu = NULL; diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 73e19b3b2a..5c3c260549 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -561,12 +561,12 @@ void LLPanelPrimMediaControls::updateShape() } LLCoordGL screen_min; - screen_min.mX = llround((F32)gViewerWindow->getWorldViewWidth() * (min.mV[VX] + 1.f) * 0.5f); - screen_min.mY = llround((F32)gViewerWindow->getWorldViewHeight() * (min.mV[VY] + 1.f) * 0.5f); + screen_min.mX = llround((F32)gViewerWindow->getWorldViewWidthRaw() * (min.mV[VX] + 1.f) * 0.5f); + screen_min.mY = llround((F32)gViewerWindow->getWorldViewHeightRaw() * (min.mV[VY] + 1.f) * 0.5f); LLCoordGL screen_max; - screen_max.mX = llround((F32)gViewerWindow->getWorldViewWidth() * (max.mV[VX] + 1.f) * 0.5f); - screen_max.mY = llround((F32)gViewerWindow->getWorldViewHeight() * (max.mV[VY] + 1.f) * 0.5f); + screen_max.mX = llround((F32)gViewerWindow->getWorldViewWidthRaw() * (max.mV[VX] + 1.f) * 0.5f); + screen_max.mY = llround((F32)gViewerWindow->getWorldViewHeightRaw() * (max.mV[VY] + 1.f) * 0.5f); // grow panel so that screenspace bounding box fits inside "media_region" element of HUD LLRect media_controls_rect; @@ -697,6 +697,7 @@ bool LLPanelPrimMediaControls::isMouseOver() LLView* controls_view = NULL; controls_view = getChild<LLView>("media_controls"); + //FIXME: rewrite as LLViewQuery or get hover set from LLViewerWindow? if(controls_view && controls_view->getVisible()) { controls_view->screenPointToLocal(cursor_pos_gl.mX, cursor_pos_gl.mY, &x, &y); diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 72856d5b82..057cdde6f0 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -163,7 +163,6 @@ void LLTeleportHistoryPanel::ContextMenu::show(LLView* spawning_view, S32 index, if (parent) { parent->removeChild(mMenu); - mMenu->setParent(NULL); } delete mMenu; } @@ -658,7 +657,6 @@ void LLTeleportHistoryPanel::onAccordionTabRightClick(LLView *view, S32 x, S32 y if (parent) { parent->removeChild(mAccordionTabMenu); - mAccordionTabMenu->setParent(NULL); } delete mAccordionTabMenu; } diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index 34e78b5c46..c95882931b 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -454,7 +454,7 @@ LLMultiPreview::LLMultiPreview() { // start with a rect in the top-left corner ; will get resized LLRect rect; - rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeight(), 200, 200); + rect.setLeftTopAndSize(0, gViewerWindow->getWindowHeightScaled(), 200, 200); setRect(rect); } setTitle(LLTrans::getString("MultiPreviewTitle")); diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 3eab13fc4a..13d02b7dec 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -394,8 +394,8 @@ void LLPreviewTexture::updateDimensions() S32 client_height = image_height; S32 horiz_pad = 2 * (LLPANEL_BORDER_WIDTH + PREVIEW_PAD) + PREVIEW_RESIZE_HANDLE_SIZE; S32 vert_pad = PREVIEW_HEADER_SIZE + 2 * CLIENT_RECT_VPAD + LLPANEL_BORDER_WIDTH; - S32 max_client_width = gViewerWindow->getWindowWidth() - horiz_pad; - S32 max_client_height = gViewerWindow->getWindowHeight() - vert_pad; + S32 max_client_width = gViewerWindow->getWindowWidthScaled() - horiz_pad; + S32 max_client_height = gViewerWindow->getWindowHeightScaled() - vert_pad; if (mAspectRatio > 0.f) { diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index e4dbcbd219..b667fbf5fd 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -103,8 +103,8 @@ void LLScreenChannelBase::updatePositionAndSize(LLRect old_world_rect, LLRect ne void LLScreenChannelBase::init(S32 channel_left, S32 channel_right) { - S32 channel_top = gViewerWindow->getWorldViewRect().getHeight(); - S32 channel_bottom = gViewerWindow->getWorldViewRect().mBottom + gSavedSettings.getS32("ChannelBottomPanelMargin"); + S32 channel_top = gViewerWindow->getWorldViewRectRaw().getHeight(); + S32 channel_bottom = gViewerWindow->getWorldViewRectRaw().mBottom + gSavedSettings.getS32("ChannelBottomPanelMargin"); setRect(LLRect(channel_left, channel_top, channel_right, channel_bottom)); setVisible(TRUE); } @@ -706,7 +706,7 @@ void LLScreenChannel::updateShowToastsState() // for Message Well floater showed in a docked state - adjust channel's height if(dynamic_cast<LLSysWellWindow*>(floater)) { - S32 channel_bottom = gViewerWindow->getWorldViewRect().mBottom + gSavedSettings.getS32("ChannelBottomPanelMargin");; + S32 channel_bottom = gViewerWindow->getWorldViewRectRaw().mBottom + gSavedSettings.getS32("ChannelBottomPanelMargin");; LLRect this_rect = getRect(); if(floater->getVisible() && floater->isDocked()) { diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 1d9b1261d6..e8f310c27e 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -100,7 +100,7 @@ LLSideTray* LLSideTray::getInstance() { if (!sInstance) { - sInstance = LLUICtrlFactory::createFromFile<LLSideTray>("panel_side_tray.xml",gViewerWindow->getRootView(), LLRootView::child_registry_t::instance()); + sInstance = LLUICtrlFactory::createFromFile<LLSideTray>("panel_side_tray.xml",NULL, LLRootView::child_registry_t::instance()); } return sInstance; @@ -148,7 +148,6 @@ public: /*virtual*/ bool addChild (LLView* view, S32 tab_group); - void arrange (S32 width, S32 height); void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE); static LLSideTrayTab* createInstance (); @@ -156,8 +155,6 @@ public: const std::string& getDescription () const { return mDescription;} const std::string& getTabTitle() const { return mTabTitle;} - void draw(); - void onOpen (const LLSD& key); private: @@ -209,60 +206,24 @@ BOOL LLSideTrayTab::postBuild() static const S32 splitter_margin = 1; -//virtual -void LLSideTrayTab::arrange(S32 width, S32 height ) -{ - if(!mMainPanel) - return; - - S32 offset = 0; - - LLView* title_panel = findChildView(TAB_PANEL_CAPTION_NAME, true); - - if(title_panel) - { - title_panel->setOrigin( 0, height - title_panel->getRect().getHeight() ); - offset = title_panel->getRect().getHeight(); - } - - LLRect sRect = mMainPanel->getRect(); - sRect.setLeftTopAndSize( splitter_margin, height - offset - splitter_margin, width - 2*splitter_margin, height - offset - 2*splitter_margin); - mMainPanel->reshape(sRect.getWidth(),sRect.getHeight()); - mMainPanel->setRect(sRect); - - - -} - void LLSideTrayTab::reshape (S32 width, S32 height, BOOL called_from_parent ) { - if(!mMainPanel) - return; - S32 offset = 0; - + LLPanel::reshape(width, height, called_from_parent); LLView* title_panel = findChildView(TAB_PANEL_CAPTION_NAME, true); - - if(title_panel) + if (!title_panel) { - title_panel->setOrigin( 0, height - title_panel->getRect().getHeight() ); - title_panel->reshape(width,title_panel->getRect().getHeight()); - offset = title_panel->getRect().getHeight(); + // not fully constructed yet + return; } - - - LLRect sRect = mMainPanel->getRect(); - sRect.setLeftTopAndSize( splitter_margin, height - offset - splitter_margin, width - 2*splitter_margin, height - offset - 2*splitter_margin); - //mMainPanel->setMaxWidth(sRect.getWidth()); - mMainPanel->reshape(sRect.getWidth(), sRect.getHeight()); - - mMainPanel->setRect(sRect); - -} + S32 title_height = title_panel->getRect().getHeight(); + title_panel->setOrigin( 0, height - title_height ); + title_panel->reshape(width,title_height); -void LLSideTrayTab::draw() -{ - LLPanel::draw(); + LLRect sRect; + sRect.setLeftTopAndSize( splitter_margin, height - title_height - splitter_margin, + width - 2*splitter_margin, height - title_height - 2*splitter_margin); + mMainPanel->setShape(sRect); } void LLSideTrayTab::onOpen (const LLSD& key) @@ -300,17 +261,20 @@ LLSideTray::LLSideTray(Params& params) ,mActiveTab(0) ,mCollapsed(false) ,mCollapseButton(0) - ,mMaxBarWidth(params.rect.width) { mCollapsed=params.collapsed; - LLUICtrl::CommitCallbackRegistry::Registrar& commit = LLUICtrl::CommitCallbackRegistry::currentRegistrar(); // register handler function to process data from the xml. // panel_name should be specified via "parameter" attribute. commit.add("SideTray.ShowPanel", boost::bind(&LLSideTray::showPanel, this, _2, LLUUID::null)); LLTransientFloaterMgr::getInstance()->addControlView(this); + + LLPanel::Params p; + p.name = "buttons_panel"; + p.mouse_opaque = false; + mButtonsPanel = LLUICtrlFactory::create<LLPanel>(p); } @@ -400,7 +364,7 @@ LLButton* LLSideTray::createButton (const std::string& name,const std::string& i rect.setOriginAndSize(0, 0, sidetray_params.default_button_width, sidetray_params.default_button_height); bparams.name(name); - bparams.follows.flags (FOLLOWS_LEFT | FOLLOWS_BOTTOM); + bparams.follows.flags (FOLLOWS_LEFT | FOLLOWS_TOP); bparams.rect (rect); bparams.tab_stop(false); bparams.image_unselected.name(sidetray_params.tab_btn_image_normal); @@ -420,7 +384,7 @@ LLButton* LLSideTray::createButton (const std::string& name,const std::string& i button->setImageOverlay(image); } - addChildInBack(button); + mButtonsPanel->addChildInBack(button); return button; } @@ -530,7 +494,7 @@ void LLSideTray::onToggleCollapse() void LLSideTray::reflectCollapseChange() { - setPanelRect(); + updateSidetrayVisibility(); if(mCollapsed) { @@ -539,23 +503,24 @@ void LLSideTray::reflectCollapseChange() } else { - gFloaterView->setSnapOffsetRight(mMaxBarWidth); + gFloaterView->setSnapOffsetRight(getRect().getWidth()); setFocus(TRUE); } gFloaterView->refresh(); } -void LLSideTray::arrange () +void LLSideTray::arrange() { static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams<LLSideTray>()); - setPanelRect(); + updateSidetrayVisibility(); LLRect ctrl_rect; - ctrl_rect.setLeftTopAndSize(0,getRect().getHeight()-sidetray_params.default_button_width - ,sidetray_params.default_button_width - ,sidetray_params.default_button_height); + ctrl_rect.setLeftTopAndSize(0, + mButtonsPanel->getRect().getHeight() - sidetray_params.default_button_width, + sidetray_params.default_button_width, + sidetray_params.default_button_height); mCollapseButton->setRect(ctrl_rect); @@ -567,9 +532,10 @@ void LLSideTray::arrange () { LLSideTrayTab* sidebar_tab = *child_it; - ctrl_rect.setLeftTopAndSize(0,getRect().getHeight()-offset - ,sidetray_params.default_button_width - ,sidetray_params.default_button_height); + ctrl_rect.setLeftTopAndSize(0, + mButtonsPanel->getRect().getHeight()-offset, + sidetray_params.default_button_width, + sidetray_params.default_button_height); if(mTabButtons.find(sidebar_tab->getName()) == mTabButtons.end()) continue; @@ -583,14 +549,11 @@ void LLSideTray::arrange () btn->setVisible(ctrl_rect.mBottom > 0); } - ctrl_rect.setLeftTopAndSize(sidetray_params.default_button_width,getRect().getHeight(),mMaxBarWidth,getRect().getHeight()); - //arrange tabs - for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) + for ( child_vector_t::iterator child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) { LLSideTrayTab* sidebar_tab = *child_it; - sidebar_tab->setRect(ctrl_rect); - sidebar_tab->arrange(mMaxBarWidth,getRect().getHeight()); + sidebar_tab->setShape(getLocalRect()); } } @@ -619,7 +582,7 @@ void LLSideTray::collapseSideBar() { mCollapseButton->setImageOverlay( home_tab->mImage ); } - mActiveTab->setVisible(FALSE); + //mActiveTab->setVisible(FALSE); reflectCollapseChange(); setFocus( FALSE ); @@ -635,7 +598,6 @@ void LLSideTray::expandSideBar() } LLSD key;//empty mActiveTab->onOpen(key); - mActiveTab->setVisible(TRUE); reflectCollapseChange(); } @@ -651,15 +613,6 @@ void LLSideTray::highlightFocused() */ } -BOOL LLSideTray::handleScrollWheel(S32 x, S32 y, S32 mask) -{ - BOOL ret = LLPanel::handleScrollWheel(x,y,mask); - - if(!ret && childFromPoint(x,y) != 0 ) - return TRUE;//mouse wheel over sidetray buttons, eat mouse wheel - return ret; -} - //virtual BOOL LLSideTray::handleMouseDown (S32 x, S32 y, MASK mask) { @@ -669,58 +622,13 @@ BOOL LLSideTray::handleMouseDown (S32 x, S32 y, MASK mask) return ret; } -void LLSideTray::reshape (S32 width, S32 height, BOOL called_from_parent) +void LLSideTray::reshape(S32 width, S32 height, BOOL called_from_parent) { - LLPanel::reshape(width, height, called_from_parent); if(!mActiveTab) return; - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams<LLSideTray>()); - - setPanelRect(); - - LLRect ctrl_rect; - ctrl_rect.setLeftTopAndSize(0 - ,getRect().getHeight()-sidetray_params.default_button_width - ,sidetray_params.default_button_width - ,sidetray_params.default_button_height); - - mCollapseButton->setRect(ctrl_rect); - - //arrange tab buttons - child_vector_const_iter_t child_it; - int offset = (sidetray_params.default_button_height+sidetray_params.default_button_margin)*2; - for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) - { - LLSideTrayTab* sidebar_tab = *child_it; - - ctrl_rect.setLeftTopAndSize(0,getRect().getHeight()-offset - ,sidetray_params.default_button_width - ,sidetray_params.default_button_height); - - if(mTabButtons.find(sidebar_tab->getName()) == mTabButtons.end()) - continue; - - LLButton* btn = mTabButtons[sidebar_tab->getName()]; - - btn->setRect(ctrl_rect); - offset+=sidetray_params.default_button_height; - offset+=sidetray_params.default_button_margin; - - btn->setVisible(ctrl_rect.mBottom > 0); - } - - //arrange tabs - - for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) - { - LLSideTrayTab* sidebar_tab = *child_it; - sidebar_tab->reshape(mMaxBarWidth,getRect().getHeight()); - ctrl_rect.setLeftTopAndSize(sidetray_params.default_button_width,getRect().getHeight(),mMaxBarWidth,getRect().getHeight()); - sidebar_tab->setRect(ctrl_rect); - - } + arrange(); } /** @@ -768,42 +676,12 @@ LLPanel* LLSideTray::showPanel (const std::string& panel_name, const LLSD& para static const S32 fake_offset = 132; static const S32 fake_top_offset = 18; -void LLSideTray::resetPanelRect () -{ - const LLRect& parent_rect = gViewerWindow->getRootView()->getRect(); - - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams<LLSideTray>()); - - S32 panel_width = sidetray_params.default_button_width; - panel_width += mCollapsed ? 0 : mMaxBarWidth; - - S32 panel_height = parent_rect.getHeight()-fake_top_offset; - - reshape(panel_width,panel_height); -} - -void LLSideTray::setPanelRect () +void LLSideTray::updateSidetrayVisibility() { - LLNavigationBar* nav_bar = LLNavigationBar::getInstance(); - LLRect nav_rect = nav_bar->getRect(); - - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams<LLSideTray>()); - - const LLRect& parent_rect = gViewerWindow->getRootView()->getRect(); - - S32 panel_width = sidetray_params.default_button_width; - panel_width += mCollapsed ? 0 : mMaxBarWidth; - - S32 panel_height = parent_rect.getHeight()-fake_top_offset - nav_rect.getHeight(); - S32 panel_top = parent_rect.mTop-fake_top_offset - nav_rect.getHeight(); - - LLRect panel_rect; - panel_rect.setLeftTopAndSize( parent_rect.mRight-panel_width, panel_top, panel_width, panel_height); - setRect(panel_rect); + // set visibility of parent container based on collapsed state + if (getParent()) + { + getParent()->setVisible(!mCollapsed); + } } -S32 LLSideTray::getTrayWidth() -{ - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams<LLSideTray>()); - return getRect().getWidth() - (sidetray_params.default_button_width + sidetray_params.default_button_margin); -} diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 19d9ca8f7e..8b30199c45 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -118,6 +118,8 @@ public: LLPanel::setVisible(visible); } + LLPanel* getButtonsPanel() { return mButtonsPanel; } + public: virtual ~LLSideTray(){}; @@ -129,12 +131,8 @@ public: bool addChild (LLView* view, S32 tab_group); BOOL handleMouseDown (S32 x, S32 y, MASK mask); - BOOL handleScrollWheel(S32 x, S32 y, S32 mask); void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE); - S32 getTrayWidth(); - - void resetPanelRect (); void processTriState (); @@ -150,7 +148,7 @@ protected: void toggleTabButton (LLSideTrayTab* tab); - void setPanelRect (); + void updateSidetrayVisibility(); @@ -166,15 +164,15 @@ private: private: - std::map<std::string,LLButton*> mTabButtons; + LLPanel* mButtonsPanel; + typedef std::map<std::string,LLButton*> button_map_t; + button_map_t mTabButtons; child_vector_t mTabs; LLSideTrayTab* mActiveTab; LLButton* mCollapseButton; bool mCollapsed; - S32 mMaxBarWidth; - static LLSideTray* sInstance; }; diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index d441762fa6..57ea018f25 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -129,6 +129,8 @@ LLSpeakButton::LLSpeakButton(const Params& p) LLSpeakButton::~LLSpeakButton() { + LLTransientFloaterMgr::getInstance()->removeControlView(mSpeakBtn); + LLTransientFloaterMgr::getInstance()->removeControlView(mShowBtn); } void LLSpeakButton::onMouseDown_SpeakBtn() diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 0a6eefc41d..64dcd7b97f 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1386,7 +1386,7 @@ bool idle_startup() // Make sure agent knows correct aspect ratio // FOV limits depend upon aspect ratio so this needs to happen before initializing the FOV below - LLViewerCamera::getInstance()->setViewHeightInPixels(gViewerWindow->getWorldViewHeight()); + LLViewerCamera::getInstance()->setViewHeightInPixels(gViewerWindow->getWorldViewHeightRaw()); LLViewerCamera::getInstance()->setAspect(gViewerWindow->getWorldViewAspectRatio()); // Initialize FOV LLViewerCamera::getInstance()->setDefaultFOV(gSavedSettings.getF32("CameraAngle")); @@ -2122,7 +2122,7 @@ void login_show() BOOL bUseDebugLogin = TRUE; #endif - LLPanelLogin::show( gViewerWindow->getVirtualWindowRect(), + LLPanelLogin::show( gViewerWindow->getWindowRectScaled(), bUseDebugLogin, login_callback, NULL ); diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 723ac0fc33..4422c4b672 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -238,7 +238,7 @@ void LLSysWellWindow::initChannel() //--------------------------------------------------------------------------------- void LLSysWellWindow::getAllowedRect(LLRect& rect) { - rect = gViewerWindow->getWorldViewRect(); + rect = gViewerWindow->getWorldViewRectRaw(); } //--------------------------------------------------------------------------------- diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 69a2d1d7a6..6a4b967487 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1543,6 +1543,8 @@ bool LLTextureCache::readComplete(handle_t handle, bool abort) handle_map_t::iterator iter = mReaders.find(handle); llassert_always(iter != mReaders.end() || abort); LLTextureCacheWorker* worker = iter->second; + if (!worker) + return false; bool res = worker->complete(); if (res || abort) { diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index 0572f9a698..268a18d2a2 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -206,7 +206,7 @@ void LLToolBar::layoutButtons() { #if LL_DARWIN const S32 FUDGE_WIDTH_OF_SCREEN = 4; - S32 width = gViewerWindow->getWindowWidth() + FUDGE_WIDTH_OF_SCREEN; + S32 width = gViewerWindow->getWindowWidthScaled() + FUDGE_WIDTH_OF_SCREEN; S32 pad = 2; // this function may be called before postBuild(), in which case mResizeHandle won't have been set up yet. diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index 9400840bdf..e2ccc05e30 100644 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -365,7 +365,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask) // Orbit tool if (hasMouseCapture()) { - const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWorldViewWidth(); + const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWorldViewWidthRaw(); if (dx != 0) { @@ -393,7 +393,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask) F32 dist = (F32) camera_to_focus.normVec(); // Fudge factor for pan - F32 meters_per_pixel = 3.f * dist / gViewerWindow->getWorldViewWidth(); + F32 meters_per_pixel = 3.f * dist / gViewerWindow->getWorldViewWidthRaw(); if (dx != 0) { @@ -415,7 +415,7 @@ BOOL LLToolCamera::handleHover(S32 x, S32 y, MASK mask) if (hasMouseCapture()) { - const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWorldViewWidth(); + const F32 RADIANS_PER_PIXEL = 360.f * DEG_TO_RAD / gViewerWindow->getWorldViewWidthRaw(); if (dx != 0) { diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index b7a97562bd..44fb6e9271 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -510,8 +510,8 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) const F32 RADIANS_PER_PIXEL_X = 0.01f; const F32 RADIANS_PER_PIXEL_Y = 0.01f; - S32 dx = x - (gViewerWindow->getWorldViewWidth() / 2); - S32 dy = y - (gViewerWindow->getWorldViewHeight() / 2); + S32 dx = x - (gViewerWindow->getWorldViewWidthRaw() / 2); + S32 dy = y - (gViewerWindow->getWorldViewHeightRaw() / 2); if (dx != 0 || dy != 0) { @@ -631,10 +631,10 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) // Handle auto-rotation at screen edge. LLVector3 grab_pos_agent = gAgent.getPosAgentFromGlobal( grab_point_global ); - LLCoordGL grab_center_gl( gViewerWindow->getWorldViewWidth() / 2, gViewerWindow->getWorldViewHeight() / 2); + LLCoordGL grab_center_gl( gViewerWindow->getWorldViewWidthRaw() / 2, gViewerWindow->getWorldViewHeightRaw() / 2); LLViewerCamera::getInstance()->projectPosAgentToScreen(grab_pos_agent, grab_center_gl); - const S32 ROTATE_H_MARGIN = gViewerWindow->getWorldViewWidth() / 20; + const S32 ROTATE_H_MARGIN = gViewerWindow->getWorldViewWidthRaw() / 20; const F32 ROTATE_ANGLE_PER_SECOND = 30.f * DEG_TO_RAD; const F32 rotate_angle = ROTATE_ANGLE_PER_SECOND / gFPSClamped; // ...build mode moves camera about focus point @@ -649,7 +649,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) gAgent.cameraOrbitAround(rotate_angle); } } - else if (grab_center_gl.mX > gViewerWindow->getWorldViewWidth() - ROTATE_H_MARGIN) + else if (grab_center_gl.mX > gViewerWindow->getWorldViewWidthRaw() - ROTATE_H_MARGIN) { if (gAgent.getFocusOnAvatar()) { @@ -662,7 +662,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) } // Don't move above top of screen or below bottom - if ((grab_center_gl.mY < gViewerWindow->getWorldViewHeight() - 6) + if ((grab_center_gl.mY < gViewerWindow->getWorldViewHeightRaw() - 6) && (grab_center_gl.mY > 24)) { // Transmit update to simulator @@ -893,7 +893,7 @@ void LLToolGrab::handleHoverInactive(S32 x, S32 y, MASK mask) gAgent.yaw(rotate_angle); //gAgent.setControlFlags(AGENT_CONTROL_YAW_POS); } - else if (x == (gViewerWindow->getWorldViewWidth() - 1) ) + else if (x == (gViewerWindow->getWorldViewWidthRaw() - 1) ) { gAgent.yaw(-rotate_angle); //gAgent.setControlFlags(AGENT_CONTROL_YAW_NEG); diff --git a/indra/newview/lltoolgun.cpp b/indra/newview/lltoolgun.cpp index 53d71a42cf..a441d653c7 100644 --- a/indra/newview/lltoolgun.cpp +++ b/indra/newview/lltoolgun.cpp @@ -140,7 +140,7 @@ void LLToolGun::draw() { LLUIImagePtr crosshair = LLUI::getUIImage("crosshairs.tga"); crosshair->draw( - ( gViewerWindow->getVirtualWorldViewRect().getWidth() - crosshair->getWidth() ) / 2, - ( gViewerWindow->getVirtualWorldViewRect().getHeight() - crosshair->getHeight() ) / 2); + ( gViewerWindow->getWorldViewRectScaled().getWidth() - crosshair->getWidth() ) / 2, + ( gViewerWindow->getWorldViewRectScaled().getHeight() - crosshair->getHeight() ) / 2); } } diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 93da32b115..d49ea5109d 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -700,13 +700,17 @@ BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, MASK mask) // *HACK: We may select this object, so pretend it was clicked mPick = mHoverPick; - LLToolTipMgr::instance().show(LLToolTip::Params() - .message(avatar_name) - .image(LLUI::getUIImage("Info")) - .click_callback(boost::bind(showAvatarInspector, hover_object->getID())) - .visible_time_near(6.f) - .visible_time_far(3.f) - .wrap(false)); + LLInspector::Params p; + p.message(avatar_name); + p.image(LLUI::getUIImage("Info")); + p.click_callback(boost::bind(showAvatarInspector, hover_object->getID())); + p.visible_time_near(6.f); + p.visible_time_far(3.f); + p.wrap(false); + + p.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>()); + + LLToolTipMgr::instance().show(p); } } else @@ -787,18 +791,22 @@ BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, MASK mask) { // We may select this object, so pretend it was clicked mPick = mHoverPick; - LLToolTipMgr::instance().show(LLToolTip::Params() - .message(tooltip_msg) - .image(LLUI::getUIImage("Info_Off")) - .click_callback(boost::bind(showObjectInspector, hover_object->getID(), mHoverPick.mObjectFace)) - .time_based_media(is_time_based_media) - .web_based_media(is_web_based_media) - .media_playing(is_media_playing) - .click_playmedia_callback(boost::bind(playCurrentMedia, mHoverPick)) - .click_homepage_callback(boost::bind(VisitHomePage, mHoverPick)) - .visible_time_near(6.f) - .visible_time_far(3.f) - .wrap(false)); + LLInspector::Params p; + p.message(tooltip_msg); + p.image(LLUI::getUIImage("Info_Off")); + p.click_callback(boost::bind(showObjectInspector, hover_object->getID(), mHoverPick.mObjectFace)); + p.time_based_media(is_time_based_media); + p.web_based_media(is_web_based_media); + p.media_playing(is_media_playing); + p.click_playmedia_callback(boost::bind(playCurrentMedia, mHoverPick)); + p.click_homepage_callback(boost::bind(VisitHomePage, mHoverPick)); + p.visible_time_near(6.f); + p.visible_time_far(3.f); + p.wrap(false); + + p.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>()); + + LLToolTipMgr::instance().show(p); } } } diff --git a/indra/newview/lluilistener.cpp b/indra/newview/lluilistener.cpp index 9c643e78de..8b4cfa7248 100644 --- a/indra/newview/lluilistener.cpp +++ b/indra/newview/lluilistener.cpp @@ -20,10 +20,16 @@ #include "lluictrl.h" #include "llerror.h" -LLUIListener::LLUIListener(const std::string& name): - LLDispatchListener(name, "op") +LLUIListener::LLUIListener(): + LLEventAPI("UI", + "LLUICtrl::CommitCallbackRegistry listener.\n" + "Capable of invoking any function (with parameter) you can specify in XUI.") { - add("call", &LLUIListener::call, LLSD().insert("function", LLSD())); + add("call", + "Invoke the operation named by [\"function\"], passing [\"parameter\"],\n" + "as if from a user gesture on a menu -- or a button click.", + &LLUIListener::call, + LLSD().insert("function", LLSD())); } void LLUIListener::call(const LLSD& event) const diff --git a/indra/newview/lluilistener.h b/indra/newview/lluilistener.h index ea904a99ff..8605d60bd3 100644 --- a/indra/newview/lluilistener.h +++ b/indra/newview/lluilistener.h @@ -12,15 +12,15 @@ #if ! defined(LL_LLUILISTENER_H) #define LL_LLUILISTENER_H -#include "lleventdispatcher.h" +#include "lleventapi.h" #include <string> class LLSD; -class LLUIListener: public LLDispatchListener +class LLUIListener: public LLEventAPI { public: - LLUIListener(const std::string& name); + LLUIListener(); private: void call(const LLSD& event) const; diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index b5709fa102..5566fea89f 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -401,10 +401,10 @@ void LLViewerCamera::setPerspective(BOOL for_selection, if (for_selection && (width > 1 || height > 1)) { - calculateFrustumPlanesFromWindow((F32)(x - width / 2) / (F32)gViewerWindow->getWindowWidth() - 0.5f, - (F32)(y_from_bot - height / 2) / (F32)gViewerWindow->getWindowHeight() - 0.5f, - (F32)(x + width / 2) / (F32)gViewerWindow->getWindowWidth() - 0.5f, - (F32)(y_from_bot + height / 2) / (F32)gViewerWindow->getWindowHeight() - 0.5f); + calculateFrustumPlanesFromWindow((F32)(x - width / 2) / (F32)gViewerWindow->getWindowWidthScaled() - 0.5f, + (F32)(y_from_bot - height / 2) / (F32)gViewerWindow->getWindowHeightScaled() - 0.5f, + (F32)(x + width / 2) / (F32)gViewerWindow->getWindowWidthScaled() - 0.5f, + (F32)(y_from_bot + height / 2) / (F32)gViewerWindow->getWindowHeightScaled() - 0.5f); } @@ -469,7 +469,7 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord } } - LLRect world_view_rect = gViewerWindow->getWorldViewRect(); + LLRect world_view_rect = gViewerWindow->getWorldViewRectRaw(); S32 viewport[4]; viewport[0] = world_view_rect.mLeft; viewport[1] = world_view_rect.mBottom; @@ -485,7 +485,7 @@ BOOL LLViewerCamera::projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoord y /= gViewerWindow->getDisplayScale().mV[VY]; // should now have the x,y coords of grab_point in screen space - LLRect world_view_rect = gViewerWindow->getVirtualWorldViewRect(); + LLRect world_view_rect = gViewerWindow->getWorldViewRectScaled(); // convert to pixel coordinates S32 int_x = lltrunc(x); @@ -572,7 +572,7 @@ BOOL LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent, in_front = FALSE; } - LLRect world_view_rect = gViewerWindow->getWorldViewRect(); + LLRect world_view_rect = gViewerWindow->getWorldViewRectRaw(); S32 viewport[4]; viewport[0] = world_view_rect.mLeft; viewport[1] = world_view_rect.mBottom; @@ -587,7 +587,7 @@ BOOL LLViewerCamera::projectPosAgentToScreenEdge(const LLVector3 &pos_agent, x /= gViewerWindow->getDisplayScale().mV[VX]; y /= gViewerWindow->getDisplayScale().mV[VY]; // should now have the x,y coords of grab_point in screen space - const LLRect& world_rect = gViewerWindow->getVirtualWorldViewRect(); + const LLRect& world_rect = gViewerWindow->getWorldViewRectScaled(); // ...sanity check S32 int_x = lltrunc(x); diff --git a/indra/newview/llviewercontrollistener.cpp b/indra/newview/llviewercontrollistener.cpp index ecba1b8eb0..0b9db1b906 100644 --- a/indra/newview/llviewercontrollistener.cpp +++ b/indra/newview/llviewercontrollistener.cpp @@ -18,12 +18,22 @@ LLViewerControlListener gSavedSettingsListener; LLViewerControlListener::LLViewerControlListener() - : LLDispatchListener("LLViewerControl", "group") + : LLEventAPI("LLViewerControl", + "LLViewerControl listener: set, toggle or set default for various controls", + "group") { - add("Global", boost::bind(&LLViewerControlListener::set, &gSavedSettings, _1)); - add("PerAccount", boost::bind(&LLViewerControlListener::set, &gSavedPerAccountSettings, _1)); - add("Warning", boost::bind(&LLViewerControlListener::set, &gWarningSettings, _1)); - add("Crash", boost::bind(&LLViewerControlListener::set, &gCrashSettings, _1)); + add("Global", + "Set gSavedSettings control [\"key\"] to value [\"value\"]", + boost::bind(&LLViewerControlListener::set, &gSavedSettings, _1)); + add("PerAccount", + "Set gSavedPerAccountSettings control [\"key\"] to value [\"value\"]", + boost::bind(&LLViewerControlListener::set, &gSavedPerAccountSettings, _1)); + add("Warning", + "Set gWarningSettings control [\"key\"] to value [\"value\"]", + boost::bind(&LLViewerControlListener::set, &gWarningSettings, _1)); + add("Crash", + "Set gCrashSettings control [\"key\"] to value [\"value\"]", + boost::bind(&LLViewerControlListener::set, &gCrashSettings, _1)); #if 0 add(/*"toggleControl",*/ "Global", boost::bind(&LLViewerControlListener::toggleControl, &gSavedSettings, _1)); diff --git a/indra/newview/llviewercontrollistener.h b/indra/newview/llviewercontrollistener.h index cacf97e908..88afbb871d 100644 --- a/indra/newview/llviewercontrollistener.h +++ b/indra/newview/llviewercontrollistener.h @@ -12,12 +12,12 @@ #ifndef LL_LLVIEWERCONTROLLISTENER_H #define LL_LLVIEWERCONTROLLISTENER_H -#include "lleventdispatcher.h" +#include "lleventapi.h" class LLControlGroup; class LLSD; -class LLViewerControlListener : public LLDispatchListener +class LLViewerControlListener : public LLEventAPI { public: LLViewerControlListener(); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index e0bb8fedeb..5b733ed817 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -782,10 +782,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // LLRect floater_rect = frontmost_floaterp->calcScreenRect(); // // deflate by one pixel so rounding errors don't occlude outside of floater extents // floater_rect.stretch(-1); - // LLRectf floater_3d_rect((F32)floater_rect.mLeft / (F32)gViewerWindow->getWindowWidth(), - // (F32)floater_rect.mTop / (F32)gViewerWindow->getWindowHeight(), - // (F32)floater_rect.mRight / (F32)gViewerWindow->getWindowWidth(), - // (F32)floater_rect.mBottom / (F32)gViewerWindow->getWindowHeight()); + // LLRectf floater_3d_rect((F32)floater_rect.mLeft / (F32)gViewerWindow->getWindowWidthScaled(), + // (F32)floater_rect.mTop / (F32)gViewerWindow->getWindowHeightScaled(), + // (F32)floater_rect.mRight / (F32)gViewerWindow->getWindowWidthScaled(), + // (F32)floater_rect.mBottom / (F32)gViewerWindow->getWindowHeightScaled()); // floater_3d_rect.translate(-0.5f, -0.5f); // glTranslatef(0.f, 0.f, -LLViewerCamera::getInstance()->getNear()); // glScalef(LLViewerCamera::getInstance()->getNear() * LLViewerCamera::getInstance()->getAspect() / sinf(LLViewerCamera::getInstance()->getView()), LLViewerCamera::getInstance()->getNear() / sinf(LLViewerCamera::getInstance()->getView()), 1.f); @@ -874,7 +874,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) /// and then display it again with compositor effects. /// Using render to texture would be faster/better, but I don't have a /// grasp of their full display stack just yet. - // gPostProcess->apply(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight()); + // gPostProcess->apply(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender) { @@ -1011,7 +1011,7 @@ void render_hud_attachments() BOOL setup_hud_matrices() { - LLRect whole_screen = gViewerWindow->getVirtualWindowRect(); + LLRect whole_screen = gViewerWindow->getWindowRectScaled(); // apply camera zoom transform (for high res screenshots) F32 zoom_factor = LLViewerCamera::getInstance()->getZoomFactor(); @@ -1019,13 +1019,13 @@ BOOL setup_hud_matrices() if (zoom_factor > 1.f) { S32 num_horizontal_tiles = llceil(zoom_factor); - S32 tile_width = llround((F32)gViewerWindow->getWindowWidth() / zoom_factor); - S32 tile_height = llround((F32)gViewerWindow->getWindowHeight() / zoom_factor); + S32 tile_width = llround((F32)gViewerWindow->getWindowWidthScaled() / zoom_factor); + S32 tile_height = llround((F32)gViewerWindow->getWindowHeightScaled() / 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->getWindowHeight() - (tile_y * tile_height), tile_width, tile_height); + whole_screen.setLeftTopAndSize(tile_x * tile_width, gViewerWindow->getWindowHeightScaled() - (tile_y * tile_height), tile_width, tile_height); } return setup_hud_matrices(whole_screen); @@ -1048,12 +1048,12 @@ BOOL setup_hud_matrices(const LLRect& screen_region) F32 aspect_ratio = LLViewerCamera::getInstance()->getAspect(); glh::matrix4f mat; - F32 scale_x = (F32)gViewerWindow->getWindowWidth() / (F32)screen_region.getWidth(); - F32 scale_y = (F32)gViewerWindow->getWindowHeight() / (F32)screen_region.getHeight(); + F32 scale_x = (F32)gViewerWindow->getWindowWidthScaled() / (F32)screen_region.getWidth(); + F32 scale_y = (F32)gViewerWindow->getWindowHeightScaled() / (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->getWindowWidth(), 0.5f * scale_x * aspect_ratio, -0.5f * scale_x * aspect_ratio), - clamp_rescale((F32)screen_region.getCenterY(), 0.f, (F32)gViewerWindow->getWindowHeight(), 0.5f * scale_y, -0.5f * scale_y), + 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), 0.f)); proj *= mat; @@ -1269,8 +1269,8 @@ void render_ui_2d() int pos_y = sub_region / llceil(zoom_factor); int pos_x = sub_region - (pos_y*llceil(zoom_factor)); // offset for this tile - LLFontGL::sCurOrigin.mX -= llround((F32)gViewerWindow->getWindowWidth() * (F32)pos_x / zoom_factor); - LLFontGL::sCurOrigin.mY -= llround((F32)gViewerWindow->getWindowHeight() * (F32)pos_y / zoom_factor); + LLFontGL::sCurOrigin.mX -= llround((F32)gViewerWindow->getWindowWidthScaled() * (F32)pos_x / zoom_factor); + LLFontGL::sCurOrigin.mY -= llround((F32)gViewerWindow->getWindowHeightScaled() * (F32)pos_y / zoom_factor); } stop_glerror(); @@ -1280,8 +1280,8 @@ void render_ui_2d() if (gAgent.getAvatarObject() && gAgent.mHUDCurZoom < 0.98f) { glPushMatrix(); - S32 half_width = (gViewerWindow->getWindowWidth() / 2); - S32 half_height = (gViewerWindow->getWindowHeight() / 2); + S32 half_width = (gViewerWindow->getWindowWidthScaled() / 2); + S32 half_height = (gViewerWindow->getWindowHeightScaled() / 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; @@ -1341,8 +1341,8 @@ void render_ui_2d() LLGLDisable cull(GL_CULL_FACE); LLGLDisable blend(GL_BLEND); - S32 width = gViewerWindow->getWindowWidth(); - S32 height = gViewerWindow->getWindowHeight(); + S32 width = gViewerWindow->getWindowWidthScaled(); + S32 height = gViewerWindow->getWindowHeightScaled(); gGL.getTexUnit(0)->bind(&gPipeline.mUIScreen); gGL.begin(LLRender::TRIANGLE_STRIP); gGL.color4f(1,1,1,1); @@ -1411,8 +1411,8 @@ void render_disconnected_background() } // Make sure the progress view always fills the entire window. - S32 width = gViewerWindow->getWindowWidth(); - S32 height = gViewerWindow->getWindowHeight(); + S32 width = gViewerWindow->getWindowWidthScaled(); + S32 height = gViewerWindow->getWindowHeightScaled(); if (gDisconnectedImagep) { diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp index 0e0727e382..056260791c 100644 --- a/indra/newview/llviewerhelp.cpp +++ b/indra/newview/llviewerhelp.cpp @@ -39,6 +39,7 @@ #include "llviewercontrol.h" #include "llversionviewer.h" #include "llappviewer.h" +#include "lllogininstance.h" #include "llviewerhelputil.h" #include "llviewerhelp.h" @@ -51,17 +52,25 @@ void LLViewerHelp::showTopic(const std::string &topic) { showHelp(); + // allow overriding the help server with a local help file if( gSavedSettings.getBOOL("HelpUseLocal") ) { LLFloaterHelpBrowser* helpbrowser = dynamic_cast<LLFloaterHelpBrowser*>(LLFloaterReg::getInstance("help_browser")); helpbrowser->navigateToLocalPage( "help-offline" , "index.html" ); + return; } - else + + // use a special login topic before the user logs in + std::string help_topic = topic; + if (! LLLoginInstance::getInstance()->authSuccess()) { - const LLOSInfo& osinfo = LLAppViewer::instance()->getOSInfo(); - std::string helpURL = LLViewerHelpUtil::buildHelpURL( topic, gSavedSettings, osinfo ); - setRawURL( helpURL ); + help_topic = preLoginTopic(); } + + // work out the URL for this topic and display it + const LLOSInfo& osinfo = LLAppViewer::instance()->getOSInfo(); + std::string helpURL = LLViewerHelpUtil::buildHelpURL( help_topic, gSavedSettings, osinfo ); + setRawURL( helpURL ); } std::string LLViewerHelp::defaultTopic() @@ -70,6 +79,12 @@ std::string LLViewerHelp::defaultTopic() return "this_is_fallbacktopic"; } +std::string LLViewerHelp::preLoginTopic() +{ + // *hack: to be done properly + return "pre_login_help"; +} + ////////////////////////////// // our own interfaces diff --git a/indra/newview/llviewerhelp.h b/indra/newview/llviewerhelp.h index 17aab6f239..dcb5ae32c9 100644 --- a/indra/newview/llviewerhelp.h +++ b/indra/newview/llviewerhelp.h @@ -57,6 +57,9 @@ class LLViewerHelp : public LLHelp, public LLSingleton<LLViewerHelp> // return topic derived from viewer UI focus, else default topic std::string getTopicFromFocus(); + // return topic to use before the user logs in + std::string preLoginTopic(); + private: static void showHelp(); // make sure help UI is visible & raised static void setRawURL(std::string url); // send URL to help UI diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 69650425cb..493457704b 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -295,11 +295,21 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s } } - if(media_impl && needs_navigate) + if(media_impl) { std::string url = media_entry->getCurrentURL(); - - media_impl->navigateTo(url, "", true, true); + if(needs_navigate) + { + media_impl->navigateTo(url, "", true, true); + } + else if(!media_impl->mMediaURL.empty() && (media_impl->mMediaURL != url)) + { + // If we already have a non-empty media URL set and we aren't doing a navigate, update the media URL to match the media entry. + media_impl->mMediaURL = url; + + // If this causes a navigate at some point (such as after a reload), it should be considered server-driven so it isn't broadcast. + media_impl->mNavigateServerRequest = true; + } } return media_impl; @@ -847,7 +857,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ { LLPluginClassMedia* media_source = new LLPluginClassMedia(owner); media_source->setSize(default_width, default_height); - if (media_source->init(launcher_name, plugin_name)) + if (media_source->init(launcher_name, plugin_name, gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins"))) { return media_source; } @@ -1133,11 +1143,15 @@ void LLViewerMediaImpl::mouseMove(S32 x, S32 y, MASK mask) void LLViewerMediaImpl::mouseDown(const LLVector2& texture_coords, MASK mask, S32 button) { if(mMediaSource) - { - mouseDown( - llround(texture_coords.mV[VX] * mMediaSource->getTextureWidth()), - llround((1.0f - texture_coords.mV[VY]) * mMediaSource->getTextureHeight()), - mask, button); + { + // scale x and y to texel units. + S32 x = llround(texture_coords.mV[VX] * mMediaSource->getTextureWidth()); + S32 y = llround((1.0f - texture_coords.mV[VY]) * mMediaSource->getTextureHeight()); + + // Adjust for the difference between the actual texture height and the amount of the texture in use. + y -= (mMediaSource->getTextureHeight() - mMediaSource->getHeight()); + + mouseDown(x, y, mask, button); } } @@ -1145,10 +1159,14 @@ void LLViewerMediaImpl::mouseUp(const LLVector2& texture_coords, MASK mask, S32 { if(mMediaSource) { - mouseUp( - llround(texture_coords.mV[VX] * mMediaSource->getTextureWidth()), - llround((1.0f - texture_coords.mV[VY]) * mMediaSource->getTextureHeight()), - mask, button); + // scale x and y to texel units. + S32 x = llround(texture_coords.mV[VX] * mMediaSource->getTextureWidth()); + S32 y = llround((1.0f - texture_coords.mV[VY]) * mMediaSource->getTextureHeight()); + + // Adjust for the difference between the actual texture height and the amount of the texture in use. + y -= (mMediaSource->getTextureHeight() - mMediaSource->getHeight()); + + mouseUp(x, y, mask, button); } } @@ -1156,10 +1174,14 @@ void LLViewerMediaImpl::mouseMove(const LLVector2& texture_coords, MASK mask) { if(mMediaSource) { - mouseMove( - llround(texture_coords.mV[VX] * mMediaSource->getTextureWidth()), - llround((1.0f - texture_coords.mV[VY]) * mMediaSource->getTextureHeight()), - mask); + // scale x and y to texel units. + S32 x = llround(texture_coords.mV[VX] * mMediaSource->getTextureWidth()); + S32 y = llround((1.0f - texture_coords.mV[VY]) * mMediaSource->getTextureHeight()); + + // Adjust for the difference between the actual texture height and the amount of the texture in use. + y -= (mMediaSource->getTextureHeight() - mMediaSource->getHeight()); + + mouseMove(x, y, mask); } } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index cb1be5fabc..976d89a5b7 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -415,7 +415,7 @@ public: static LLMenuParcelObserver* gMenuParcelObserver = NULL; -static LLUIListener sUIListener("UI"); +static LLUIListener sUIListener; LLMenuParcelObserver::LLMenuParcelObserver() { @@ -468,16 +468,6 @@ void set_underclothes_menu_options() void init_menus() { S32 top = gViewerWindow->getRootView()->getRect().getHeight(); - S32 width = gViewerWindow->getRootView()->getRect().getWidth(); - - // - // Main menu bar - // - gMenuHolder = new LLViewerMenuHolderGL(); - gMenuHolder->setRect(LLRect(0, top, width, 0)); - gMenuHolder->setFollowsAll(); - - LLMenuGL::sMenuContainer = gMenuHolder; // Initialize actions initialize_menus(); @@ -3807,7 +3797,7 @@ class LLViewDefaultUISize : public view_listener_t { gSavedSettings.setF32("UIScaleFactor", 1.0f); gSavedSettings.setBOOL("UIAutoScale", FALSE); - gViewerWindow->reshape(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight()); + gViewerWindow->reshape(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); return true; } }; @@ -7078,6 +7068,11 @@ void handle_test_load_url(void*) // // LLViewerMenuHolderGL // +static LLDefaultChildRegistry::Register<LLViewerMenuHolderGL> r("menu_holder"); + +LLViewerMenuHolderGL::LLViewerMenuHolderGL(const LLViewerMenuHolderGL::Params& p) +: LLMenuHolderGL(p) +{} BOOL LLViewerMenuHolderGL::hideMenus() { @@ -7087,8 +7082,11 @@ BOOL LLViewerMenuHolderGL::hideMenus() mParcelSelection = NULL; mObjectSelection = NULL; - gMenuBarView->clearHoverItem(); - gMenuBarView->resetMenuTrigger(); + if (gMenuBarView) + { + gMenuBarView->clearHoverItem(); + gMenuBarView->resetMenuTrigger(); + } return handled; } diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index db4eb3be9d..9a6fe03f9f 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -133,6 +133,11 @@ void handle_export_selected( void * ); class LLViewerMenuHolderGL : public LLMenuHolderGL { public: + struct Params : public LLInitParam::Block<Params, LLMenuHolderGL::Params> + {}; + + LLViewerMenuHolderGL(const Params& p); + virtual BOOL hideMenus(); void setParcelSelection(LLSafeHandle<LLParcelSelection> selection); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index d17c7e486f..753acab172 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -404,8 +404,8 @@ class LLFileTakeSnapshotToDisk : public view_listener_t { LLPointer<LLImageRaw> raw = new LLImageRaw; - S32 width = gViewerWindow->getWindowDisplayWidth(); - S32 height = gViewerWindow->getWindowDisplayHeight(); + S32 width = gViewerWindow->getWindowWidthRaw(); + S32 height = gViewerWindow->getWindowHeightRaw(); if (gSavedSettings.getBOOL("HighResSnapshot")) { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index bb61b4e16f..1a4c849f25 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4329,7 +4329,7 @@ void process_alert_core(const std::string& message, BOOL modal) std::string snap_filename = gDirUtilp->getLindenUserDir(); snap_filename += gDirUtilp->getDirDelimiter(); snap_filename += SCREEN_HOME_FILENAME; - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight(), FALSE, FALSE); + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); } const std::string ALERT_PREFIX("ALERT: "); diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index caa94dba38..939d5e3970 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -822,8 +822,8 @@ void send_stats() // Screen size so the UI team can figure out how big the widgets // appear and use a "typical" size for end user tests. - S32 window_width = gViewerWindow->getWindowDisplayWidth(); - S32 window_height = gViewerWindow->getWindowDisplayHeight(); + S32 window_width = gViewerWindow->getWindowWidthRaw(); + S32 window_height = gViewerWindow->getWindowHeightRaw(); S32 window_size = (window_width * window_height) / 1024; misc["string_1"] = llformat("%d", window_size); // misc["string_2"] = diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index fc09c946af..d69cc5999c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -315,7 +315,7 @@ public: mTextColor = LLColor4( 0.86f, 0.86f, 0.86f, 1.f ); // Draw stuff growing up from right lower corner of screen - U32 xpos = mWindow->getWindowWidth() - 350; + U32 xpos = mWindow->getWindowWidthScaled() - 350; U32 ypos = 64; const U32 y_inc = 20; @@ -600,8 +600,8 @@ void LLViewerWindow::updateDebugText() BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK mask, LLMouseHandler::EClickType clicktype, BOOL down) { - std::string buttonname; - std::string buttonstatestr; + const char* buttonname = ""; + const char* buttonstatestr = ""; BOOL handled = FALSE; S32 x = pos.mX; S32 y = pos.mY; @@ -1196,9 +1196,9 @@ LLViewerWindow::LLViewerWindow( mActive(TRUE), mWantFullscreen(fullscreen), mShowFullscreenProgress(FALSE), - mWindowRect(0, height, width, 0), - mVirtualWindowRect(0, height, width, 0), - mWorldViewRect(0, height, width, 0), + mWindowRectRaw(0, height, width, 0), + mWindowRectScaled(0, height, width, 0), + mWorldViewRectRaw(0, height, width, 0), mLeftMouseDown(FALSE), mMiddleMouseDown(FALSE), mRightMouseDown(FALSE), @@ -1212,7 +1212,7 @@ LLViewerWindow::LLViewerWindow( mStatesDirty(false), mIsFullscreenChecked(false), mCurrResolutionIndex(0), - mViewerWindowListener(new LLViewerWindowListener("LLViewerWindow", this)) + mViewerWindowListener(new LLViewerWindowListener(this)) { LLNotificationChannel::buildChannel("VW_alerts", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alert")); LLNotificationChannel::buildChannel("VW_alertmodal", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alertmodal")); @@ -1267,8 +1267,8 @@ LLViewerWindow::LLViewerWindow( { LLCoordWindow size; mWindow->getSize(&size); - mWindowRect.set(0, size.mY, size.mX, 0); - mVirtualWindowRect.set(0, llround((F32)size.mY / mDisplayScale.mV[VY]), llround((F32)size.mX / mDisplayScale.mV[VX]), 0); + mWindowRectRaw.set(0, size.mY, size.mX, 0); + mWindowRectScaled.set(0, llround((F32)size.mY / mDisplayScale.mV[VY]), llround((F32)size.mX / mDisplayScale.mV[VX]), 0); } LLFontManager::initClass(); @@ -1324,15 +1324,15 @@ LLViewerWindow::LLViewerWindow( // Create container for all sub-views LLView::Params rvp; rvp.name("root"); - rvp.rect(mVirtualWindowRect); + rvp.rect(mWindowRectScaled); rvp.mouse_opaque(false); rvp.follows.flags(FOLLOWS_NONE); mRootView = LLUICtrlFactory::create<LLRootView>(rvp); LLUI::setRootView(mRootView); // Make avatar head look forward at start - mCurrentMousePoint.mX = getWindowWidth() / 2; - mCurrentMousePoint.mY = getWindowHeight() / 2; + mCurrentMousePoint.mX = getWindowWidthScaled() / 2; + mCurrentMousePoint.mY = getWindowHeightScaled() / 2; gShowOverlayTitle = gSavedSettings.getBOOL("ShowOverlayTitle"); mOverlayTitle = gSavedSettings.getString("OverlayTitle"); @@ -1377,10 +1377,14 @@ void LLViewerWindow::initGLDefaults() gCylinder.prerender(); } +struct MainPanel : public LLPanel +{ +}; + void LLViewerWindow::initBase() { - S32 height = getWindowHeight(); - S32 width = getWindowWidth(); + S32 height = getWindowHeightScaled(); + S32 width = getWindowWidthScaled(); LLRect full_window(0, height, width, 0); @@ -1400,30 +1404,18 @@ void LLViewerWindow::initBase() // Create the floater view at the start so that other views can add children to it. // (But wait to add it as a child of the root view so that it will be in front of the // other views.) + MainPanel* main_view = new MainPanel(); + LLUICtrlFactory::instance().buildPanel(main_view, "main_view.xml"); + main_view->setShape(full_window); + getRootView()->addChild(main_view); + + // placeholder widget that controls where "world" is rendered + mWorldViewPlaceholder = main_view->getChildView("world_view_rect")->getHandle(); // Constrain floaters to inside the menu and status bar regions. - LLRect floater_view_rect = full_window; - // make space for menu bar - floater_view_rect.mTop -= MENU_BAR_HEIGHT; - - LLFloaterView::Params fvparams; - fvparams.name("Floater View"); - fvparams.rect(floater_view_rect); - fvparams.mouse_opaque(false); - fvparams.follows.flags(FOLLOWS_ALL); - fvparams.tab_stop(false); - gFloaterView = LLUICtrlFactory::create<LLFloaterView> (fvparams); - - LLSnapshotFloaterView::Params snapParams; - snapParams.name("Snapshot Floater View"); - snapParams.rect(full_window); - snapParams.enabled(false); - gSnapshotFloaterView = LLUICtrlFactory::create<LLSnapshotFloaterView> (snapParams); + gFloaterView = getRootView()->getChild<LLFloaterView>("Floater View"); + gSnapshotFloaterView = getRootView()->getChild<LLSnapshotFloaterView>("Snapshot Floater View"); - // Snapshot floater must start invisible otherwise it eats all - // the tooltips. JC - gSnapshotFloaterView->setVisible(FALSE); - // Console llassert( !gConsole ); LLConsole::Params cp; @@ -1447,43 +1439,21 @@ void LLViewerWindow::initBase() } #endif - // Debug view over the console - LLDebugView::Params debug_p; - debug_p.name("DebugView"); - debug_p.rect(full_window); - debug_p.follows.flags(FOLLOWS_ALL); - debug_p.visible(true); - gDebugView = LLUICtrlFactory::create<LLDebugView>(debug_p); - getRootView()->addChild(gDebugView); - - // Add floater view at the end so it will be on top, and give it tab priority over others - getRootView()->addChild(gFloaterView, -1); - getRootView()->addChild(gSnapshotFloaterView); - - // notify above floaters! - LLRect notify_rect = floater_view_rect; - LLNotifyBoxView::Params p; - p.name("notify_container"); - p.rect(notify_rect); - p.mouse_opaque(false); - p.follows.flags(FOLLOWS_ALL); - gNotifyBoxView = LLUICtrlFactory::create<LLNotifyBoxView> (p); - getRootView()->addChild(gNotifyBoxView, -2); - - // View for tooltips - LLToolTipView::Params hvp; - hvp.name("tooltip view"); - hvp.rect(full_window); - hvp.follows.flags(FOLLOWS_ALL); - gToolTipView = LLUICtrlFactory::create<LLToolTipView>(hvp); - gToolTipView->setFollowsAll(); - getRootView()->addChild(gToolTipView); + gDebugView = getRootView()->getChild<LLDebugView>("DebugView"); + gDebugView->init(); + gNotifyBoxView = getRootView()->getChild<LLNotifyBoxView>("notify_container"); + gToolTipView = getRootView()->getChild<LLToolTipView>("tooltip view"); // Add the progress bar view (startup view), which overrides everything mProgressView = new LLProgressView(full_window); getRootView()->addChild(mProgressView); setShowProgress(FALSE); setProgressCancelButtonVisible(FALSE); + + gMenuHolder = getRootView()->getChild<LLViewerMenuHolderGL>("Menu Holder"); + + LLMenuGL::sMenuContainer = gMenuHolder; + } void LLViewerWindow::initWorldUI() @@ -1492,20 +1462,19 @@ void LLViewerWindow::initWorldUI() S32 width = mRootView->getRect().getWidth(); LLRect full_window(0, height, width, 0); - gIMMgr = LLIMMgr::getInstance(); - // side tray - getRootView()->addChild(LLSideTray::getInstance()); + gIMMgr = LLIMMgr::getInstance(); getRootView()->sendChildToFront(gFloaterView); getRootView()->sendChildToFront(gSnapshotFloaterView); // new bottom panel - LLRect rc = LLBottomTray::getInstance()->getRect(); - rc.mLeft = 0; - rc.mRight = mRootView->getRect().getWidth(); - LLBottomTray::getInstance()->reshape(rc.getWidth(),rc.getHeight(),FALSE); - LLBottomTray::getInstance()->setRect(rc); + LLPanel* bottom_tray_container = getRootView()->getChild<LLPanel>("bottom_tray_container"); + LLBottomTray* bottom_tray = LLBottomTray::getInstance(); + bottom_tray->setShape(bottom_tray_container->getLocalRect()); + bottom_tray->setFollowsAll(); + bottom_tray_container->addChild(bottom_tray); + bottom_tray_container->setVisible(TRUE); // Pre initialize instance communicate instance; // currently needs to happen before initializing chat or IM @@ -1521,17 +1490,6 @@ void LLViewerWindow::initWorldUI() gMorphView = LLUICtrlFactory::create<LLMorphView>(mvp); getRootView()->addChild(gMorphView); - // Make space for nav bar. - LLNavigationBar* navbar = LLNavigationBar::getInstance(); - LLRect floater_view_rect = gFloaterView->getRect(); - LLRect notify_view_rect = gNotifyBoxView->getRect(); - floater_view_rect.mTop -= navbar->getDefNavBarHeight(); - floater_view_rect.mBottom += LLBottomTray::getInstance()->getRect().getHeight(); - notify_view_rect.mTop -= navbar->getDefNavBarHeight(); - notify_view_rect.mBottom += LLBottomTray::getInstance()->getRect().getHeight(); - gFloaterView->setRect(floater_view_rect); - gNotifyBoxView->setRect(notify_view_rect); - LLWorldMapView::initClass(); // Force gFloaterWorldMap to initialize @@ -1542,22 +1500,23 @@ void LLViewerWindow::initWorldUI() LLFloaterReg::hideInstance("build"); // Status bar - S32 menu_bar_height = gMenuBarView->getRect().getHeight(); - LLRect root_rect = getRootView()->getRect(); - LLRect status_rect(0, root_rect.getHeight(), root_rect.getWidth(), root_rect.getHeight() - menu_bar_height); - gStatusBar = new LLStatusBar(status_rect); - gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_TOP); - - gStatusBar->reshape(root_rect.getWidth(), gStatusBar->getRect().getHeight(), TRUE); - gStatusBar->translate(0, root_rect.getHeight() - gStatusBar->getRect().getHeight()); + LLPanel* status_bar_container = getRootView()->getChild<LLPanel>("status_bar_container"); + gStatusBar = new LLStatusBar(status_bar_container->getLocalRect()); + gStatusBar->setFollowsAll(); + gStatusBar->setShape(status_bar_container->getLocalRect()); // sync bg color with menu bar gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor().get() ); + status_bar_container->addChild(gStatusBar); + status_bar_container->setVisible(TRUE); // Navigation bar - navbar->reshape(root_rect.getWidth(), navbar->getRect().getHeight(), TRUE); // *TODO: redundant? - navbar->translate(0, root_rect.getHeight() - menu_bar_height - navbar->getRect().getHeight()); // FIXME - navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get()); + LLPanel* nav_bar_container = getRootView()->getChild<LLPanel>("nav_bar_container"); + LLNavigationBar* navbar = LLNavigationBar::getInstance(); + navbar->setShape(nav_bar_container->getLocalRect()); + navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get()); + nav_bar_container->addChild(navbar); + nav_bar_container->setVisible(TRUE); if (!gSavedSettings.getBOOL("ShowNavbarNavigationPanel")) { @@ -1589,19 +1548,6 @@ void LLViewerWindow::initWorldUI() LLBottomTray::getInstance()->showGestureButton(FALSE); } - getRootView()->addChild(gStatusBar); - getRootView()->addChild(navbar); - - - //sidetray - //then notify area - //then menu - //getRootView()->sendChildToFront(LLSideTray::getInstance()); - - getRootView()->sendChildToFront(gNotifyBoxView); - // menu holder appears on top to get first pass at all mouse events - getRootView()->sendChildToFront(gMenuHolder); - if ( gHUDView == NULL ) { LLRect hud_rect = full_window; @@ -1615,11 +1561,27 @@ void LLViewerWindow::initWorldUI() getRootView()->addChildInBack(gHUDView); } - // this allows not to see UI elements created while UI initializing after Alt+Tab was pressed during login. EXT-744. - moveProgressViewToFront(); - - // tooltips are always on top - getRootView()->sendChildToFront(gToolTipView); + LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("stand_stop_flying_container"); + LLPanelStandStopFlying* panel_stand_stop_flying = LLPanelStandStopFlying::getInstance(); + panel_stand_stop_flying->setShape(panel_ssf_container->getLocalRect()); + panel_stand_stop_flying->setFollowsAll(); + panel_ssf_container->addChild(panel_stand_stop_flying); + panel_ssf_container->setVisible(TRUE); + + // put sidetray in container + LLPanel* side_tray_container = getRootView()->getChild<LLPanel>("side_tray_container"); + LLSideTray* sidetrayp = LLSideTray::getInstance(); + sidetrayp->setShape(side_tray_container->getLocalRect()); + sidetrayp->setFollowsAll(); + side_tray_container->addChild(sidetrayp); + side_tray_container->setVisible(FALSE); + + // put sidetray buttons in their own panel + LLPanel* buttons_panel = sidetrayp->getButtonsPanel(); + LLPanel* buttons_panel_container = getRootView()->getChild<LLPanel>("side_bar_tabs"); + buttons_panel->setShape(buttons_panel_container->getLocalRect()); + buttons_panel->setFollowsAll(); + buttons_panel_container->addChild(buttons_panel); } // Destroy the UI @@ -1747,8 +1709,8 @@ void LLViewerWindow::sendShapeToSim() msg->addU32Fast(_PREHASH_CircuitCode, gMessageSystem->mOurCircuitCode); msg->nextBlockFast(_PREHASH_HeightWidthBlock); msg->addU32Fast(_PREHASH_GenCounter, 0); - U16 height16 = (U16) mWorldViewRect.getHeight(); - U16 width16 = (U16) mWorldViewRect.getWidth(); + U16 height16 = (U16) mWorldViewRectRaw.getHeight(); + U16 width16 = (U16) mWorldViewRectRaw.getWidth(); msg->addU16Fast(_PREHASH_Height, height16); msg->addU16Fast(_PREHASH_Width, width16); gAgent.sendReliableMessage(); @@ -1770,14 +1732,14 @@ void LLViewerWindow::reshape(S32 width, S32 height) } // update our window rectangle - mWindowRect.mRight = mWindowRect.mLeft + width; - mWindowRect.mTop = mWindowRect.mBottom + height; + mWindowRectRaw.mRight = mWindowRectRaw.mLeft + width; + mWindowRectRaw.mTop = mWindowRectRaw.mBottom + height; //glViewport(0, 0, width, height ); if (height > 0) { - LLViewerCamera::getInstance()->setViewHeightInPixels( mWorldViewRect.getHeight() ); + LLViewerCamera::getInstance()->setViewHeightInPixels( mWorldViewRectRaw.getHeight() ); LLViewerCamera::getInstance()->setAspect( getWorldViewAspectRatio() ); } @@ -1787,8 +1749,8 @@ void LLViewerWindow::reshape(S32 width, S32 height) LLUI::setScaleFactor(mDisplayScale); // update our window rectangle - mVirtualWindowRect.mRight = mVirtualWindowRect.mLeft + llround((F32)width / mDisplayScale.mV[VX]); - mVirtualWindowRect.mTop = mVirtualWindowRect.mBottom + llround((F32)height / mDisplayScale.mV[VY]); + mWindowRectScaled.mRight = mWindowRectScaled.mLeft + llround((F32)width / mDisplayScale.mV[VX]); + mWindowRectScaled.mTop = mWindowRectScaled.mBottom + llround((F32)height / mDisplayScale.mV[VY]); setup2DViewport(); @@ -1930,7 +1892,7 @@ void LLViewerWindow::draw() if (!gSavedSettings.getBOOL("RenderUIBuffer")) { - LLUI::sDirtyRect = this->getWindowRect(); + LLUI::sDirtyRect = this->getWindowRectRaw(); } // HACK for timecode debugging @@ -1944,8 +1906,8 @@ void LLViewerWindow::draw() microsecondsToTimecodeString(gFrameTime,text); const LLFontGL* font = LLFontGL::getFontSansSerif(); font->renderUTF8(text, 0, - llround((getWindowWidth()/2)-100.f), - llround((getWindowHeight()-60.f)), + llround((getWindowWidthScaled()/2)-100.f), + llround((getWindowHeightScaled()-60.f)), LLColor4( 1.f, 1.f, 1.f, 1.f ), LLFontGL::LEFT, LLFontGL::TOP); } @@ -1968,8 +1930,8 @@ void LLViewerWindow::draw() int pos_y = sub_region / llceil(zoom_factor); int pos_x = sub_region - (pos_y*llceil(zoom_factor)); // offset for this tile - glTranslatef((F32)getWindowWidth() * -(F32)pos_x, - (F32)getWindowHeight() * -(F32)pos_y, + glTranslatef((F32)getWindowWidthScaled() * -(F32)pos_x, + (F32)getWindowHeightScaled() * -(F32)pos_y, 0.f); glScalef(zoom_factor, zoom_factor, 1.f); LLUI::sGLScaleFactor *= zoom_factor; @@ -2014,8 +1976,8 @@ void LLViewerWindow::draw() const S32 DIST_FROM_TOP = 20; LLFontGL::getFontSansSerifBig()->renderUTF8( mOverlayTitle, 0, - llround( getWindowWidth() * 0.5f), - getWindowHeight() - DIST_FROM_TOP, + llround( getWindowWidthScaled() * 0.5f), + getWindowHeightScaled() - DIST_FROM_TOP, LLColor4(1, 1, 1, 0.4f), LLFontGL::HCENTER, LLFontGL::TOP); } @@ -2315,7 +2277,7 @@ void LLViewerWindow::handleScrollWheel(S32 clicks) // Zoom the camera in and out behavior - if(top_ctrl == 0 && mWorldViewRect.pointInRect(mCurrentMousePoint.mX, mCurrentMousePoint.mY) ) + if(top_ctrl == 0 && mWorldViewRectRaw.pointInRect(mCurrentMousePoint.mX, mCurrentMousePoint.mY) ) gAgent.handleScrollWheel(clicks); return; @@ -2323,8 +2285,8 @@ void LLViewerWindow::handleScrollWheel(S32 clicks) void LLViewerWindow::moveCursorToCenter() { - S32 x = mWorldViewRect.getWidth() / 2; - S32 y = mWorldViewRect.getHeight() / 2; + S32 x = mWorldViewRectRaw.getWidth() / 2; + S32 y = mWorldViewRectRaw.getHeight() / 2; //on a forced move, all deltas get zeroed out to prevent jumping mCurrentMousePoint.set(x,y); @@ -2334,29 +2296,6 @@ void LLViewerWindow::moveCursorToCenter() LLUI::setMousePositionScreen(x, y); } -void LLViewerWindow::updateBottomTrayRect() -{ - if(LLBottomTray::instanceExists() && LLSideTray::instanceCreated()) - { - S32 side_tray_width = 0; - if(LLSideTray::getInstance()->getVisible()) - { - side_tray_width = LLSideTray::getInstance()->getTrayWidth(); - } - - LLBottomTray* bottom_tray = LLBottomTray::getInstance(); - S32 right = llround((F32)mWindowRect.mRight / mDisplayScale.mV[VX]) - side_tray_width; - - LLRect rc = bottom_tray->getRect(); - if (right != rc.mRight) - { - rc.mRight = right; - bottom_tray->reshape(rc.getWidth(), rc.getHeight(), FALSE); - bottom_tray->setRect(rc); - mOnBottomTrayWidthChanged(); - } - } -} ////////////////////////////////////////////////////////////////////// // @@ -2398,9 +2337,10 @@ void LLViewerWindow::updateUI() { static std::string last_handle_msg; - updateWorldViewRect(); + // animate layout stacks so we have up to date rect for world view + LLLayoutStack::updateClass(); - updateBottomTrayRect(); + updateWorldViewRect(); LLView::sMouseHandlerMessage.clear(); @@ -2784,8 +2724,8 @@ void LLViewerWindow::updateMouseDelta() mWindow->getCursorPosition(&mouse_pos); if (mouse_pos.mX < 0 || mouse_pos.mY < 0 || - mouse_pos.mX > mWindowRect.getWidth() || - mouse_pos.mY > mWindowRect.getHeight()) + mouse_pos.mX > mWindowRectRaw.getWidth() || + mouse_pos.mY > mWindowRectRaw.getHeight()) { mMouseInWindow = FALSE; } @@ -2900,42 +2840,30 @@ void LLViewerWindow::updateKeyboardFocus() LLSideTray::getInstance()->highlightFocused(); } +static LLFastTimer::DeclareTimer FTM_UPDATE_WORLD_VIEW("Update World View"); void LLViewerWindow::updateWorldViewRect(bool use_full_window) { - if (!LLSideTray::instanceCreated()) return; + LLFastTimer ft(FTM_UPDATE_WORLD_VIEW); // start off using whole window to render world - LLRect new_world_rect = mWindowRect; + LLRect new_world_rect = mWindowRectRaw; - if (use_full_window == false) + if (use_full_window == false && mWorldViewPlaceholder.get()) { - // pull in right side of world view based on sidetray - LLSideTray* sidetray = LLSideTray::getInstance(); - if (sidetray->getVisible()) - { - new_world_rect.mRight -= llround((F32)sidetray->getTrayWidth() * mDisplayScale.mV[VX]); - } - - // push top of world view below nav bar - if (LLNavigationBar::getInstance()->getVisible()) - { - LLNavigationBar* barp = LLNavigationBar::getInstance(); - LLRect nav_bar_rect; - if(barp->localRectToOtherView(barp->getLocalRect(), &nav_bar_rect, mRootView)) - { - new_world_rect.mTop = llround((F32)LLNavigationBar::getInstance()->getRect().mBottom * mDisplayScale.mV[VY]); - } - } + new_world_rect = mWorldViewPlaceholder.get()->calcScreenRect(); + // clamp to at least a 1x1 rect so we don't try to allocate zero width gl buffers + new_world_rect.mTop = llmax(new_world_rect.mTop, new_world_rect.mBottom + 1); + new_world_rect.mRight = llmax(new_world_rect.mRight, new_world_rect.mLeft + 1); } - if (mWorldViewRect != new_world_rect) + if (mWorldViewRectRaw != new_world_rect) { // sending a signal with a new WorldView rect - mOnWorldViewRectUpdated(mWorldViewRect, new_world_rect); + mOnWorldViewRectUpdated(mWorldViewRectRaw, new_world_rect); - mWorldViewRect = new_world_rect; + mWorldViewRectRaw = new_world_rect; gResizeScreenTexture = TRUE; - LLViewerCamera::getInstance()->setViewHeightInPixels( mWorldViewRect.getHeight() ); + LLViewerCamera::getInstance()->setViewHeightInPixels( mWorldViewRectRaw.getHeight() ); LLViewerCamera::getInstance()->setAspect( getWorldViewAspectRatio() ); } } @@ -2948,9 +2876,9 @@ void LLViewerWindow::saveLastMouse(const LLCoordGL &point) { mCurrentMousePoint.mX = 0; } - else if (point.mX > getWindowWidth()) + else if (point.mX > getWindowWidthScaled()) { - mCurrentMousePoint.mX = getWindowWidth(); + mCurrentMousePoint.mX = getWindowWidthScaled(); } else { @@ -2961,9 +2889,9 @@ void LLViewerWindow::saveLastMouse(const LLCoordGL &point) { mCurrentMousePoint.mY = 0; } - else if (point.mY > getWindowHeight() ) + else if (point.mY > getWindowHeightScaled() ) { - mCurrentMousePoint.mY = getWindowHeight(); + mCurrentMousePoint.mY = getWindowHeightScaled(); } else { @@ -3208,10 +3136,10 @@ void LLViewerWindow::pickAsync(S32 x, S32 y_from_bot, MASK mask, void (*callback { mPickScreenRegion.setCenterAndSize(x, y_from_bot, PICK_DIAMETER, PICK_DIAMETER); - if (mPickScreenRegion.mLeft < mWorldViewRect.mLeft) mPickScreenRegion.translate(mWorldViewRect.mLeft - mPickScreenRegion.mLeft, 0); - if (mPickScreenRegion.mBottom < mWorldViewRect.mBottom) mPickScreenRegion.translate(0, mWorldViewRect.mBottom - mPickScreenRegion.mBottom); - if (mPickScreenRegion.mRight > mWorldViewRect.mRight ) mPickScreenRegion.translate(mWorldViewRect.mRight - mPickScreenRegion.mRight, 0); - if (mPickScreenRegion.mTop > mWorldViewRect.mTop ) mPickScreenRegion.translate(0, mWorldViewRect.mTop - mPickScreenRegion.mTop); + if (mPickScreenRegion.mLeft < mWorldViewRectRaw.mLeft) mPickScreenRegion.translate(mWorldViewRectRaw.mLeft - mPickScreenRegion.mLeft, 0); + if (mPickScreenRegion.mBottom < mWorldViewRectRaw.mBottom) mPickScreenRegion.translate(0, mWorldViewRectRaw.mBottom - mPickScreenRegion.mBottom); + if (mPickScreenRegion.mRight > mWorldViewRectRaw.mRight ) mPickScreenRegion.translate(mWorldViewRectRaw.mRight - mPickScreenRegion.mRight, 0); + if (mPickScreenRegion.mTop > mWorldViewRectRaw.mTop ) mPickScreenRegion.translate(0, mWorldViewRectRaw.mTop - mPickScreenRegion.mTop); } // set frame buffer region for picking results @@ -3417,11 +3345,11 @@ LLVector3 LLViewerWindow::mouseDirectionGlobal(const S32 x, const S32 y) const F32 fov = LLViewerCamera::getInstance()->getView(); // find world view center in scaled ui coordinates - F32 center_x = (F32)getWorldViewRect().getCenterX() / mDisplayScale.mV[VX]; - F32 center_y = (F32)getWorldViewRect().getCenterY() / mDisplayScale.mV[VY]; + F32 center_x = (F32)getWorldViewRectRaw().getCenterX() / mDisplayScale.mV[VX]; + F32 center_y = (F32)getWorldViewRectRaw().getCenterY() / mDisplayScale.mV[VY]; // calculate pixel distance to screen - F32 distance = ((F32)getWorldViewHeight() / (mDisplayScale.mV[VY] * 2.f)) / (tan(fov / 2.f)); + F32 distance = ((F32)getWorldViewHeightRaw() / (mDisplayScale.mV[VY] * 2.f)) / (tan(fov / 2.f)); // calculate click point relative to middle of screen F32 click_x = x - center_x; @@ -3440,11 +3368,11 @@ LLVector3 LLViewerWindow::mouseDirectionGlobal(const S32 x, const S32 y) const LLVector3 LLViewerWindow::mousePointHUD(const S32 x, const S32 y) const { // find screen resolution - S32 height = llround((F32)getWorldViewHeight() / mDisplayScale.mV[VY]); + S32 height = llround((F32)getWorldViewHeightRaw() / mDisplayScale.mV[VY]); // find world view center - F32 center_x = (F32)getWorldViewRect().getCenterX() / mDisplayScale.mV[VX]; - F32 center_y = (F32)getWorldViewRect().getCenterY() / mDisplayScale.mV[VY]; + F32 center_x = (F32)getWorldViewRectRaw().getCenterX() / mDisplayScale.mV[VX]; + F32 center_y = (F32)getWorldViewRectRaw().getCenterY() / mDisplayScale.mV[VY]; // remap with uniform scale (1/height) so that top is -0.5, bottom is +0.5 F32 hud_x = -((F32)x - center_x) / height; @@ -3462,12 +3390,12 @@ LLVector3 LLViewerWindow::mouseDirectionCamera(const S32 x, const S32 y) const F32 fov_width = fov_height * LLViewerCamera::getInstance()->getAspect(); // find screen resolution - S32 height = llround((F32)getWorldViewHeight() / mDisplayScale.mV[VY]); - S32 width = llround((F32)getWorldViewWidth() / mDisplayScale.mV[VX]); + S32 height = llround((F32)getWorldViewHeightRaw() / mDisplayScale.mV[VY]); + S32 width = llround((F32)getWorldViewWidthRaw() / mDisplayScale.mV[VX]); // find world view center - F32 center_x = (F32)getWorldViewRect().getCenterX() / mDisplayScale.mV[VX]; - F32 center_y = (F32)getWorldViewRect().getCenterY() / mDisplayScale.mV[VY]; + F32 center_x = (F32)getWorldViewRectRaw().getCenterX() / mDisplayScale.mV[VX]; + F32 center_y = (F32)getWorldViewRectRaw().getCenterY() / mDisplayScale.mV[VY]; // calculate click point relative to middle of screen F32 click_x = (((F32)x - center_x) / (F32)width) * fov_width * -1.f; @@ -3707,8 +3635,8 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height) ||(size.mY != new_height + BORDERHEIGHT)) { // use actual display dimensions, not virtual UI dimensions - S32 x = gViewerWindow->getWindowDisplayWidth(); - S32 y = gViewerWindow->getWindowDisplayHeight(); + S32 x = gViewerWindow->getWindowWidthRaw(); + S32 y = gViewerWindow->getWindowHeightRaw(); BORDERWIDTH = size.mX - x; BORDERHEIGHT = size.mY- y; LLCoordScreen new_size(new_width + BORDERWIDTH, @@ -3806,9 +3734,9 @@ BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 p S32 w = preview_width ; S32 h = preview_height ; LLVector2 display_scale = mDisplayScale ; - mDisplayScale.setVec((F32)w / mWindowRect.getWidth(), (F32)h / mWindowRect.getHeight()) ; - LLRect window_rect = mWindowRect; - mWindowRect.set(0, h, w, 0); + mDisplayScale.setVec((F32)w / mWindowRectRaw.getWidth(), (F32)h / mWindowRectRaw.getHeight()) ; + LLRect window_rect = mWindowRectRaw; + mWindowRectRaw.set(0, h, w, 0); gDisplaySwapBuffers = FALSE; gDepthDirty = TRUE; @@ -3820,7 +3748,7 @@ BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 p LLHUDText::setDisplayText(FALSE) ; if (type == SNAPSHOT_TYPE_OBJECT_ID) { - gObjectList.renderPickList(gViewerWindow->getVirtualWindowRect(), FALSE, FALSE); + gObjectList.renderPickList(gViewerWindow->getWindowRectScaled(), FALSE, FALSE); } else { @@ -3873,7 +3801,7 @@ BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 p LLFontGL::setFontDisplay(TRUE) ; LLHUDText::setDisplayText(TRUE) ; mDisplayScale.setVec(display_scale) ; - mWindowRect = window_rect; + mWindowRectRaw = window_rect; setup3DRender(); gDisplaySwapBuffers = FALSE; gDepthDirty = TRUE; @@ -3941,12 +3869,12 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei // Copy screen to a buffer // crop sides or top and bottom, if taking a snapshot of different aspect ratio // from window - S32 snapshot_width = mWindowRect.getWidth(); - S32 snapshot_height = mWindowRect.getHeight(); + S32 snapshot_width = mWindowRectRaw.getWidth(); + S32 snapshot_height = mWindowRectRaw.getHeight(); // SNAPSHOT - S32 window_width = mWindowRect.getWidth(); - S32 window_height = mWindowRect.getHeight(); - LLRect window_rect = mWindowRect; + S32 window_width = mWindowRectRaw.getWidth(); + S32 window_height = mWindowRectRaw.getHeight(); + LLRect window_rect = mWindowRectRaw; BOOL use_fbo = FALSE; LLRenderTarget target; @@ -3977,7 +3905,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei window_width = snapshot_width; window_height = snapshot_height; scale_factor = 1.f; - mWindowRect.set(0, snapshot_height, snapshot_width, 0); + mWindowRectRaw.set(0, snapshot_height, snapshot_width, 0); target.bindTarget(); } } @@ -4045,7 +3973,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei LLViewerCamera::getInstance()->setZoomParameters(scale_factor, subimage_x+(subimage_y*llceil(scale_factor))); setup3DRender(); - gObjectList.renderPickList(gViewerWindow->getVirtualWindowRect(), FALSE, FALSE); + gObjectList.renderPickList(gViewerWindow->getWindowRectScaled(), FALSE, FALSE); } else { @@ -4124,7 +4052,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei if (use_fbo) { - mWindowRect = window_rect; + mWindowRectRaw = window_rect; target.flush(); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); } @@ -4205,23 +4133,13 @@ void LLViewerWindow::drawMouselookInstructions() font->renderUTF8( instructions, 0, - getVirtualWorldViewRect().getCenterX(), - getVirtualWorldViewRect().mBottom + INSTRUCTIONS_PAD, + getWorldViewRectScaled().getCenterX(), + getWorldViewRectScaled().mBottom + INSTRUCTIONS_PAD, LLColor4( 1.0f, 1.0f, 1.0f, 0.5f ), LLFontGL::HCENTER, LLFontGL::TOP, LLFontGL::NORMAL,LLFontGL::DROP_SHADOW); } -S32 LLViewerWindow::getWindowHeight() const -{ - return mVirtualWindowRect.getHeight(); -} - -S32 LLViewerWindow::getWindowWidth() const -{ - return mVirtualWindowRect.getWidth(); -} - void* LLViewerWindow::getPlatformWindow() const { return mWindow->getPlatformWindow(); @@ -4242,9 +4160,9 @@ LLRootView* LLViewerWindow::getRootView() const return mRootView; } -LLRect LLViewerWindow::getVirtualWorldViewRect() const +LLRect LLViewerWindow::getWorldViewRectScaled() const { - LLRect world_view_rect = mWorldViewRect; + LLRect world_view_rect = mWorldViewRectRaw; world_view_rect.mLeft = llround((F32)world_view_rect.mLeft / mDisplayScale.mV[VX]); world_view_rect.mRight = llround((F32)world_view_rect.mRight / mDisplayScale.mV[VX]); world_view_rect.mBottom = llround((F32)world_view_rect.mBottom / mDisplayScale.mV[VY]); @@ -4252,39 +4170,49 @@ LLRect LLViewerWindow::getVirtualWorldViewRect() const return world_view_rect; } -S32 LLViewerWindow::getWorldViewHeight() const +S32 LLViewerWindow::getWorldViewHeightRaw() const { - return mWorldViewRect.getHeight(); + return mWorldViewRectRaw.getHeight(); } -S32 LLViewerWindow::getWorldViewWidth() const +S32 LLViewerWindow::getWorldViewWidthRaw() const { - return mWorldViewRect.getWidth(); + return mWorldViewRectRaw.getWidth(); +} + +S32 LLViewerWindow::getWindowHeightScaled() const +{ + return mWindowRectScaled.getHeight(); +} + +S32 LLViewerWindow::getWindowWidthScaled() const +{ + return mWindowRectScaled.getWidth(); } -S32 LLViewerWindow::getWindowDisplayHeight() const +S32 LLViewerWindow::getWindowHeightRaw() const { - return mWindowRect.getHeight(); + return mWindowRectRaw.getHeight(); } -S32 LLViewerWindow::getWindowDisplayWidth() const +S32 LLViewerWindow::getWindowWidthRaw() const { - return mWindowRect.getWidth(); + return mWindowRectRaw.getWidth(); } void LLViewerWindow::setup2DRender() { // setup ortho camera - gl_state_for_2d(mWindowRect.getWidth(), mWindowRect.getHeight()); + gl_state_for_2d(mWindowRectRaw.getWidth(), mWindowRectRaw.getHeight()); setup2DViewport(); } void LLViewerWindow::setup2DViewport(S32 x_offset, S32 y_offset) { - gGLViewport[0] = mWindowRect.mLeft + x_offset; - gGLViewport[1] = mWindowRect.mBottom + y_offset; - gGLViewport[2] = mWindowRect.getWidth(); - gGLViewport[3] = mWindowRect.getHeight(); + gGLViewport[0] = mWindowRectRaw.mLeft + x_offset; + gGLViewport[1] = mWindowRectRaw.mBottom + y_offset; + gGLViewport[2] = mWindowRectRaw.getWidth(); + gGLViewport[3] = mWindowRectRaw.getHeight(); glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); } @@ -4292,7 +4220,7 @@ void LLViewerWindow::setup2DViewport(S32 x_offset, S32 y_offset) void LLViewerWindow::setup3DRender() { // setup perspective camera - LLViewerCamera::getInstance()->setPerspective(NOT_FOR_SELECTION, mWorldViewRect.mLeft, mWorldViewRect.mBottom, mWorldViewRect.getWidth(), mWorldViewRect.getHeight(), FALSE, LLViewerCamera::getInstance()->getNear(), MAX_FAR_CLIP*2.f); + LLViewerCamera::getInstance()->setPerspective(NOT_FOR_SELECTION, mWorldViewRectRaw.mLeft, mWorldViewRectRaw.mBottom, mWorldViewRectRaw.getWidth(), mWorldViewRectRaw.getHeight(), FALSE, LLViewerCamera::getInstance()->getNear(), MAX_FAR_CLIP*2.f); setup3DViewport(); } @@ -4300,17 +4228,17 @@ void LLViewerWindow::setup3DViewport(S32 x_offset, S32 y_offset) { if (LLRenderTarget::getCurrentBoundTarget() != NULL) { - // don't use translation component of mWorldViewRect, as we are already in a properly sized render target + // don't use translation component of mWorldViewRectRaw, as we are already in a properly sized render target gGLViewport[0] = x_offset; gGLViewport[1] = y_offset; } else { - gGLViewport[0] = mWorldViewRect.mLeft + x_offset; - gGLViewport[1] = mWorldViewRect.mBottom + y_offset; + gGLViewport[0] = mWorldViewRectRaw.mLeft + x_offset; + gGLViewport[1] = mWorldViewRectRaw.mBottom + y_offset; } - gGLViewport[2] = mWorldViewRect.getWidth(); - gGLViewport[3] = mWorldViewRect.getHeight(); + gGLViewport[2] = mWorldViewRectRaw.getWidth(); + gGLViewport[3] = mWorldViewRectRaw.getHeight(); glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); } @@ -4521,8 +4449,8 @@ void LLViewerWindow::getTargetWindow(BOOL& fullscreen, S32& width, S32& height) if (mWindow && mWindow->getFullscreen() == mWantFullscreen) { - width = getWindowDisplayWidth(); - height = getWindowDisplayHeight(); + width = getWindowWidthRaw(); + height = getWindowHeightRaw(); } else if (mWantFullscreen) { @@ -4569,7 +4497,7 @@ BOOL LLViewerWindow::checkSettings() getWindow()->setNativeAspectRatio(gSavedSettings.getF32("FullScreenAspectRatio")); } - reshape(getWindowDisplayWidth(), getWindowDisplayHeight()); + reshape(getWindowWidthRaw(), getWindowHeightRaw()); // force aspect ratio if (mIsFullscreenChecked) @@ -4795,8 +4723,8 @@ F32 LLViewerWindow::getDisplayAspectRatio() const F32 LLViewerWindow::getWorldViewAspectRatio() const { - F32 world_aspect = (F32)mWorldViewRect.getWidth() / (F32)mWorldViewRect.getHeight(); - //F32 window_aspect = (F32)mWindowRect.getWidth() / (F32)mWindowRect.getHeight(); + F32 world_aspect = (F32)mWorldViewRectRaw.getWidth() / (F32)mWorldViewRectRaw.getHeight(); + //F32 window_aspect = (F32)mWindowRectRaw.getWidth() / (F32)mWindowRectRaw.getHeight(); if (mWindow->getFullscreen()) { return world_aspect * mWindow->getPixelAspectRatio(); @@ -4813,7 +4741,7 @@ void LLViewerWindow::calcDisplayScale() F32 ui_scale_factor = gSavedSettings.getF32("UIScaleFactor"); LLVector2 display_scale; display_scale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f)); - F32 height_normalization = gSavedSettings.getBOOL("UIAutoScale") ? ((F32)mWindowRect.getHeight() / display_scale.mV[VY]) / 768.f : 1.f; + F32 height_normalization = gSavedSettings.getBOOL("UIAutoScale") ? ((F32)mWindowRectRaw.getHeight() / display_scale.mV[VY]) / 768.f : 1.f; if(mWindow->getFullscreen()) { display_scale *= (ui_scale_factor * height_normalization); @@ -4831,8 +4759,8 @@ void LLViewerWindow::calcDisplayScale() if (mWindow->getFullscreen()) { - display_scale.mV[0] = llround(display_scale.mV[0], 2.0f/(F32) mWindowRect.getWidth()); - display_scale.mV[1] = llround(display_scale.mV[1], 2.0f/(F32) mWindowRect.getHeight()); + display_scale.mV[0] = llround(display_scale.mV[0], 2.0f/(F32) mWindowRectRaw.getWidth()); + display_scale.mV[1] = llround(display_scale.mV[1], 2.0f/(F32) mWindowRectRaw.getHeight()); } if (display_scale != mDisplayScale) @@ -4857,7 +4785,7 @@ S32 LLViewerWindow::getChatConsoleBottomPad() LLRect LLViewerWindow::getChatConsoleRect() { - LLRect full_window(0, getWindowHeight(), getWindowWidth(), 0); + LLRect full_window(0, getWindowHeightScaled(), getWindowWidthScaled(), 0); LLRect console_rect = full_window; const S32 CONSOLE_PADDING_TOP = 24; @@ -4879,7 +4807,7 @@ LLRect LLViewerWindow::getChatConsoleRect() { // Make console rect somewhat narrow so having inventory open is // less of a problem. - console_rect.mRight = console_rect.mLeft + 2 * getWindowWidth() / 3; + console_rect.mRight = console_rect.mLeft + 2 * getWindowWidthScaled() / 3; } return console_rect; diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index c2906b1718..ce71ef6173 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -210,21 +210,23 @@ public: // LLRootView* getRootView() const; + // 3D world area in scaled pixels (via UI scale), use for most UI computations + LLRect getWorldViewRectScaled() const; + + // 3D world area, in raw unscaled pixels + LLRect getWorldViewRectRaw() const { return mWorldViewRectRaw; } + S32 getWorldViewHeightRaw() const; + S32 getWorldViewWidthRaw() const; + + // Window in scaled pixels (via UI scale), use for most UI computations + LLRect getWindowRectScaled() const { return mWindowRectScaled; } + S32 getWindowHeightScaled() const; + S32 getWindowWidthScaled() const; + // Window in raw pixels as seen on screen. - const LLRect& getWindowRect() const { return mWindowRect; }; - // portion of window that shows 3d world - const LLRect& getWorldViewRect() const { return mWorldViewRect; }; - LLRect getVirtualWorldViewRect() const; - S32 getWorldViewHeight() const; - S32 getWorldViewWidth() const; - S32 getWindowDisplayHeight() const; - S32 getWindowDisplayWidth() const; - - // Window in scaled pixels (via UI scale), use this for - // UI elements checking size. - const LLRect& getVirtualWindowRect() const { return mVirtualWindowRect; }; - S32 getWindowHeight() const; - S32 getWindowWidth() const; + LLRect getWindowRectRaw() const { return mWindowRectRaw; } + S32 getWindowHeightRaw() const; + S32 getWindowWidthRaw() const; LLWindow* getWindow() const { return mWindow; } void* getPlatformWindow() const; @@ -294,7 +296,6 @@ public: void updateKeyboardFocus(); void updateWorldViewRect(bool use_full_window=false); - void updateBottomTrayRect(); BOOL handleKey(KEY key, MASK mask); void handleScrollWheel (S32 clicks); @@ -410,10 +411,11 @@ protected: BOOL mActive; BOOL mWantFullscreen; BOOL mShowFullscreenProgress; - LLRect mWindowRect; - LLRect mVirtualWindowRect; - LLRect mWorldViewRect; // specifies area of screen where we render the 3D world - LLRootView* mRootView; // a view of size mWindowRect, containing all child views + + LLRect mWindowRectRaw; // whole window, including UI + LLRect mWindowRectScaled; // whole window, scaled by UI size + LLRect mWorldViewRectRaw; // area of screen for 3D world + LLRootView* mRootView; // a view of size mWindowRectRaw, containing all child views LLVector2 mDisplayScale; LLCoordGL mCurrentMousePoint; // last mouse position in GL coords @@ -451,6 +453,8 @@ protected: BOOL mIgnoreActivate; std::string mInitAlert; // Window / GL initialization requires an alert + + LLHandle<LLView> mWorldViewPlaceholder; // widget that spans the portion of screen dedicated to rendering the 3d world class LLDebugText* mDebugText; // Internal class for debug text diff --git a/indra/newview/llviewerwindowlistener.cpp b/indra/newview/llviewerwindowlistener.cpp index 317e361c80..de57788271 100644 --- a/indra/newview/llviewerwindowlistener.cpp +++ b/indra/newview/llviewerwindowlistener.cpp @@ -20,8 +20,9 @@ // other Linden headers #include "llviewerwindow.h" -LLViewerWindowListener::LLViewerWindowListener(const std::string& pumpname, LLViewerWindow* llviewerwindow): - LLDispatchListener(pumpname, "op"), +LLViewerWindowListener::LLViewerWindowListener(LLViewerWindow* llviewerwindow): + LLEventAPI("LLViewerWindow", + "LLViewerWindow listener to (e.g.) save a screenshot"), mViewerWindow(llviewerwindow) { // add() every method we want to be able to invoke via this event API. @@ -34,8 +35,15 @@ LLViewerWindowListener::LLViewerWindowListener(const std::string& pumpname, LLVi // saveSnapshotArgs["showui"] = LLSD::Boolean(); // saveSnapshotArgs["rebuild"] = LLSD::Boolean(); // saveSnapshotArgs["type"] = LLSD::String(); - add("saveSnapshot", &LLViewerWindowListener::saveSnapshot, saveSnapshotArgs); - add("requestReshape", &LLViewerWindowListener::requestReshape); + add("saveSnapshot", + "Save screenshot: [\"filename\"], [\"width\"], [\"height\"], [\"showui\"], [\"rebuild\"], [\"type\"]\n" + "type: \"COLOR\", \"DEPTH\", \"OBJECT_ID\"\n" + "Post on [\"reply\"] an event containing [\"ok\"]", + &LLViewerWindowListener::saveSnapshot, + saveSnapshotArgs); + add("requestReshape", + "Resize the window: [\"w\"], [\"h\"]", + &LLViewerWindowListener::requestReshape); } void LLViewerWindowListener::saveSnapshot(const LLSD& event) const @@ -50,8 +58,8 @@ void LLViewerWindowListener::saveSnapshot(const LLSD& event) const #undef tp // Our add() call should ensure that the incoming LLSD does in fact // contain our required arguments. Deal with the optional ones. - S32 width (mViewerWindow->getWindowDisplayWidth()); - S32 height(mViewerWindow->getWindowDisplayHeight()); + S32 width (mViewerWindow->getWindowWidthRaw()); + S32 height(mViewerWindow->getWindowHeightRaw()); if (event.has("width")) width = event["width"].asInteger(); if (event.has("height")) diff --git a/indra/newview/llviewerwindowlistener.h b/indra/newview/llviewerwindowlistener.h index 59c636ecec..699f7907af 100644 --- a/indra/newview/llviewerwindowlistener.h +++ b/indra/newview/llviewerwindowlistener.h @@ -12,18 +12,17 @@ #if ! defined(LL_LLVIEWERWINDOWLISTENER_H) #define LL_LLVIEWERWINDOWLISTENER_H -#include "lleventdispatcher.h" +#include "lleventapi.h" class LLViewerWindow; class LLSD; /// Listen on an LLEventPump with specified name for LLViewerWindow request events. -class LLViewerWindowListener: public LLDispatchListener +class LLViewerWindowListener: public LLEventAPI { public: - /// Specify the pump name on which to listen, and bind the LLViewerWindow - /// instance to use (e.g. gViewerWindow). - LLViewerWindowListener(const std::string& pumpname, LLViewerWindow* llviewerwindow); + /// Bind the LLViewerWindow instance to use (e.g. gViewerWindow). + LLViewerWindowListener(LLViewerWindow* llviewerwindow); private: void saveSnapshot(const LLSD& event) const; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c987dd1764..2def905bbb 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -108,6 +108,12 @@ public: if (te->getMediaData() != NULL) { result = te->getMediaData()->asLLSD(); + // XXX HACK: workaround bug in asLLSD() where whitelist is not set properly + // See DEV-41949 + if (!result.has(LLMediaEntry::WHITELIST_KEY)) + { + result[LLMediaEntry::WHITELIST_KEY] = LLSD::emptyArray(); + } } } return result; @@ -1663,6 +1669,13 @@ void LLVOVolume::requestMediaDataUpdate() sObjectMediaClient->fetchMedia(new LLMediaDataClientObjectImpl(this)); } +bool LLVOVolume::isMediaDataBeingFetched() const +{ + // I know what I'm doing by const_casting this away: this is just + // a wrapper class that is only going to do a lookup. + return sObjectMediaClient->isInQueue(new LLMediaDataClientObjectImpl(const_cast<LLVOVolume*>(this))); +} + void LLVOVolume::cleanUpMediaImpls() { // Iterate through our TEs and remove any Impls that are no longer used diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 784ef16ba3..10fc8865fc 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -265,7 +265,10 @@ public: bool hasMedia() const; LLVector3 getApproximateFaceNormal(U8 face_id); - + + // Returns 'true' iff the media data for this object is in flight + bool isMediaDataBeingFetched() const; + protected: S32 computeLODDetail(F32 distance, F32 radius); BOOL calcLOD(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2daaf77772..1129e9ffd1 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -506,12 +506,14 @@ void LLPipeline::destroyGL() } } +static LLFastTimer::DeclareTimer FTM_RESIZE_SCREEN_TEXTURE("Resize Screen Texture"); void LLPipeline::resizeScreenTexture() { + LLFastTimer ft(FTM_RESIZE_SCREEN_TEXTURE); if (gPipeline.canUseVertexShaders() && assertInitialized()) { - GLuint resX = gViewerWindow->getWorldViewWidth(); - GLuint resY = gViewerWindow->getWorldViewHeight(); + GLuint resX = gViewerWindow->getWorldViewWidthRaw(); + GLuint resY = gViewerWindow->getWorldViewHeightRaw(); allocateScreenBuffer(resX,resY); @@ -696,8 +698,8 @@ void LLPipeline::createGLBuffers() stop_glerror(); - GLuint resX = gViewerWindow->getWorldViewWidth(); - GLuint resY = gViewerWindow->getWorldViewHeight(); + GLuint resX = gViewerWindow->getWorldViewWidthRaw(); + GLuint resY = gViewerWindow->getWorldViewHeightRaw(); if (LLPipeline::sRenderGlow) { //screen space glow buffers @@ -3049,7 +3051,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_PICKING)) { LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderForSelect"); - gObjectList.renderObjectsForSelect(camera, gViewerWindow->getVirtualWindowRect()); + gObjectList.renderObjectsForSelect(camera, gViewerWindow->getWindowRectScaled()); } else { @@ -5530,8 +5532,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) U32 res_mod = gSavedSettings.getU32("RenderResolutionDivisor"); LLVector2 tc1(0,0); - LLVector2 tc2((F32) gViewerWindow->getWorldViewWidth()*2, - (F32) gViewerWindow->getWorldViewHeight()*2); + LLVector2 tc2((F32) gViewerWindow->getWorldViewWidthRaw()*2, + (F32) gViewerWindow->getWorldViewHeightRaw()*2); if (res_mod > 1) { @@ -5731,14 +5733,14 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); } - gGLViewport[0] = gViewerWindow->getWorldViewRect().mLeft; - gGLViewport[1] = gViewerWindow->getWorldViewRect().mBottom; - gGLViewport[2] = gViewerWindow->getWorldViewRect().getWidth(); - gGLViewport[3] = gViewerWindow->getWorldViewRect().getHeight(); + gGLViewport[0] = gViewerWindow->getWorldViewRectRaw().mLeft; + gGLViewport[1] = gViewerWindow->getWorldViewRectRaw().mBottom; + gGLViewport[2] = gViewerWindow->getWorldViewRectRaw().getWidth(); + gGLViewport[3] = gViewerWindow->getWorldViewRectRaw().getHeight(); glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); - tc2.setVec((F32) gViewerWindow->getWorldViewWidth(), - (F32) gViewerWindow->getWorldViewHeight()); + tc2.setVec((F32) gViewerWindow->getWorldViewWidthRaw(), + (F32) gViewerWindow->getWorldViewHeightRaw()); gGL.flush(); @@ -8742,7 +8744,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) glClearStencil(0); // get the number of pixels per angle - F32 pa = gViewerWindow->getWindowDisplayHeight() / (RAD_TO_DEG * LLViewerCamera::getInstance()->getView()); + F32 pa = gViewerWindow->getWindowHeightRaw() / (RAD_TO_DEG * LLViewerCamera::getInstance()->getView()); //get resolution based on angle width and height of impostor (double desired resolution to prevent aliasing) U32 resY = llmin(nhpo2((U32) (fov*pa)), (U32) 512); diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index cbd57c4a41..028a5844c6 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -70,7 +70,7 @@ value="1 1 0 1" /> <color name="Unused?" - value="1 0 1 1" /> + value="1 0.5 0 1" /> <color name="Transparent" value="0 0 0 0" /> diff --git a/indra/newview/skins/default/textures/icons/AudioMute_Off.png b/indra/newview/skins/default/textures/icons/AudioMute_Off.png Binary files differnew file mode 100644 index 0000000000..938aaef491 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/AudioMute_Off.png diff --git a/indra/newview/skins/default/textures/icons/AudioMute_Over.png b/indra/newview/skins/default/textures/icons/AudioMute_Over.png Binary files differnew file mode 100644 index 0000000000..7bd1b12aae --- /dev/null +++ b/indra/newview/skins/default/textures/icons/AudioMute_Over.png diff --git a/indra/newview/skins/default/textures/icons/Audio_Off.png b/indra/newview/skins/default/textures/icons/Audio_Off.png Binary files differnew file mode 100644 index 0000000000..ef746aab92 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Audio_Off.png diff --git a/indra/newview/skins/default/textures/icons/Audio_Press.png b/indra/newview/skins/default/textures/icons/Audio_Press.png Binary files differnew file mode 100644 index 0000000000..25a669224a --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Audio_Press.png diff --git a/indra/newview/skins/default/textures/icons/ExternalBrowser_Off.png b/indra/newview/skins/default/textures/icons/ExternalBrowser_Off.png Binary files differnew file mode 100644 index 0000000000..69646ce473 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/ExternalBrowser_Off.png diff --git a/indra/newview/skins/default/textures/icons/Pause_Off.png b/indra/newview/skins/default/textures/icons/Pause_Off.png Binary files differnew file mode 100644 index 0000000000..77f6be569d --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Pause_Off.png diff --git a/indra/newview/skins/default/textures/icons/Pause_Over.png b/indra/newview/skins/default/textures/icons/Pause_Over.png Binary files differnew file mode 100644 index 0000000000..580808bf7e --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Pause_Over.png diff --git a/indra/newview/skins/default/textures/icons/Pause_Press.png b/indra/newview/skins/default/textures/icons/Pause_Press.png Binary files differnew file mode 100644 index 0000000000..859db34cae --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Pause_Press.png diff --git a/indra/newview/skins/default/textures/icons/Play_Off.png b/indra/newview/skins/default/textures/icons/Play_Off.png Binary files differnew file mode 100644 index 0000000000..e594c1a4cb --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Play_Off.png diff --git a/indra/newview/skins/default/textures/icons/Play_Over.png b/indra/newview/skins/default/textures/icons/Play_Over.png Binary files differnew file mode 100644 index 0000000000..70ab94e8c2 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Play_Over.png diff --git a/indra/newview/skins/default/textures/icons/Play_Press.png b/indra/newview/skins/default/textures/icons/Play_Press.png Binary files differnew file mode 100644 index 0000000000..b52742c6da --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Play_Press.png diff --git a/indra/newview/skins/default/textures/icons/SkipBackward_Off.png b/indra/newview/skins/default/textures/icons/SkipBackward_Off.png Binary files differnew file mode 100644 index 0000000000..8fc10e6583 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/SkipBackward_Off.png diff --git a/indra/newview/skins/default/textures/icons/SkipForward_Off.png b/indra/newview/skins/default/textures/icons/SkipForward_Off.png Binary files differnew file mode 100644 index 0000000000..2892e3cfa9 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/SkipForward_Off.png diff --git a/indra/newview/skins/default/textures/icons/StopReload_Off.png b/indra/newview/skins/default/textures/icons/StopReload_Off.png Binary files differnew file mode 100644 index 0000000000..698569a540 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/StopReload_Off.png diff --git a/indra/newview/skins/default/textures/icons/StopReload_Over.png b/indra/newview/skins/default/textures/icons/StopReload_Over.png Binary files differnew file mode 100644 index 0000000000..251b38630a --- /dev/null +++ b/indra/newview/skins/default/textures/icons/StopReload_Over.png diff --git a/indra/newview/skins/default/textures/icons/Zoom_Off.png b/indra/newview/skins/default/textures/icons/Zoom_Off.png Binary files differnew file mode 100644 index 0000000000..d096720c9c --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Zoom_Off.png diff --git a/indra/newview/skins/default/textures/icons/parcel_color_EVRY.png b/indra/newview/skins/default/textures/icons/parcel_color_EVRY.png Binary files differnew file mode 100644 index 0000000000..b5508423eb --- /dev/null +++ b/indra/newview/skins/default/textures/icons/parcel_color_EVRY.png diff --git a/indra/newview/skins/default/textures/icons/parcel_color_EXP.png b/indra/newview/skins/default/textures/icons/parcel_color_EXP.png Binary files differnew file mode 100644 index 0000000000..4813d37198 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/parcel_color_EXP.png diff --git a/indra/newview/skins/default/textures/icons/parcel_color_M.png b/indra/newview/skins/default/textures/icons/parcel_color_M.png Binary files differnew file mode 100644 index 0000000000..41984c43e4 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/parcel_color_M.png diff --git a/indra/newview/skins/default/textures/navbar/Flag.png b/indra/newview/skins/default/textures/navbar/Flag.png Binary files differnew file mode 100644 index 0000000000..df53c89224 --- /dev/null +++ b/indra/newview/skins/default/textures/navbar/Flag.png diff --git a/indra/newview/skins/default/textures/navbar/Lock.png b/indra/newview/skins/default/textures/navbar/Lock.png Binary files differnew file mode 100644 index 0000000000..cf569d6ad2 --- /dev/null +++ b/indra/newview/skins/default/textures/navbar/Lock.png diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 0e533b1c0e..e881665578 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -23,6 +23,14 @@ <texture name="Arrow_Up" file_name="widgets/Arrow_Up.png" preload="true" /> <texture name="Arrow_Down" file_name="widgets/Arrow_Down.png" preload="true" /> + <texture name="AudioMute_Off.png" file_name="icons/AudioMute_Off.png" preload="false" /> + <texture name="AudioMute_Over.png" file_name="icons/AudioMute_Over.png" preload="false" /> + <texture name="AudioMute_Press.png" file_name="icons/AudioMute_Press.png" preload="false" /> + + <texture name="Audio_Off.png" file_name="icons/Audio_Off.png" preload="false" /> + <texture name="Audio_Over.png" file_name="icons/Audio_Over.png" preload="false" /> + <texture name="Audio_Press.png" file_name="icons/Audio_Press.png" preload="false" /> + <texture name="BackArrow_Disabled" file_name="icons/BackArrow_Disabled.png" preload="false" /> <texture name="BackArrow_Off" file_name="icons/BackArrow_Off.png" preload="false" /> <texture name="BackArrow_Press" file_name="icons/BackArrow_Press.png" preload="false" /> @@ -101,6 +109,10 @@ <texture name="DropTarget" file_name="widgets/DropTarget.png" preload="false" /> + <texture name="ExternalBrowser_Off.png" file_name="icons/ExternalBrowser_Off.png" preload="false" /> + <texture name="ExternalBrowser_Over.png" file_name="icons/ExternalBrowser_Over.png" preload="false" /> + <texture name="ExternalBrowser_Press.png" file_name="icons/ExternalBrowser_Press.png" preload="false" /> + <texture name="Favorite_Star_Active" file_name="navbar/Favorite_Star_Active.png" preload="false" /> <texture name="Favorite_Star_Off" file_name="navbar/Favorite_Star_Off.png" preload="false" /> <texture name="Favorite_Star_Press" file_name="navbar/Favorite_Star_Press.png" preload="false" /> @@ -110,6 +122,8 @@ <texture name="FileMenu_BarSelect" file_name="navbar/FileMenu_BarSelect.png" preload="false" scale.left="2" scale.top="0" scale.right="2" scale.bottom="0" /> <texture name="FileMenu_BG" file_name="navbar/FileMenu_BG.png" preload="false" /> + <texture name="Flag" file_name="navbar/Flag.png" preload="false" /> + <texture name="ForSale_Badge" file_name="icons/ForSale_Badge.png" preload="false" /> <texture name="ForwardArrow_Off" file_name="icons/ForwardArrow_Off.png" preload="false" /> <texture name="ForwardArrow_Press" file_name="icons/ForwardArrow_Press.png" preload="false" /> @@ -209,6 +223,7 @@ <texture name="ListItem_Over" file_name="widgets/ListItem_Over.png" preload="true" /> <texture name="Lock" file_name="icons/Lock.png" preload="false" /> + <texture name="Lock2" file_name="navbar/Lock.png" preload="false" /> <texture name="Login_Pod" file_name="windows/Login_Pod.png" preload="true" /> @@ -279,10 +294,16 @@ <texture name="Overhead_M" file_name="world/Overhead_M.png" preload="false" /> <texture name="Overhead_S" file_name="world/Overhead_S.png" preload="false" /> + <texture name="parcel_color_EVRY" file_name="icons/parcel_color_EVRY.png" preload="false" /> + <texture name="parcel_color_EXP" file_name="icons/parcel_color_EXP.png" preload="false" /> + <texture name="parcel_color_M" file_name="icons/parcel_color_M.png" preload="false" /> + <texture name="parcel_drk_Build" file_name="icons/parcel_drk_Build.png" preload="false" /> <texture name="parcel_drk_BuildNo" file_name="icons/parcel_drk_BuildNo.png" preload="false" /> <texture name="parcel_drk_Damage" file_name="icons/parcel_drk_Damage.png" preload="false" /> <texture name="parcel_drk_DamageNo" file_name="icons/parcel_drk_DamageNo.png" preload="false" /> + <texture name="parcel_drk_EVRY" file_name="icons/parcel_drk_EVRY.png" preload="false" /> + <texture name="parcel_drk_EXP" file_name="icons/parcel_drk_EXP.png" preload="false" /> <texture name="parcel_drk_Fly" file_name="icons/parcel_drk_Fly.png" preload="false" /> <texture name="parcel_drk_FlyNo" file_name="icons/parcel_drk_FlyNo.png" preload="false" /> <texture name="parcel_drk_ForSale" file_name="icons/parcel_drk_ForSale.png" preload="false" /> @@ -301,6 +322,8 @@ <texture name="parcel_lght_BuildNo" file_name="icons/parcel_lght_BuildNo.png" preload="false" /> <texture name="parcel_lght_Damage" file_name="icons/parcel_lght_Damage.png" preload="false" /> <texture name="parcel_lght_DamageNo" file_name="icons/parcel_lght_DamageNo.png" preload="false" /> + <texture name="parcel_lght_EVRY" file_name="icons/parcel_lght_EVRY.png" preload="false" /> + <texture name="parcel_lght_EXP" file_name="icons/parcel_lght_EXP.png" preload="false" /> <texture name="parcel_lght_Fly" file_name="icons/parcel_lght_Fly.png" preload="false" /> <texture name="parcel_lght_FlyNo" file_name="icons/parcel_lght_FlyNo.png" preload="false" /> <texture name="parcel_lght_ForSale" file_name="icons/parcel_lght_ForSale.png" preload="false" /> @@ -315,6 +338,13 @@ <texture name="parcel_lght_Voice" file_name="icons/parcel_lght_Voice.png" preload="false" /> <texture name="parcel_lght_VoiceNo" file_name="icons/parcel_lght_VoiceNo.png" preload="false" /> + <texture name="Pause_Off.png" file_name="icons/Pause_Off.png" preload="false" /> + <texture name="Pause_Over.png" file_name="icons/Pause_Over.png" preload="false" /> + <texture name="Pause_Press.png" file_name="icons/Pause_Press.png" preload="false" /> + <texture name="Play_Off.png" file_name="icons/Play_Off.png" preload="false" /> + <texture name="Play_Over.png" file_name="icons/Play_Over.png" preload="false" /> + <texture name="Play_Press.png" file_name="icons/Play_Press.png" preload="false" /> + <texture name="Progress_1" file_name="icons/Progress_1.png" preload="false" /> <texture name="Progress_2" file_name="icons/Progress_2.png" preload="false" /> <texture name="Progress_3" file_name="icons/Progress_3.png" preload="false" /> @@ -366,6 +396,12 @@ <texture name="ScrollTrack_Vert" file_name="widgets/ScrollTrack_Vert.png" preload="true" scale.left="2" scale.top="40" scale.bottom="13" scale.right="0" /> <texture name="ScrollTrack_Horiz" file_name="widgets/ScrollTrack_Horiz.png" preload="true" scale.left="4" scale.top="0" scale.bottom="0" scale.right="2" /> + <texture name="ScrubberThumb_Disabled" file_name="widgets/ScrubberThumb_Disabled.png" preload="false" /> + <texture name="ScrubberThumb_Focus" file_name="widgets/ScrubberThumb_Focus.png" preload="false" /> + <texture name="ScrubberThumb_Off" file_name="widgets/ScrubberThumb_Off.png" preload="false" /> + <texture name="ScrubberThumb_Over" file_name="widgets/ScrubberThumb_Over.png" preload="false" /> + <texture name="ScrubberThumb_Press" file_name="widgets/ScrubberThumb_Press.png" preload="false" /> + <texture name="Search" file_name="navbar/Search.png" preload="false" /> <texture name="SegmentedBtn_Left_Off" file_name="widgets/SegmentedBtn_Left_Off.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> @@ -389,6 +425,13 @@ <texture name="SegmentedBtn_Right_Selected_Press" file_name="widgets/SegmentedBtn_Right_Selected_Press.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> <texture name="SegmentedBtn_Right_Selected_Disabled" file_name="widgets/SegmentedBtn_Right_Selected_Disabled.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> + <texture name="SkipBackward_Off.png" file_name="icons/SkipBackward_Off.png" preload="false" /> + <texture name="SkipBackward_Over.png" file_name="icons/SkipBackward_Over.png" preload="false" /> + <texture name="SkipBackward_Press.png" file_name="icons/SkipBackward_Press.png" preload="false" /> + <texture name="SkipForward_Off.png" file_name="icons/SkipForward_Off.png" preload="false" /> + <texture name="SkipForward_Over.png" file_name="icons/SkipForward_Over.png" preload="false" /> + <texture name="SkipForward_Press.png" file_name="icons/SkipForward_Press.png" preload="false" /> + <texture name="SliderTrack_Horiz" file_name="widgets/SliderTrack_Horiz.png" scale.left="4" scale.top="4" scale.right="100" scale.bottom="2" /> <texture name="SliderTrack_Vert" file_name="widgets/SliderTrack_Vert.png" scale.left="2" scale.top="100" scale.right="4" scale.bottom="4" /> <texture name="SliderThumb_Off" file_name="widgets/SliderThumb_Off.png" /> @@ -406,6 +449,10 @@ <texture name="Stepper_Up_Off" file_name="widgets/Stepper_Up_Off.png" preload="true" /> <texture name="Stepper_Up_Press" file_name="widgets/Stepper_Up_Press.png" preload="true" /> + <texture name="StopReload_Off.png" file_name="icons/StopReload_Off.png" preload="false" /> + <texture name="StopReload_Over.png" file_name="icons/StopReload_Over.png" preload="false" /> + <texture name="StopReload_Press.png" file_name="icons/StopReload_Press.png" preload="false" /> + <texture name="TabIcon_Appearance_Large" file_name="taskpanel/TabIcon_Appearance_Large.png" preload="false" /> <texture name="TabIcon_Appearance_Off" file_name="taskpanel/TabIcon_Appearance_Off.png" preload="false" /> <texture name="TabIcon_Appearance_Over" file_name="taskpanel/TabIcon_Appearance_Over.png" preload="false" /> @@ -461,6 +508,9 @@ <texture name="TextField_Disabled" file_name="widgets/TextField_Disabled.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" /> <texture name="TextField_Active" file_name="widgets/TextField_Active.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" /> + <texture name="TimeBasedMediaBackground" file_name="windows/TimeBasedMediaBackground.png" preload="false" /> + + <texture name="Toast_CloseBtn" file_name="windows/Toast_CloseBtn.png" preload="true" /> <texture name="Toast_Background" file_name="windows/Toast_Background.png" preload="true" scale.left="4" scale.top="28" scale.right="60" scale.bottom="4" /> @@ -495,6 +545,8 @@ <texture name="VoicePTT_Off" file_name="bottomtray/VoicePTT_Off.png" preload="false" /> <texture name="VoicePTT_On" file_name="bottomtray/VoicePTT_On.png" preload="false" /> + <texture name="WebBasedMediaBackground" file_name="windows/WebBasedMediaBackground.png" preload="false" /> + <texture name="Widget_DownArrow" file_name="icons/Widget_DownArrow.png" preload="true" /> <texture name="Widget_UpArrow" file_name="icons/Widget_UpArrow.png" preload="true" /> @@ -509,6 +561,10 @@ <texture name="YouAreHere_Badge" file_name="icons/YouAreHere_Badge.png" preload="false" /> + <texture name="Zoom_Off.png" file_name="icons/Zoom_Off.png" preload="false" /> + <texture name="Zoom_Over.png" file_name="icons/Zoom_Over.png" preload="false" /> + <texture name="Zoom_Press.png" file_name="icons/Zoom_Press.png" preload="false" /> + <!--WARNING OLD ART *do not use*--> <texture name="btn_chatbar.tga" scale.left="20" scale.top="24" scale.right="44" scale.bottom="0" /> diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml index 4d5268681b..d0d0cc64c5 100644 --- a/indra/newview/skins/default/xui/en/floater_aaa.xml +++ b/indra/newview/skins/default/xui/en/floater_aaa.xml @@ -1,24 +1,9 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater - legacy_header_height="18" - height="440" + height="768" layout="topleft" name="floater_aaa" - help_topic="floater_aaa" - save_rect="true" can_resize="true" - title="ABOUT [APP_NAME]" - width="470"> - <text_editor - follows="left|top|right|bottom" - height="400" - layout="topleft" - left="6" - max_length="65536" - name="credits_editor" - top="25" - width="458" - word_wrap="true"> -This is line 4 - </text_editor> + width="1024"> + <panel filename="main_view.xml" follows="all" width="1024" height="768" top="0"/> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index edc1fb8838..b9cf456842 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -2,7 +2,7 @@ <floater legacy_header_height="18" can_resize="true" - height="400" + height="512" layout="topleft" min_height="140" min_width="467" diff --git a/indra/newview/skins/default/xui/en/floater_test_textbox.xml b/indra/newview/skins/default/xui/en/floater_test_textbox.xml index 8dba05f1ee..3aeb7c93e7 100644 --- a/indra/newview/skins/default/xui/en/floater_test_textbox.xml +++ b/indra/newview/skins/default/xui/en/floater_test_textbox.xml @@ -10,83 +10,64 @@ <text type="string" length="1" - height="10" - layout="topleft" - left="10" - top="30" - width="300"> - Bottom and left specified - </text> - <text - type="string" - length="1" - height="10" - layout="topleft" - left_delta="200" - top_delta="0" - width="300"> - Bottom delta left delta - </text> - <text - type="string" - length="1" - height="10" + height="90" layout="topleft" left="10" - top="50" - width="300"> - Bottom delta -20 - </text> - <text - type="string" - length="1" - height="10" - layout="topleft" - left_delta="0" top_pad="30" width="300"> First line of multiple lines - Second line of multiple lines +Second line of multiple lines +Third line of multiple lines +Fourth line of multiple lines +Fifth line of multiple lines </text> <text top_pad="10" left="10" - right="-10" + right="-10" + height="20" follows="top|left" font.name="SansSerifSmall" name="test_text10" tool_tip="text"> - SansSerifSmall. Русский 中文 (简体) The quick brown fox jumped over the lazy dog. + SansSerifSmall +The 华文细黑 brown fox ヒラキjumped over the lazy dog. </text> <text top_pad="10" left="10" - right="-10" + right="-10" + height="25" follows="top|left" - font.name="SansSerif" + font.name="SansSerifMedium" name="test_text11" tool_tip="text"> - SansSerif. Русский 中文 (简体) The quick brown fox jumped over the lazy dog. + SansSerif +The 华文细黑 brown fox ヒラキjumped over the lazy dog. </text> <text top_pad="10" left="10" - right="-10" + right="-10" follows="top|left" + height="26" font.name="SansSerifLarge" name="test_text12" tool_tip="text"> - SansSerifLarge. Русский 中文 (简体) The quick brown fox jumped over the lazy dog. + SansSerifLarge +The 华文细黑 brown fox ヒラキjumped over the lazy dog. </text> <text top_pad="10" left="10" - right="-10" + height="35" + right="-10" follows="top|left" font.name="SansSerifHuge" name="test_text13" tool_tip="text"> - SansSerifHuge. Русский 中文 (简体) The quick brown fox jumped over the lazy dog. + SansSerifHuge +The 华文细黑 brown fox ヒラキjumped over the lazy dog. </text> <text type="string" @@ -113,27 +94,6 @@ SansSerif BOLD UNDERLINE </text> <text - type="string" - length="1" - font="SansSerif" - height="10" - layout="topleft" - left_delta="0" - top_pad="10" - width="300"> - SansSerif UNDERLINE - </text> - <text - type="string" - length="1" - height="10" - layout="topleft" - left_delta="0" - top_pad="10" - width="300"> - Escaped greater than > - </text> - <text type="string" length="1" bottom="390" @@ -142,8 +102,7 @@ left="10" name="right_aligned_text" width="380" - halign="right" - text_color="1 1 1 0.7" + halign="right" top_pad="10"> Right aligned text </text> @@ -157,21 +116,19 @@ name="centered_text" width="380" halign="center" - text_color="1 1 1 0.7" top_pad="10"> Centered text </text> <text type="string" length="1" - height="60" + height="60" label="N" layout="topleft" left="10" name="left_aligned_text" width="380" halign="left" - text_color="1 1 1 0.7" top_pad="10"> Left aligned text </text> @@ -184,7 +141,6 @@ left="10" name="floater_map_north" right="30" - text_color="1 1 1 0.7" top="370"> N </text> diff --git a/indra/newview/skins/default/xui/en/fonts.xml b/indra/newview/skins/default/xui/en/fonts.xml index f3da62a896..ebbb53729d 100644 --- a/indra/newview/skins/default/xui/en/fonts.xml +++ b/indra/newview/skins/default/xui/en/fonts.xml @@ -144,18 +144,18 @@ /> <font_size name="Huge" comment="Size of huge font (points, or 1/72 of an inch)" - size="15.0" + size="16.0" /> <font_size name="Large" comment="Size of large font (points, or 1/72 of an inch)" - size="10.0" + size="10.6" /> <font_size name="Medium" comment="Size of medium font (points, or 1/72 of an inch)" - size="9.0" + size="8.6" /> <font_size name="Small" comment="Size of small font (points, or 1/72 of an inch)" - size="7.8" + size="7.6" /> </fonts> diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml new file mode 100644 index 0000000000..08f7ee456e --- /dev/null +++ b/indra/newview/skins/default/xui/en/main_view.xml @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + follows="left|right|top|bottom" + height="768" + layout="topleft" + left="0" + mouse_opaque="false" + name="main_view" + width="1024"> + <layout_stack border_size="0" + follows="all" + mouse_opaque="false" + height="772" + name="menu_stack" + orientation="vertical" + top="0"> + <layout_panel auto_resize="false" + min_height="19" + mouse_opaque="false" + name="status_bar_container" + height="19" + width="1024" + visible="false"/> + <layout_panel auto_resize="false" + height="65" + mouse_opaque="false" + name="nav_bar_container" + width="1024" + visible="false"/> + <panel auto_resize="true" + follows="all" + height="500" + layout="topleft" + mouse_opaque="false" + name="hud" + width="1024"> + <layout_stack border_size="0" + follows="all" + height="500" + left="0" + mouse_opaque="false" + name="hud_stack" + orientation="horizontal" + top="0" + width="1024"> + <panel auto_resize="true" + follows="all" + height="500" + layout="topleft" + mouse_opaque="false" + name="main_view" + user_resize="true" + width="500"> + <layout_stack border_size="0" + bottom="500" + follows="all" + height="500" + left="0" + mouse_opaque="false" + name="world_stack" + orientation="vertical"> + <panel auto_resize="true" + follows="all" + height="500" + layout="topleft" + mouse_opaque="false" + name="hud container" + width="500"> + <view bottom="500" + follows="all" + height="500" + left="0" + mouse_opaque="false" + name="world_view_rect" + width="500"/> + <panel follows="right|top|bottom" + height="500" + mouse_opaque="false" + name="side_bar_tabs" + right="500" + top="0" + width="32"/> + <panel bottom="500" + follows="left|right|bottom" + height="25" + left="0" + mouse_opaque="false" + name="stand_stop_flying_container" + visible="false" + width="500"/> + </panel> + <layout_panel auto_resize="false" + follows="all" + min_height="33" + mouse_opaque="false" + name="bottom_tray_container" + visible="false"/> + </layout_stack> + </panel> + <!-- side tray --> + <layout_panel auto_resize="false" + follows="all" + height="500" + min_width="333" + mouse_opaque="false" + name="side_tray_container" + user_resize="true" + visible="false" + width="333"/> + </layout_stack> + <floater_view follows="all" + height="500" + left="0" + mouse_opaque="false" + name="Floater View" + tab_group="-1" + tab_stop="false" + top="0" + width="1024"/> + <debug_view follows="all" + left="0" + top="0" + mouse_opaque="false" + height="500" + name="DebugView" + width="1024"/> + </panel> + </layout_stack> + <notify_box_view top="0" + follows="all" + height="768" + mouse_opaque="false" + name="notify_container" + tab_group="-2" + width="1024"/> + <menu_holder top="0" + follows="all" + height="768" + mouse_opaque="false" + name="Menu Holder" + width="1024"/> + <snapshot_floater_view enabled="false" + follows="all" + height="768" + left="0" + mouse_opaque="false" + name="Snapshot Floater View" + tab_stop="false" + top="0" + visible="false" + width="1024"/> + <tooltip_view top="0" + follows="all" + height="768" + mouse_opaque="false" + name="tooltip view" + tab_group="-2" + width="1024"/> +</panel> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 1499095bcc..e98a6d57bb 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -843,18 +843,18 @@ <menu_item_call.on_click
function="Floater.Toggle"
parameter="perm_prefs" />
- <menu_item_check
- label="Show Advanced Permissions"
- layout="topleft"
- name="DebugPermissions">
- <menu_item_check.on_check
- function="CheckControl"
- parameter="DebugPermissions" />
- <menu_item_check.on_click
- function="ToggleControl"
- parameter="DebugPermissions" />
- </menu_item_check>
</menu_item_call>
+ <menu_item_check
+ label="Show Advanced Permissions"
+ layout="topleft"
+ name="DebugPermissions">
+ <menu_item_check.on_check
+ function="CheckControl"
+ parameter="DebugPermissions" />
+ <menu_item_check.on_click
+ function="ToggleControl"
+ parameter="DebugPermissions" />
+ </menu_item_check>
<!--menu_item_call
label="Show Script Warning/Error Window"
layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index e4726b38b0..8188016455 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -31,6 +31,7 @@ height="10" image_name="spacer24.tga" layout="topleft" + min_width="4" left="0" top="0" width="4" /> @@ -55,34 +56,35 @@ height="28" layout="topleft" min_height="28" - width="100" + width="104" top_delta="0" - min_width="100" + min_width="104" name="speak_panel" user_resize="false"> - <talk_button - follows="right" - height="23" - speak_button.tab_stop="true" - show_button.tab_stop="true" - layout="topleft" - left="0" - name="talk" - top="3" + <talk_button + follows="right" + height="23" + speak_button.tab_stop="true" + show_button.tab_stop="true" + layout="topleft" + left="0" + name="talk" + top="3" width="100" speak_button.tool_tip="Turns microphone on/off" show_button.tool_tip="Shows/hides voice control panel" /> </layout_panel> - <icon - auto_resize="false" - follows="left|right" - height="10" - image_name="spacer24.tga" - layout="topleft" - left="0" - name="DUMMY" - top="0" - width="4"/> + <icon + auto_resize="false" + follows="left|right" + height="10" + image_name="spacer24.tga" + layout="topleft" + left="0" + name="DUMMY" + min_width="4" + top="0" + width="4"/> <layout_panel mouse_opaque="false" auto_resize="false" @@ -115,6 +117,7 @@ image_name="spacer24.tga" layout="topleft" left="0" + min_width="4" name="DUMMY" top="0" width="4"/> @@ -153,6 +156,7 @@ image_name="spacer24.tga" layout="topleft" left="0" + min_width="4" name="DUMMY" top="0" width="4"/> @@ -192,6 +196,7 @@ image_name="spacer24.tga" layout="topleft" left="0" + min_width="4" name="DUMMY" top="0" width="4"/> @@ -205,7 +210,7 @@ name="snapshot_panel" width="40"> <button - follows="left|right" + follows="left|right" height="23" left="0" label="" @@ -214,9 +219,12 @@ width="36" top="3" image_overlay="Snapshot_Off" - tool_tip="Take snapshot" - /> - </layout_panel> + tool_tip="Take snapshot"> + <button.commit_callback + function="Floater.Toggle" + parameter="snapshot" /> + </button> + </layout_panel> <layout_panel mouse_opaque="false" follows="left|right" @@ -276,6 +284,7 @@ as for parent layout_panel (chiclet_list_panel) to resize bottom tray properly. image_name="spacer24.tga" layout="topleft" left="0" + min_width="4" top="0" width="5"/> <layout_panel @@ -321,6 +330,7 @@ as for parent layout_panel (chiclet_list_panel) to resize bottom tray properly. height="10" image_name="spacer24.tga" layout="topleft" + min_width="4" right="-1" top="0" width="26"/> diff --git a/indra/newview/skins/default/xui/en/panel_group_notify.xml b/indra/newview/skins/default/xui/en/panel_group_notify.xml index bd98996ae1..ef3120174e 100644 --- a/indra/newview/skins/default/xui/en/panel_group_notify.xml +++ b/indra/newview/skins/default/xui/en/panel_group_notify.xml @@ -25,7 +25,7 @@ name="subject" text_color="GroupNotifyTextColor" font="SansSerifBig" - top="60" + top="40" use_ellipses="true" value="subject" width="300" diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml index 13337a2098..1ef845b769 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml @@ -43,11 +43,13 @@ <button follows="right" is_toggle="true" - width="45" + width="20" top="0" layout="topleft" - left_pad="8" - label="Log" + left_pad="4 " + image_disabled="ComboButton_UpOff" + image_unselected="ComboButton_UpOff" + image_selected="ComboButton_UpSelected" height="23" name="show_nearby_chat" tool_tip="Shows/hides nearby chat log"> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 06f0710406..0ac0521b10 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -284,7 +284,7 @@ Avatars: enabled_control="EnableVoiceChat" control_name="PushToTalkToggle" height="20" - label="Toggle mode for microphone when I press the Speak trigger key:" + label="Toggle mode for microphone when I press the speak trigger key:" layout="topleft" left="30" name="push_to_talk_toggle_check" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index 645863e7a4..5a4b0a3892 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -45,14 +45,20 @@ <color_swatch border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" - control_name="UserChatColor" follows="left|top" height="47" layout="topleft" left="30" name="user" top_pad="10" - width="44" /> + width="44" > + <color_swatch.init_callback + function="Pref.getUIColor" + parameter="UserChatColor" /> + <color_swatch.commit_callback + function="Pref.applyUIColor" + parameter="UserChatColor" /> + </color_swatch> <text type="string" length="1" @@ -69,14 +75,20 @@ <color_swatch border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" - control_name="AgentChatColor" follows="left|top" height="47" layout="topleft" left="180" name="agent" top_pad="-17" - width="44" /> + width="44" > + <color_swatch.init_callback + function="Pref.getUIColor" + parameter="AgentChatColor" /> + <color_swatch.commit_callback + function="Pref.applyUIColor" + parameter="AgentChatColor" /> + </color_swatch> <text type="string" length="1" @@ -94,7 +106,6 @@ border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" color="0.6 0.6 1 1" - control_name="IMChatColor" follows="left|top" height="47" label_width="60" @@ -102,8 +113,15 @@ left="350" name="im" top_pad="-17" - width="44" /> - <text + width="44"> + <color_swatch.init_callback + function="Pref.getUIColor" + parameter="IMChatColor" /> + <color_swatch.commit_callback + function="Pref.applyUIColor" + parameter="IMChatColor" /> + </color_swatch> + <text type="string" length="1" follows="left|top" @@ -120,7 +138,6 @@ border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" color="0.8 1 1 1" - control_name="SystemChatColor" follows="left|top" height="47" label_width="44" @@ -128,7 +145,14 @@ left="30" name="system" top_pad="40" - width="44" /> + width="44" > + <color_swatch.init_callback + function="Pref.getUIColor" + parameter="SystemChatColor" /> + <color_swatch.commit_callback + function="Pref.applyUIColor" + parameter="SystemChatColor" /> + </color_swatch> <text type="string" length="1" @@ -146,14 +170,20 @@ border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" color="0.82 0.82 0.99 1" - control_name="ScriptErrorColor" follows="left|top" height="47" layout="topleft" left="180" name="script_error" top_pad="-17" - width="44" /> + width="44"> + <color_swatch.init_callback + function="Pref.getUIColor" + parameter="ScriptErrorColor" /> + <color_swatch.commit_callback + function="Pref.applyUIColor" + parameter="ScriptErrorColor" /> + </color_swatch> <text type="string" length="1" @@ -171,14 +201,20 @@ border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" color="0.7 0.9 0.7 1" - control_name="ObjectChatColor" follows="left|top" height="47" layout="topleft" left="350" name="objects" top_pad="-17" - width="44" /> + width="44" > + <color_swatch.init_callback + function="Pref.getUIColor" + parameter="ObjectChatColor" /> + <color_swatch.commit_callback + function="Pref.applyUIColor" + parameter="ObjectChatColor" /> + </color_swatch> <text type="string" length="1" @@ -196,14 +232,20 @@ border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" color="0.7 0.9 0.7 1" - control_name="llOwnerSayChatColor" follows="left|top" height="47" layout="topleft" left="30" name="owner" top_pad="40" - width="44" /> + width="44" > + <color_swatch.init_callback + function="Pref.getUIColor" + parameter="llOwnerSayChatColor" /> + <color_swatch.commit_callback + function="Pref.applyUIColor" + parameter="llOwnerSayChatColor" /> + </color_swatch> <text type="string" length="1" @@ -221,14 +263,20 @@ border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" color="0.6 0.6 1 1" - control_name="HTMLLinkColor" follows="left|top" height="47" layout="topleft" left="180" name="links" top_pad="-17" - width="44" /> + width="44" > + <color_swatch.init_callback + function="Pref.getUIColor" + parameter="HTMLLinkColor" /> + <color_swatch.commit_callback + function="Pref.applyUIColor" + parameter="HTMLLinkColor" /> + </color_swatch> <text type="string" length="1" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index 975d21aaa6..a6ca73d4b7 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -305,7 +305,7 @@ name="effects_color_textbox" top_pad="5" width="400"> - My Effects: + My effects: </text> <color_swatch border_color="0.45098 0.517647 0.607843 1" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml index acf4601bfe..8c22a5e483 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml @@ -208,7 +208,7 @@ <button follows="left|bottom" height="20" - label="Block List" + label="Block list" layout="topleft" left="30" name="block_list" diff --git a/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml b/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml index c8703aa895..b48943c699 100644 --- a/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml +++ b/indra/newview/skins/default/xui/en/panel_stand_stop_flying.xml @@ -5,7 +5,7 @@ layout="topleft" name="panel_stand_stop_flying" mouse_opaque="false" - visible="false" + visible="true" width="115"> <button follows="left|bottom" 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 7b9c9f47a2..1171a8f0b5 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -3,7 +3,7 @@ background_opaque="true" background_visible="true" bg_opaque_color="MouseGray" - follows="top|left|right" + follows="all" height="19" layout="topleft" left="0" diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index fd8316d79c..ea66bfa197 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2849,7 +2849,6 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="IM_default_text_label">Click here to instant message.</string> <string name="IM_to_label">To</string> <string name="IM_moderator_label">(Moderator)</string> - <string name="IM_adhoc_title">Ad-Hoc Conference</string> <string name="ringing-im"> Joining Voice Chat... @@ -2863,6 +2862,9 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. <string name="answering-im"> Connecting... </string> + <string name="conference-title"> + Friends Conference + </string> <string name="inventory_item_offered-im"> Inventory item offered </string> diff --git a/indra/newview/skins/default/xui/en/widgets/context_menu.xml b/indra/newview/skins/default/xui/en/widgets/context_menu.xml new file mode 100644 index 0000000000..459706c689 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/context_menu.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<context_menu visible="false"/> diff --git a/indra/newview/skins/default/xui/en/widgets/inspector.xml b/indra/newview/skins/default/xui/en/widgets/inspector.xml new file mode 100644 index 0000000000..61950d7554 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/inspector.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- See also settings.xml UIFloater* settings for configuration --> +<inspector name="inspector" + bg_opaque_color="ToolTipBgColor" + background_visible="true" + bg_opaque_image="none" + bg_alpha_image="none" + /> diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_column_header.xml b/indra/newview/skins/default/xui/en/widgets/scroll_column_header.xml new file mode 100644 index 0000000000..0794b49a0c --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/scroll_column_header.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<scroll_column_header image_unselected="square_btn_32x128.tga" + image_selected="square_btn_selected_32x128.tga" + image_disabled="square_btn_32x128.tga" + image_disabled_selected="square_btn_selected_32x128.tga" + image_overlay="combobox_arrow.tga" + image_overlay_alignment="right" + halign="left" + scale_image="true"/> diff --git a/indra/newview/skins/default/xui/en/widgets/side_tray.xml b/indra/newview/skins/default/xui/en/widgets/side_tray.xml index 8b4a5afbe9..022564c12f 100644 --- a/indra/newview/skins/default/xui/en/widgets/side_tray.xml +++ b/indra/newview/skins/default/xui/en/widgets/side_tray.xml @@ -1,8 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <side_tray tab_btn_image="TaskPanel_Tab_Off" - tab_btn_image_selected="TaskPanel_Tab_Selected" - tab_btn_width="32" - tab_btn_height="40" - tab_btn_margin="1" - > + tab_btn_image_selected="TaskPanel_Tab_Selected" + tab_btn_width="32" + tab_btn_height="40" + tab_btn_margin="1"> </side_tray> diff --git a/indra/newview/skins/default/xui/en/widgets/toggleable_menu.xml b/indra/newview/skins/default/xui/en/widgets/toggleable_menu.xml new file mode 100644 index 0000000000..48950a98ad --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/toggleable_menu.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<toggleable_menu visible="false"/> diff --git a/indra/newview/tests/llmediadataclient_test.cpp b/indra/newview/tests/llmediadataclient_test.cpp index 445ec7aa34..3ac631d96e 100644 --- a/indra/newview/tests/llmediadataclient_test.cpp +++ b/indra/newview/tests/llmediadataclient_test.cpp @@ -497,5 +497,38 @@ namespace tut ensure("REF COUNT", o->getNumRefs(), 1); } - + template<> template<> + void mediadataclient_object_t::test<7>() + { + // Test LLMediaDataClient::isInQueue() + LOG_TEST(7); + + LLMediaDataClientObject::ptr_t o1 = new LLMediaDataClientObjectTest( + _DATA(VALID_OBJECT_ID_1,"3.0","1.0")); + LLMediaDataClientObject::ptr_t o2 = new LLMediaDataClientObjectTest( + _DATA(VALID_OBJECT_ID_2,"1.0","1.0")); + int num_refs_start = o1->getNumRefs(); + { + LLPointer<LLObjectMediaDataClient> mdc = new LLObjectMediaDataClient(NO_PERIOD,NO_PERIOD); + + ensure("not in queue yet 1", ! mdc->isInQueue(o1)); + ensure("not in queue yet 2", ! mdc->isInQueue(o2)); + + mdc->fetchMedia(o1); + + ensure("is in queue", mdc->isInQueue(o1)); + ensure("is not in queue", ! mdc->isInQueue(o2)); + + ::pump_timers(); + + ensure("not in queue anymore", ! mdc->isInQueue(o1)); + ensure("still is not in queue", ! mdc->isInQueue(o2)); + + ensure("queue empty", mdc->isEmpty()); + } + + // Make sure everyone's destroyed properly + ensure("REF COUNT", o1->getNumRefs(), num_refs_start); + + } } diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index b85d31d1ac..7e5c30a978 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -231,8 +231,21 @@ class WindowsManifest(ViewerManifest): 'llplugin', 'slplugin', self.args['configuration'], "slplugin.exe"), "slplugin.exe") - # need to get the llcommon.dll from the build directory as well - if self.prefix(src=self.args['configuration'], dst=""): + self.disable_manifest_check() + + # Get shared libs from the shared libs staging directory + if self.prefix(src=os.path.join(os.pardir, 'sharedlibs', self.args['configuration']), + dst=""): + + self.enable_crt_manifest_check() + + # Get kdu dll, continue if missing. + try: + self.path('%s/llkdu.dll' % self.args['configuration'], dst='llkdu.dll') + except RuntimeError: + print "Skipping llkdu.dll" + + # Get llcommon and deps. If missing assume static linkage and continue. try: self.path('llcommon.dll') self.path('libapr-1.dll') @@ -242,22 +255,41 @@ class WindowsManifest(ViewerManifest): print err.message print "Skipping llcommon.dll (assuming llcommon was linked statically)" - self.end_prefix() + self.disable_manifest_check() - # need to get the kdu dll from the build directory as well - try: - self.path('%s/llkdu.dll' % self.args['configuration'], dst='llkdu.dll') - except RuntimeError: - print "Skipping llkdu.dll" - - self.disable_manifest_check() - - # For textures - if self.prefix(src=self.args['configuration'], dst=""): - if(self.args['configuration'].lower() == 'debug'): + # For textures + if self.args['configuration'].lower() == 'debug': self.path("openjpegd.dll") else: self.path("openjpeg.dll") + + # These need to be installed as a SxS assembly, currently a 'private' assembly. + # See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx + if self.args['configuration'].lower() == 'debug': + self.path("msvcr80d.dll") + self.path("msvcp80d.dll") + self.path("Microsoft.VC80.DebugCRT.manifest") + else: + self.path("msvcr80.dll") + self.path("msvcp80.dll") + self.path("Microsoft.VC80.CRT.manifest") + + # Vivox runtimes + self.path("SLVoice.exe") + self.path("alut.dll") + self.path("vivoxsdk.dll") + self.path("ortp.dll") + self.path("wrap_oal.dll") + + # For google-perftools tcmalloc allocator. + try: + if self.args['configuration'].lower() == 'debug': + self.path('libtcmalloc_minimal-debug.dll') + else: + self.path('libtcmalloc_minimal.dll') + except: + print "Skipping libtcmalloc_minimal.dll" + self.end_prefix() self.path(src="licenses-win32.txt", dst="licenses.txt") @@ -270,6 +302,7 @@ class WindowsManifest(ViewerManifest): self.path("fmod.dll") self.enable_no_crt_manifest_check() + # Media plugins - QuickTime if self.prefix(src='../media_plugins/quicktime/%s' % self.args['configuration'], dst="llplugin"): self.path("media_plugin_quicktime.dll") @@ -302,28 +335,6 @@ class WindowsManifest(ViewerManifest): self.disable_manifest_check() - # These need to be installed as a SxS assembly, currently a 'private' assembly. - # See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx - if self.prefix(src=self.args['configuration'], dst=""): - if self.args['configuration'] == 'Debug': - self.path("msvcr80d.dll") - self.path("msvcp80d.dll") - self.path("Microsoft.VC80.DebugCRT.manifest") - else: - self.path("msvcr80.dll") - self.path("msvcp80.dll") - self.path("Microsoft.VC80.CRT.manifest") - self.end_prefix() - - # Vivox runtimes - if self.prefix(src=self.args['configuration'], dst=""): - self.path("SLVoice.exe") - self.path("alut.dll") - self.path("vivoxsdk.dll") - self.path("ortp.dll") - self.path("wrap_oal.dll") - self.end_prefix() - # pull in the crash logger and updater from other projects # tag:"crash-logger" here as a cue to the exporter self.path(src='../win_crash_logger/%s/windows-crash-logger.exe' % self.args['configuration'], @@ -331,17 +342,6 @@ class WindowsManifest(ViewerManifest): self.path(src='../win_updater/%s/windows-updater.exe' % self.args['configuration'], dst="updater.exe") - # For google-perftools tcmalloc allocator. - if self.prefix(src=self.args['configuration'], dst=""): - try: - if self.args['configuration'] == 'Debug': - self.path('libtcmalloc_minimal-debug.dll') - else: - self.path('libtcmalloc_minimal.dll') - except: - print "Skipping libtcmalloc_minimal.dll" - self.end_prefix() - def nsi_file_commands(self, install=True): def wpath(path): if path.endswith('/') or path.endswith(os.path.sep): |